 |
WiiLi.org a new revolution
|
| View previous topic :: View next topic |
| Author |
Message |
mech_supernova
Joined: 01 Jul 2008 Posts: 7
Digg It |
Posted: Tue Jul 01, 2008 3:52 am Post subject: 2 cursors |
|
|
this should be a pretty easy code for someone that knows what there doing. I have a Saitek Cyborg command unit on my left and a mouse on my right I want it to work a 2nd cursor I have a 4 monitor setup and it would be usefull to me
the mouseparty.pie would be perfect if it dident have those 2 extra cursors I tried taking them off but the more I mess with it the more screwed up it becomes. |
|
| Back to top |
|
 |
Wreyth

Joined: 03 Nov 2007 Posts: 77
Digg It |
Posted: Tue Jul 01, 2008 6:11 am Post subject: |
|
|
| Code: |
// Wiimote multiple fake cursors script for Windows desktop
// Requires a sensor bar
// A=LMB, B=RMB, Home=MMB, -=XButton1, +=XButton2, Up=WheelUp, Down=WheelDown
// By Carl Kenner
if starting then
var.ButtonFreezeTime = 250ms
Wiimote1.Led1 = true
Wiimote2.Led2 = true
Wiimote3.Led3 = true
Wiimote4.Led4 = true
cursor1.Colour = [1.0, 0.0, 1.0]
cursor1.PermanentCursor = -2
cursor1.Caption = ""
cursor2.Colour = [1.0, 0.0, 0.0]
cursor2.PermanentCursor = -2
cursor2.Caption = ""
end if
cursor1.ctrl = ctrl
cursor2.ctrl = ctrl
cursor1.shift = shift
cursor2.shift = shift
cursor1.Visible = Wiimote1.PointerVisible
cursor1.Roll = Wiimote1.Roll
cursor1.LeftButton = Wiimote1.A and KeepDown(Wiimote1.PointerVisible,0.5s)
cursor1.RightButton = Wiimote1.B and KeepDown(Wiimote1.PointerVisible,0.5s)
cursor1.MiddleButton = Wiimote1.Home and KeepDown(Wiimote1.PointerVisible,0.5s)
cursor1.XButton1 = Wiimote1.Minus
cursor1.XButton2 = Wiimote1.Plus
var.PointerBump1 = KeepDown(Pressed(Wiimote1.A),var.ButtonFreezeTime) or KeepDown(Pressed(Wiimote1.B),var.ButtonFreezeTime)
if Wiimote1.PointerVisible but not var.PointerBump1 then
cursor1.x = Wiimote1.PointerX
cursor1.y = Wiimote1.PointerY
end if
cursor2.Visible = Wiimote2.PointerVisible
cursor2.LeftButton = Wiimote2.A and KeepDown(Wiimote2.PointerVisible,0.5s)
cursor2.RightButton = Wiimote2.B and KeepDown(Wiimote2.PointerVisible,0.5s)
cursor2.MiddleButton = Wiimote2.Home and KeepDown(Wiimote2.PointerVisible,0.5s)
cursor2.XButton1 = Wiimote2.Minus
cursor2.XButton2 = Wiimote2.Plus
var.PointerBump2 = KeepDown(Pressed(Wiimote2.A),var.ButtonFreezeTime) or KeepDown(Pressed(Wiimote2.B),var.ButtonFreezeTime)
if Wiimote2.PointerVisible but not var.PointerBump2 then
cursor2.x = Wiimote2.PointerX
cursor2.y = Wiimote2.PointerY
end if
if Wiimote1.Up or Wiimote2.Up then
mouse.WheelUp = true
wait 30ms
mouse.WheelUp = false
wait 30ms
end if
if Wiimote1.Down or Wiimote2.Down then
mouse.WheelDown = true
wait 30ms
mouse.WheelDown = false
wait 30ms
end if |
|
|
| Back to top |
|
 |
mech_supernova
Joined: 01 Jul 2008 Posts: 7
Digg It |
Posted: Tue Jul 01, 2008 12:29 pm Post subject: |
|
|
this dosent seem to work for me, dose this reqire a wii remote because I dont have one  |
|
| Back to top |
|
 |
AlMightyBob
Joined: 24 May 2008 Posts: 11
Digg It |
Posted: Tue Jul 01, 2008 1:18 pm Post subject: |
|
|
| Yea Wreyth, at no point in mech's post did he mention anything about a wiimote. He just wants 2 cursors for 2 mouses. |
|
| Back to top |
|
 |
Pode
Joined: 11 May 2008 Posts: 2
Digg It |
Posted: Tue Jul 01, 2008 1:49 pm Post subject: |
|
|
| If I can add something, from the script, isn't it possible to replace the binding of the cursors to the Wiimote to other periphals, keeping the idea ? |
|
| Back to top |
|
 |
mech_supernova
Joined: 01 Jul 2008 Posts: 7
Digg It |
Posted: Tue Jul 01, 2008 8:58 pm Post subject: |
|
|
I started from scratch and now I have both cursors and have it working with the correct part of the joystick, the only problem I am having now is that the cursor keeps re-centering its self how do I disable the re-centering? so far my code is:
Cursor2.PosX = MapRange(Joystick1.x, -1,1, -1280,2639)
Cursor2.PosY = MapRange(Joystick1.y, -1,1, -768,1127)
not at all impessive I know im just starting to learn. |
|
| Back to top |
|
 |
Wreyth

Joined: 03 Nov 2007 Posts: 77
Digg It |
Posted: Wed Jul 02, 2008 12:51 am Post subject: |
|
|
sorry bout that lol if you notice it was like 2 am pacific time >< and i been taking care of my newborn twins i didn't catch it wasn't with a wiimote.
my best guess would be that because your using a joystick style then it recenters just as a joystick would provided you let it go so the answer isn't setting it like a joystick if you want it to not recenter everytime.
unfourtunatly i don't have any expierience with that particular controller.
but i think i might know how to fix this gimem a little bit to find it |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|