boppreh / keyboard

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

Added checks to remove_word_listener to avoid KeyError #527

Closed BlueHephaestus closed 2 years ago

BlueHephaestus commented 2 years ago

Noticed while working on my own daemon using this that if I have multiple word listeners with the same word but different triggers, or other strange / peculiar cases where this would crop up - it either wouldn't remove them entirely or would produce key errors because it would try to remove something that was already removed by a previous call of remove_word_listener. Adding this never hurts and it also fixed the bug on my local install, so that it makes sure they're present before trying to delete.

Thanks for the awesome library by the way!

boppreh commented 2 years ago

Thank you for your contribution, merged!