Skip to content
Advertisement

GlobalHotKeys pynput not working not reacting to function keys

community. I’m trying to put together a quick hotkey script in python here. For some reason it doesn’t react to function keys, meaning the expression '<ctrl>+<F2>': function_1 doesn’t work.

I was not able to find any clues in the official documentation or other examples online. Any thoughts?

Here is the script for testing.

JavaScript

Advertisement

Answer

I solved this issue by moving away from pynput Global Hotkeys and using just keyboard instead. I still don’t understand the nature of this issue with global hotkeys not recognizing F1 key..

Here is the solution I used. I also added the passthrough of values with lambda function for each hotkey.

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement