Skip to content

byunei/system_hotkey

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

System Hotkey

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!

Installation

the old
pip3 install system_hotkey
should do the trick

Windows

install pywin32

Linux

For x11 you will can either use xcffib (bsd license),
or you may use the python xlib bindings (gpl license)

Usage

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.

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%