fix translate mode, simulate unicode
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
91e4413a34
commit
e833f92219
@ -1256,8 +1256,10 @@ fn translate_keyboard_mode(evt: &KeyEvent) {
|
|||||||
simulate_(&EventType::KeyRelease(RdevKey::ShiftRight));
|
simulate_(&EventType::KeyRelease(RdevKey::ShiftRight));
|
||||||
}
|
}
|
||||||
for chr in seq.chars() {
|
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")]
|
#[cfg(target_os = "windows")]
|
||||||
rdev::simulate_char(chr, true).ok();
|
rdev::simulate_unicode(chr as _).ok();
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
en.key_click(Key::Layout(chr));
|
en.key_click(Key::Layout(chr));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user