moses-palmer / pynput

Sends virtual input commands
GNU Lesser General Public License v3.0
1.77k stars 245 forks source link

Fix Hotkeys that are not modifiers or characters not working #466

Closed cwtravis closed 2 years ago

cwtravis commented 2 years ago

When creating hotkeys, some keys were not working, particularly those that are not modifiers or characters (e.g. Esc, Page Down, Arrows, End, etc...) The Key enums were getting added to the list of hotkeys by the parsing function instead of the KeyCode. I added logic to check if the key is not a modifier, and if its not, create and add the KeyCode to the hotkey instead. I made the change to Hotkey.parse()

moses-palmer commented 2 years ago

Thank you for you contribution, and I apologise for this very late reply!

I had a small comment on the format of the patch, and merged a very similar one with a small explanation instead. I will make a mention of you in the release notes!