windows extended key input

This commit is contained in:
sjpark 2022-10-29 14:37:20 +09:00
parent 270c2ae291
commit 422dadfef3

View File

@ -640,17 +640,8 @@ fn sync_status(evt: &KeyEvent) -> (bool, bool) {
|| (!caps_locking && en.get_key_state(enigo::Key::CapsLock));
let click_numlock = (num_locking && !en.get_key_state(enigo::Key::NumLock))
|| (!num_locking && en.get_key_state(enigo::Key::NumLock));
return (click_capslock, click_numlock);
}
fn map_keyboard_mode(evt: &KeyEvent) {
// map mode(1): Send keycode according to the peer platform.
let (click_capslock, click_numlock) = sync_status(evt);
#[cfg(windows)]
let click_numlock = {
crate::platform::windows::try_change_desktop();
let code = evt.chr();
let key = rdev::get_win_key(code, 0);
//let key = rdev::windows::keycodes::key_from_code(code);
@ -664,13 +655,20 @@ fn map_keyboard_mode(evt: &KeyEvent) {
RdevKey::DownArrow |
RdevKey::PageDown |
RdevKey::Insert |
RdevKey::Delete => {
let mut en = ENIGO.lock().unwrap();
en.get_key_state(enigo::Key::NumLock)
},
RdevKey::Delete => en.get_key_state(enigo::Key::NumLock),
_ => click_numlock,
}
};
};
return (click_capslock, click_numlock);
}
fn map_keyboard_mode(evt: &KeyEvent) {
// map mode(1): Send keycode according to the peer platform.
#[cfg(windows)]
crate::platform::windows::try_change_desktop();
let (click_capslock, click_numlock) = sync_status(evt);
// Wayland
#[cfg(target_os = "linux")]
if !*IS_X11.lock().unwrap() {