Controlling mouse in linux

3.1k Views Asked by At

Basically I'm currently using the wiiuse library to get the wiimote working on linux. I want to now be able to control the mouse through the IR readings.

Can somebody point me in the right direction as to how to approach this? I know of uinput but there doesn't seem to be a lot of tutorials/guides on the web.

I'm working with c/c++ so a library in c/c++ would be helpful.

Cheers.

3

There are 3 best solutions below

0
John Jiang On BEST ANSWER

In the end I decided to just draw "cursor" objects on the screen and use setup each input device to control a separate "cursor" object. This seemed the best idea as we were short on time.

2
unwind On

I think you should look into "becoming" a new mouse device. This would require developing a device driver that knows how to read the Wii device, and present that data to the input system as if it came from a mouse. The Linux kernel supports multiple mice connected at the same time, and merges the inputs from all of them, so this will work fine.

This book might be a handy help along the way. Not sure if it's possible to do this totally in userland, but that is of course worth investigating too.

2
greg On

I`m not sure if I understood you question corectly. If looking for controling mouse pointer from userspace look at XTest Extension Usefull link

Edit: From kernel POV uinput looks like good starting point