Air Mouse Script like GlovePIE's "lednerg"? ($ Opportunity!)

Official forum for open source FreePIE discussion and development.
Post Reply
dcutler
One Eyed Hopeful
Posts: 4
Joined: Wed Aug 26, 2015 10:01 am

Air Mouse Script like GlovePIE's "lednerg"? ($ Opportunity!)

Post by dcutler »

Possible $ Opportunity!

I really want a new Wii Air Mouse script to replace what I currently use: GlovePIE with the "lednerg" Air Mouse script (pasted below).

I want exactly what that script does, with FreePIE.

I am willing to pay someone to replicate this GlovePIE script into FreePIE!

Why? To get this useful functionality (Wii Air Mouse) into an open source, currently supported, 2015 version.

I don't know whether GlovePIE scripts are easy to translate to FreePIE, but if this sounds like something you could help me with, please message me!






(lednerg GlovePIE script pasted below)

Code: Select all

/*
    WiiMotion Plus Mouse                                  v 2010.01.14
    by lednerg

    Emulates the basic functionality of a Gyration Air Mouse.
    Requires GlovePIE version .42 or higher.

    Leave the Wiimote on your desk when starting so it can calibrate.
    Hold B to move, A = Left-Click, + = Right-Click, Down = Middle-Click.
*/

var.MoveButton = wiimote.B
mouse.LeftButton = wiimote.A
mouse.RightButton = wiimote.Plus
mouse.MiddleButton = wiimote.Down

var.Speed = 75   // 0 to 100

PIE.FrameRate = 120hz
if wiimote.HasMotionPlus = false then debug = "WiiMotion Plus NOT DETECTED!"
if wiimote.HasMotionPlus = true and var.MoveButton = true {
   var.YawSpeed = wiimote.MotionPlus.YawSpeed
   var.PitchSpeed = wiimote.MotionPlus.PitchSpeed
   if SameValue( Smooth(wiimote.SmoothRoll, 10), wiimote.SmoothRoll, 10) then var.Roll = Smooth(wiimote.SmoothRoll, 10) else var.Roll = wiimote.SmoothRoll
   if var.Roll < 0 and var.Roll >= -90 {
      var.XYswap = 1 - EnsureMapRange(var.Roll, -90, 0, 0, 1)
      var.RightDown = -1
      var.TopUp = 1
   }
   if var.Roll <= 90 and var.Roll >= 0 {
      var.XYswap = 1 - EnsureMapRange(var.Roll, 90, 0, 0, 1)
      var.RightDown = 1
      var.TopUp = 1
   }
   if var.Roll > 90 and var.Roll <= 180 {
      var.XYswap = 1 - EnsureMapRange(var.Roll, 90, 180, 0, 1)
      var.RightDown = 1
      var.TopUp = -1
   }
   if var.Roll < -90 and var.Roll >= -180 {
      var.XYswap = 1 - EnsureMapRange(var.Roll, -90, -180, 0, 1)
      var.RightDown = -1
      var.TopUp = -1
   }
   var.SpeedX = var.TopUp * var.YawSpeed - ( var.TopUp * var.YawSpeed * var.XYswap ) + ( var.RightDown * var.PitchSpeed * var.XYswap )
   var.SpeedY = var.TopUp * var.PitchSpeed - ( var.TopUp * var.PitchSpeed * var.XYswap) + ( -var.RightDown * var.YawSpeed * var.XYswap )
   mouse.DirectInputX = int(var.MouseX)
   mouse.DirectInputY = int(var.MouseY)
   var.MouseX = var.MouseX + ( var.SpeedX / (10500000 - EnsureMapRange(var.Speed, 0, 100, 0, 10000000) ) )
   var.MouseY = var.MouseY - ( var.SpeedY / (10500000 - EnsureMapRange(var.Speed, 0, 100, 0, 10000000) ) )
/* // for mouse.x and mouse.y instead
   mouse.x = var.MouseX
   mouse.y = var.MouseY
   var.MouseX = var.MouseX + ( var.SpeedX / (20500 - EnsureMapRange(var.Speed, 0, 100, 0, 20000) ) )
   var.MouseY = var.MouseY - ( var.SpeedY / (20500 - EnsureMapRange(var.Speed, 0, 100, 0, 20000) ) )
*/
}
if var.MoveButton = false {
   var.MouseX = mouse.DirectInputX
   var.MouseY = mouse.DirectInputY
/* // for mouse.x and mouse.y instead
   var.MouseX = mouse.x
   var.MouseY = mouse.y
*/
}
dcutler
One Eyed Hopeful
Posts: 4
Joined: Wed Aug 26, 2015 10:01 am

Bumping for $ Opportunity

Post by dcutler »

bumping this just once after edit.

I want to hire someone to replicate the funcationality of a popular GlovePIE Wii Air Mouse script, in FreePIE - check my original post for details and the GlovePIE script.

If this is something that could be done, please message me.
konstantin_lozev
Cross Eyed!
Posts: 192
Joined: Fri Jul 04, 2014 1:43 am

Re: Air Mouse Script like GlovePIE's "lednerg"? ($ Opportuni

Post by konstantin_lozev »

I am not experienced in Python, so cant't help you, but I do have some experience with GlovePIE. As far as I remember, FreePIE does not have a Smoothroll equivalent, so to do it one would have to write such function himself. There are a few ways you can implement it, so no guarantee it would be 1:1 with lednerg's. Anyway, the smoothroll in ledner's script seems a bit weird to me only reading it. I always wonder why everyone uses ledner's script. Is it because you can swap the x and y axes, so you can attach the wiimote sideways to a gun? Or is it the fact that you activate by pressing A? I found the basic mouse script in the examples not that bad (excluding drift).
dcutler
One Eyed Hopeful
Posts: 4
Joined: Wed Aug 26, 2015 10:01 am

Re: Air Mouse Script like GlovePIE's "lednerg"? ($)

Post by dcutler »

Thanks for the reply! :)
konstantin_lozev wrote:I am not experienced in Python, so cant't help you, but I do have some experience with GlovePIE. As far as I remember, FreePIE does not have a Smoothroll equivalent, so to do it one would have to write such function himself. There are a few ways you can implement it, so no guarantee it would be 1:1 with lednerg's. Anyway, the smoothroll in ledner's script seems a bit weird to me only reading it.
Thanks for the direction. I apologize for being such a noob but does this mean that I would need to write a smoothroll function as part of a Python script, or in C# as part of a contribution to FreePIE?
I always wonder why everyone uses ledner's script. Is it because you can swap the x and y axes, so you can attach the wiimote sideways to a gun? Or is it the fact that you activate by pressing A? I found the basic mouse script in the examples not that bad (excluding drift).
In my case I use it exclusively as my desktop mouse rather than any gaming. It is the first and by far the best air mouse I have used. I literally switched back from Mac to Windows just to be able to use GlovePIE again. I had even bought the Gyration Air Mouse (that the script emulates) but it wasn't even close to being as nice as the Wii controller w/ the lednerg script.

The single most important thing that sets it apart from any other solution is that you hold B to move the cursor, so cursor movement is relative to the position of the Wii controller when you press B.

This allows me to do things like switch hands, control the mouse with my hands behind my back (if I want) or even incorporate the movement of walking into mouse movements when working on a treadmill!

Combined with a bigscreen, a standing desk and speech recognition and it is awesome!

Check out my workstation, I stand at the podium (or walk on the treadmill) all day (w/ couch breaks, still using the Air Mouse) and between speech recognition and the Wii Air Mouse I sometimes go hours without touching the keyboard or mouse. Total game changer ;)

Image
Image

To be honest my ultimate goal is to open source a small desktop application that provides that Wii air mouse function (and only that function) very simply, to make it available to the masses rather than the somewhat dodgy (and tempermental) GlovePIE/lednerg combo. So that it's open source and auditable, and safe to use in professional and education contexts, but also as simple as opening the application and clicking the "Start" button and connecting the Wii controller.

So if I am able to get it created in FreePIE then I will at least have an open source Wii Air Mouse, then I can either fork FreePIE or at least use it to guide the development of another open source standalone Wii mouse app. With proper credit given of course.

Cheers!
konstantin_lozev
Cross Eyed!
Posts: 192
Joined: Fri Jul 04, 2014 1:43 am

Re: Air Mouse Script like GlovePIE's "lednerg"? ($ Opportuni

Post by konstantin_lozev »

If the only thing that you want to add is tracking when you hold A, that should be pretty easy with FreePIE. There is a simple gyro mouse script somewhere in this forum and adding to that is trivial. You will not need any smothroll function. The large part of lednerg's script is the one allowing you to hold the wiimote sideways, which I understand you don't need to implement. On a general note, I am not sure many people would be interested in the free solution that you mention. The main thing is you are never guaranteed good bluetooth connection with the wiimote. For example, my built in bluetooth connected well to my wiimote under win 8.1, but not anymore on win 10. I am actually quite happy with the two air mice that I have for my HTPC (one bluetooth and one with a usb dongle. I have a MAG II for big screen FPSs on the PC. I see that you have a walking setup, you can check out my experiments on youtube, e.g. https://www.youtube.com/watch?app=deskt ... qi7BR1owiQ (this one works with the wiimote accelerometers only, so it is even not necessary to have wii motion plus). Feel free to use and improve them with proper credit. Up there I have also a driftless pitch script which I think is better in some ways than lednerg's.
Post Reply

Return to “FreePIE”