boppreh/keyboard

is_modifier and keyboard.get_hotkey_names don't work with non-english names

Avasam opened this issue · 0 comments

Here "left shift" is called "maj".

>>> import keyboard
>>> keyboard.read_event(True)
KeyboardEvent(maj down)
>>> keyboard.is_modifier(keyboard.read_event(True).name)
False
>>> import keyboard
>>>keyboard.get_hotkey_name(['ctrl', 'maj', 'D'])
KeyboardEvent(maj down)
'ctrl+D+maj'

Workaround: manually use keycodes instead
keyboard.is_modifier(keyboard.read_event(True).scan_code)