This script is a hybrid of my PPJoy Button Mapping and Mouse scripts. It allows you to use the wiimote as a mouse and simultaneously supports input from a Nunchuk or Classic Controller. It also has specific features for the Nintendo DS emulator DeSmuME.
Tip: All the other wiimote buttons besides A, B, and Home are available as controller inputs. The wiimote D-Pad can be used as 4 unique digital inputs, which is useful when combined with a nunchuk. Up, Down, Left, and Right can be mapped to emulated console buttons such as Nintendo standard B, A, Y, X or Sony standard X, , O, or /\. Plus and Minus make a very obvious choice for Start and Select, and Nunchuck C/Z and Wiimote 1/2 can also cover L1, R1, L2, and R2. Or you can just map the buttons however you want.
Changes to the config can be made in the header of the script after opening it in GlovePIE and before running it.
var.smoothmouse = true/false
Smooth mouse is a feature 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.
This option locks the mouse cursor to a defined section of the screen. This is useful while in fullscreen mode in DeSmuME when playing with both screens enabled (for games like Metroid Prime: Hunters). Wherever you have the touch screen located, enter that value for confinement. For example, if you are using "LCDs Layout >> Horizontal + Top First", then you would enter "right" because the touch screen will be on the right. Use "none" if you want the wiimote mouse to have access to your entire screen, and use "dualscreen" if you want the wiimote mouse range to be able to span across two screens.
Note: This option has only been completely tested on a 16:9 1920x1080 resolution.
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 which is useful for DeSmuME, or you can try a very small value like 25ms. This value by default is 350ms. If you find this is too fast and you have trouble double clicking, then try increasing this value.
These modes are designed specifically for DeSmuME with games like Metroid Prime: Hunters in mind.
Mode 3 and 4 for each extension are essentially the same as Mode 1 and 2 with one very important difference. While either of these modes are active, pressing the A button will toggle "Left Click" and hold it down until A is pressed again which will release it. While Left Click is toggled wiimote LED 1 will light up along with the current mode LED. This option allows you to freelook in emulated 3D games on DeSmuME that required you to use the stylus to aim. Use in conjunction with the "Confinement" option for the best results. You may also want to try adjusting the stylus movement speed in the game settings to fine tune it to a speed that you feel comfortable with.