Mouse + Multi-Media Player GlovePIE Script - v1.4
By: Bighead - bighead.0@gmail.com
http://bhemuhelp.co.nf
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Description:
This script makes the wiimote function as a mouse using the sensor bar and has hotkey support for common media players. This is my personal wiimote script that I felt like sharing with anyone who is looking for something like this. I made it for the times that I want to lay back and be lazy and not sit in my PC chair. Feel free to alter it in any way you see fit for your specific needs.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Configuration:
Changes to the config can be made in the header of the script after opening it in GlovePIE and before running it. This section is for those who don't want to bother trying to figure out what's going on in the script to make some simple changes to it.

Smooth Mouse:
var.smoothmouse = true/false
Smooth mouse is a feature added in v1.4 that gives much smoother mouse movements when pointing the wiimote at the sensors. Compared to 1:1 wiimote-mouse movement, it may feel like there is a slight delay at first but there is not.

Dual Screens:
var.dualscreens = true/false
This option increases the wiimotes range so it will span across two screens. This inadvertently increases the speed and alters the "center point" of the cursor. You do not have to move the sensor bar between your two screens. Just keep it under your primary screen. The range and speed should be enough to span the cursor across both screens without having to move the sensors.

Cursor Click-Freeze Duration:
var.clickfreeze = 350ms
When wiimote A (Left Click) or wiimote B (Right Click) are pressed, the cursor will freeze for the given time in milliseconds. This makes it much easier to accurately click and double click. Changing this value to 0ms effectively disables this function. This value by default is 350ms. If you find this is too fast and you have trouble double clicking, then try increasing this value.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Modes:

The script supports four "modes" that the wiimote can be in which can be changed with the "Home" key. The current mode is displayed on the wiimote with a matching LED. The following explains what each mode represents.

Mode 1: Mouse Only
Mode 2: VLC Media Player
Mode 3: Winamp
Mode 4: Windows Media Player
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Mode 1 - Windows/Browser Tips:

- Hold down Wimote 2 (keyboard control) on the wiimote, and press up/down on the control pad to zoom in/out in browsers.
- The function above can also be used to change the size of desktop icons and folders when navigating directories.
- Just like the middle mouse button, pressing the wiimote 2 button on a browser link will open it up into a new tab.
- Wiimote Plus and Minus buttons can go Forward or Back in browsers or when navigating through Windows folders.
- Attach a Nunchuk for a few more keyboard buttons. The analog stick can be used as arrow keys and Z/C gives Enter/Backspace.
- Nunchuk is useful when wanting to navigate through folders or scrolling through a Winamp/WMP playlist (due to no Middle Mouse).
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Button Mappings:

This section eplains all the button mapping for the four modes that the wiimote can be in. This script uses the default hotkeys set by each player, so if you changed them then there may be conflicts. Most buttons are the same across all players except Winamp.

All Modes - Basic Mouse + Basic Keyboard
Mouse Move    -  Point at IR Sensor Bar
Left Click    -  Wiimote A
Right Click   -  Wiimote B
Enter         -  Nunchuk Z
Backspace     -  Nunchuk C
Arrow Keys    -  Nunchuk Analog Directions

Mode 1: Mouse Only
Key Control   -  Wiimote 2
Middle Click  -  Wiimote 1
Mouse Wheel+  -  Wiimote D-Pad Up
Mouse Wheel-  -  Wiimote D-Pad Down
Xtra Button1  -  Wiimote Minus
Xtra Button2  -  Wiimote Plus

Mode 2: VLC Media Player
Fullscreen    -  Hold A for second
Play/Pause    -  Wiimote Plus
Stop          -  Wiimote Minus
Next          -  Wiimote 1
Previous      -  Wiimote 2
Forward       -  Wiimote D-Pad Right
Reverse       -  Wiimote D-Pad Left
Volume UP     -  Wiimote D-Pad Up
Volume DOWN   -  Wiimote D-Pad Down

Mode 3: Winamp
Play          -  Wiimote Plus
Pause         -  Wiimote Minus
Stop          -  Hold Minus for 1 second
Next          -  Wiimote 1
Previous      -  Wiimote 2
Forward       -  Wiimote D-Pad Right
Reverse       -  Wiimote D-Pad Left
Volume UP     -  Wiimote D-Pad Up
Volume DOWN   -  Wiimote D-Pad Down

Winamp does not have a Play/Pause button by default. You can change this in the Winamp Preferences/Global Hotkeys. Just turn the Play Action into Play/Pause and Pause into Stop. Or you can modify the script but changing it in Winamp is probably simpler.

Mode 4: Windows Media Player
Fullscreen    -  Hold A for second
Play/Pause    -  Wiimote Plus
Stop          -  Wiimote Minus
Next          -  Wiimote 1
Previous      -  Wiimote 2
Fast Forward  -  Wiimote D-Pad Right (Toggled)
Rewind        -  Wiimote D-Pad Left (Toggled)
Volume UP     -  Wiimote D-Pad Up
Volume DOWN   -  Wiimote D-Pad Down
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Change Log:

v1.4
- Added a configuration header.
- Added mouse smoothing feature.
- Added dual screen support.
- Added rewind to Windows Media Player.
- Again tuned the volume/skip rates.
- Fixed wiimote mouse to better reach screen corners.
- Fixed real middle mouse button to respond better when script is running.
- Fixed real keyboard inputs again only this time for Modes 3/4.
- Wiimote Button 1 in Mode 1 (Middle Mouse) now has a click freeze so scroll toggle works.
- Updated this ReadMe with lots more info (will hopefully minimize some questions I recieved).

* All bugs that affected the keyboard while the script is running in any mode should now be fixed. This version should hopefully be the last. Everything that bothered me with this script has finally been fixed and every feature I wanted is implemented.

v1.3
- Slightly increased the pointer freeze duration when pressing A or B.
- Added "Control" to Wiimote 2. This allows webpage zooming with Wiimote 2 + Dpad Up or Down.
- Fixed "Right" arrow key from getting stuck when connecting/disconnecting the Nunchuk.
- Fixed real keyboard inputs that match wiimote buttons not being detected while the script is running.

v1.2
- Mouse cursor should be much more smooth now in Windows 8.
- Changed Nunchuk analog to function more like real arrow keys.
- Fine tuned many of the input delays.
- Moved info from script into this ReadMe.

v1.1
- Removed middle mouse mapping from "Home" (it was moved to button 1)
- Added support for more mouse buttons in Mode 1 (middle, xtra1, xtra2).
- Adjusted scroller speed to be faster in Mode 1 than Mode 2.
- Added better support for extra Nunchuk keyboard controls.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------