XGetDeviceMotionEvents.txt revision 4940c694
11.2SchristosXGETDEVICEMOTIONEVENTS(libmansuffix)
21.1Schristos====================================
31.1Schristos
41.1SchristosNAME
51.1Schristos----
61.1Schristos
71.1Schristos   XGetDeviceMotionEvents, XDeviceTimeCoord - get device motion
81.1Schristos   history
91.1Schristos
101.1SchristosSYNOPSIS
111.1Schristos--------
121.1Schristos
131.1Schristos   #include <X11/extensions/XInput.h>
141.1Schristos
151.1Schristos   XDeviceTimeCoord *XGetDeviceMotionEvents( Display *display,
161.1Schristos                                             XDevice *device,
171.1Schristos                                             Time start,
181.1Schristos                                             Time stop,
191.2Schristos                                             int *nevents_return,
201.2Schristos                                             int *mode_return,
211.1Schristos                                             int *axis_count_return);
221.1Schristos
231.1Schristos   display
241.1Schristos          Specifies the connection to the X server.
251.1Schristos
261.1Schristos   device
271.1Schristos          Specifies the device whose motion history is to be
281.1Schristos          queried.
291.1Schristos
301.1Schristos   start, stop
311.1Schristos          Specify the time interval in which the events are
321.1Schristos          returned from the motion history buffer. You can pass a
331.1Schristos          timestamp or CurrentTime.
341.1Schristos
351.1Schristos   nevents_return
361.1Schristos          Returns the number of events from the motion history
371.2Schristos          buffer.
381.1Schristos
391.1Schristos   mode_return
401.1Schristos          Returns the mode of the device (Absolute or Relative).
411.1Schristos
421.1Schristos   axis_count_return
431.1Schristos          Returns the count of axes being reported.
441.1Schristos
451.1SchristosDESCRIPTION
461.1Schristos-----------
471.1Schristos
481.1Schristos   The server may retain the recent history of the device motion
491.1Schristos   and do so to a finer granularity than is reported by
501.1Schristos   DeviceMotionNotify events. The XGetDeviceMotionEvents request
511.1Schristos   makes this history available.
521.1Schristos
531.1Schristos   The XGetDeviceMotionEvents request returns all events in the
541.1Schristos   motion history buffer that fall between the specified start and
551.1Schristos   stop times, inclusive. If the start time is later than the stop
561.1Schristos   time or if the start time is in the future, no events are
571.1Schristos   returned. If the stop time is in the future, it is equivalent
581.1Schristos   to specifying CurrentTime.
591.1Schristos
601.1Schristos   The mode indicates whether the device is reporting absolute
611.1Schristos   positional data (mode = Absolute ) or relative motion data
621.1Schristos   (mode = Relative ). Some devices allow their mode to be changed
631.1Schristos   via the XSetDeviceMode request. These constants are defined in
641.1Schristos   the file XI.h. The axis_count returns the number of axes or
651.1Schristos   valuators being reported by the device.
661.1Schristos
671.1Schristos   XGetDeviceMotionEvents can generate a BadDevice, or BadMatch
681.1Schristos   error.
691.1Schristos
701.1SchristosStructures
711.1Schristos
721.1Schristos   The XDeviceTimeCoord structure contains:
731.1Schristos
741.1Schristos                typedef struct {
751.1Schristos                    Time time;
761.1Schristos                    int *data;
771.1Schristos                } XDeviceTimeCoord;
781.1Schristos
791.1Schristos   The time member is set to the time, in milliseconds. The data
801.1Schristos   member is a pointer to an array of integers. These integers are
811.1Schristos   set to the values of each valuator or axis reported by the
821.1Schristos   device. There is one element in the array per axis of motion
831.1Schristos   reported by the device. The value of the array elements depends
841.1Schristos   on the mode of the device. If the mode is Absolute, the values
851.1Schristos   are the raw values generated by the device. These may be scaled
861.1Schristos   by client programs using the maximum values that the device can
871.1Schristos   generate. The maximum value for each axis of the device is
881.1Schristos   reported in the max_val field of the XAxisInfo returned by the
891.1Schristos   XListInputDevices request. If the mode is Relative, the data
901.1Schristos   values are the relative values generated by the device.
911.1Schristos
921.1Schristos   You should use XFreeDeviceMotionEvents to free the data
931.1Schristos   returned by this request.
941.1Schristos
951.2Schristos   Errors returned by this request: BadDevice, BadMatch.
961.1Schristos
971.1SchristosDIAGNOSTICS
981.2Schristos-----------
991.1Schristos
1001.1Schristos   BadDevice
1011.1Schristos          An invalid device was specified. The specified device
1021.1Schristos          does not exist or has not been opened by this client via
1031.1Schristos          XOpenInputDevice. This error may also occur if the
1041.1Schristos          specified device is the X keyboard or X pointer device.
1051.1Schristos
1061.1Schristos   BadMatch
1071.1Schristos          This error may occur if an XGetDeviceMotionEvents
1081.1Schristos          request is made specifying a device that has no
1091.1Schristos          valuators and reports no axes of motion.
1101.1Schristos