mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-06 04:41:27 +03:00
Release modifier when multi conn
This commit is contained in:
@@ -365,6 +365,21 @@ pub fn get_keyboard_mode_enum() -> KeyboardMode {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn is_modifier(key: &rdev::Key) -> bool {
|
||||
matches!(
|
||||
key,
|
||||
Key::ShiftLeft
|
||||
| Key::ShiftRight
|
||||
| Key::ControlLeft
|
||||
| Key::ControlRight
|
||||
| Key::MetaLeft
|
||||
| Key::MetaRight
|
||||
| Key::Alt
|
||||
| Key::AltGr
|
||||
)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
fn is_numpad_key(event: &Event) -> bool {
|
||||
@@ -984,3 +999,13 @@ pub fn translate_keyboard_mode(peer: &str, event: &Event, key_event: KeyEvent) -
|
||||
}
|
||||
events
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
pub fn keycode_to_rdev_key(keycode: u32) -> Key {
|
||||
#[cfg(target_os = "windows")]
|
||||
return rdev::win_key_from_scancode(keycode);
|
||||
#[cfg(target_os = "linux")]
|
||||
return rdev::linux_key_from_code(keycode);
|
||||
#[cfg(target_os = "macos")]
|
||||
return rdev::macos_key_from_code(keycode.try_into().unwrap_or_default());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user