refactor: keyboard listen and grab && fix shift + scroll

This commit is contained in:
Asura
2022-10-30 05:44:33 -07:00
committed by Chieh Wang
parent eec5c16876
commit 996a317b57
9 changed files with 208 additions and 122 deletions

View File

@@ -429,6 +429,13 @@ fn handle_mouse_(evt: &MouseEvent, conn: i32) {
x = -x;
y = -y;
}
// fix shift + scroll(down/up)
#[cfg(target_os = "macos")]
if evt.modifiers.contains(&EnumOrUnknown::new(ControlKey::Shift)){
x = y;
y = 0;
}
if x != 0 {
en.mouse_scroll_x(x);
}
@@ -621,6 +628,7 @@ fn rdev_key_click(key: RdevKey) {
}
fn sync_status(evt: &KeyEvent) -> (bool, bool) {
/* todo! Shift+delete */
let mut en = ENIGO.lock().unwrap();
// remote caps status