pyhook

Pyhook stops capturing key events after 6 presses

和自甴很熟 提交于 2019-12-06 13:27:52
问题 I wrote a script to move the mouse around when a key is pressed using pyHook. The problem is that after 6 key press events the script stops picking up key presses and needs to be ended from task manager. I am using python 2.7 on a Windows 7 machine. I have not found anyone else with an answer to a similar problem. The code is designed to hook the mouse, and then once it is clicked move the cursor, unhook the mouse and hook the keyboard. There, the keyboard hook only works for 6 events. If I

Freeze when using tkinter + pyhook. Two event loops and multithreading

为君一笑 提交于 2019-12-06 02:12:48
I am writing a tool in python 2.7 registering the amount of times the user pressed a keyboard or mouse button. The amount of clicks will be displayed in a small black box in the top left of the screen. The program registers clicks even when another application is the active one. It works fine except when I move the mouse over the box. The mouse then freezes for a few seconds after which the program works again. If I then move the mouse over the box a second time, the mouse freezes again, but this time the program crashes. I have tried commenting out pumpMessages() and then the program works.

Something like pyHook on OS X

不打扰是莪最后的温柔 提交于 2019-12-04 11:33:37
I am actually working with pyHook , but I'd like to write my program for OS X too. If someone know such a module ... I've been looking on the internet for a while, but nothing really relevant. -> The idea is to be able to record keystrokes outside the python app. My application is a community statistics builder, so it would be great to have statistics from OS X too. Thanks in advance ;) Edit : PyHook : Record keystrokes and other things outside the python app http://sourceforge.net/apps/mediawiki/pyhook/index.php?title=PyHook_Tutorial http://pyhook.sourceforge.net/doc_1.5.0/ http://sourceforge

pyHook stops receiving Key press events (randomly)?

荒凉一梦 提交于 2019-12-04 01:54:57
问题 I have a program that captures all key presses using pyHook, then runs a few functions. I notice that after a while (of random duration), the program was stop receiving key triggers, even though I am pressing keys? Is pyHook unstable? I'm not changing what keys are pressed or pressing them prematurely or anything like that. Here's my code: import time import win32api import win32con import pythoncom import pyHook import os import ctypes def Click(x,y): win32api.SetCursorPos((x,y)) win32api

Can't install pyHook package “Could not find a version that satisfies the requirement pyHook”

那年仲夏 提交于 2019-12-02 08:03:52
im trying to install the pyHook package in pycharm but get the error in the title. I have successfully installed it in cmd with pip install pyHook-1.5.1-cp37-cp37m-win_amd64.whl ,but when I go to install it in pycharm I get the aforementioned error : Collecting pyHook Could not find a version that satisfies the requirement pyHook (from versions: ) No matching distribution found for pyHook I ran into this problem myself, and after alot of searching, found that although pyhook has wheels for python 3, it's incompatible. Look at the last release date for pyhook: October 10th 2008. Python 3 was

Using pyHook to get mouse coordinates to play back later

二次信任 提交于 2019-12-02 04:51:03
问题 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 later. Here is my present code: import win32api, win32con, time, win32ui, pyHook, pythoncom #Define the clicks in the win32api def click(x,y): win32api.SetCursorPos((x,y)) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,x,y,0,0) win32api.mouse_event

pyHook stops receiving Key press events (randomly)?

允我心安 提交于 2019-12-01 10:33:33
I have a program that captures all key presses using pyHook, then runs a few functions. I notice that after a while (of random duration), the program was stop receiving key triggers, even though I am pressing keys? Is pyHook unstable? I'm not changing what keys are pressed or pressing them prematurely or anything like that. Here's my code: import time import win32api import win32con import pythoncom import pyHook import os import ctypes def Click(x,y): win32api.SetCursorPos((x,y)) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,x,y,0,0) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,x,y,0

ImportError: No module named pywintypes

六月ゝ 毕业季﹏ 提交于 2019-11-29 18:01:49
问题 I am working to make a small keylogger with Python, by using the pyHook, pythoncom and Pywin32 modules. Here is my code: import pyHook, pythoncom, sys, logging file_log = 'C:\\important\\log.txt' def OnKeyboardEvent (event): logging.basicConfig(filename=file_log, level=logging.DEBUG, format='%(message)s') chr(event.Ascii) logging.log(10, chr(Event.Ascii)) return True hooks_manager=pyHook.HookManager() hooks_manager.KeyDown = OnKeyboardEvent hooks_manager.HookKeyboard() pythoncom.PumpMessages(

pythoncom crashes on KeyDown when used hooked to certain applications

喜欢而已 提交于 2019-11-27 13:44:39
I wrote this code on to observe the event of a keydown motion. The problem appears to be that when this script is run, certain programs will crash this program, spitting out this error message: TypeError: KeyboardSwitch() missing 8 required positional arguments: 'msg', 'vk_ code', 'scan_code', 'ascii', 'flags', 'time', 'hwnd', and 'win_name' Some programs observed to crash are: Skype, Sublime Text 2 After a few trials at debugging it, the problem appears to be occurring on the final line but I can't seem to narrow it down. I also don't understand the meaning of KeyboardSwitch() as returned by