Public Member Functions | Public Attributes | Private Attributes | Static Private Attributes
Leap::Listener Class Reference

#include <Leap.h>

Inheritance diagram for Leap::Listener:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __disown__
def __init__
LEAP_EXPORT Listener ()
def on_connect
def on_device_change
def on_disconnect
def on_exit
def on_focus_gained
def on_focus_lost
def on_frame
def on_images
def on_init
def on_service_connect
def on_service_disconnect
virtual LEAP_EXPORT void onConnect (const Controller &)
virtual LEAP_EXPORT void onDeviceChange (const Controller &)
virtual LEAP_EXPORT void onDisconnect (const Controller &)
virtual LEAP_EXPORT void onExit (const Controller &)
virtual LEAP_EXPORT void onFocusGained (const Controller &)
virtual LEAP_EXPORT void onFocusLost (const Controller &)
virtual LEAP_EXPORT void onFrame (const Controller &)
virtual LEAP_EXPORT void onImages (const Controller &)
virtual LEAP_EXPORT void onInit (const Controller &)
virtual LEAP_EXPORT void onServiceConnect (const Controller &)
virtual LEAP_EXPORT void onServiceDisconnect (const Controller &)
virtual LEAP_EXPORT ~Listener ()

Public Attributes

 this

Private Attributes

 __class__

Static Private Attributes

 __del__ = lambdaself:None
tuple __getattr__ = lambdaself,name:_swig_getattr(self, Listener, name)
 __repr__ = _swig_repr
tuple __setattr__ = lambdaself,name,value:_swig_setattr(self, Listener, name, value)
 __swig_destroy__ = LeapPython.delete_Listener
dictionary __swig_getmethods__ = {}
dictionary __swig_setmethods__ = {}

Detailed Description

The Listener class defines a set of callback functions that you can override in a subclass to respond to events dispatched by the Controller object.

To handle Leap Motion events, create an instance of a Listener subclass and assign it to the Controller instance. The Controller calls the relevant Listener callback function when an event occurs, passing in a reference to itself. You do not have to implement callbacks for events you do not want to handle.

The Controller object calls these Listener functions from a thread created by the Leap Motion library, not the thread used to create or set the Listener instance.

Since:
1.0

Definition at line 5943 of file Leap.h.


Constructor & Destructor Documentation

Constructs a Listener object.

Since:
1.0

Definition at line 5949 of file Leap.h.

virtual LEAP_EXPORT Leap::Listener::~Listener ( ) [inline, virtual]

Destroys this Listener object.

Definition at line 5954 of file Leap.h.

def Leap::Listener::__init__ (   self)

Definition at line 2238 of file Leap.py.


Member Function Documentation

Definition at line 2283 of file Leap.py.

def Leap::Listener::on_connect (   self,
  arg0 
)

Reimplemented in leap_interface.LeapInterface.

Definition at line 2254 of file Leap.py.

def Leap::Listener::on_device_change (   self,
  arg0 
)

Definition at line 2278 of file Leap.py.

def Leap::Listener::on_disconnect (   self,
  arg0 
)

Reimplemented in leap_interface.LeapInterface.

Definition at line 2257 of file Leap.py.

def Leap::Listener::on_exit (   self,
  arg0 
)

Reimplemented in leap_interface.LeapInterface.

Definition at line 2260 of file Leap.py.

def Leap::Listener::on_focus_gained (   self,
  arg0 
)

Definition at line 2266 of file Leap.py.

def Leap::Listener::on_focus_lost (   self,
  arg0 
)

Definition at line 2269 of file Leap.py.

def Leap::Listener::on_frame (   self,
  arg0 
)

Reimplemented in leap_interface.LeapInterface.

Definition at line 2263 of file Leap.py.

def Leap::Listener::on_images (   self,
  arg0 
)

Definition at line 2281 of file Leap.py.

def Leap::Listener::on_init (   self,
  arg0 
)

Reimplemented in leap_interface.LeapInterface.

Definition at line 2251 of file Leap.py.

def Leap::Listener::on_service_connect (   self,
  arg0 
)

Definition at line 2272 of file Leap.py.

def Leap::Listener::on_service_disconnect (   self,
  arg0 
)

Definition at line 2275 of file Leap.py.

virtual LEAP_EXPORT void Leap::Listener::onConnect ( const Controller ) [inline, virtual]

Called when the Controller object connects to the Leap Motion software and the Leap Motion hardware device is plugged in, or when this Listener object is added to a Controller that is already connected.

When this callback is invoked, Controller::isServiceConnected is true, Controller::devices() is not empty, and, for at least one of the Device objects in the list, Device::isStreaming() is true.

Parameters:
controllerThe Controller object invoking this callback function.
Since:
1.0

Reimplemented in CameraListener, CameraListener, HandsListener, and LeapListener.

Definition at line 5980 of file Leap.h.

virtual LEAP_EXPORT void Leap::Listener::onDeviceChange ( const Controller ) [inline, virtual]

Called when a Leap Motion controller plugged in, unplugged, or the device changes state.

State changes include changes in frame rate and entering or leaving "robust" mode. Note that there is currently no way to query whether a device is in robust mode. You can use Frame::currentFramerate() to get the framerate.

Parameters:
controllerThe Controller object invoking this callback function.
Since:
1.2

Reimplemented in CameraListener, CameraListener, and HandsListener.

Definition at line 6096 of file Leap.h.

virtual LEAP_EXPORT void Leap::Listener::onDisconnect ( const Controller ) [inline, virtual]

Called when the Controller object disconnects from the Leap Motion software or the Leap Motion hardware is unplugged. The controller can disconnect when the Leap Motion device is unplugged, the user shuts the Leap Motion software down, or the Leap Motion software encounters an unrecoverable error.

Note: When you launch a Leap-enabled application in a debugger, the Leap Motion library does not disconnect from the application. This is to allow you to step through code without losing the connection because of time outs.

Parameters:
controllerThe Controller object invoking this callback function.
Since:
1.0

Reimplemented in CameraListener, CameraListener, HandsListener, and LeapListener.

Definition at line 5998 of file Leap.h.

virtual LEAP_EXPORT void Leap::Listener::onExit ( const Controller ) [inline, virtual]

Called when this Listener object is removed from the Controller or the Controller instance is destroyed.

Parameters:
controllerThe Controller object invoking this callback function.
Since:
1.0

Reimplemented in CameraListener, CameraListener, HandsListener, and LeapListener.

Definition at line 6009 of file Leap.h.

virtual LEAP_EXPORT void Leap::Listener::onFocusGained ( const Controller ) [inline, virtual]

Called when this application becomes the foreground application.

Only the foreground application receives tracking data from the Leap Motion Controller. This function is only called when the controller object is in a connected state.

Parameters:
controllerThe Controller object invoking this callback function.
Since:
1.0

Reimplemented in CameraListener, CameraListener, and HandsListener.

Definition at line 6042 of file Leap.h.

virtual LEAP_EXPORT void Leap::Listener::onFocusLost ( const Controller ) [inline, virtual]

Called when this application loses the foreground focus.

Only the foreground application receives tracking data from the Leap Motion Controller. This function is only called when the controller object is in a connected state.

Parameters:
controllerThe Controller object invoking this callback function.
Since:
1.0

Reimplemented in CameraListener, CameraListener, and HandsListener.

Definition at line 6056 of file Leap.h.

virtual LEAP_EXPORT void Leap::Listener::onFrame ( const Controller ) [inline, virtual]

Called when a new frame of hand and finger tracking data is available. Access the new frame data using the Controller::frame() function.

Note, the Controller skips any pending onFrame events while your onFrame handler executes. If your implementation takes too long to return, one or more frames can be skipped. The Controller still inserts the skipped frames into the frame history. You can access recent frames by setting the history parameter when calling the Controller::frame() function. You can determine if any pending onFrame events were skipped by comparing the ID of the most recent frame with the ID of the last received frame.

Parameters:
controllerThe Controller object invoking this callback function.
Since:
1.0

Reimplemented in CameraListener, CameraListener, HandsListener, and LeapListener.

Definition at line 6028 of file Leap.h.

virtual LEAP_EXPORT void Leap::Listener::onImages ( const Controller ) [inline, virtual]

Called when new images are available. Access the new frame data using the Controller::images() function.

Parameters:
controllerThe Controller object invoking this callback function.
Since:
2.2.1

Definition at line 6107 of file Leap.h.

virtual LEAP_EXPORT void Leap::Listener::onInit ( const Controller ) [inline, virtual]

Called once, when this Listener object is newly added to a Controller.

Parameters:
controllerThe Controller object invoking this callback function.
Since:
1.0

Reimplemented in CameraListener, CameraListener, HandsListener, and LeapListener.

Definition at line 5964 of file Leap.h.

virtual LEAP_EXPORT void Leap::Listener::onServiceConnect ( const Controller ) [inline, virtual]

Called when the Leap Motion daemon/service connects to your application Controller.

Parameters:
controllerThe Controller object invoking this callback function.
Since:
1.2

Reimplemented in CameraListener, CameraListener, and HandsListener.

Definition at line 6070 of file Leap.h.

virtual LEAP_EXPORT void Leap::Listener::onServiceDisconnect ( const Controller ) [inline, virtual]

Called if the Leap Motion daemon/service disconnects from your application Controller.

Normally, this callback is not invoked. It is only called if some external event or problem shuts down the service or otherwise interrupts the connection.

Parameters:
controllerThe Controller object invoking this callback function.
Since:
1.2

Reimplemented in CameraListener, CameraListener, and HandsListener.

Definition at line 6082 of file Leap.h.


Member Data Documentation

Definition at line 2238 of file Leap.py.

Leap::Listener::__del__ = lambdaself:None [static, private]

Definition at line 2249 of file Leap.py.

tuple Leap::Listener::__getattr__ = lambdaself,name:_swig_getattr(self, Listener, name) [static, private]

Definition at line 2235 of file Leap.py.

Leap::Listener::__repr__ = _swig_repr [static, private]

Definition at line 2236 of file Leap.py.

tuple Leap::Listener::__setattr__ = lambdaself,name,value:_swig_setattr(self, Listener, name, value) [static, private]

Definition at line 2233 of file Leap.py.

Leap::Listener::__swig_destroy__ = LeapPython.delete_Listener [static, private]

Definition at line 2248 of file Leap.py.

dictionary Leap::Listener::__swig_getmethods__ = {} [static, private]

Definition at line 2234 of file Leap.py.

dictionary Leap::Listener::__swig_setmethods__ = {} [static, private]

Definition at line 2232 of file Leap.py.

Definition at line 2238 of file Leap.py.


The documentation for this class was generated from the following files:


leap_motion
Author(s): Florian Lier , Mirza Shah , Isaac IY Saito
autogenerated on Sat Jun 8 2019 18:47:25