HandListΒΆ

Methods:

class com::leapmotion::leap::HandList

The HandList class represents a list of Hand objects.

Get a HandList object by calling Frame::hands().

HandList allHands = frame.hands();

Since
1.0

Public Functions

HandList append(HandList other)

Appends the members of the specified HandList to this HandList.

Parameters

int count()

Returns the number of hands in this list.

if (frame.hands().count() > 0) {
    //Process hand data...
}
Return
The number of hands in this list.
Since
1.0

Hand frontmost()

The member of the list that is farthest to the front within the standard Leap Motion frame of reference (i.e has the smallest Z coordinate).

Hand frontHand = frame.hands().frontmost();

Return
The frontmost hand, or invalid if list is empty.
Since
1.0

Hand get(int index)

Access a list member by its position in the list.

HandList allHandsinFrame = frame.hands();
for (int index = 0; index < allHandsinFrame.count(); index++) {
    System.out.println(allHandsinFrame.get(index));
}

Return
The Hand object at the specified index.
Since
1.0
Parameters
  • index -

    The zero-based list position index.

HandList()

Constructs an empty list of hands.

Since
1.0

boolean isEmpty()

Reports whether the list is empty.

if (!frame.hands().isEmpty()) {
    //Process hands...
}

Return
True, if the list has no members.
Since
1.0

Hand leftmost()

The member of the list that is farthest to the left within the standard Leap Motion frame of reference (i.e has the smallest X coordinate).

Note: to determine whether a hand is the left hand, use the Hand::isLeft() function.

Hand furthestLeft = frame.hands().leftmost();

Return
The leftmost hand, or invalid if list is empty.
Since
1.0

Hand rightmost()

The member of the list that is farthest to the right within the standard Leap Motion frame of reference (i.e has the largest X coordinate).

Note: to determine whether a hand is the right hand, use the Hand::isRight() function.

Hand furthestRight = frame.hands().rightmost();

Return
The rightmost hand, or invalid if list is empty.
Since
1.0

class HandListIterator