work around of italian keyboard shift+"." issue
https://github.com/rustdesk/rustdesk/issues/366#issuecomment-1120379312
This commit is contained in:
parent
ed897f4b6d
commit
b526bf4a67
@ -6,7 +6,8 @@ fn main() {
|
|||||||
thread::sleep(Duration::from_secs(2));
|
thread::sleep(Duration::from_secs(2));
|
||||||
let mut enigo = Enigo::new();
|
let mut enigo = Enigo::new();
|
||||||
|
|
||||||
enigo.key_down(Key::Layout('a')).ok();
|
enigo.key_down(Key::Shift).ok();
|
||||||
thread::sleep(Duration::from_secs(1));
|
enigo.key_down(Key::Layout('.')).ok();
|
||||||
enigo.key_up(Key::Layout('a'));
|
enigo.key_up(Key::Layout('.'));
|
||||||
|
enigo.key_up(Key::Shift);
|
||||||
}
|
}
|
||||||
|
@ -370,7 +370,12 @@ impl Enigo {
|
|||||||
unsafe { GetWindowThreadProcessId(GetForegroundWindow(), std::ptr::null_mut()) };
|
unsafe { GetWindowThreadProcessId(GetForegroundWindow(), std::ptr::null_mut()) };
|
||||||
unsafe { LAYOUT = GetKeyboardLayout(current_window_thread_id) };
|
unsafe { LAYOUT = GetKeyboardLayout(current_window_thread_id) };
|
||||||
let keycode_and_shiftstate = unsafe { VkKeyScanExW(chr as _, LAYOUT) };
|
let keycode_and_shiftstate = unsafe { VkKeyScanExW(chr as _, LAYOUT) };
|
||||||
keycode_and_shiftstate as _
|
if keycode_and_shiftstate == (EVK_DECIMAL as i16) && chr == '.' {
|
||||||
|
// a workaround of italian keyboard shift + '.' issue
|
||||||
|
unsafe { VkKeyScanW(chr as _) as _ }
|
||||||
|
} else {
|
||||||
|
keycode_and_shiftstate as _
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
0
|
0
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user