PDA

View Full Version : Control Mouse



Scarvenger
09-04-2007, 04:12 PM
How can i can control mouse position? (Not only in my app, but in the whole system)

brewbuck
09-04-2007, 04:21 PM
How can i can control mouse position? (Not only in my app, but in the whole system)

The most basic X call to move the mouse is XWarpPointer(), but to use it you need a display handle. In general, there should be a function to move the mouse that is specific to the window toolkit you are using.

What exactly is your purpose?

Scarvenger
09-05-2007, 10:17 AM
I have a app for computer vision that "translates" the coordinates of my hand to my app, then i wanted to make it control the mouse accordinly to my hand's position and later i would like to add mouse click support. PS: Control not only mouse position for my app but for the whole OS.

matsp
09-05-2007, 11:34 AM
That sounds like you actually want to hook into the mouse-driver interface, rather than fake it in from above. This is probably a bit harder in some ways, but it will help in other ways, because you won't have to combat with things preventing you from moving the mouse...

--
Mats

Scarvenger
09-05-2007, 04:59 PM
And how can i do this? :)

matsp
09-06-2007, 02:01 AM
You'll have to look at the existing mouse drivers and see how they work, then work out a way to connect your device as a mouse-device - I've never done any work with mice as such, but I'm 95% sure that this is the right way to go.

There's probably a Linux Kernel mailing list group for mouse drivers or HID (Human Interface Devices).

--
Mats