fix(pynput): Add dead key conversion rules to support Czech keyboard

This commit is contained in:
Asura 2022-07-04 08:08:43 -07:00
parent 9e8d8e4357
commit 234b8df417
2 changed files with 6 additions and 2 deletions

View File

@ -145,7 +145,11 @@ class MyController(Controller):
or (keycode_flag == False and keycode == list(keycode_set)[0] and len(keycode_set) == 1):
deakkey_chr = str(key).replace("'", '')
keysym = DEAD_KEYS[deakkey_chr]
keycode, shift_state = self.keyboard_mapping[keysym][0]
# shift_state = 0
keycode, shift_state = list(
filter(lambda x: x[1] == 0,
self.keyboard_mapping[keysym])
)[0]
# If the key has a virtual key code, use that immediately with
# fake_input; fake input,being an X server extension, has access to

View File

@ -276,7 +276,7 @@ impl Handler {
KeyRelease(k) => (k, 0),
_ => return,
};
log::debug!("{:?}", key);
log::debug!("{:?}", key);a
let alt = get_key_state(enigo::Key::Alt);
#[cfg(windows)]
let ctrl = {