Leap Motion C API  4.1.0
The API to the LeapC library.
Functions

Functions exported by the LeapC library. More...

Functions

int64_t LeapGetNow (void)
 Samples the universal clock used by the system to timestamp image and tracking frames. More...
 
eLeapRS LeapCreateConnection (const LEAP_CONNECTION_CONFIG *pConfig, LEAP_CONNECTION *phConnection)
 Creates a new LEAP_CONNECTION object. More...
 
eLeapRS LeapOpenConnection (LEAP_CONNECTION hConnection)
 Opens a connection to the service. More...
 
eLeapRS LeapGetConnectionInfo (LEAP_CONNECTION hConnection, LEAP_CONNECTION_INFO *pInfo)
 Retrieves status information about the specified connection. More...
 
eLeapRS LeapSetPolicyFlags (LEAP_CONNECTION hConnection, uint64_t set, uint64_t clear)
 Sets or clears one or more policy flags. More...
 
eLeapRS LeapSetPause (LEAP_CONNECTION hConnection, bool pause)
 Pauses the service. More...
 
eLeapRS LeapSaveConfigValue (LEAP_CONNECTION hConnection, const char *key, const LEAP_VARIANT *value, uint32_t *pRequestID)
 Causes the client to commit a configuration change to the Leap Motion service. More...
 
eLeapRS LeapRequestConfigValue (LEAP_CONNECTION hConnection, const char *key, uint32_t *pRequestID)
 Requests the current value of a service configuration setting. More...
 
eLeapRS LeapGetDeviceList (LEAP_CONNECTION hConnection, LEAP_DEVICE_REF *pArray, uint32_t *pnArray)
 Retrieves a list of Leap Motion devices currently attached to the system. More...
 
eLeapRS LeapOpenDevice (LEAP_DEVICE_REF rDevice, LEAP_DEVICE *phDevice)
 Opens a device reference and retrieves a handle to the device. More...
 
eLeapRS LeapGetDeviceInfo (LEAP_DEVICE hDevice, LEAP_DEVICE_INFO *info)
 Gets device properties. More...
 
eLeapRS LeapPollConnection (LEAP_CONNECTION hConnection, uint32_t timeout, LEAP_CONNECTION_MESSAGE *evt)
 Polls the connection for a new event. More...
 
eLeapRS LeapGetFrameSize (LEAP_CONNECTION hConnection, int64_t timestamp, uint64_t *pncbEvent)
 Retrieves the number of bytes required to allocate an interpolated frame at the specified time. More...
 
eLeapRS LeapInterpolateFrame (LEAP_CONNECTION hConnection, int64_t timestamp, LEAP_TRACKING_EVENT *pEvent, uint64_t ncbEvent)
 Constructs a frame at the specified timestamp by interpolating between measured frames. More...
 
eLeapRS LeapInterpolateFrameFromTime (LEAP_CONNECTION hConnection, int64_t timestamp, int64_t sourceTimestamp, LEAP_TRACKING_EVENT *pEvent, uint64_t ncbEvent)
 Constructs a frame at the specified timestamp by interpolating between a frame near the timestamp and a frame near the sourceTimestamp. More...
 
eLeapRS LeapInterpolateHeadPose (LEAP_CONNECTION hConnection, int64_t timestamp, LEAP_HEAD_POSE_EVENT *pEvent)
 Gets the head tracking pose at the specified timestamp by interpolating between measured frames. More...
 
void LeapCloseDevice (LEAP_DEVICE hDevice)
 Closes a device handle previously opened with LeapOpenDevice. More...
 
void LeapCloseConnection (LEAP_CONNECTION hConnection)
 Closes a previously opened connection. More...
 
void LeapDestroyConnection (LEAP_CONNECTION hConnection)
 Destroys a previously opened connection. More...
 
eLeapRS LeapCreateClockRebaser (LEAP_CLOCK_REBASER *phClockRebaser)
 Initializes a new Leap clock-rebaser handle object. More...
 
eLeapRS LeapUpdateRebase (LEAP_CLOCK_REBASER hClockRebaser, int64_t userClock, int64_t leapClock)
 Updates the relationship between the Leap Motion clock and the user clock. More...
 
eLeapRS LeapRebaseClock (LEAP_CLOCK_REBASER hClockRebaser, int64_t userClock, int64_t *pLeapClock)
 Computes the Leap Motion clock corresponding to a specified application clock value. More...
 
void LeapDestroyClockRebaser (LEAP_CLOCK_REBASER hClockRebaser)
 Destroys a previously created clock-rebaser object. More...
 
LEAP_VECTOR LeapPixelToRectilinear (LEAP_CONNECTION hConnection, eLeapPerspectiveType camera, LEAP_VECTOR pixel)
 Provides the corrected camera ray intercepting the specified point on the image. More...
 
LEAP_VECTOR LeapRectilinearToPixel (LEAP_CONNECTION hConnection, eLeapPerspectiveType camera, LEAP_VECTOR rectilinear)
 Provides the point in the image corresponding to a ray projecting from the camera. More...
 
void LeapCameraMatrix (LEAP_CONNECTION hConnection, eLeapPerspectiveType camera, float *dest)
 Returns an OpenCV-compatible camera matrix. More...
 
void LeapDistortionCoeffs (LEAP_CONNECTION hConnection, eLeapPerspectiveType camera, float *dest)
 Returns an OpenCV-compatible lens distortion using the 8-parameter rational model. More...
 
const char * LeapDevicePIDToString (eLeapDevicePID pid)
 Provides the human-readable canonical name of the specified device model. More...
 
eLeapRS LeapRecordingOpen (LEAP_RECORDING *ppRecording, const char *filePath, LEAP_RECORDING_PARAMETERS params)
 Opens or creates a LEAP_RECORDING. More...
 
eLeapRS LeapRecordingClose (LEAP_RECORDING *ppRecording)
 Closes a LEAP_RECORDING. More...
 
eLeapRS LeapRecordingGetStatus (LEAP_RECORDING pRecording, LEAP_RECORDING_STATUS *pstatus)
 Fills in a LEAP_RECORDING_STATUS struct for an open recording. More...
 
eLeapRS LeapRecordingReadSize (LEAP_RECORDING pRecording, uint64_t *pncbEvent)
 Retrieves the number of bytes required to allocate the next frame in a recording. More...
 
eLeapRS LeapRecordingRead (LEAP_RECORDING pRecording, LEAP_TRACKING_EVENT *pEvent, uint64_t ncbEvent)
 Reads a tracking frame from a LEAP_RECORDING file. More...
 
eLeapRS LeapRecordingWrite (LEAP_RECORDING pRecording, LEAP_TRACKING_EVENT *pEvent, uint64_t *pnBytesWritten)
 Writes a tracking frame to a LEAP_RECORDING file. More...
 

Detailed Description

Functions exported by the LeapC library.

Function Documentation

void LeapCameraMatrix ( LEAP_CONNECTION  hConnection,
eLeapPerspectiveType  camera,
float *  dest 
)

Returns an OpenCV-compatible camera matrix.

Parameters
hConnectionThe connection handle created by LeapCreateConnection().
cameraThe camera to use, a member of the eLeapPerspectiveType enumeration
[out]destA pointer to a single-precision float array of size 9
Since
3.2.1
void LeapCloseConnection ( LEAP_CONNECTION  hConnection)

Closes a previously opened connection.

This method closes the specified connection object if it is opened

This method never fails.

Parameters
hConnectionA handle to the connection object to be closed.
Since
4.0.0
void LeapCloseDevice ( LEAP_DEVICE  hDevice)

Closes a device handle previously opened with LeapOpenDevice.

Parameters
hDeviceThe device handle to close.
Since
3.0.0
eLeapRS LeapCreateClockRebaser ( LEAP_CLOCK_REBASER phClockRebaser)

Initializes a new Leap clock-rebaser handle object.

Pass the filled-in LEAP_CLOCK_REBASER object to calls to LeapUpdateRebase(), LeapRebaseClock(), and LeapDestroyClockRebaser().

Parameters
[out]phClockRebaserThe pointer to the clock-rebaser object to be initialized.
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.1.2
eLeapRS LeapCreateConnection ( const LEAP_CONNECTION_CONFIG pConfig,
LEAP_CONNECTION phConnection 
)

Creates a new LEAP_CONNECTION object.

Pass the LEAP_CONNECTION pointer to LeapOpenConnection() to establish a connection to the Leap Motion service; and to subsequent operations on the same connection.

Parameters
pConfigThe configuration to be used with the newly created connection. If pConfig is null, a connection is created with a default configuration.
[out]phConnectionReceives a pointer to the connection object
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.0.0
void LeapDestroyClockRebaser ( LEAP_CLOCK_REBASER  hClockRebaser)

Destroys a previously created clock-rebaser object.

This method destroys the specified clock-rebaser object, and releases all resources associated with it.

Parameters
hClockRebaserA handle to the clock-rebaser object to be destroyed.
Since
3.1.2
void LeapDestroyConnection ( LEAP_CONNECTION  hConnection)

Destroys a previously opened connection.

This method closes the specified connection object if it is opened, destroys the underlying object, and releases all resources associated with it.

This method never fails.

Be sure that no other functions are accessing the connection when this function is called.

Parameters
hConnectionA handle to the connection object to be destroyed.
Since
3.0.0
const char* LeapDevicePIDToString ( eLeapDevicePID  pid)

Provides the human-readable canonical name of the specified device model.

This method is guaranteed to never return null for the LEAP_DEVICE_INFO.pid field returned by a successful call to LeapGetDeviceInfo

Parameters
pidThe pid of the device
Returns
The string name of the device model, or null if the device type string is invalid.
void LeapDistortionCoeffs ( LEAP_CONNECTION  hConnection,
eLeapPerspectiveType  camera,
float *  dest 
)

Returns an OpenCV-compatible lens distortion using the 8-parameter rational model.

The order of the returned array is: [k1, k2, p1, p2, k3, k4, k5, k6]

Parameters
hConnectionThe connection handle created by LeapCreateConnection().
cameraThe camera to use, a member of the eLeapPerspectiveType enumeration
[out]destA pointer to a single-precision float array of size 8.
Since
3.2.1
eLeapRS LeapGetConnectionInfo ( LEAP_CONNECTION  hConnection,
LEAP_CONNECTION_INFO pInfo 
)

Retrieves status information about the specified connection.

Call LeapCreateConnection() to generate the handle for the connection; call LeapOpenConnection() to establish the connection; then call this function to check the connection status.

Parameters
hConnectionThe handle of the connection of interest. Created by LeapCreateConnection.
[out]pInfoA pointer to a buffer that receives additional connection information. One input, the size field of pInfo is the size of the buffer(i.e. the size of a LEAP_CONNECTION_INFO struct); On output, the size field of pInfo receives the size necessary to hold the entire information block.
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.0.0
eLeapRS LeapGetDeviceInfo ( LEAP_DEVICE  hDevice,
LEAP_DEVICE_INFO info 
)

Gets device properties.

To get the device serial number, you must supply a LEAP_DEVICE_INFO struct whose serial member points to a char array large enough to hold the null-terminated serial number string. To get the required length, call LeapGetDeviceInfo() using a LEAP_DEVICE_INFO struct that has serial set to NULL. LeapC sets serial_length field of the struct to the required length. You can then allocate memory for the string, set the serial field, and call this function again.

Parameters
hDeviceA handle to the device to be queried.
[out]infoThe struct to receive the device property data.
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.0.0
eLeapRS LeapGetDeviceList ( LEAP_CONNECTION  hConnection,
LEAP_DEVICE_REF pArray,
uint32_t *  pnArray 
)

Retrieves a list of Leap Motion devices currently attached to the system.

To get the number of connected devices, call this function with the pArray parameter set to null. The number of devices is written to the memory specified by pnArray. Use the device count to create an array of LEAP_DEVICE_REF structs large enough to hold the number of connected devices. Finally, call LeapGetDeviceList() with this array and known count to get the list of Leap devices. A device must be opened with LeapOpenDevice() before device properties can be queried.

Parameters
hConnectionThe connection handle created by LeapCreateConnection().
[out]pArrayA pointer to an array that LeapC fills with the device list.
[in,out]pnArrayOn input, set to the number of elements in pArray; on output, LeapC sets this to the number of valid device handles.
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.0.0
eLeapRS LeapGetFrameSize ( LEAP_CONNECTION  hConnection,
int64_t  timestamp,
uint64_t *  pncbEvent 
)

Retrieves the number of bytes required to allocate an interpolated frame at the specified time.

Use this function to determine the size of the buffer to allocate when calling LeapInterpolateFrame().

Parameters
hConnectionThe connection handle created by LeapCreateConnection().
timestampThe timestamp of the frame whose size is to be queried.
[out]pncbEventA pointer that receives the number of bytes required to store the specified frame.
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.1.1
int64_t LeapGetNow ( void  )

Samples the universal clock used by the system to timestamp image and tracking frames.

The returned counter value is given in microseconds since an epoch time. The clock used for the counter itself is implementation-defined, but generally speaking, it is global, monotonic, and makes use of the most accurate high-performance counter available on the system.

Returns
microseconds since an unspecified epoch.
Since
3.0.0
eLeapRS LeapInterpolateFrame ( LEAP_CONNECTION  hConnection,
int64_t  timestamp,
LEAP_TRACKING_EVENT pEvent,
uint64_t  ncbEvent 
)

Constructs a frame at the specified timestamp by interpolating between measured frames.

Caller is responsible for allocating a buffer large enough to hold the data of the frame. Use LeapGetFrameSize() to calculate the minimum size of this buffer.

Use LeapCreateClockRebaser(), LeapUpdateRebase(), and LeapRebaseClock() to synchronize time measurements in the application with time measurements in the Leap Motion service. This process is required to achieve accurate, smooth interpolation.

Parameters
hConnectionThe connection handle created by LeapCreateConnection().
timestampThe timestamp at which to interpolate the frame data.
[out]pEventA pointer to a flat buffer which is filled with an interpolated frame.
ncbEventThe number of bytes pointed to by pEvent.
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.1.1
eLeapRS LeapInterpolateFrameFromTime ( LEAP_CONNECTION  hConnection,
int64_t  timestamp,
int64_t  sourceTimestamp,
LEAP_TRACKING_EVENT pEvent,
uint64_t  ncbEvent 
)

Constructs a frame at the specified timestamp by interpolating between a frame near the timestamp and a frame near the sourceTimestamp.

Caller is responsible for allocating a buffer large enough to hold the data of the frame. Use LeapGetFrameSize() to calculate the minimum size of this buffer.

Use LeapCreateClockRebaser(), LeapUpdateRebase(), and LeapRebaseClock() to synchronize time measurements in the application with time measurements in the Leap Motion service. This process is required to achieve accurate, smooth interpolation.

Parameters
hConnectionThe connection handle created by LeapCreateConnection().
timestampThe timestamp to which to interpolate the frame data.
sourceTimestampThe timestamp of the beginning frame from which to interpolate the frame data.
[out]pEventA pointer to a flat buffer which is filled with an interpolated frame.
ncbEventThe number of bytes pointed to by pEvent.
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.1.1
eLeapRS LeapInterpolateHeadPose ( LEAP_CONNECTION  hConnection,
int64_t  timestamp,
LEAP_HEAD_POSE_EVENT *  pEvent 
)

Gets the head tracking pose at the specified timestamp by interpolating between measured frames.

Caller is responsible for allocating a buffer large enough to hold the data of the frame. Use LeapGetFrameSize() to calculate the minimum size of this buffer.

Use LeapCreateClockRebaser(), LeapUpdateRebase(), and LeapRebaseClock() to synchronize time measurements in the application with time measurements in the Leap Motion service. This process is required to achieve accurate, smooth interpolation.

Parameters
hConnectionThe connection handle created by LeapCreateConnection().
timestampThe timestamp at which to interpolate the frame data.
[out]pEventA pointer to a flat buffer which is filled with an interpolated frame.
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.1.1
eLeapRS LeapOpenConnection ( LEAP_CONNECTION  hConnection)

Opens a connection to the service.

This routine will not block. A connection to the service will not be established until the first invocation of LeapPollConnection.

Parameters
hConnectionA handle to the connection object, created by LeapCreateConnection().
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.0.0
eLeapRS LeapOpenDevice ( LEAP_DEVICE_REF  rDevice,
LEAP_DEVICE phDevice 
)

Opens a device reference and retrieves a handle to the device.

To ensure resources are properly freed, users must call LeapCloseDevice() when finished with the device, even if the retrieved device has problems or cannot stream.

Parameters
rDeviceA device reference.
[out]phDeviceA pointer that receives the opened device handle.
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.0.0
LEAP_VECTOR LeapPixelToRectilinear ( LEAP_CONNECTION  hConnection,
eLeapPerspectiveType  camera,
LEAP_VECTOR  pixel 
)

Provides the corrected camera ray intercepting the specified point on the image.

Given a point on the image, LeapPixelToRectilinear() corrects for camera distortion and returns the true direction from the camera to the source of that image point within the Leap Motion field of view.

This direction vector has an x and y component [x, y, 1], with the third element always 1. Note that this vector uses the 2D camera coordinate system where the x-axis parallels the longer (typically horizontal) dimension and the y-axis parallels the shorter (vertical) dimension. The camera coordinate system does not correlate to the 3D Leap Motion coordinate system.

Parameters
hConnectionThe connection handle created by LeapCreateConnection().
cameraThe camera to use, a member of the eLeapPerspectiveType enumeration
pixelA Vector containing the position of a pixel in the image.
Returns
A Vector containing the ray direction (the z-component of the vector is always 1).
Since
3.1.3
eLeapRS LeapPollConnection ( LEAP_CONNECTION  hConnection,
uint32_t  timeout,
LEAP_CONNECTION_MESSAGE evt 
)

Polls the connection for a new event.

The specific types of events that may be received are not configurable in this entrypoint. Configure the device or connection object directly to change what events will be received.

Pointers in the retrieved event message structure will be valid until the associated connection or device is closed, or the next call to LeapPollConnection().

Calling this method concurrently will return eLeapRS_ConcurrentCall.

Parameters
hConnectionThe connection handle created by LeapCreateConnection().
timeoutThe maximum amount of time to wait, in milliseconds. If this value is zero, the evt pointer references the next queued message, if there is one, and returns immediately.
[out]evtA pointer to a structure that is filled with event information. This structure will be valid as long as the LEAP_CONNECTION object is valid.
Returns
The operation result code, a member of the eLeapRS enumeration. If the operation times out, this method will return eLeapRS_Timeout. The evt pointer will reference a message of type eLeapEventType_None.
Since
3.0.0
eLeapRS LeapRebaseClock ( LEAP_CLOCK_REBASER  hClockRebaser,
int64_t  userClock,
int64_t *  pLeapClock 
)

Computes the Leap Motion clock corresponding to a specified application clock value.

Use this function to translate your application clock to the Leap Motion clock when interpolating frames. LeapUpdateRebase() must be called for every rendered frame for the relationship between the two clocks to remain synchronized.

Parameters
hClockRebaserThe handle to a rebaser object created by LeapCreateClockRebaser().
userClockThe clock in microseconds referenced to the application clock.
[out]pLeapClockThe corresponding Leap Motion clock value.
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.1.2
eLeapRS LeapRecordingClose ( LEAP_RECORDING ppRecording)

Closes a LEAP_RECORDING.

Parameters
[out]ppRecordingThe recording being closed. Will modify *ppRecording to be null.
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.2.0
eLeapRS LeapRecordingGetStatus ( LEAP_RECORDING  pRecording,
LEAP_RECORDING_STATUS pstatus 
)

Fills in a LEAP_RECORDING_STATUS struct for an open recording.

This struct provides the applicable eLeapRecordingFlags.

Parameters
pRecordingThe open recording.
[out]pstatusA LEAP_RECORDING_STATUS struct to receive the recording status.
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.2.0
eLeapRS LeapRecordingOpen ( LEAP_RECORDING ppRecording,
const char *  filePath,
LEAP_RECORDING_PARAMETERS  params 
)

Opens or creates a LEAP_RECORDING.

Pass the LEAP_RECORDING pointer to LeapRecordingOpen() to initiate reading from or writing to a recording. The recording path is relative to the "user path" which is the SD card on Android.

Parameters
ppRecordingThe recording being opened.
filePathThe file path. This will be passed directly to the OS without modification. An ".lmt" suffix is suggested.
paramsThe LEAP_RECORDING_PARAMETERS describing what operations are requested.
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.2.0
eLeapRS LeapRecordingRead ( LEAP_RECORDING  pRecording,
LEAP_TRACKING_EVENT pEvent,
uint64_t  ncbEvent 
)

Reads a tracking frame from a LEAP_RECORDING file.

Caller is responsible for allocating a buffer large enough to hold the data of the frame. Use LeapGetFrameSize() to calculate the minimum size of this buffer.

Parameters
pRecordingThe recording being read from.
[out]pEventA pointer to a flat buffer which is filled with the next recorded frame.
ncbEventThe number of bytes pointed to by pEvent.
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.2.0
eLeapRS LeapRecordingReadSize ( LEAP_RECORDING  pRecording,
uint64_t *  pncbEvent 
)

Retrieves the number of bytes required to allocate the next frame in a recording.

Use this function to determine the size of the buffer to allocate before calling LeapRecordingRead().

Parameters
pRecordingThe recording being read from.
[out]pncbEventA pointer that receives the number of bytes required to store the next frame.
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.2.0
eLeapRS LeapRecordingWrite ( LEAP_RECORDING  pRecording,
LEAP_TRACKING_EVENT pEvent,
uint64_t *  pnBytesWritten 
)

Writes a tracking frame to a LEAP_RECORDING file.

Parameters
pRecordingThe recording being written to.
[out]pEventA pointer to a flat buffer which is filled with an interpolated frame.
pnBytesWrittenIf non-null the number of bytes written.
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.2.0
LEAP_VECTOR LeapRectilinearToPixel ( LEAP_CONNECTION  hConnection,
eLeapPerspectiveType  camera,
LEAP_VECTOR  rectilinear 
)

Provides the point in the image corresponding to a ray projecting from the camera.

Given a ray projected from the camera in the specified direction, LeapRectilinearToPixel() corrects for camera distortion and returns the corresponding pixel coordinates in the image.

The ray direction is specified in relationship to the camera. The first vector element is the tangent of the "horizontal" view angle; the second element is the tangent of the "vertical" view angle.

The LeapRectilinearToPixel() function returns pixel coordinates outside of the image bounds if you project a ray toward a point for which there is no recorded data.

LeapRectilinearToPixel() is typically not fast enough for realtime distortion correction. For better performance, use a shader program executed on a GPU.

Parameters
hConnectionThe connection handle created by LeapCreateConnection().
cameraThe camera to use, a member of the eLeapPerspectiveType enumeration
rectilinearA Vector containing the ray direction.
Returns
A Vector containing the pixel coordinates [x, y, 1] (with z always 1).
Since
3.1.3
eLeapRS LeapRequestConfigValue ( LEAP_CONNECTION  hConnection,
const char *  key,
uint32_t *  pRequestID 
)

Requests the current value of a service configuration setting.

The value is fetched asynchronously since it requires a service transaction. LeapPollConnection() returns this event structure when the request has been processed. Use the pRequestID value to correlate the response to the originating request.

Parameters
hConnectionThe connection handle created by LeapCreateConnection().
keyThe key of the configuration to request
[out]pRequestIDA pointer to a memory location to which the id for this request is written.
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.0.0
eLeapRS LeapSaveConfigValue ( LEAP_CONNECTION  hConnection,
const char *  key,
const LEAP_VARIANT value,
uint32_t *  pRequestID 
)

Causes the client to commit a configuration change to the Leap Motion service.

The change is performed asynchronously – and may fail. LeapPollConnection() returns this event structure when the request has been processed. Use the pRequestID value to correlate the response to the originating request.

Parameters
hConnectionThe connection handle created by LeapCreateConnection().
keyThe key of the configuration to commit.
valueThe value of the configuration to commit.
[out]pRequestIDA pointer to a memory location to which the id for this request is written, or nullptr if this value is not needed.
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.0.0
eLeapRS LeapSetPause ( LEAP_CONNECTION  hConnection,
bool  pause 
)

Pauses the service.

Attempts to pause or unpause the service depending on the argument. This is treated as a 'user pause', as though a user had requested a pause through the Leap Control Panel. The connection must have the AllowPauseResume policy set or it will fail with eLeapRS_InvalidArgument.

Parameters
hConnectionThe connection handle created by LeapCreateConnection().
pauseSet to 'true' to pause, or 'false' to unpause
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
4.0.0
eLeapRS LeapSetPolicyFlags ( LEAP_CONNECTION  hConnection,
uint64_t  set,
uint64_t  clear 
)

Sets or clears one or more policy flags.

Changing policies is asynchronous. After you call this function, a subsequent call to LeapPollConnection provides a LEAP_POLICY_EVENT containing the current policies, reflecting any changes.

To get the current policies without changes, specify zero for both the set and clear parameters. When ready, LeapPollConnection() provides the a LEAP_POLICY_EVENT containing the current settings.

The eLeapPolicyFlag enumeration defines the policy flags.

Parameters
hConnectionThe connection handle created by LeapCreateConnection().
setA bitwise combination of flags to be set. Set to 0 if not setting any flags.
clearA bitwise combination of flags to be cleared. Set to 0 to if not clearing any flags.
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.0.0
eLeapRS LeapUpdateRebase ( LEAP_CLOCK_REBASER  hClockRebaser,
int64_t  userClock,
int64_t  leapClock 
)

Updates the relationship between the Leap Motion clock and the user clock.

When using LeapInterpolateFrame(), call this function for every graphics frame rendered by your application. The function should be called as close to the actual point of rendering as possible.

The relationship between the application clock and the Leap Motion clock is neither fixed nor stable. Simulation restarts can cause user clock values to change instantaneously. Certain systems simulate slow motion, or respond to heavy load, by reducing the tick rate of the user clock. As a result, the LeapUpdateRebase() function must be called for every rendered frame.

Parameters
hClockRebaserThe handle to a rebaser object created by LeapCreateClockRebaser().
userClockA clock value supplied by the application, sampled at about the same time as LeapGetNow() was sampled.
leapClockThe Leap Motion clock value sampled by a call to LeapGetNow().
Returns
The operation result code, a member of the eLeapRS enumeration.
Since
3.1.2