WiiLi Wiki frontpage Include your post in the News Get links Hoteles Quito
WiiLi.org Forum Index WiiLi.org
a new revolution
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Any working scripts for Wiimote pointing on PC screen?
Goto page 1, 2, 3, 4  Next
 
Post new topic   Reply to topic    WiiLi.org Forum Index -> GlovePie
View previous topic :: View next topic  
Author Message
Isindil



Joined: 30 Dec 2006
Posts: 13

Digg It
PostPosted: Sat Dec 30, 2006 10:41 pm    Post subject: Any working scripts for Wiimote pointing on PC screen?

I have tried a couple of scripts from the GlovePIE Wii-Mote Scripts-topic, but all mouse-pointing scripts seem to be based on using the tilt sensor and not the pointer. Is there any working scripts that uses the pointer and a sensor bar to move the mouse cursor? I really want to see if I can do that on my PC, would impress some of my friends a lot.

In addition, any scripts for how to use the Nunchuk analoge stick to move the cursor will also be helpful if anyone has one of those in their possession.
Back to top
View user's profile Send private message MSN Messenger
kunalkunal2



Joined: 13 Dec 2006
Posts: 279

Digg It
PostPosted: Sat Dec 30, 2006 10:51 pm    Post subject:

Yup there is, but its really sensitive Crying or Very sad
its called
Counter Strike
located with glovepie
Back to top
View user's profile Send private message
TweaK



Joined: 24 Dec 2006
Posts: 57

Digg It
PostPosted: Sat Dec 30, 2006 11:05 pm    Post subject:

It's called Wiimouse IR, it comes with GlovePIE 0.28 (maybe earlier versions too) by default. Smile
Back to top
View user's profile Send private message
Isindil



Joined: 30 Dec 2006
Posts: 13

Digg It
PostPosted: Sat Dec 30, 2006 11:11 pm    Post subject:

Thanks to both of you, though I didn't get the chance to test WiiMouse IR, cause my mom stole my candles. >_<

And when I'm at it; what is the GlovePIE command for '/'?
Back to top
View user's profile Send private message MSN Messenger
TweaK



Joined: 24 Dec 2006
Posts: 57

Digg It
PostPosted: Sat Dec 30, 2006 11:34 pm    Post subject:

Heh, you could always try building your own. Smile
Back to top
View user's profile Send private message
Isindil



Joined: 30 Dec 2006
Posts: 13

Digg It
PostPosted: Sat Dec 30, 2006 11:37 pm    Post subject:

I'm working on one, but I'll have to wait for some days until I can get any resistors. And I don't think they even have any IR LEDs there. Stupid Norwegian electrostore.
Back to top
View user's profile Send private message MSN Messenger
Arianol



Joined: 26 Dec 2006
Posts: 49

Digg It
PostPosted: Sat Dec 30, 2006 11:50 pm    Post subject:

This one is a direct pointing script and isn't super-sensitive. Hope it works for ya!

Code:
/* Direct Pointing Script With Wii-mote by Arianol v0.7 */

/* This PIE requires that you have either one or two IR points to aim the
   Wiimote at. A lit teacandle sitting in a small glass works nicely as a
   single point and reduces fire hazard.  The Wii Sensor Bar is best for the
   two-point setting. At any time you can point the Wiimote away from the dot(s)
   and Press 1 to move your cursor back to center-screen. Please set the value
   of the following variable to your number of infrared points (1 or 2). */
   var.irAmount = 2          // 1 OR 2

   var.deadzone = 15         // Region where no motion is detected
   var.Speed = 1/5           // Mouse Speed (Default 1/5)

// Remote Controls
             Up = Wiimote.Up                     // Up
           Down = Wiimote.Down                   // Down
           Left = Wiimote.Left                   // Left
          Right = Wiimote.Right                  // Right

  mouse.LeftButton = Wiimote.A                   // Left Click
mouse.middlebutton = Wiimote.B                   // Click MouseWheel

mouse.RightButton = Wiimote.Minus                // Right Click
      Windows + M = Wiimote.Home                 // Show Desktop
            Enter = Wiimote.Plus                 // Enter
     Escape = Wiimote.Plus                       // Escape

Windows + M = Wiimote.Home           // Show Desktop

// LED Lights
Wiimote.Led4 = four
Wiimote.Led3 = three
Wiimote.Led2 = two
Wiimote.Led1 = one

/* Code for Pointing Mechanism
   ---------------------------
              Do Not Modify */

// If two dots are visible, find midpoint
If var.irAmount = 2 Then
   var.xPos = (Wiimote.dot1x + Wiimote.dot2x) / 2
   var.yPos = (Wiimote.dot1y + Wiimote.dot2y) / 2
Else
   var.xPos = Wiimote.dot1x * 1
   var.yPos = Wiimote.dot1y
EndIf

If Wiimote.dot1vis Then     // If at least one IR point is visible
   // Locate Inrared Point Coordinates
   var.actualX = (1-(round(var.xPos) / 1024)) * Screen.Width
   var.actualY = ((round(var.yPos) / 768)) * Screen.Height
   // Calculate Speed
   var.xSpeed = (var.actualX - Mouse.CursorPosX) * var.Speed
   var.ySpeed = (var.actualY - Mouse.CursorPosY) * var.Speed
   // Move Cursor
   If Mouse.CursorPosX > var.actualX + var.deadzone Or Mouse.CursorPosX < var.actualX - var.deadzone Then
      Mouse.CursorPosX = Mouse.CursorPosX + var.xSpeed + var.xOffset
   EndIf
   If Mouse.CursorPosY > var.actualY + var.deadzone Or Mouse.CursorPosY < var.actualY - var.deadzone Then
      Mouse.CursorPosY = Mouse.CursorPosY + var.ySpeed + var.yOffset
   EndIf
   // Assign the One button
   Alt + Tab = Wiimote.One
ElseIf Pressed(Wiimote.One) Then
   // Move Cursor Back to Center
   Mouse.CursorPosX = Screen.Width / 2
   Mouse.CursorPosY = Screen.Height / 2
EndIf

// Debug
debug = 'Debug:  xOffset: ' + (-1 * var.actualX) + '  yOffset: ' + (-1 * var.actualY)


Last edited by Arianol on Sun Dec 31, 2006 2:33 am; edited 1 time in total
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> GlovePie All times are GMT
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
Jump to:  
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