1c27c18e8SmrgXGETDEVICECONTROL(libmansuffix)
2c27c18e8Smrg===============================
3c27c18e8Smrg
4c27c18e8SmrgNAME
5c27c18e8Smrg----
6c27c18e8Smrg
7c27c18e8Smrg   XGetDeviceControl, XChangeDeviceControl - query and change
8c27c18e8Smrg   input device controls
9c27c18e8Smrg
10c27c18e8SmrgSYNOPSIS
11c27c18e8Smrg--------
12c27c18e8Smrg
13c27c18e8Smrg   #include <X11/extensions/XInput.h>
14c27c18e8Smrg
15c27c18e8Smrg   XDeviceControl *XGetDeviceControl( Display *display,
16c27c18e8Smrg                                      XDevice *device,
17c27c18e8Smrg                                      int *controlType);
18c27c18e8Smrg
19c27c18e8Smrg   int XChangeDeviceControl( Display *display,
20c27c18e8Smrg                             XDevice *device,
21c27c18e8Smrg                             int controlType,
22c27c18e8Smrg                             XDeviceControl *control);
23c27c18e8Smrg
24c27c18e8Smrg   display
25c27c18e8Smrg          Specifies the connection to the X server.
26c27c18e8Smrg
27c27c18e8Smrg   device
28c27c18e8Smrg          Specifies the device whose control is to be interrogated
29c27c18e8Smrg          or modified.
30c27c18e8Smrg
31c27c18e8Smrg   controlType
32c27c18e8Smrg          Specifies the type of control to be interrogated or
33c27c18e8Smrg          changed.
34c27c18e8Smrg
35c27c18e8Smrg   control
36c27c18e8Smrg          Specifies the address of an XDeviceControl structure
37c27c18e8Smrg          that contains the new values for the Device.
38c27c18e8Smrg
39c27c18e8SmrgDESCRIPTION
40c27c18e8Smrg-----------
41c27c18e8Smrg
42c27c18e8Smrg   These requests are provided to manipulate those input devices
43c27c18e8Smrg   that support device control. A BadMatch error will be generated
44c27c18e8Smrg   if the requested device does not support any device controls.
45c27c18e8Smrg
46c27c18e8Smrg   Valid device control types that can be used with these requests
47c27c18e8Smrg   include the following:
48c27c18e8Smrg
49f1ee322dSmrg   DEVICE_RESOLUTION: Queries or changes the resolution of
50c27c18e8Smrg   valuators on input devices.
51c27c18e8Smrg
52c27c18e8Smrg   The XGetDeviceControl request returns a pointer to an
53c27c18e8Smrg   XDeviceControl structure.
54c27c18e8Smrg
55c27c18e8Smrg   XGetDeviceControl can generate a BadDevice or BadMatch error.
56c27c18e8Smrg
57c27c18e8Smrg   The XChangeDeviceControl request modifies the values of one
58c27c18e8Smrg   control on the specified device. The control is identified by
59c27c18e8Smrg   the id field of the XDeviceControl structure that is passed
60c27c18e8Smrg   with the request.
61c27c18e8Smrg
62c27c18e8Smrg   XChangeDeviceControl can generate a BadDevice, BadMatch, or
63f1ee322dSmrg   BadValue error.
64f1ee322dSmrg
65f1ee322dSmrgSTRUCTURES
66f1ee322dSmrg----------
67f1ee322dSmrg
68f1ee322dSmrg   Each control is described by a structure specific to that control.
69f1ee322dSmrg   These structures are defined in the file XInput.h.
70c27c18e8Smrg
71c27c18e8Smrg   XDeviceControl is a generic structure that contains two fields
72c27c18e8Smrg   that are at the beginning of each class of control:
73c27c18e8Smrg
74c27c18e8Smrg                typedef struct {
75c27c18e8Smrg                    XID class;
76c27c18e8Smrg                    int length;
77c27c18e8Smrg                } XDeviceControl;
78c27c18e8Smrg
79c27c18e8Smrg   The XDeviceResolutionState structure defines the information
80c27c18e8Smrg   that is returned for device resolution for devices with
81c27c18e8Smrg   valuators.
82c27c18e8Smrg
83c27c18e8Smrg                typedef struct {
84c27c18e8Smrg                    XID control;
85c27c18e8Smrg                    int length;
86c27c18e8Smrg                    int num_valuators;
87c27c18e8Smrg                    int* resolutions;
88c27c18e8Smrg                    int* min_resolutions;
89c27c18e8Smrg                    int* max_resolutions;
90c27c18e8Smrg                } XDeviceResolutionState;
91c27c18e8Smrg
92c27c18e8Smrg   The XDeviceResolutionControl structure defines the attributes
93c27c18e8Smrg   that can be controlled for keyboard Devices.
94c27c18e8Smrg
95c27c18e8Smrg                typedef struct {
96c27c18e8Smrg                    XID control;
97c27c18e8Smrg                    int length;
98c27c18e8Smrg                    int first_valuator;
99c27c18e8Smrg                    int num_valuators;
100c27c18e8Smrg                    int* resolutions;
101c27c18e8Smrg                } XDeviceResolutionControl;
102c27c18e8Smrg
103c27c18e8SmrgDIAGNOSTICS
104c27c18e8Smrg-----------
105c27c18e8Smrg
106c27c18e8Smrg   BadDevice
107c27c18e8Smrg          An invalid device was specified. The specified device
108c27c18e8Smrg          does not exist or has not been opened by this client via
109c27c18e8Smrg          XOpenInputDevice. This error may also occur if some
110c27c18e8Smrg          other client has caused the specified device to become
111c27c18e8Smrg          the X keyboard or X pointer device via the
112c27c18e8Smrg          XChangeKeyboardDevice or XChangePointerDevice requests.
113c27c18e8Smrg
114c27c18e8Smrg   BadMatch
115c27c18e8Smrg          This error may occur if an XGetDeviceControl request was
116c27c18e8Smrg          made specifying a device that has no controls or an
117c27c18e8Smrg          XChangeDeviceControl request was made with an
118c27c18e8Smrg          XDeviceControl structure that contains an invalid Device
119c27c18e8Smrg          type. It may also occur if an invalid combination of
120c27c18e8Smrg          mask bits is specified ( DvKey but no DvAutoRepeatMode
121c27c18e8Smrg          for keyboard Devices), or if an invalid KeySym is
122c27c18e8Smrg          specified for a string Device.
123c27c18e8Smrg
124c27c18e8Smrg   BadValue
125c27c18e8Smrg          Some numeric value falls outside the range of values
126c27c18e8Smrg          accepted by the XChangeDeviceControl request. Unless a
127c27c18e8Smrg          specific range is specified for an argument, the full
128c27c18e8Smrg          range defined by the argument's type is accepted. Any
129c27c18e8Smrg          argument defined as a set of alternatives can generate
130c27c18e8Smrg          this error.
131