A Useful Glovepie Script for Controlling Your Computer with a Wii Remote

This is a script that controls the mouse, things like your music player and your browser, and more with a Wii Remote.

If you don’t know much about GlovePIE, go here to learn how to use it.

If this is too much, you can find a simpler script, with just mouse controls here.

For more fun articles, please visit my blog, The Brain Collective.

This article has now paid me over $25, and counting!  Click here to join Triond and start making money for youself!

Here is a rundown of the controls:

- The Joystick controls the mouse

- A is click and B is right click

- Left and right on the D-Pad controls the volume

- Up and Down on the D-Pad scrolls

- The + and – buttons control forward and back in your web browser

- The 1 button opens email

- The 2 button refreshes your web browser

- The C button play the next track on your music player

- The the Z button is lots of random fun

That’s it, your can change anything if you want to.  Have fun!

====Script starts here, copy everything below this line====

//Start Script

     var.minim = 0.08    //Joy sensibility
       var.top = 10       //Maximum speed( pixels/frame )
var.freezetime = 300 ms
 pie.FrameRate = 100 hz  //Leave between 60 and 100 Hz

var.freeze = KeepDown(Pressed(nunchuk.ZButton),var.freezetime)

If var.active=True and var.freeze=false
Mouse.x=Smooth((1/(screen.Width/var.x)), 2)
Mouse.y=Smooth((1/(screen.Height/var.y)), 2)
var.x = MapRange(Mouse.x, 0, 1, 1, screen.Width)
var.y = MapRange(Mouse.y, 0, 1, 1, screen.Height)

if (-var.minim<(wiimote.Nunchuk.Joyy or wiimote.Nunchuk.Joyx)
If wiimote.Nunchuk.Joyy < -var.minim Then var.y=var.y-var.speedy
If wiimote.Nunchuk.Joyy > var.minim Then var.y=var.y+var.speedy
If wiimote.Nunchuk.Joyx < -var.minim Then var.x=var.x-var.speedx
If wiimote.Nunchuk.Joyx > var.minim Then var.x=var.x+var.speedx

if pressed (Wiimote1.Nunchuk.ZButton)
wiimote.rumble = 1
if var.check = 1
wiimote.leds = var.led+1
var.led = var.led+1
wiimote.leds = 1
var.led = 1
var.check = 1
wait 150 ms
wiimote.rumble = 0

Mouse.LeftButton = Wiimote1.A
Mouse.RightButton = Wiimote1.B
Key.VolumeDown = Wiimote1.Left
Key.VolumeUp = Wiimote1.Right
Mouse.WheelUp = Wiimote1.Up
Mouse.WheelDown = Wiimote1.Down
Key.WebBack = Wiimote1.Minus
Key.WebForward = Wiimote1.Plus
Key.WebHome = Wiimote1.Home
Key.Mail = Wiimote1.One
Key.WebRefresh = Wiimote1.Two
Key.NextTrack = Wiimote1.Nunchuk.CButton

//End Script

==== Script is over, do not copy this line====


i need your help…
i used your wiimote script and my only issue is that the joystick(to control mouse) does not work.

it is connected and also the buttons on the nunchuck work


hey i can help you just add >

var.speed = nunchuck.Joy

var.speed = var.speed * 15
end if

mouse.DirectInput2D += var.speed

and the nunchuck works
i am not the one who made the script up at the top of this page!
i just thought i might help!


by the way> var.speed = var.speed * 15<the 15 can be changed

it refers to the speed of the cursor.


Now i can control my mouse with the nunchuck thanks to you! :) :)


Like many others I was looking for an easy “how to” about making music with my WiiMote, I couldn’t find it so I wrote my own. Check my website:




thank you very much for this. it is awesome!!!

comments powered by Disqus