Skip to content

Commit

Permalink
fix apps key
Browse files Browse the repository at this point in the history
  • Loading branch information
rustdesk committed Aug 10, 2021
1 parent bb25964 commit e510d27
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 7 deletions.
4 changes: 1 addition & 3 deletions libs/enigo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -347,8 +347,6 @@ pub enum Key {
///
Clear,
///
Menu, // deprecated, use alt instead
///
Pause,
///
Kana,
Expand Down
3 changes: 1 addition & 2 deletions libs/enigo/src/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions libs/enigo/src/macos/macos_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,8 @@ impl Enigo {
_ => 0,
}
}

#[inline]
fn map_key_board(&self, ch: char) -> CGKeyCode {
match ch {
'a' => kVK_ANSI_A,
Expand Down
1 change: 0 additions & 1 deletion libs/enigo/src/win/keycodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion libs/enigo/src/win/win_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down
4 changes: 4 additions & 0 deletions src/ui/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit e510d27

Please sign in to comment.