Is there any way to monitor keyboard events in windows 7 with python without the python program having focus? I would like to run the python script as a background process that monitors certain keyboard events and does certain things on various keyboard input combinations.
Asked
Active
Viewed 1,640 times
3
-
Possible duplicates: http://stackoverflow.com/questions/365110/cross-platform-keylogger http://stackoverflow.com/questions/694296/detect-in-python-which-keys-are-pressed – volting Aug 13 '10 at 11:15
-
None of those address the python process running in the background. – David K. Aug 13 '10 at 11:21
-
I looked into pyhook and it refuses to install on windows 7 with python 2.7. – David K. Aug 13 '10 at 11:29
-
Have you tried "Backwards Compatibility Mode"? – Katriel Aug 13 '10 at 11:41
-
I don't think it's a compatibility mode issue. PyHook just refuses to run because it says it requires python 2.6 even though the documentation says any version of python starting at 2.4 is ok. – David K. Aug 13 '10 at 11:55
1 Answers
2
Ok, I got pyHook working after installing the 32bit version of python 2.7 and compiling pyHook from the source with MinGW. Thanks for the pointers everyone.

David K.
- 6,153
- 10
- 47
- 78