Wii Hacks

        

Sunday, December 03, 2006

HOWTO: Use the Wii-Mote In Windows as your Mouse

OK, here is how I was able to use the Wii-Mote in Windows using a program called GlovePIE by Carl Kenner.

You need a Wii-Mote, and a Bluetooth Adapter for your PC. This DOES NOT work with the Microsoft Bluetooth Stack. You must download another one to get it working. I have successfully gotten it to work with the BlueSolei drivers, but they are only a trial and have expired on me. For a list of other Wii compatible Bluetooth Adapters check out the WiiBrew Wiki.

If you need a new BT driver you can try to DL the trial version of BlueSolei Drivers here

Once your BT is setup and you can successfully see the Nintendo RVL-CNT device in your bluetooth manager, connect to it's HID service. It may also say (keyboard, mouse, joystick). You will need to hold down the 1 and 2 buttons on the wii-mote to put it into discovery mode. While the LED's are blinking do a discover on your computer and it should find the nintendo rvl-cnt device. If the lights go off during the process, press 1 & 2 down again, or hold them during the entire connecting process.

After you have that connected you are ready to download GlovePIE from here:
http://carl.kenner.googlepages.com/glovepie_download

Extract it and run the EXE. Then goto File->Open
and open the file named TestWiimote.PIE

Press run and you should see the number in the debug window move as you rotate the remote. If this is working on to the next step. If it does not work, and it is stuck at -127 your bluetooth driver is not compatible, or it is not successfully connected to the wii-mote.

If your getting numbers you can now try to emulate a mouse. Start a new GlovePIE script and paste this script in there, courtesy of BlackFrog and other members of the WiiLi Forums:

// Show wiimote forces
debug = "X="+Wiimote.RawForceX+' Y='+Wiimote.RawForceY+' Z='+Wiimote.RawForceZ

if wiimote.Up then
Mouse.WheelUp = true
wait 120 ms
Mouse.WheelUp = false
endif
if wiimote.Down then
Mouse.WheelDown = true
wait 120 ms
Mouse.WheelDown = false
endif
if wiimote.Left then
Mouse.WheelLeft = true
wait 120 ms
Mouse.WheelLeft = false
endif
if wiimote.Right then
Mouse.WheelRight = true
wait 120 ms
Mouse.WheelRight = false
endif

Mouse.RightButton = Wiimote.A
Mouse.LeftButton = Wiimote.B

Mouse.MiddleButton = Wiimote.Home
if Wiimote.Plus then
if var.osk= false then
Execute("osk")
var.osk = true
wait 300 ms
endif
endif
if Wiimote.Minus then
if var.osk = true then
ExitProgram
wait 300 ms
var.osk= false
endif
endif

if wiimote.one then
wiimote.leds = wiimote.leds + 1
if(wiimote.Leds>15)
wiimote.Leds=15
endif
wait 120 ms
endif
if wiimote.two then
wiimote.leds = wiimote.leds - 1
if(wiimote.Leds<0)>
wiimote.leds = 0
endif
wait 120 ms
endif

// set these to the offsets when the wiimote is at rest
// will be different for each wiimote most likely
var.x = Wiimote.RawForceX +12 //trim to 0
var.y = Wiimote.RawForceY -37 // trim to 0
var.z = Wiimote.RawForceZ +12 //trim to 0

//precision
var.sense0 = 500
var.thresh0x = 5
var.thresh0y = 2

var.sense = 300
var.threshx = 10
var.threshy = 5

var.sense2 = 100
var.thresh2x = 15
var.thresh2y = 8

var.sense3 = 50
var.thresh3x = 20
var.thresh3y = 12

//first sensitivity setting
//xaxis
if var.x > var.thresh0x
mouse.x = mouse.x - 1/var.sense0
endif
if var.x < -var.thresh0x
mouse.x = mouse.x + 1/var.sense0
endif

//yaxis
if var.z > var.thresh0y
mouse.y = mouse.y - 1/var.sense0
endif
if var.z < -var.thresh0y
mouse.y = mouse.y + 1/var.sense0
endif


//second sensitivity setting
//xaxis
if var.x > var.threshx
mouse.x = mouse.x - 1/var.sense
endif
if var.x < -var.threshx
mouse.x = mouse.x + 1/var.sense
endif

//yaxis
if var.z > var.threshy
mouse.y = mouse.y - 1/var.sense
endif
if var.z < -var.threshy
mouse.y = mouse.y + 1/var.sense
endif

//third sensitivity setting
//xaxis
if var.x > var.thresh2x
mouse.x = mouse.x - 1/var.sense2
endif
if var.x < -var.thresh2x
mouse.x = mouse.x + 1/var.sense2
endif

//yaxis
if var.z > var.thresh2y
mouse.y = mouse.y - 1/var.sense2
endif
if var.z < -var.thresh2y
mouse.y = mouse.y + 1/var.sense2
endif

//fourth sensitivity setting
//xaxis
if var.x > var.thresh3x
mouse.x = mouse.x - 1/var.sense3
endif
if var.x < -var.thresh3x
mouse.x = mouse.x + 1/var.sense3
endif

//yaxis
if var.z > var.thresh3y
mouse.y = mouse.y - 1/var.sense3
endif
if var.z < -var.thresh3y
mouse.y = mouse.y + 1/var.sense3
endif

Now the mouse should be moving when you tilt the wii-mote. Lots of other scripts are being created to work with other PC apps and games. Watch the original thread for more info:
http://www.wiili.org/forum/download-windows-driver-here-t294.html

For the non believers here's some videos:







UPDATE: News scripts, including ones that support IR pointer functionality have been posted here.

57 Comments:

Unknown said...

Well done for this driver, i'll try it as soon as i have a wiimote.
For the bluetooth drivers, maybe can you try with this one, which is the one provided with my Broadcom bluetooth dongle (blutonium bcm2035). I have also found another drvier, currently being downloaded but very slowly :-/.
You will find them here.
Good luck, let me know if it works!
alecool

Corbin said...

the second link requires a password, just hit enter and it will work. its a null password to fend off the lazy.

Chris said...

Why didn't they just make a mouse using the IR output from the remote? It feels so much more natural pointing rather than moving up and down and twisting left and right. Meh.

Unknown said...

I also found this driver, I'm in the process of testing it...

Doktor J said...

Chris, the IR thing on the remote is an input not an output - if you'll look at the Wii "Sensor Bar" with a digital camera (using the LCD viewfinder, not the optical viewfinder) you'll see the infrared LEDs in the sensor bar - the remote just picks up these two strong sources of IR to determine where it is.

LiquidIce said...

The latest version of GraphPIE supports multiple wii-motes and the ability to use the IR on the wii-mote to get pointer positions. The devs are working on code to make this a useable pointer and I will post an update when it's ready.

WrightAMagicSpell said...

They should still use the IR feature. Several people have used candles instead of the Wii sensor bar. It would be much better than tilting, to just point.

(On another note, how did this thing know my name was Alex?

Thats kinda freaky.)

Denis Bergeron said...

I use the iogear GBU211 USB Bluetooth adapter with the stock driver from iogear.com on XP and it is working. I was able to do everything a mouse is supose to do with the GlovePie022 (023 doesn't appear to work) but I have the restart the Glovepie022 everytime I want to run the script. Anyway good work people.

Unknown said...

I was able to get connected using Windows it shows the status as connected and the signal as good and the four led lights constanly flash, but when I try to use Glovepie the numbers stay at 0,0,0 and when I tried using that other program WinRemote it said access denied, but found the device :S

Anyone got any ideas?

Unknown said...

Despite having a WIDCOMM / broadcom driver for my Kensington bluetooth dongle, I can recognize the device, but can't pair no matter what the heck I hold down. BlueSoleil doesn't seem to recognize the dongle, so I've been attempting the software that shipped with the CD.

The 1 + 2 option does seem to light the remote, however only the sync button gets the software to even recognize the device.

Once recognized, and entering no PIN, it flat out won't pair. If I put the remote back into discovery mode while it's attempting to pair, the lights immediately blank the second the dongle attempts to communicate.

This is the remote that came with the unit...is it possible that once the primary remote pairs with the Wii, it sets a PIN, and then is unpairable with other devices unless the PIN is discovered?

Has anyone else been able to connect their "default" remote? or just the slaves? Any recommended dongles?

Unknown said...

is there a "glovepie" that runs the ir on windows, or only linux and OSX?


(How does this know my name?)

Unknown said...

Great jobs you guys. I am also testing the bt stacks mentioned here. I got some buttons to work with the MS stack but no acceleration, so its time get some better bluetooth stacks!

Unknown said...

btw, it knows our name due to the google account. if we have cookies and the option to stay logged on then it will not ask for a username and password... sorry if I spoiled the mystery!

Unknown said...

I don't know how many people this will be useful to, but the Logitech bluetooth stack for my keyboard and mouse works for this.

Unknown said...

Can people please post the model names/numbers next to the products they've found to work? I'm off to compUSA again this afternoon to try out several more that use WIDCOMM / broadcom based stacks. I'll post anything I have a successful result with.

tjfear said...

Has anyone had a success with the built in Bluetooth on a MacBook Pro running XP?? Or do I need to find another bluetooth driver (I've tried all the one's posted here, haven't got anything to work.) If you think you can help me email tjfear@gmail.com Thanks, sorry for the n00bness!!

Tricks Uploads said...
This comment has been removed by the author.
Tricks Uploads said...

Well i am looking at getting this program but the bandwidth has exceeded its limit. I have enough bandwidth to post a link for this as well if someone wants to help me out and send me this Prg.
trickedoutimpulse@hotmail.com

Tricks Uploads said...

Well TY from adam who hooked me up with a copy of GlovePie .24 i have made a few mirrors seeing the makers site doesnt have enough bandwidth to cover it.

http://rapidshare.com/files/6606785/GlovePIE024.zip
and
http://www.infamous-phear.com/downloads/GlovePIE024.zip

You welcome!

Jigo said...

Are there any decent alternatives to BlueSoleil? it doesn't want to work with my dongle, and the last person to ask on the BlueSoleil forums about my specific dongle was back in july and got no 2nd responce from the admins. If you have no other known programs, what would you suggest I search for in google. I'm pretty new to Bluetooth, so I wouldn't know what this kind of software might be referred to as.

Peanut said...

Okay I'm going to sound like a complete 1nt3rn3t n00b kid here...ahem...

I'm using an Anycom bluetooth dongle with Anycom software and the Widcom driver, and I've managed to receive data packets from the Wiimote, but these packets aren't transferring to anywhere else on my PC, i.e. GlovePIE. Does this sound like my bluetooth dongle isn't compatible?

PLZ Hlp me!!1!111! etc...

Unknown said...

Uhg. I'm trying to get it to work with my Kensington Model 33348, but its not connecting to BlueSolei. Other drivers would be appreciated.

J Z said...

bluesoleil doesnt recognize my integrated broadcom 2045 bluetooth. ive tried many drivers(widcomm, anycom,...). with the several versions of widcomm's drivers i was able to connect to my wiimote. with glovepie, i was able to use the four leds and rumble any way i wanted. however, my laptop wasn't getting any information back. it was a one way communication; button presses did nothing. ive tried everything i could think of. p.s.- the wiimote im using has never been connected to a wii.

Unknown said...

And where do i get this adapter?

Calvin Poon said...

After u guys used the wii-mote windows mouse hack thing did your wii-mote still work fine with the wii, or does it like damage it?
(THE PC KNOWS MY NAME!!!!!)

gergesim said...

Hey, I'm using Windows Vista and the BlueSoli drivers wont work, does anybody know of any other drivrs that will allow me to connect? My current drivers ask for a pairing key.

skibur said...

Kip Brown:

What drivers are you using??

Unknown said...

I have a question... I'm using the kensington bluetooth dongle and windows isn't letting me skip the pairing of the device. nothing happens when i click this button. Does anyone have any recommendations

LiquidIce said...

dan, you have to go through the bluetooth discovery WIZARD. it will not work from the connect window for some people.. don't know why.

Thw0rted said...

Liquidice, you are my effin H-E-R-O. I am using WIDCOMM 4.0.1.2400 -- these came w/ the widget, and are the latest version I could find here:

ftp://ftp.kensington.com/BT/

I have Dan's problem -- when you scan for devices in My BT Places, then connect, the Skip button is "disconnected". Also interesting: on the same screen (pairing), if you hit Back, you return to the Wizard's search page, but here, the Next button is "disconnected", just like Skip. I think this version must be buggy -- I'm going to try to replicate w/ my phone, and submit a bug report to Kensington and/or Broadcom.

Thw0rted said...

Oh, in case it wasn't clear, your fix worked. I will update the compatibility page on the Wiki.

roschler said...

Thanks for the tip on using the Wizard to Skip Pairing. I got to the point of being able to discover the WiiRemote, but having the Skip Pairing button inoperative because I tried clicking the WiiRemote icon in the Bluetooth Neighborhood screen.

Here's the instructions I have now that work for me, I'm leaving them here in case it might help others:

----

After installing my Belkin Bluetooth Class 2 adapter and rebooting I:

* Clicked on the Bluetooth SysTray Icon
It took me through the configuration process

* Clicked on Bluetooth SysTray Icon again

* In "My Bluetooth Places", I chose the "Bluetooth Setup Wizard"

* Selected the option labeled "I want to find a specific device and configure how this computer will use its services" and then clicked "Next".

* Clicked buttons "1" and "2" simultaneously on the WiiRemote to initiate pairing and held the buttons down through the rest of this procedure

It located the Nintendo Wii Remote (Nintendo RVL-CNT-01)

* Clicked on the icon labeled "Nintendo RVL-CNT-01" to select it and then clicked "Next"

* Clicked the button labeled "Skip Pairing"

I now saw a screen with a device named "Nintendo RVL-CNT-01" and the text "Use a Bluetooth enabled mouse, keyboard, or other interface device" with a "checked" checkbox next to it.

* I then clicked Finish

To verify the connection I then went into "My BlueTooth Places" and then "Entire Bluetooth Neighborhood":

* I right-clicked "Nintendo RVL-CNT-01" and chose the "Status" option

The connection was listed as good and button presses on the Wii Remote were reflected in the status screen.

* I clicked "Close" to finish the validation.

----

Can anyone tell the minimum number of services I need for the Wii Remote? I'm not going to use my Bluetooth adapter for anything else but the Wii Remote, and I want the most secure installation.

Also, what is the best source for algorithm code or pseudo code for getting the best use out of the Wii Remote's output? I use Borland's Delphi (Object Pascal) for development, but I know C/C++ quite well too.

Thanks again for your help LiquidIce.

Scott said...

I need a link to a WiiMote C# project.

Thanks!

Anonymous said...

wow, nice

VitalBytes said...

Hi All,

I just made some .NET/C# code work with Nintendo Wiimote

Here is the page: http://vitalbytes.com/wiimote/

please let me know how it worked for you.

Unknown said...

can someone help me please.

i got bluesoleli, and glovepie. and a wiimote and
i did everything OP said in the top of the thread. and in the Bluesoleli i do see NINTENDO RVL CNT O1 connect to the sun.
i open up glovepie and copy the code up there in to the GP and hit run but all that does is just make my cursor automatic goes to the top left hand corner on it own.

Alessandro Rizzoli said...

Nic, I've found the same behaviour of my cursor... I'm still able to move the cursor somewere a bit moving the wiimote. I'll try some script tweaking since it looks like there is some threshold to set... later

electr0flux said...

I have the same problem as nic and alessandro.And wiinremote for that matter but in that the cursor go to the right and get stuck there.I tested the GP script without the wii connected and the cursor did the same thing so it seems like an issue with the script itself..Any ideas?

chris!!@@!@!@$#$% said...

I am using the Kensington Bluetooth USB Adapter 2.0 successfully. I updated the drivers first and used the 1 + 2 method. Only thing I need now is to set up my sensorbar.

nerdkiller14 said...

i got it to work but it doesn't stay connected

hexpunK said...

I have a problem with my Belkin adapter (F8T013). It will discover but won't pair (I think), I am on vista premium and have tried WINCOMM, I think its call RX something and bluesoleil isnt compatable apparetnly, anyone have any ideas?

Exxtreme said...

Can anyone help me???

I've connected the Wiimote in BlueSoleil and ti seems to work in there, but when i open the file in GlovePIE 0,29 and click run, no numbers change... What is wrong?

I'm running Vista Ultimate...

Unknown said...

I seem to be running into the same problem as other people here, with my Kesington USB Bluetooth Adapter 2.0. Apparently it is not supported by BlueSoleil, and the WIDDCOM stack that ships with it is not compatible. It picks up the wiimote, connects, and the light on the bluetooth adapter blinks when I press buttons, however it doesn't get any info showing up in glovepie. I'm going to try to get another adapter today, but I'd reccomend those wishing to try this to not get the Kesington USB Bluetooth Adapter 2.0, as it seems incompatible.

Unknown said...

If i don't do anything with the wiimote, the cursor automatically goes to the top left corner. if i twist/tilt it right/down, it moves slowly, and when i put at a neutral position again, the cursor returns to the corner. WHY?

Unknown said...

lalalelelele

Anonymous said...

is it possible to pair and connect a Wiimote and a VZW LG VX8500R?

Unknown said...

awesome that it works, but why is it slow? when i hold my wii remote in a direction it goes that way but it is kind of slow, anyway to speed it up?

qwertymodo said...

There is a plugin for BlueSoleil called Gamei or something like that, but its sole purpose is for connecting video game controllers. Perhaps they block the basic version from being able to connect to the Wiimote so you have to buy the plugin (it's $15). I was using a trial of BlueSoleil to see if it worked with the Wiimote before I bought it, and it didn't work without the plugin. It's bull, but at least the plugin also comes with some nice stuff like button-mapping options and the ability to make certain programs recognize input from the Wiimote (WMP is enable by default, so you can use it kinda like a really dumbed down media center remote). So basically, I would say it's worth the $15, but right now I don't feel like dropping $35 to get the program and the plugin. Maybe once I get a job...

Collin said...

Hey all,
If anyone is looking for a good bluetooth setup to do this, the D-Link DBT-120 works perfectly. If you run the software on the disk and install the stack, it'll work right away. BlueSoleil is a POS, so I'd avoid that... It can't recognize a number of bluetooth devices I've tried. Also, that GlovePIE program is really great and it's super easy to code in, for those of you who, like me, felt that the above code doesn't work very well. The one must-change in the above code if you're going to use it is to get rid of the offsets for the wiimote at rest. Whoever wrote the code must've had a pretty f'd up wiimote, because mine all work fine with offsets of 0. If you just comment out the +12, -37, and +12, things willl work a lot better. Also, tinkering with the wait times can make things a lot less choppy. Great job still though to whoever wrote the code and made it available.

Kafka said...

The script has this line :

if(wiimote.Leds<0)>

Which glovepie seems to complain about. I'm assuming the trailing ">" is a typo?

I'm having the top-left corner issue as well... threshold, sensitivity setting maybe?

Nathaniel said...

It would be great if there was a way to use the wiimote with windows with the sensor bar.


P.S.:How the hell this thing knows my google account???

CJC said...

After reading all these comments I feel like I am living in a parallel universe ...
I am trying to get this *#&*# wiimote to pair with my PC.
I am using WIn-XP and an Anycomm bluetooth USB dongle. So far I have not had any other bluetooth issues and I do use it for lots of different devices. But for the wii remote, it keeps asking for the *&##(# passkey. I have tried all the steps listed above - but NOwhere in any of the bluetooth setup etc is there an area to disable uncheck or otherwise turn off the checking for a passkey,
Suggestions?

Unknown said...

Howdy. I'm using Blue Soleil 6.4.299 Trial. I can get one wiimote to work fine 100% except it always asks for a passkey and wont pair, also I cannot connect a second wiimote. ver 299 doesn't have a setup wizard either or any way to disable a pairing passkey.

D.Cans said...

Most of the connection tutorials I have read told me to press both the (1) and (2) buttons down while connecting to bluetooh. This did not work for me, my controllers have a red "sync" button located in the battery compartment of the wiimote. I spent and hour holding down the two buttons wondering why it would not work, so I hope this information helps savew someone some time.

I found some good tutorials that helped me get connected. http://ubuntudan.blogspot.com/search/label/Play%20Wii%20on%20Ubuntu

Joe Passive said...

WTF? not only GloverPie doesnt work, it opens a Boycott Israel site. thats where i'm from, so, wtf????

Adam Rabello said...

Works fine here!
With a motion plus is like a wii but no sensor!! :D

Now i can control my windows/tv in sofa :P

Anonymous said...

I sat until 1am to connect my wiimote to my notebook... no luck.
I have a compaq 615 running windows 7 ultimate and it has intergrated broadcom 2070 bluetooth device. I can connect to the wiimote to my pc. when it comes to pairing, i just clicked on pair without a passcode, it installed the drivers and showed mi it is connected. however i have no respnse from the remote, i then downloaded another more basic prog it pics up the remote, it responds to me pressing buttons for about 10 seconds, then i downloaded this app called widapp it sees the wiimote and it picks up any buttons i press on the remote and can even enable or disable the led's. the thing is this only works for about 20 seconds, the i lose connection and the device disappears. i found out i can't use the microsoft stack. then i downloaded the latest broadcom drivers, and installed it, finaly i got a bit of movement on the screen after connecting my wiimote and ran the script above, again i have less than a minute of operation. above is a link to download the bluesoleil software, when i ran the software i got a memory dump from a file named something like blueaudio.

What can i do to get my wiimote working??

somebody above mentioned using two candles for the wiimote, as the wiimote uses the ir sensor to recieve data. it is just a theory, but maybe get two old tv remotes and space the exactly the same width as the wii sensor and try to get this function working on the pc

Click Here to Post a Comment

Subscribe to the Nintendo Wii Hacks Blog RSS Feed

Also see:
PSP Hacks
PS3 Hacks
Zune Hacks
iPhone Hacks
Apple TV Hacks