diff --git a/libs/enigo/src/lib.rs b/libs/enigo/src/lib.rs index e5a19750c1af..893f5918c1ef 100644 --- a/libs/enigo/src/lib.rs +++ b/libs/enigo/src/lib.rs @@ -299,7 +299,7 @@ pub enum Key { /// meta key (also known as "windows", "super", and "command") Meta, /// option key on macOS (alt key on Linux and Windows) - Option, + Option, // deprecated, use Alt instead /// page down key PageDown, /// page up key @@ -347,8 +347,6 @@ pub enum Key { /// Clear, /// - Menu, // deprecated, use alt instead - /// Pause, /// Kana, diff --git a/libs/enigo/src/linux.rs b/libs/enigo/src/linux.rs index 58f134a18963..24628c1f9a77 100644 --- a/libs/enigo/src/linux.rs +++ b/libs/enigo/src/linux.rs @@ -238,7 +238,6 @@ fn keysequence<'a>(key: Key) -> Cow<'a, str> { Key::Decimal => "U2E", //"KP_Decimal", Key::Cancel => "Cancel", Key::Clear => "Clear", - Key::Menu => "Menu", Key::Pause => "Pause", Key::Kana => "Kana", Key::Hangul => "Hangul", @@ -261,7 +260,7 @@ fn keysequence<'a>(key: Key) -> Cow<'a, str> { Key::Scroll => "Scroll_Lock", Key::NumLock => "Num_Lock", Key::RWin => "Super_R", - Key::Apps => "", + Key::Apps => "Menu", Key::Multiply => "KP_Multiply", Key::Add => "KP_Add", Key::Subtract => "KP_Subtract", diff --git a/libs/enigo/src/macos/macos_impl.rs b/libs/enigo/src/macos/macos_impl.rs index 33c7d7ad230f..0ee038012da2 100644 --- a/libs/enigo/src/macos/macos_impl.rs +++ b/libs/enigo/src/macos/macos_impl.rs @@ -431,6 +431,8 @@ impl Enigo { _ => 0, } } + + #[inline] fn map_key_board(&self, ch: char) -> CGKeyCode { match ch { 'a' => kVK_ANSI_A, diff --git a/libs/enigo/src/win/keycodes.rs b/libs/enigo/src/win/keycodes.rs index 5f4312f1f36d..351e82a870dd 100644 --- a/libs/enigo/src/win/keycodes.rs +++ b/libs/enigo/src/win/keycodes.rs @@ -3,7 +3,6 @@ // JP/KR mapping https://github.com/TigerVNC/tigervnc/blob/1a008c1380305648ab50f1d99e73439747e9d61d/vncviewer/win32.c#L267 // altgr handle: https://github.com/TigerVNC/tigervnc/blob/dccb95f345f7a9c5aa785a19d1bfa3fdecd8f8e0/vncviewer/Viewport.cxx#L1066 - pub const EVK_RETURN: u16 = 0x0D; pub const EVK_TAB: u16 = 0x09; pub const EVK_SPACE: u16 = 0x20; diff --git a/libs/enigo/src/win/win_impl.rs b/libs/enigo/src/win/win_impl.rs index cf4735bb6c01..3a6b6215f8b1 100644 --- a/libs/enigo/src/win/win_impl.rs +++ b/libs/enigo/src/win/win_impl.rs @@ -303,7 +303,6 @@ impl Enigo { Key::Numpad9 => EVK_NUMPAD9, Key::Cancel => EVK_CANCEL, Key::Clear => EVK_CLEAR, - Key::Menu => EVK_MENU, Key::Pause => EVK_PAUSE, Key::Kana => EVK_KANA, Key::Hangul => EVK_HANGUL, diff --git a/src/client.rs b/src/client.rs index fe35d4f532f7..ec3a7da66c96 100644 --- a/src/client.rs +++ b/src/client.rs @@ -1134,6 +1134,8 @@ lazy_static::lazy_static! { ("VK_NUMPAD7", Key::ControlKey(ControlKey::Numpad7)), ("VK_NUMPAD8", Key::ControlKey(ControlKey::Numpad8)), ("VK_NUMPAD9", Key::ControlKey(ControlKey::Numpad9)), + ("Apps", Key::ControlKey(ControlKey::Apps)), + ("Meta", Key::ControlKey(ControlKey::Meta)), ("RAlt", Key::ControlKey(ControlKey::RAlt)), ("RWin", Key::ControlKey(ControlKey::RWin)), ("RControl", Key::ControlKey(ControlKey::RControl)), diff --git a/src/ui/remote.rs b/src/ui/remote.rs index 0ac398222d89..95902878b62a 100644 --- a/src/ui/remote.rs +++ b/src/ui/remote.rs @@ -890,6 +890,10 @@ impl Handler { } let mut name = name; + #[cfg(target_os = "linux")] + if code == 65383 { // VK_MENU + name = "Apps".to_owned(); + } if extended { match name.as_ref() {