fix apps key

This commit is contained in:
rustdesk 2021-08-10 12:18:10 +08:00
parent bb25964307
commit e510d2744d
7 changed files with 10 additions and 7 deletions

View File

@ -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,

View File

@ -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",

View File

@ -431,6 +431,8 @@ impl Enigo {
_ => 0,
}
}
#[inline]
fn map_key_board(&self, ch: char) -> CGKeyCode {
match ch {
'a' => kVK_ANSI_A,

View File

@ -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;

View File

@ -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,

View File

@ -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)),

View File

@ -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() {