The pyHook package provides callbacks for global mouse and keyboard events in Windows. Python applications register can event handlers for user input events such as left mouse down, left mouse up, key down, etc. and set the keyboard and/or mouse hook. The underlying C library reports information like the time of the event, the name of the window in which the event occurred, the value of the event, any keyboard modifiers, etc. Events can be logged and/or filtered.
- Windows 2000 or later (low-level hooks are not supported in earlier versions of Windows)
- Python 2.4 or later
- PyWin32 (formerly known as win32all extensions)
This project provides compiled releases of the pyHook library in the file releases section of the project site. It is advised that you use the latest release. If you choose to use the precompiled installer, all you have to do is double-click the installer and follow the install wizard.
The project also makes source code releases, also posted in the file releases section. You can if you wish get the source zip, and compile the code yourself, using these instructions. This will produce a binary installer for you, just like the ones released by the project.
You can also pull the latest code from git, if you are feeling adventurous.
- Switch to using Unicode instead of Ascii, to be more useful to non-English locales
- Fix the dead-keys bug
pyHook is licensed under the MIT Licence.
The original author of this library is Peter Parente (though he no longer maintains this project.)
If you need help, please post on the help forum of the project site.