boppreh / keyboard

Hook and simulate global keyboard events on Windows and Linux.
MIT License
3.74k stars 432 forks source link

Periodicaly produce a TypeError: object of type 'NoneType' has no len() #641

Open frimigit opened 4 months ago

frimigit commented 4 months ago

I use the module with some add_abbreviation() and one add_hotkey() in a keyboard.wait() loop and receive sometime an error while it runs:

Traceback (most recent call last): File "local-packages\Python311\site-packages\keyboard_generic.py", line 22, in invoke_handlers if handler(event): ^^^^^^^^^^^^^^ File "local-packages\Python311\site-packages\keyboard__init__.py", line 1110, in handler elif len(name) > 1: ^^^^^^^^^ TypeError: object of type 'NoneType' has no len()