From 9237ae30dc200caededbe8e1648f3d1bdd398839 Mon Sep 17 00:00:00 2001 From: Asura Date: Mon, 4 Jul 2022 08:18:58 -0700 Subject: [PATCH] fix(pynput): Add dead key conversion rules to support Czech keyboard --- pynput_service.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pynput_service.py b/pynput_service.py index c51e9a524..5aca57986 100644 --- a/pynput_service.py +++ b/pynput_service.py @@ -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