You are not logged in.
Pages: 1
I want to be able to take all mouse events (motion, button click) and store them. Of course, I want to do this using Python. I don't know how to do this such that I can receive *all* mouse events, not just those that occur over, for example, a gtk window. I don't care what happens to the window under the pointer when the click occured, I just want to log that the click happened and at what coordinate.
Is this possible using a lowlevel Python API that will work on both Linux and Windows? What about Java? I'm not doing it in C.
Reason for project: I have to write some code that uses some very unique hardware that sends input location and button press events into a network socket. I want to test my code using traditional input devices (ie: mouse), so I want to capture mouse events and forward them in the correct format across the socket.
Its 2AM and I have no clue how to do this or where to start looking. Some kind of interrupt API???
thanks,
Dusty
Offline
python-xlib will work just fine. You're going to have to do a server-wide grab for mouse events, and then resend the events to the window the occured on in order to do what you're intending.
Offline
l Python API that will work on both Linux and Windows
I don't think python-xlib will work on Windows? Problem is I want this simulator to work on my system, and on my unenlightened friends' windows systems.
Maybe its not as easy as I hoped.
Dusty
Offline
Dusty wrote:l Python API that will work on both Linux and Windows
I don't think python-xlib will work on Windows? Problem is I want this simulator to work on my system, and on my unenlightened friends' windows systems.
Maybe its not as easy as I hoped.
Dusty
Nope it's not - mouse events that are not within the scope of the application window are not natively handled by python, as far as I know. You'd have to hack something together... I could do the linux side... as for windows, no idea.
Offline
was thinking I'd have to handle the interrupts directly, but I suspect that's done different for both OS too. So lets not bother.
Dusty
Offline
Pages: 1