openleap / PyLeapMouse

A Leap Motion based mouse in Python
Other
171 stars 66 forks source link

The Leap Screen freature isn't available in the newest update. #26

Open mgavin opened 10 years ago

mgavin commented 10 years ago

The newest update in the Leap API disables the screen feature and makes the screen API unavailable. Therefore, users that would like to use the default feature of using their finger for the PyLeapMouse script are left with an error message: Please calibrate your Leap screen feature.

There should be some fix to use the field of view from the Leap Motion device as some kind of makeshift screen for this functionality. With it being an inverted pyramid from the POV of the device, it would be kind of difficult to scale the screen to the field of vision from the device. Testing and ease of usage would be concerns for those that use the library as a intermediary point between their device and their screen, but I'm just bringing up this point for the latest update to the leap api.

kveroneau commented 10 years ago

I have a patch I am willing to contribute after I fork this project to enable mouse movement using a finger in the latest update.

diff --git a/FingerControl.py b/FingerControl.py index 5aa97e7..87eb66f 100755 --- a/FingerControl.py +++ b/FingerControl.py @@ -14,21 +14,13 @@ class Finger_Control_Listener(Leap.Listener): #The Listener that we attach to t super(Finger_Control_Listener, self).init() #Initialize like a normal listener

Initialize a bunch of stuff specific to this implementation

     self.screen = None

- self.screen_resolution = (self.screen.width_pixels, self.screen.height_pixels)

     print "Initialized"

 def on_connect(self, controller):

@@ -42,12 +34,15 @@ class Finger_Control_Listener(Leap.Listener): #The Listener that we attach to t

 def on_frame(self, controller):
     frame = controller.frame()  #Grab the latest 3D data

It works, but isn't the greatest implementation so far, you also need to manually set your resolution. Hope someone who is part of this project can tidy it up and make it much better.