Switch monitors based on keyboard shortcuts

This commit is contained in:
loki
2021-07-29 16:48:03 +02:00
parent c243e82047
commit 2af179630a
6 changed files with 136 additions and 21 deletions

View File

@@ -136,7 +136,16 @@ struct input_t {
* return 0
*/
inline int apply_shortcut(short keyCode) {
constexpr auto VK_F1 = 0x70;
constexpr auto VK_F13 = 0x7C;
BOOST_LOG(debug) << "Apply Shortcut: 0x"sv << util::hex((std::uint8_t)keyCode).to_string_view();
if(keyCode >= VK_F1 && keyCode <= VK_F13) {
mail::man->event<int>(mail::switch_display)->raise(keyCode - VK_F1);
return 1;
}
switch(keyCode) {
case 0x4E /* VKEY_N */:
display_cursor = !display_cursor;