Open mgavin opened 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
self.screen = None
self.screen_resolution = (1920,1080)
self.cursor = mouse.absolute_cursor() #The cursor object that lets us control mice cross-p
self.mouse_position_smoother = mouse_position_smoother(smooth_aggressiveness, smooth_fallof
self.mouse_button_debouncer = debouncer(5) #A signal debouncer that ensures a reliable, no
self.most_recent_pointer_finger_id = None #This holds the ID of the most recently used poi
def on_init(self, controller):
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.
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.