New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using numpad numbers as hotkeys ? #161
Comments
Im also trying to accomplish this. Has anyone found a way to do this with the keyboard package? |
I still have to work on it to ensure everything is correct, but try removing the lines on _canonial_names (https://github.com/boppreh/keyboard/blob/master/keyboard/_canonical_names.py#L70) that transform "num 5" to simply "5". And you can always just listen by scan code. |
Thanks for the answer. Sorry if this is trivial but how can we know the corresponding scan_codes ? |
Can we create a combo-hotkey with scan codes? E.g. ctrl-Numpad* |
@ornariece any hooks will give you an event object with the scan code. The easiest way is to run "python -m keyboard", press the key and watch what is printed. @Apollys sure, just pass a list of integers. For multi-step step hotkeys, pass a list of list of integers. Check "parse_hotkey" for more details. All high level functions should support this kind of flexible input. |
Solved: used tuples instead of lists. -- Am I using the wrong function?
Of course same result if I do |
Ah, I see the problem. It's a bug that'll be fixing soon, but for now you can workaround by passing a tuple instead of a list. So if you were doing |
@boppreh , how do i hook on an event only if is_keypad is True? |
I've had to use asweigart/pyautogui to actually send the right event for numpad keys. See Toufool/AutoSplit/pull/61 |
Well, I just found a way to make numpad work in the keyboard.add_hotkey function. Works perfectly now. |
I did that and nothing changed. |
it is currently not possible to use numpad numbers as hotkeys, they are considered as the same as normal numbers on the keyboard :/
it would add options on hotkeys
The text was updated successfully, but these errors were encountered: