1c27c18e8SmrgXQUERYDEVICESTATE(libmansuffix) 2c27c18e8Smrg=============================== 3c27c18e8Smrg 4c27c18e8SmrgNAME 5c27c18e8Smrg---- 6c27c18e8Smrg 7c27c18e8Smrg XQueryDeviceState - query the state of an extension input 8c27c18e8Smrg device. 9c27c18e8Smrg 10c27c18e8SmrgSYNOPSIS 11c27c18e8Smrg-------- 12c27c18e8Smrg 13c27c18e8Smrg #include <X11/extensions/XInput.h> 14c27c18e8Smrg 15c27c18e8Smrg XDeviceState* XQueryDeviceState( Display *display, 16c27c18e8Smrg XDevice *device); 17c27c18e8Smrg 18c27c18e8Smrg display 19c27c18e8Smrg Specifies the connection to the X server. 20c27c18e8Smrg 21c27c18e8Smrg device 22c27c18e8Smrg Specifies the device whose state is to be queried. 23c27c18e8Smrg 24c27c18e8SmrgDESCRIPTION 25c27c18e8Smrg----------- 26c27c18e8Smrg 27c27c18e8Smrg The XQueryDeviceState request queries the state of an input 28c27c18e8Smrg device. The current state of keys and buttons (up or down), and 29c27c18e8Smrg valuators (current value) on the device is reported by this 30c27c18e8Smrg request. Each key or button is represented by a bit in the 31c27c18e8Smrg XDeviceState structure that is returned. Valuators on the 32c27c18e8Smrg device report 0 if they are reporting relative information, and 33c27c18e8Smrg the current value if they are reporting absolute information. 34c27c18e8Smrg 35c27c18e8Smrg XQueryDeviceState can generate a BadDevice error. 36c27c18e8Smrg 37c27c18e8Smrg Structures: 38c27c18e8Smrg 39c27c18e8Smrg The XDeviceState structure contains: 40c27c18e8Smrg 41c27c18e8Smrg typedef struct { 42c27c18e8Smrg XID device_id; 43c27c18e8Smrg int num_classes; 44c27c18e8Smrg XInputClass *data; 45c27c18e8Smrg } XDeviceState; 46c27c18e8Smrg 47c27c18e8Smrg The XValuatorState structure contains: 48c27c18e8Smrg 49c27c18e8Smrg typedef struct { 50c27c18e8Smrg unsigned char class; 51c27c18e8Smrg unsigned char length; 52c27c18e8Smrg unsigned char num_valuators; 53c27c18e8Smrg unsigned char mode; 54c27c18e8Smrg int *valuators; 55c27c18e8Smrg } XValuatorState; 56c27c18e8Smrg 57c27c18e8Smrg The XKeyState structure contains: 58c27c18e8Smrg 59c27c18e8Smrg typedef struct { 60c27c18e8Smrg unsigned char class; 61c27c18e8Smrg unsigned char length; 62c27c18e8Smrg short num_keys; 63c27c18e8Smrg char keys[32]; 64c27c18e8Smrg } XKeyState; 65c27c18e8Smrg 66c27c18e8Smrg The XButtonState structure contains: 67c27c18e8Smrg 68c27c18e8Smrg typedef struct { 69c27c18e8Smrg unsigned char class; 70c27c18e8Smrg unsigned char length; 71c27c18e8Smrg short num_buttons; 72c27c18e8Smrg char buttons[32]; 73c27c18e8Smrg } XButtonState; 74c27c18e8Smrg 75c27c18e8SmrgDIAGNOSTICS 76c27c18e8Smrg----------- 77c27c18e8Smrg 78c27c18e8Smrg BadDevice 79c27c18e8Smrg An invalid device was specified. The specified device 80c27c18e8Smrg does not exist or has not been opened by this client via 81c27c18e8Smrg XOpenInputDevice. This error may also occur if some 82c27c18e8Smrg other client has caused the specified device to become 83c27c18e8Smrg the X keyboard or X pointer device via the 84c27c18e8Smrg XChangeKeyboardDevice or XChangePointerDevice requests. 85