I'm working on a project which uses the Leap Motion to control the mouse with Python and I use the win32api library. I have one gesture that sets the middlebutton of the mouse to "down" like this: win32api.mouse_event(win32con.MOUSEEVENTF_MIDDLEDOWN, x, y, 0, 0)
However, it seems to be down for just one frame of a second. For example, if I do the same for the left button ( so i can drag things around) it works and the button only goes up when I say so. I need the middle button so I can "pan" around an image.
The thing is that at the same time I have
state_middle = win32api.GetKeyState(0x04)
print state_middle
And it keeps printing "-128" which should mean the button is being pressed. But in practice it isn't.
I did a similar project with c# and in that one the code works perfectly. Is it because I'm using python and the library does not work that well?