fix translate mode, simulate unicode

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2023-04-21 16:03:14 +08:00
parent 91e4413a34
commit e833f92219

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));
}