Multi platform system wide hotkeys for python 3,
Currently no mac or python2 support :(
Mac support is coming in a few years i would say!
the old
should do the trick
pip3 install system_hotkey
should do the trick
install pywin32
For x11 you will can either use xcffib (bsd license),
or you may use the python xlib bindings (gpl license)
or you may use the python xlib bindings (gpl license)
from system_hotkey import SystemHotkey
hk = SystemHotkeys()
hk.register(('control', 'shift', 'h'), callback=lambda:print("Easy!"))
To unregister a hotkey
hk.unregister(('control', 'shift', 'h'))
If you want you can pass in a custom consumer:
def some_func(self, event, hotkey, args):
pass
hk = SystemHotkeys(consumer=some_func)
So you have a master function that receives all hotkey presses and can delegate as desired.