Open matttattoli opened 5 years ago
Here's a sample program that will demonstrate the error, you can replace the key 1 with the others affected.
import keyboard
def callback(kb_event):
print(kb_event.to_json())
keyboard.hook_key('1', callback, suppress=False)
keyboard.wait()
output:
{"event_type": "down", "scan_code": 2, "name": "1", "time": 1560635769.8070629, "is_keypad": false}
{"event_type": "up", "scan_code": 2, "name": "1", "time": 1560635769.8819523, "is_keypad": false}
{"event_type": "down", "scan_code": 79, "name": "end", "time": 1560635769.9382055, "is_keypad": false}
{"event_type": "up", "scan_code": 79, "name": "end", "time": 1560635770.0160363, "is_keypad": false}
Using
keyboard.hook("1")
also automatically hooks the end key,"2"
also hooks thedown key
,"3"
hooks thepage down
key, and"4"
hooks theleft
key.Using Windows 10, Python 3.6.7, latest version of keyboard (0.13.3).