FingerList

Attributes:

Methods:

class Leap.FingerList

The FingerList class extends the Python array to represent a list of Finger objects.

Get a FingerList object by calling Frame.fingers or Hand.fingers.

New in version 1.0.

classmethod FingerList()

Constructs an empty list.

New in version 1.0.

is_empty
Type:boolean

Reports whether the list is empty.

if not frame.fingers.is_empty:
    #Use the fingers

New in version 1.0.

frontmost
Type:Finger

The item in this list with the smallest z coordinate.

most_forward_finger = frame.fingers.frontmost

New in version 1.0.

leftmost
Type:Finger

The item in this list with the smallest x coordinate.

finger_with_smallest_x = frame.fingers.leftmost

New in version 1.0.

rightmost
Type:Finger

The item in this list with the largest x coordinate.

finger_with_largest_x = frame.fingers.rightmost

New in version 1.0.

append(other)

Appends the members of the specifed FingerList to this FingerList.

Parameters:other (FingerList) – A FingerList object containing Finger objects to append to the end of this FingerList.

New in version 1.0.

extended()

Removes non-extended fingers from this FingerList.

extended_finger_list = frame.fingers.extended()
Returns:This modified FingerList object containing only extended fingers.

New in version 2.0.

finger_type(type)

Returns a FingerList object containing only the specified finger types, i.e. only thumbs, or only index fingers, etc.

index_finger_list = hand.fingers.finger_type(Finger.TYPE_INDEX)
index_finger = index_finger_list[0] #since there is only one per hand
Parameters:type (integer) – The finger type code. Use the attributes of the Finger class, such as Finger.TYPE_THUMB to specify the desired type.
Returns:A FingerList object containing Finger objects of the specified type.

New in version 2.0.