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
2
votes
1 answer
Reset GPU memory using Keras 1.2.2 with MXnet backend
I'm using AWS p2.x8large and trying to evaluate my model using k-fold cross validation.
After the first repetition my GPUs memory is full and when I try to train once again I receive a cuda memory problem.
My question is how to reset the GPU memory…

Jenia Golbstein
- 374
- 2
- 12
2
votes
1 answer
pyHook giving wrong ASCII values
I was working on a keylogger to learn a bit about pyHook, but it seems like event.Ascii gives me the wrong ASCII values. For example I get 0 for any symbol or number, 1 for A (should be 65), etc.
import pyHook, pythoncom
def…

Shadowphyre
- 21
- 4
2
votes
0 answers
Script in Python crashed when alt+tab is pressed repeatedly (pyhook and pythoncom)
I'm making a script in Python 3.5.2 on windows 10 that capture the keys that user press.The code works perfectly except when I press alt+tab to switch the windows, sometimes crashes immediately and sometimes crashes when I press it repeatedly.
The…

Mauricio Avendaño
- 801
- 9
- 15
2
votes
1 answer
Returning pyhook keypress event to thread queue
I am trying to route keyboard presses detected by a simple keylogger to another thread. My program sets up key logging in a thread like this:
import threading
import Queue
import pythoncom
import pyHook
stopevent = threading.Event() #how to stop…

willpower2727
- 769
- 2
- 8
- 23
2
votes
2 answers
How to install pyhook for python 3.4?
How do I install pyhook for python 3.4? I can find the files for 2.7, but not 3.4.
Does anyone have the download link to get pyhook for python 3.4? Any help would be greatly appreciated.

Wiyaaa
- 43
- 1
- 4
2
votes
0 answers
Errors with pyhook on python 3.5
I am trying to write a keylogger using pyhook. Below is the piece of code.
I recently changed to py3.5 from py2.7. The code was working fine before migration.
After migration I am getting errors.
Everytime I press say "a" on keyboard, I get…

codebraker
- 98
- 10
2
votes
1 answer
pyHook + pyGTK - close app on key press (Windows)
I want my (Python/Windows) GUI GTK window to close on key press. However, there's no reaction.
I'm a beginner and I was looking for answers in google.
My english isn't very proffesional too.
Please be patient with me.
import pygtk
import gtk
import…

Nicolas
- 37
- 8
2
votes
1 answer
pythoncom crashes on keylogger with skype
This is my source code:
import pythoncom, pyHook, sys
def OnKeyboardEvent(event):
if event.Ascii==5:
sys.exit
elif event.Ascii !=0 or 8:
f = open('output.txt', 'r+')
buffer = f.read()
f.close()
f = open ('output.txt',…

Yoast
- 53
- 6
2
votes
0 answers
pyhook: call function when pressing a specific key (separately from others)
I started using pyHook because I wanted a function to be called whenever the user pressed a specific key. This is my code:
def on_keyboard_event(event):
if event.KeyID == 79: # ID 79 = 'o' key
next_query() # this is a…

Acla
- 141
- 3
- 12
2
votes
1 answer
pyHook or pythoncom bug?
I have Windows 7, 64 bit. I'm running the example.py file (code posted below) that comes with the pyHook package. Whenever my active window is Skype, either my computer crashes or I get 'TypeError: KeyboardSwitch() missing 8 required positional…

Nathan Schmidt
- 374
- 1
- 4
- 16
2
votes
2 answers
pyHook KeyLogger thread not finishing
I created a thread for a keylogger that logs in parallel to another thread that produces some sounds ( I want to catch reaction times).
Unfortunately, the thread never finishes although i invoke killKey() and "invoked killkey()" is printed.
I…

refuzee
- 408
- 4
- 15
2
votes
2 answers
cx_freeze not importing external modules
I choose to try using cx_freeze which converts my simple python 3.x keylogger to an exe. I choose cx_freeze because py2exe is only python 2.x I am compiling my code using this setup.py script.
from cx_Freeze import setup, Executable
# Dependencies…

Coder77
- 2,203
- 5
- 20
- 28
2
votes
1 answer
cx_freeze not working with pyHooks
I am very new to cx_Freeze, but when I tried to use pyHooks, it didn't work.
here's my setup.py code:
from cx_Freeze import setup, Executable
includes=["re", "pyHook"]
exe = Executable(
script="hello.py",
base="Win32Gui",
targetName =…

CannedAnchovy
- 308
- 1
- 2
- 7
2
votes
2 answers
How to find files and save them to different folder in python
I amt trying to find all relevant files and folders from local repository.
e.g. I pulled projects from git to my local machine and I want to search for specific files(.txt) and save them to new folder in same pattern (root->dir-> file).
Basically I…

user2661518
- 2,677
- 9
- 42
- 79
2
votes
3 answers
Using pyHook to get mouse coordinates to play back later
I am writing a chunk of code to get gather mouse click information using pyHook and then the win32api to get access to a click function. Essentially I am trying to use the mouse to record a pattern of clicks to be recorded and played back…

CodeMonkeyAlx
- 813
- 4
- 16
- 32