Fortunately those api are ported to python by PyHook and already used by mouse event plugin viewtopic.php?f=9&t=3720.
We need for example to listen to Windows messages to get resizing event, as explained here http://stackoverflow.com/questions/2880 ... in-c-sharp.
I tired to incorporate this in my own plugin but because my knowledge in python is shallow I get like ton of errors related to threading:
Code: Select all
..\EventGhost\eg\Classes\ThreadWorker.py:319: Runtime Warning: tp_compare didn't return -1 or -2 for exception
if resultCode == WAIT_OBJECT_0:
Traceback (most recent call last) (1722):
File "..\EventGhost\eg\Classes\ThreadWorker.py", line 319, in __DoOneEvent
if resultCode == WAIT_OBJECT_0:
TypeError: an integer is required
Exception in thread ActionThread:
Traceback (most recent call last):
File "threading.pyc", line 532, in __bootstrap_inner
File "threading.pyc", line 484, in runCode: Select all
import pyHook
import cpyHook
import HookManager
class Test(eg.ActionBase):
def __call__(self):
print "dose nothing"
def Hok(self):
hc=HookManager.HookConstants()
cpyHook.cSetHook(hc.WH_MOUSE_LL, self.Res)
def Res(self, msg, x, y, data, flags, time, hwnd, window_name):
print "working"
Any help is appreciated how to incorporate this stuff, since my knowledge here is limited.
P.S
I just put all PyHook files in the same folder of the plugin, otherwise it will not "see" cpyHook.