Skip to content

Pure Python hotkey hook, with thanks to pyHook and pyhk

Notifications You must be signed in to change notification settings

markmmm/pyhooked

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#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!

About

Pure Python hotkey hook, with thanks to pyHook and pyhk

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%