To get the motion history for a specified extended device,
window, and time, use
XHPGetDeviceMotionEvents.
This function is provided for client programs that need to
receive every motion event generated by the X server (such as graphics
programs that allow the user to paint
on the screen). For most other programs, selecting motion events
is sufficient. The X server compresses motion events for the X pointer
device and extended input devices.
XHPTimeCoord *XHPGetDeviceMotionEvents(display, deviceid, w, start, stop, nevents_return) Display *display; XID deviceid; Window w; Time start, stop; int *nevents_return; /* RETURN */
|
Title not available (Getting Extended Device Motion History )
- display
Specifies the connection to the X server.
- deviceid
Specifies the extended input device.
- w
Specifies the window ID. The only value currently
supported for this parameter is the constant: ALLWINDOWS.
- start stop
Specify the time interval in which the events are
returned from the motion history buffer. You can pass a time stamp,
expressed in milliseconds, or CurrentTime.
If the stop time is in the future, it is equivalent to specifying
CurrentTime.
- nevents_return
Returns the number of events from the motion history
buffer.
The XHPGetDeviceMotionEvents
function returns all events in the motion history buffer that fall
between the specified start and stop times, inclusive. If the start
time is later than the stop time or if the start time is in the
future, no events are returned. The return type for this function
is a structure defined as follows:
typedef struct { Time time; short *data; } XHPTimeCoord;
|
The time member is set to the time
in milliseconds. The data member is a
pointer to an array of motion values. The number of elements in
this array is determined by the num_axes
field of the XHPDeviceList
structure associated with the device. You should use XFree
to free the data returned from this call.
XHPGetDeviceMotionEvents
can generate BadWindow
and BadDevice
errors.