Using the Wiimote as a mouse with C#
My wife and i recently got rid of our cable subscription, and just hooked up our desktop to our TV instead. Mostly works well for us, but don't really like our setup with the keyboard and mouse. We bought a wireless package, but apparently the max range is 3 feet, and our couch is at least twice that away from the TV. So I've been looking into turning my Wiimote into a mouse device using C#.
Using the WiimoteLib library from Brian Peek you can get total access to the wiimote and it's movements.
I tried using his example of a wiimote mousebut the accelerometer is too sensitive, and it was really difficult to move the mouse to small icons and click them.
Another website decided just to use the absolute X and Y values (IRState.RawMidpoint) instead, which works well for the most part, but the code needed a bit more tweaking to be usable. Some of the things that I modified:
I've put the project here if you want to try it out.
The main issue i have with it is that the mouse X value can move off the screen to the right, as if the systeminformation.primaryscreen.width value is incorrect, and makes the value larger than it actually is. I've included an offset to fix this, but it's just odd, considering that the Y value is dead on.
Using the WiimoteLib library from Brian Peek you can get total access to the wiimote and it's movements.
I tried using his example of a wiimote mousebut the accelerometer is too sensitive, and it was really difficult to move the mouse to small icons and click them.
Another website decided just to use the absolute X and Y values (IRState.RawMidpoint) instead, which works well for the most part, but the code needed a bit more tweaking to be usable. Some of the things that I modified:
- ability to adapt dynamically depending on the screen resolution
- inverted the x axis
- added a battery life reader.- I additionally added a feature that the mouse won't move unless the 'B' button is held down. This makes it more like the gyroscope mouse, which is what I've used in the past.
- Additionally, i upgraded the project to VS 2008, and the latest WiimoteLib library.
I've put the project here if you want to try it out.
The main issue i have with it is that the mouse X value can move off the screen to the right, as if the systeminformation.primaryscreen.width value is incorrect, and makes the value larger than it actually is. I've included an offset to fix this, but it's just odd, considering that the Y value is dead on.
Labels: c#, mouse, Wiimote, WiimoteLib
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home