Hacking the Wiimote
Wednesday, January 30, 2008 12:58:56 AM
I spent my free time today messing around with bluetooth, specifically trying to access my Wii controller from my PC. While it took me a while to get things going, I was finally able to connect through Windows Vista with the dongle from my new Rocketfish Keyboard. And man is it amazing! Using a program called GlovePie I easily mapped the wiimote's buttons to keyboard and mouse movements on my PC. The result being my own makeshift wiimote mouse driver. It's not the most sensitive, since I don't have a sensor bar at my computer, but it (sort of) works.
Here's how I did it in GlovePie:
Here's how I did it in GlovePie:
/* C R A P M O U S E --beefmunk's IR-less Wii Mouse-- Roll the wiimote left or right to move horizontally, tilt the wiimote up or down to move vertically. Use up and down on the d-pad to page up and down, and press a to left-click. */ //Horizontal Sensetivity. Mess with this until it feels right var.horSense = 45 //Vertical Sensitivity. Mess with this until it feels right var.verSense = 20 //How fast the mouse pointer moves accross the screen var.speed = 15 //Button Mappings key.PageUp = wiimote.Up key.PageDown = wiimote.Down mouse.LeftButton = wiimote.A //Test for movement if wiimote.Pitch > var.verSense then mouse.CursorPosY = mouse.CursorPosY - var.speed elseif wiimote.pitch < -var.verSense then mouse.CursorPosY = mouse.CursorPosY + var.speed endif if wiimote.Roll < -var.horSense then mouse.CursorPosX = mouse.CursorPosX - var.speed elseif wiimote.Roll > var.horSense then mouse.CursorPosX = mouse.CursorPosX + var.speed endif








dennis72 # Monday, March 10, 2008 8:18:33 PM