// ParticleView by Jeff Matson
// Uses WiiMouse 0.1 by WiiScript.co.nr (sbraidley@yahoo.co.uk)
wiimote.Leds=0
Shift=Equals = wiimote.Up
minus = wiimote.Down
Left = wiimote.Left
Right = wiimote.Right
Mouse.LeftButton = Wiimote.minus
Mouse.RightButton = Wiimote.plus
Mouse.LeftButton= Wiimote.A
//D = wiimote.home
E = wiimote.Two
if doubleclicked(wiimote.A) then {
if var.latch!=1 then var.latch=1 else var.latch=0
}
//(var.latch=1) = Mouse.LeftButton
//(var.latch=0) = Release(Mouse.LeftButton)
//if (var.latch=1) then Mouse.LeftButton=1 else Mouse.LeftButton=0
// Key.B = KeepDown(Mouse.LeftButton = )
if (Wiimote.B || Wiimote.A || var.latch==1) { // begin mouse conditional
var.trimx = 6
var.trimy = -31
var.trimz = 6
var.x = Wiimote.RawForceX + var.trimx
var.y = Wiimote.RawForceY + var.trimy
var.z = Wiimote.RawForceZ + var.trimz
var.sense0 = 1000
var.thresh0x = 2
var.thresh0y = 1
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
if var.x > var.thresh0x then mouse.x = mouse.x – 1/var.sense0
if var.x < -var.thresh0x then mouse.x = mouse.x + 1/var.sense0
if var.z > var.thresh0y then mouse.y = mouse.y – 1/var.sense0
if var.z < -var.thresh0y then mouse.y = mouse.y + 1/var.sense0
if var.x > var.threshx then mouse.x = mouse.x – 1/var.sense
if var.x < -var.threshx then mouse.x = mouse.x + 1/var.sense
if var.z > var.threshy then mouse.y = mouse.y – 1/var.sense
if var.z < -var.threshy then mouse.y = mouse.y + 1/var.sense
if var.x > var.thresh2x then mouse.x = mouse.x – 1/var.sense2
if var.x < -var.thresh2x then mouse.x = mouse.x + 1/var.sense2
//yaxis
if var.z > var.thresh2y then mouse.y = mouse.y – 1/var.sense2
if var.z < -var.thresh2y then mouse.y = mouse.y + 1/var.sense2
if var.x > var.thresh3x then mouse.x = mouse.x – 1/var.sense3
if var.x < -var.thresh3x then mouse.x = mouse.x + 1/var.sense3
if var.z > var.thresh3y then mouse.y = mouse.y – 1/var.sense3
if var.z < -var.thresh3y then mouse.y = mouse.y + 1/var.sense3
}
end if
debug = var.x + ” ” + var.y + ” ” + var.z