keyboard
keyboard copied to clipboard
Cannot use scan codes to make key combinations
I am unable to use scan codes to make key combinations. I find scan codes easiest to use because some of the key names are confusing and there seems to be some overlay. However, when I try to use scan codes to make key combinations, e.g. I want keyboard.is_pressed(59+2)
to make the key combination f1 and 1, it just adds the numbers, making this example result in the single key f3. I think a good solution to this issue would be to replace the plus for combinations with &, which is not used for anything in python and should not cause any issues.
Just use this.
import keyboard
def your_function(args):
# some code
keyboard.hotkey("59+2", your_function)
keyboard.wait()