Skip to content

Latest commit

 

History

History
46 lines (38 loc) · 2.28 KB

readme.md

File metadata and controls

46 lines (38 loc) · 2.28 KB

#PyHooked: a pure Python hotkey module ####About -

Join the chat at https://gitter.im/IronManMark20/pyhooked PyHooked is a pure python keyboard hotkey that allows the creation of hotkeys in all Python implementations that support ctypes. Instead of messing around with low level Windows calls, just tell Hooked what your hotkey is and what function you want to call.

PyHooked supports IronPython (2.7), PyPy (newest repo version) and CPython (Tested:2.7,3.4,3.5 Most are likely to work) currently. It is pure Python, so porting should be very simple (see The Future below).

####Usage - It is really easy, just:

from pyhooked import hook
def foo():
    print "foo"
hk=hook() #make a new instance of PyHooked
hk.Hotkey(["LCtrl","A"],foo) #add a new shortcut ctrl+a, that calls foo() when pressed
hk.listen() #start listening for key presses

Read more in the wiki! ####Installing

Just run $ pip install git+https://github.com/IronManMark20/hooked.git

####Alternatives - pyHook and pyhk inspired the creation of this project. They are great hotkey modules too! ####Extra - There is an example in the init.py file. You can run python __init__.py and it will start two hotkeys. ####License - PyHooked Copyright (C) 2015 Ethan Smith This program comes with ABSOLUTELY NO WARRANTY; This is free software, and you are welcome to redistribute it under certain conditions; PyHooked is licensed under the LGPL v3, or at your choice, any later version. This program comes with the lgpl in a .txt file.

#####As of v0.6, the module is LGPL licensed, not under the GPL.

####The Future - Here are a few things that I will be adding (subject to change without notice):

  • add support for args for called functions
  • get mouse inputs
  • support all scancodes found here
  • Jython support
  • Threads?
  • ????
    I am open to feature requests. If you have ideas, let me know (mr.smittye(at)gmail.com). Or, even better, make your changes and a pull request!