XGetMotionEvents()XGetMotionEvents()NameXGetMotionEvents – get events from pointer motion history buffer.
Synopsis
XTimeCoord *XGetMotionEvents(display, w, start, stop, nevents_return)
Display *display;
Window w;
Time start, stop;
int *nevents_return;
Arguments
display Specifies a connection to an X server; returned from XOpenDis‐
play().
w Specifies the ID of the window whose associated pointer motion
events will be returned.
start Specify the time interval for which the events are returned
stop from the motion history buffer. Pass a time stamp (in mil‐
liseconds) or CurrentTime.
nevents_return
Returns the number of events returned from the motion history
buffer.
Returns
The list of pointer positions.
DescriptionXGetMotionEvents() returns all events in the motion history buffer that
fall between the specified start and stop times (inclusive) and that
have coordinates that lie within (including borders) the specified win‐
dow at its present placement. The x and y coordinates of the XTimeCo‐
ord return structure are reported relative to the origin of w.
XGetMotionEvent returns NULL if the server does not support a motion
history buffer (which is common), or if the start time is after the
stop time, or if the start time is in the future. If the stop time is
in the future, it is equivalent to specifying the constant CurrentTime,
since the server does not wait to report future events. A motion his‐
tory buffer is supported if XDisplayMotionBufferSize() (display) > 0.
The pointer position at each pointer hardware interrupt is then stored
for later retrieval.
Use XFree() to free the returned XTimeCoord structures when they are no
longer needed.
For more information, see Volume One, Chapter 9, The Keyboard and
Pointer.
Structures
typedef struct _XTimeCoord {
Time time;
short x, y;
} XTimeCoord;
Errors
BadWindow
See AlsoXQLength(), XAllowEvents(), XCheckIfEvent(), XCheckMaskEvent(), XCheck‐
TypedEvent(), XCheckTypedWindowEvent(), XCheckWindowEvent(),
XEventsQueued(), XGetInputFocus(), XIfEvent(), XMaskEvent(), XNex‐
tEvent(), XPeekEvent(), XPeekIfEvent(), XPending(), XPutBackEvent(),
XSelectInput(), XSendEvent(), XSetInputFocus(), XSynchronize(), XWin‐
dowEvent().
Xlib - Input Handling XGetMotionEvents()