pyHook is a python wrapper for global input hooks in Windows. Specifically it wraps the Windows SetWindowsHookEx API function using low-level keyboard (WH_KEYBOARD_LL) and mouse (WH_MOUSE_LL) hooks.
Questions tagged [pyhook]
202 questions
1
vote
0 answers
pyautogui.moveTo does not seem to generate a mouse event
I use pyautogui to test much of the functionality in my python application. It seems to work fine for left mouse down, up, and right down and up, as well as key down, and keyup. However, when I am see no mouse events for the mouse move calls.
Why…

Christopher Pisz
- 3,757
- 4
- 29
- 65
1
vote
1 answer
Pyhook event.Injected?
Really more of a question here. Based on pyHook's tutorial, the .HookManager().OnMouseEvent event variable in the function has a .Injected attribute. I couldn't find any information about it, does anyone know what it is? I tried doing
event.Injected…

Evgeny
- 153
- 16
1
vote
1 answer
Python keylogger
I was trying to make a keylogger in pyhton and have stumbled upon this piece of code on numerous blogs:
file_log='F:\\test\\log.txt'
def onKeyboardEvent(event):
logging.basicConfig(filename=file_log,level=logging.DEBUG,format='%(message)s')
…

Ketan Pandey
- 57
- 5
1
vote
0 answers
Error when installing MySQL-Python in pycharm
I'm getting the following error when attempting to connect to the MySQL-Python library in pycharm for mac:
Collecting py_mysql_connector
Could not fetch URL https://pypi.python.org/simple/py-mysql-connector/: There was a problem confirming the SSL…

MichaelS
- 11
- 1
1
vote
0 answers
Can't install pyHook3, pyhk3 for python 3.6 in windows 10
Before I learned python I had a few scripts in AHK. Now that I am learning python I want to recreate those scripts in python. Doing some searches I found that people used pyhk3 for this and pyhook3 is a dependency for that as seen here on line 46.…

Curse_USMC
- 33
- 7
1
vote
1 answer
PyHook for Python 3.6
Hello does anyone have succeded in installing pyHook on the last python version
C:\Users\T>python --version
Python 3.6.4
C:\Users\T>pip install pyHook
Collecting pyHook Could not find a version that satisfies the requirement pyHook (from versions:…

1020rpz
- 914
- 10
- 21
1
vote
0 answers
Python HookManager: Get Device ID
Using the Python HookManager, is it possible to get some distinction as to which device is giving me the input? Like if I had two keyboards, or a QR scanner for instance? How could I find out where the input is coming from?
import pyHook
import…

Chud37
- 4,907
- 13
- 64
- 116
1
vote
1 answer
pyHook doesnt let me type
I am trying to detect global keypresses in python. (I am a complete noob in Python). My problem is that pyHook recognizes my key events but it doesn't let me type anymore. If I try to type something into the opened selenium webdriver (see code),…

Sleeyz
- 25
- 3
1
vote
1 answer
Python: Using timer with PyHook
I am attempting to use PyHook to disable keyboard and mouse while running the script, and I am having difficulties setting a timer function so that the keyboard and mouse will only be disabled for a predefined amount of time, e.g. 30 seconds, and…

Jesper
- 13
- 3
1
vote
0 answers
pyhook keylogger is not case sensitive
This is a simple keylogger using python.
The problem is, whether I use lower case letter or upper case letter, it shows the letter in upper case.
import pythoncom
import pyHook
def keyboard_logger (keyEvet):
print…

Mehran
- 73
- 7
1
vote
1 answer
Using pyHook to detect key up and down
I found script that by using pyHook could print mouse clicking up and down:
class record(object):
def OnMouseEvent(self, event):
print 'MessageName:',event.MessageName
print 'Message:',event.Message
print…

T Hod
- 39
- 1
- 2
- 5
1
vote
0 answers
Pyhook Exit Program when a keybind is pressed
I am trying to make an Emergency quit button but for some reason its not working.
Here is my code:
from pyhooked import Hook, KeyboardEvent, MouseEvent
import pyautogui, os, sys, time
print "to stop Press CONTROl + A\n"
Ammo = raw_input('Enter ammo…

Tyrell
- 896
- 7
- 15
- 26
1
vote
0 answers
Cannot find reference 'PumpMessages' in 'pythoncom.py'
I am trying to understand what is happening here. I get a warning that cannot find reference 'PumpMessages' in 'pythoncom.py' but pip says Requirement already satisfied: pyHook in c:\python27\lib\site-packages so I assume it is installed…

recant
- 11
- 5
1
vote
1 answer
Can I read Unicode values using pyHook?
I created a simple keylogging program. Everything that is typed on keyboard is sent to a log.txt file. The problem is that my code works only for ASCII code.
When I type greek characters , they get treated as english.
I want my code to:
Accept…

Haki Terror
- 343
- 3
- 15
1
vote
1 answer
Python Keylogger with some features
I just started to program in Python. My first "project" is a keylogger. I've read several lines of code posted on here and other forums. I wrote this code, which should log pressed keys and begin a new line within the .txt file everytime the enter…

m3zli
- 13
- 4