XGetDeviceMotionEvents.txt revision c27c18e8
1c27c18e8SmrgXGETDEVICEMOTIONEVENTS(libmansuffix) 2c27c18e8Smrg==================================== 3c27c18e8Smrg 4c27c18e8SmrgNAME 5c27c18e8Smrg---- 6c27c18e8Smrg 7c27c18e8Smrg XGetDeviceMotionEvents, XDeviceTimeCoord - get device motion 8c27c18e8Smrg history 9c27c18e8Smrg 10c27c18e8SmrgSYNOPSIS 11c27c18e8Smrg-------- 12c27c18e8Smrg 13c27c18e8Smrg #include <X11/extensions/XInput.h> 14c27c18e8Smrg 15c27c18e8Smrg XDeviceTimeCoord *XGetDeviceMotionEvents( Display *display, 16c27c18e8Smrg XDevice *device, 17c27c18e8Smrg Time start, 18c27c18e8Smrg Time stop, 19c27c18e8Smrg int *nevents_return, 20c27c18e8Smrg int *mode_return, 21c27c18e8Smrg int *axis_count_return); 22c27c18e8Smrg 23c27c18e8Smrg display 24c27c18e8Smrg Specifies the connection to the X server. 25c27c18e8Smrg 26c27c18e8Smrg device 27c27c18e8Smrg Specifies the device whose motion history is to be 28c27c18e8Smrg queried. 29c27c18e8Smrg 30c27c18e8Smrg start, stop 31c27c18e8Smrg Specify the time interval in which the events are 32c27c18e8Smrg returned from the motionhistory buffer.You can pass a 33c27c18e8Smrg timestamp or CurrentTime. 34c27c18e8Smrg 35c27c18e8Smrg nevents_return 36c27c18e8Smrg Returns the number of events from the motion history 37c27c18e8Smrg buffer. 38c27c18e8Smrg 39c27c18e8Smrg mode_return 40c27c18e8Smrg Returns the mode of the device (Absolute or Relative). 41c27c18e8Smrg 42c27c18e8Smrg axis_count_return 43c27c18e8Smrg Returns the count of axes being reported. 44c27c18e8Smrg 45c27c18e8SmrgDESCRIPTION 46c27c18e8Smrg----------- 47c27c18e8Smrg 48c27c18e8Smrg The server may retain the recent history of the device motion 49c27c18e8Smrg and do so to a finer granularity than is reported by 50c27c18e8Smrg DeviceMotionNotify events. The XGetDeviceMotionEvents request 51c27c18e8Smrg makes this history available. 52c27c18e8Smrg 53c27c18e8Smrg The XGetDeviceMotionEvents request returns all events in the 54c27c18e8Smrg motion history buffer that fall between the specified start and 55c27c18e8Smrg stop times, inclusive. If the start time is later than the stop 56c27c18e8Smrg time or if the start time is in the future, no events are 57c27c18e8Smrg returned. If the stop time is in the future, it is equivalent 58c27c18e8Smrg to specifying CurrentTime. 59c27c18e8Smrg 60c27c18e8Smrg The mode indicates whether the device is reporting absolute 61c27c18e8Smrg positional data (mode = Absolute ) or relative motion data 62c27c18e8Smrg (mode = Relative ). Some devices allow their mode to be changed 63c27c18e8Smrg via the XSetDeviceMode request. These constants are defined in 64c27c18e8Smrg the file XI.h. The axis_count returns the number of axes or 65c27c18e8Smrg valuators being reported by the device. 66c27c18e8Smrg 67c27c18e8Smrg XGetDeviceMotionEvents can generate a BadDevice, or BadMatch 68c27c18e8Smrg error. 69c27c18e8Smrg 70c27c18e8SmrgStructures 71c27c18e8Smrg 72c27c18e8Smrg The XDeviceTimeCoord structure contains: 73c27c18e8Smrg 74c27c18e8Smrg typedef struct { 75c27c18e8Smrg Time time; 76c27c18e8Smrg int *data; 77c27c18e8Smrg } XDeviceTimeCoord; 78c27c18e8Smrg 79c27c18e8Smrg The time member is set to the time, in milliseconds. The data 80c27c18e8Smrg member is a pointer to an array of integers. These integers are 81c27c18e8Smrg set to the values of each valuator or axis reported by the 82c27c18e8Smrg device. There is one element in the array per axis of motion 83c27c18e8Smrg reported by the device. The value of the array elements depends 84c27c18e8Smrg on the mode of the device. If the mode is Absolute, the values 85c27c18e8Smrg are the raw values generated by the device. These may be scaled 86c27c18e8Smrg by client programs using the maximum values that the device can 87c27c18e8Smrg generate. The maximum value for each axis of the device is 88c27c18e8Smrg reported in the max_val field of the XAxisInfo returned by the 89c27c18e8Smrg XListInputDevices request. If the mode is Relative, the data 90c27c18e8Smrg values are the relative values generated by the device. 91c27c18e8Smrg 92c27c18e8Smrg You should use XFreeDeviceMotionEvents to free the data 93c27c18e8Smrg returned by this request. 94c27c18e8Smrg 95c27c18e8Smrg Errors returned by this request: BadDevice, BadMatch. 96c27c18e8Smrg 97c27c18e8SmrgDIAGNOSTICS 98c27c18e8Smrg----------- 99c27c18e8Smrg 100c27c18e8Smrg BadDevice 101c27c18e8Smrg An invalid device was specified. The specified device 102c27c18e8Smrg does not exist or has not been opened by this client via 103c27c18e8Smrg XOpenInputDevice. This error may also occur if the 104c27c18e8Smrg specified device is the X keyboard or X pointer device. 105c27c18e8Smrg 106c27c18e8Smrg BadMatch 107c27c18e8Smrg This error may occur if an XGetDeviceMotionEvents 108c27c18e8Smrg request is made specifying a device that has no 109c27c18e8Smrg valuators and reports no axes of motion. 110