Simple global Python hotkey registration
Switch branches/tags
Nothing to show
Clone or download
Latest commit 7ecfc4b Dec 9, 2017
Failed to load latest commit information.
samples initial commit Dec 21, 2013 Update Dec 8, 2017 Added support for WinKey modifier Aug 1, 2015

This project is not maintained anymore. There is a Python 3 version here:


PYHK is python module that allows for simple hotkey registration in any program. It extends pyhook to have normal hotkey functionality like autohotkey (AHK) scripts.

Main features:

  • Simple hotkey registration
  • Hotkey removal by hotkey or id
  • Option to run trigger function in thread
  • Option to run trigger function on a key up event

Tested with Python 2.6, 2.7

Total downloads before moving to github: 2562

PYHK is as simple as this:

import pyhk
def fun():
    print "Do something"
#create pyhk class instance
hot = pyhk.pyhk()
#add hotkey
hot.addHotkey(['Ctrl', 'Alt','7'],fun)
#start looking for hotkey.


Old version



Links - Project home page - End user documentation

Contact Author

michael at schurpf dot com Please write in English or German only.

##K nown Issues

Python IDLE freezes at times. Best use is to call your script directly from the command line with python

After logout or sleep on some machines the hotkeys get triggered by only pressing the modifiers.



Distributed under GNU General Public License version 2.