Merge pull request #4144 from fufesou/fix/translate_mode_caret
fix translate mode, simulate unicode
This commit is contained in:
commit
5b629d7c91
@ -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