diff --git a/libs/enigo/src/linux.rs b/libs/enigo/src/linux.rs index 67af71a62..6b4c99a1b 100644 --- a/libs/enigo/src/linux.rs +++ b/libs/enigo/src/linux.rs @@ -438,9 +438,9 @@ impl KeyboardControllable for Enigo { if self.xdo.is_null() { return Ok(()); } - // if self.send_pynput(&key, true) { - // return Ok(()); - // } + if self.send_pynput(&key, true) { + return Ok(()); + } let string = CString::new(&*keysequence(key))?; unsafe { xdo_send_keysequence_window_down( @@ -456,9 +456,9 @@ impl KeyboardControllable for Enigo { if self.xdo.is_null() { return; } - // if self.send_pynput(&key, false) { - // return; - // } + if self.send_pynput(&key, false) { + return; + } if let Ok(string) = CString::new(&*keysequence(key)) { unsafe { xdo_send_keysequence_window_up( diff --git a/src/server/connection.rs b/src/server/connection.rs index 48fab0c2d..dd5b32fe9 100644 --- a/src/server/connection.rs +++ b/src/server/connection.rs @@ -420,7 +420,14 @@ impl Connection { } MessageInput::Key((mut msg, press)) => { // todo: press and down have similar meanings. + if press && msg.mode == 3 { + msg.down = true; + } handle_key(&msg); + if press && msg.mode == 3 { + msg.down = false; + handle_key(&msg); + } } MessageInput::BlockOn => { if crate::platform::block_input(true) {