Hello.
I'm trying to bind hotkeys:
def keyboard_on_key_down(self, window, keycode, text, modifiers):
if keycode[1] == "1" or keycode[1] == "numpad1":
print("\n", modifiers)
if modifiers == []:
print("Topic", "1")
elif modifiers == ["shift"]:
print("Topic", "11")
else:
print(keycode, modifiers)
The goal is to print "1" if single digit is pressed and to print "11" if shift+digit is pressed regardless location of the key (ordinary numbers or numpad).
When numlock is off, everything works as expected (prints "11"). When numlock is on, the output is "1" as if 'shift' isn't pressed...
For example, numlock is off.
1. Press simple "1", output:
2. Press shift+1, output:
['shift']
Topic 11
(49, '1') ['shift']
3. Press numpad1:
[]
Topic 1
(257, 'numpad1') []
4. Press shift+numpad1:
['shift']
Topic 11
(257, 'numpad1') ['shift']
Now, numlock is on:
1. Press numpad1:
[]
Topic 1
(257, 'numpad1') []
2. Press shift+numpad1:
[]
Topic 1
(257, 'numpad1') []
(304, 'shift') ['shift']
How to solve this issue?
Thank you in advance