| View previous topic :: View next topic |
| Author |
Message |
seth1134
Joined: 29 Jul 2008 Posts: 4
Digg It |
Posted: Tue Jul 29, 2008 10:10 pm Post subject: |
|
|
well after lurking around for a while i think ive got a basic understanding of this.
Wiimote + Nunchuk Mouse with 3 speeds.
| Code: | /*---------------------------------------------------------------------
____ _ _ _ _ _____ _ _
/ ___| ___| |_| |__ / / |___ /| || |
\___ \ / _ \ __| '_ \| | | |_ \| || |_
___) | __/ |_| | | | | |___) |__ _|
|____/ \___|\__|_| |_|_|_|____/ |_|
You may edit this script all you want as long as
you leave my name on it.
---------------------------------------------------------------------*/
//Stuff
var.speed = 5
if var.change = true then
var.change = true
endif
//Check for + or - or HOME
if wiimote1.plus then
var.stick1 = true
var.stick2 = false
elseif wiimote1.minus then
var.stick1 = false
var.stick2 = true
elseif wiimote1.home then
var.stick1 = true
var.stick2 = true
else
if var.change=true then
var.stick1 = true
var.stick2 = true
endif
endif
//Check for stick variables, change speed accordingly
if var.stick1=true && var.stick2=false then
var.speed = 7.5
var.change = false
elseif var.stick1=false && var.stick2=true then
var.speed = 2.5
var.change = false
elseif var.stick1=true && var.stick2=true then
var.speed = 5
endif
//Left &Right Mouse Movement
if (-1.2 < wiimote1.Nunchuk.JoyX < -0.5) {
Mouse.DirectInputX = Mouse.DirectInputX - var.speed;
}
if (0.5 < wiimote1.Nunchuk.JoyX < 1.2) {
Mouse.DirectInputX = Mouse.DirectInputX + var.speed;
}
//Mouse Buttons
mouse.leftbutton = wiimote1.nunchuk.cbutton
if wiimote1.nunchuk.zbutton then
var.scroll = true
else
var.scroll = false
endif
//Scrolling / Up&Down mouse movement
if var.scroll = true then
Mouse.WheelUp = (-1.2 < wiimote.Nunchuk.JoyY < -0.5)
Mouse.WheelDown = (0.5 < wiimote.Nunchuk.JoyY < 1.2)
else
if (-1.2 < wiimote1.Nunchuk.JoyY < -0.5) {
Mouse.DirectInputY = Mouse.DirectInputY - var.speed;
}
if (0.5 < wiimote1.Nunchuk.JoyY < 1.2) {
Mouse.DirectInputY = Mouse.DirectInputY + var.speed;
}
endif
|
Controls:
Nunchuk Joystick: Move mouse
Nunchuk Z button: Hold to scroll up/down
Nunchuk C button: Left Click
Wiimote - button: Slow mouse
Wiimote + button: Fast mouse
Wiimote HOME button: Normal Mouse
Edit: Removed right click and replaced it with scrolling up/down
Last edited by seth1134 on Tue Jul 29, 2008 11:18 pm; edited 3 times in total |
|
| Back to top |
|
 |
ZeroFusion
Joined: 29 Jul 2008 Posts: 15
Digg It |
Posted: Tue Jul 29, 2008 10:39 pm Post subject: |
|
|
| still didn't work the cursor just goes to the bottom left corner of the screen |
|
| Back to top |
|
 |
seth1134
Joined: 29 Jul 2008 Posts: 4
Digg It |
Posted: Tue Jul 29, 2008 10:44 pm Post subject: |
|
|
| ZeroFusion wrote: | | still didn't work the cursor just goes to the bottom left corner of the screen |
Mine? |
|
| Back to top |
|
 |
Wreyth

Joined: 03 Nov 2007 Posts: 91
Digg It |
Posted: Wed Jul 30, 2008 12:25 am Post subject: |
|
|
try adding your variable speed to this.
| Code: |
if wiimote1.Nunchuk.joyx < -0.05 or wiimote1.Nunchuk.joyx > 0.05
Mouse.DirectInputX = Mouse.DirectInputX + (30)*(wiimote1.Nunchuk.joyx)
endif
if wiimote1.Nunchuk.joyy < -0.05 or wiimote1.Nunchuk.joyy > 0.05
Mouse.DirectInputy = Mouse.DirectInputy + (30)*(wiimote1.Nunchuk.joyy)
endif
|
thats a working nunchuk joystick mouse |
|
| Back to top |
|
 |
Maxadam5

Joined: 23 May 2008 Posts: 39
Digg It |
Posted: Wed Jul 30, 2008 2:01 am Post subject: solution #2 |
|
|
| ZeroFusion wrote: | | still didn't work the cursor just goes to the bottom left corner of the screen |
ok then try this
| Code: | key.up = var.joy1up
key.Down = var.joy1down
key.Left = var.joy1left
key.Right = var.joy1right
mouse.x - 5 = key.r
mouse.x - -5 = key.l
mouse.y - 5 = key.u
mouse.y - -5 = key.d
key.u = var.joy2up
key.d = var.joy2down
key.l = var.joy2left
key.r = var.joy2right
Key.VolumeUp = var.Plus
Key.VolumeDown = var.Minus
Key.Slash = var.Home
key.X = var.x
key.Y = var.y
mouse.var.R
Mouse.var.L
key.F = var.Up
key.B = var.right
key.Space = var.a
wiimote.classic.a = var.a
wiimote.classic.r = var.r
wiimote.classic.l = var.l
wiimote.classic.minus = var.minus
wiimote.classic.plus = var.plus
wiimote.classic.home = var.home
wiimote.classic.x = var.x
wiimote.classic.y = var.y
wiimote.classic.up = var.up
wiimote.classic.right = var.right
wiimote.classic.joy1y - 5 = var.joy1up
wiimote.classic.joy1y - -5 = var.joy1down
wiimote.classic.joy1x - 5 = var.joy1right
wiimote.classic.joy1x - -5 = var.joy1left
wiimote.classic.joy2y - 5 = var.joy2up
wiimote.classic.joy2y - -5 = var.joy2down
wiimote.classic.joy2x - 5 = var.joy2right
wiimote.classic.joy2x - -5 = var.joy2left |
|
|
| Back to top |
|
 |
ZeroFusion
Joined: 29 Jul 2008 Posts: 15
Digg It |
Posted: Wed Jul 30, 2008 6:10 pm Post subject: |
|
|
still didnt work says
mouse.var.R
Mouse.var.L
are invalid mouse fields |
|
| Back to top |
|
 |
Maxadam5

Joined: 23 May 2008 Posts: 39
Digg It |
Posted: Wed Jul 30, 2008 9:31 pm Post subject: more help |
|
|
| ZeroFusion wrote: | still didnt work says
mouse.var.R
Mouse.var.L
are invalid mouse fields |
change
| Code: | mouse.var.l
mouse.var.r |
to
| Code: | mouse.leftbutton = var.r
mouse.rightbutton = var.l |
but otherwise when i run the script it doesn't do that please tell me all specifications about glovepie on your computer when you run the script,
like in the troubleshooter tab the version you know, specifications, and message my profile instead of here so we dont mess up the forum topic any more
*edit*
talk about it here http://www.wiili.org/forum/anyone-else-have-a-problem-using-nunchuk-or-classic-control-t4286.html#20149 |
|
| Back to top |
|
 |
|