Refactor is altgr for clearer expression

This commit is contained in:
asur4s 2023-03-22 05:09:02 -07:00
parent 8478c2ba48
commit 33a1ab0d32

View File

@ -842,21 +842,9 @@ fn is_altgr(event: &Event) -> bool {
false
}
#[cfg(target_os = "macos")]
// ignore right option key
if event.platform_code as u32 == rdev::kVK_RightOption {
true
} else {
false
}
#[cfg(target_os = "windows")]
if unsafe { IS_0X021D_DOWN } {
if event.position_code == 0xE038 {
true
} else {
false
}
if unsafe { IS_0X021D_DOWN } && event.position_code == 0xE038 {
true
} else {
false
}
@ -882,6 +870,13 @@ pub fn translate_keyboard_mode(peer: &str, event: &Event, key_event: KeyEvent) -
}
}
#[cfg(target_os = "macos")]
// ignore right option key
if event.code as u32 == rdev::kVK_RightOption {
return events;
}
#[cfg(not(target_os = "macos"))]
if is_altgr(event) {
return events;
}