Pat1487
Joined: 08 Jan 2007 Posts: 59
Digg It |
Posted: Sun Jan 14, 2007 3:46 am Post subject: Simple Desktop Mouse (uses IR) |
|
|
very basic, but effective mouse script, i couldnt really get the other ir mouse scripts working like i wanted so i made this, its not perfect, but i like it more then the others ive tried
| Code: | /*
Point the wiimote at the screen and use your mouse on your computer
just like you were using it on the wii
A is left click
B is right click
plus is double click
home stops this script from running (giving back normal mouse control)
holding down on the wiimote will stop the mouse from moving, i havent
finished this script so theres no sensitivity control, which
means the slightest movement will cause the mouse to move, and its
impossible to keep your hand completely steady, so hold down when you
want to click on something (changing the sensitivity in windows seems
to help)
the mouse will stop moving and the wiimote will rumble to tell you
when you roll the wiimote past 45 degrees
this is to stop everything from becoming all upsidedown
(working on a better solution where it wont matter how you hold it),
so make sure not to hold the wiimote sideways or with the B button
facing up
Tested with wii's official sensor bar at 1024x768 resolution different sensor
bars and resolutions may have different effects
*/
//Do not edit below this line, unless you know what you are doing
var.MapRangeX=MapRange(Wiimote.dot1x, screen.Width,0, 0,screen.Width)
var.MapRangeY=MapRange(Wiimote.dot1y, 0,screen.Height, 0,screen.Height
if wiimote.Roll<45 and wiimote.Roll>-45 and !helddown(wiimote.down, 1ms) then
wiimote.Rumble=false
mouse.CursorVisible=true
Mouse.CursorPosX = var.MapRangeX
Mouse.CursorPosY = var.MapRangeY
elseif helddown(wiimote.down, 1ms)
mouse.CursorVisible=false
wiimote.Rumble=false
else
mouse.CursorVisible=false
wiimote.Rumble=true
endif
ExitProgram =wiimote.Home
mouse.LeftButton=wiimote.A
mouse.RightButton=wiimote.B
DoubleClicked(Mouse.LeftButton)=wiimote.Plus
debug=" X=" + wiimote.dot1x +" Y=" + wiimote.dot1y+ " Roll="+wiimote.Roll+" Maprange X=" + var.MapRangeX +" Maprange Y=" + var.MapRangeY |
This is my first script and is just so i can get used to using glovepie |
|