mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-01-18 07:43:01 +08:00
Merge branch 'translate_mode' of github.com:asur4s/rustdesk into translate_mode
This commit is contained in:
commit
ee4fd58b3f
@ -156,7 +156,6 @@ impl KeyboardControllable for Enigo {
|
||||
}
|
||||
fn key_up(&mut self, key: Key) {
|
||||
if self.is_x11 {
|
||||
dbg!(key);
|
||||
if self.pynput.send_pynput(&key, false) {
|
||||
return;
|
||||
}
|
||||
|
@ -819,6 +819,11 @@ fn legacy_keyboard_mode(evt: &KeyEvent) {
|
||||
}
|
||||
}
|
||||
|
||||
fn translate_keyboard_mode(evt: &KeyEvent) {
|
||||
dbg!(evt.chr());
|
||||
let chr = char::from_u32(evt.chr()).unwrap_or_default();
|
||||
rdev::simulate_char(chr, evt.down);
|
||||
}
|
||||
|
||||
fn handle_key_(evt: &KeyEvent) {
|
||||
if EXITING.load(Ordering::SeqCst) {
|
||||
@ -832,6 +837,9 @@ fn handle_key_(evt: &KeyEvent) {
|
||||
KeyboardMode::Map => {
|
||||
map_keyboard_mode(evt);
|
||||
}
|
||||
KeyboardMode::Translate => {
|
||||
translate_keyboard_mode(evt);
|
||||
}
|
||||
_ => {
|
||||
legacy_keyboard_mode(evt);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user