mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
try out unicode if key_down fail
This commit is contained in:
@@ -354,9 +354,13 @@ impl KeyboardControllable for Enigo {
|
||||
}
|
||||
|
||||
fn key_down(&mut self, key: Key) -> crate::ResultType {
|
||||
let code = self.key_to_keycode(key);
|
||||
if code == 0 {
|
||||
return Err("".into());
|
||||
}
|
||||
if let Some(src) = self.event_source.as_ref() {
|
||||
if let Ok(event) =
|
||||
CGEvent::new_keyboard_event(src.clone(), self.key_to_keycode(key), true)
|
||||
CGEvent::new_keyboard_event(src.clone(), code, true)
|
||||
{
|
||||
self.post(event);
|
||||
}
|
||||
|
||||
@@ -195,7 +195,11 @@ impl KeyboardControllable for Enigo {
|
||||
}
|
||||
|
||||
fn key_down(&mut self, key: Key) -> crate::ResultType {
|
||||
let res = keybd_event(0, self.key_to_keycode(key), 0);
|
||||
let code = self.key_to_keycode(key);
|
||||
if code == 0 || code == 65535 {
|
||||
return Err("".into());
|
||||
}
|
||||
let res = keybd_event(0, code, 0);
|
||||
if res == 0 {
|
||||
let err = get_error();
|
||||
if !err.is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user