From 7fe2609ffb4598d4bc666af0395fc89a7bf3eaba Mon Sep 17 00:00:00 2001 From: Asura Date: Wed, 13 Jul 2022 02:14:32 -0700 Subject: [PATCH] feat: Support new keyboard mode --- libs/enigo/src/linux.rs | 3 --- libs/enigo/src/macos/macos_impl.rs | 2 -- libs/enigo/src/win/win_impl.rs | 2 -- src/server/input_service.rs | 2 -- src/ui/remote.rs | 7 ------- 5 files changed, 16 deletions(-) diff --git a/libs/enigo/src/linux.rs b/libs/enigo/src/linux.rs index ee27e06cf..7f2afc3dc 100644 --- a/libs/enigo/src/linux.rs +++ b/libs/enigo/src/linux.rs @@ -105,8 +105,6 @@ impl Enigo { } fn send_rdev(&mut self, key: &Key, is_press: bool) -> bool { - log::info!("{:?} {:?}", key, is_press); - if let Key::Raw(keycode) = key { let event_type = match is_press { // todo: Acccodding to client type @@ -139,7 +137,6 @@ impl Enigo { fn string_to_static_str(s: String) -> &'static str { Box::leak(s.into_boxed_str()) } - dbg!(chr.to_string()); return self .tx .send((PyMsg::Str(string_to_static_str(chr.to_string())), is_press)) diff --git a/libs/enigo/src/macos/macos_impl.rs b/libs/enigo/src/macos/macos_impl.rs index 6cae30984..df494b9cb 100644 --- a/libs/enigo/src/macos/macos_impl.rs +++ b/libs/enigo/src/macos/macos_impl.rs @@ -432,8 +432,6 @@ impl Enigo { } fn send_rdev(&mut self, key: &Key, is_press: bool) -> bool { - log::info!("{:?} {:?}", key, is_press); - if let Key::Raw(keycode) = key { let event_type = match is_press { // todo: Acccodding to client type diff --git a/libs/enigo/src/win/win_impl.rs b/libs/enigo/src/win/win_impl.rs index d0d97ecee..0967d07c9 100644 --- a/libs/enigo/src/win/win_impl.rs +++ b/libs/enigo/src/win/win_impl.rs @@ -284,8 +284,6 @@ impl Enigo { } fn send_rdev(&mut self, key: &Key, is_press: bool) -> bool { - log::info!("{:?} {:?}", key, is_press); - if let Key::Raw(keycode) = key { let event_type = match is_press { // todo: Acccodding to client type diff --git a/src/server/input_service.rs b/src/server/input_service.rs index a8fd5fbbb..8e8e2abb4 100644 --- a/src/server/input_service.rs +++ b/src/server/input_service.rs @@ -589,10 +589,8 @@ fn handle_key_(evt: &KeyEvent) { if keyboard_mode == 1 { if let Some(key_event::Union::chr(chr)) = evt.union { if evt.down { - println!("key down: {:?}", chr); en.key_down(Key::Raw(chr.try_into().unwrap())); } else { - println!("key up: {:?}", chr); en.key_up(Key::Raw(chr.try_into().unwrap())); } } diff --git a/src/ui/remote.rs b/src/ui/remote.rs index 5bef6579c..cc2ce8154 100644 --- a/src/ui/remote.rs +++ b/src/ui/remote.rs @@ -321,7 +321,6 @@ impl Handler { } MUTEX_SPECIAL_KEYS.lock().unwrap().insert(k, true); } - println!("keydown {:?} {:?} {:?}", k, evt.code, evt.scan_code); (k, 1) } KeyRelease(k) => { @@ -329,7 +328,6 @@ impl Handler { if MUTEX_SPECIAL_KEYS.lock().unwrap().contains_key(&k) { MUTEX_SPECIAL_KEYS.lock().unwrap().insert(k, false); } - println!("keyup {:?} {:?} {:?}", k, evt.code, evt.scan_code); (k, 0) } _ => return, @@ -339,11 +337,6 @@ impl Handler { #[cfg(target_os = "windows")] let key = rdev::get_win_key(evt.code.into(), evt.scan_code); - // todo: up down left right in numpad - // #[cfg(target_os = "linux")] - dbg!(key); - println!("--------------"); - let mut key_event = KeyEvent::new(); // According to peer platform. if peer == "Linux" {