Merge pull request #4144 from fufesou/fix/translate_mode_caret

fix translate mode, simulate unicode
This commit is contained in:
RustDesk 2023-04-21 16:18:24 +08:00 committed by GitHub
commit 5b629d7c91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1256,8 +1256,10 @@ fn translate_keyboard_mode(evt: &KeyEvent) {
simulate_(&EventType::KeyRelease(RdevKey::ShiftRight));
}
for chr in seq.chars() {
// char in rust is 4 bytes.
// But for this case, char comes from keyboard. We only need 2 bytes.
#[cfg(target_os = "windows")]
rdev::simulate_char(chr, true).ok();
rdev::simulate_unicode(chr as _).ok();
#[cfg(target_os = "linux")]
en.key_click(Key::Layout(chr));
}