NAME
XGetDeviceControl, XChangeDeviceControl - query and change input device controls
SYNTAX
XDeviceControl *XGetDeviceControl(Display *_d_i_s_p_l_a_y, XDevice
*_d_e_v_i_c_e, int *_c_o_n_t_r_o_l_T_y_p_e);
int XChangeDeviceControl(Display *_d_i_s_p_l_a_y, XDevice
*_d_e_v_i_c_e, int _c_o_n_t_r_o_l_T_y_p_e, XDeviceControl *_c_o_n_t_r_o_l);
ARGUMENTS
-
display
-
Specifies the connection to the X server.
-
device
-
Specifies the device whose control is to be interrogated or modified.
-
controlType
-
Specifies the type of control to be interrogated or changed.
-
control
-
Specifies the address of an _X_D_e_v_i_c_e_C_o_n_t_r_o_l structure that contains
the new values for the Device.
DESCRIPTION
These requests are provided to manipulate those input devices that
support device control. A _B_a_d_M_a_t_c_h error will be generated if the
requested device does not support any device controls.
Valid device control types that can be used with these requests include the
following:
-
DEVICE_RESOLUTION
-
Queries or changes the resolution of valuators on input devices.
The _X_G_e_t_D_e_v_i_c_e_C_o_n_t_r_o_l request returns a pointer to an
_X_D_e_v_i_c_e_C_o_n_t_r_o_l structure.
_X_G_e_t_D_e_v_i_c_e_C_o_n_t_r_o_l can generate a _B_a_d_D_e_v_i_c_e or
_B_a_d_M_a_t_c_h error.
The _X_C_h_a_n_g_e_D_e_v_i_c_e_C_o_n_t_r_o_l request modifies the values of one
control on the specified device. The control is identified by the id
field of the _X_D_e_v_i_c_e_C_o_n_t_r_o_l structure that is passed with the
request.
_X_C_h_a_n_g_e_D_e_v_i_c_e_C_o_n_t_r_o_l can generate a _B_a_d_D_e_v_i_c_e,
_B_a_d_M_a_t_c_h, or _B_a_d_V_a_l_u_e error.
STRUCTURES
Each control is described by a structure specific to that control.
These structures are defined in the file _X_I_n_p_u_t_._h.
_X_D_e_v_i_c_e_C_o_n_t_r_o_l is a generic
structure that contains two fields that are at the beginning of each class
of control:
typedef struct {
XID class;
int length;
} XDeviceControl;
The _X_D_e_v_i_c_e_R_e_s_o_l_u_t_i_o_n_S_t_a_t_e structure defines the information that is
returned for device resolution for devices with valuators.
typedef struct {
XID control;
int length;
int num_valuators;
int *resolutions;
int *min_resolutions;
int *max_resolutions;
} XDeviceResolutionState;
The _X_D_e_v_i_c_e_R_e_s_o_l_u_t_i_o_n_C_o_n_t_r_o_l structure defines the attributes that can be
controlled for keyboard Devices.
typedef struct {
XID control;
int length;
int first_valuator;
int num_valuators;
int *resolutions;
} XDeviceResolutionControl;
DIAGNOSTICS
-
_B_a_d_D_e_v_i_c_e
-
An invalid device was specified. The specified device does not exist or has
not been opened by this client via _X_O_p_e_n_I_n_p_u_t_D_e_v_i_c_e. This error may
also occur if some other client has caused the specified device to become
the X keyboard or X pointer device via the _X_C_h_a_n_g_e_K_e_y_b_o_a_r_d_D_e_v_i_c_e or
_X_C_h_a_n_g_e_P_o_i_n_t_e_r_D_e_v_i_c_e requests.
-
_B_a_d_M_a_t_c_h
-
This error may occur if an _X_G_e_t_D_e_v_i_c_e_C_o_n_t_r_o_l request was made specifying
a device that has no controls or an _X_C_h_a_n_g_e_D_e_v_i_c_e_C_o_n_t_r_o_l request was
made with an _X_D_e_v_i_c_e_C_o_n_t_r_o_l structure that contains an invalid Device
type. It may also occur if an invalid combination of mask bits is specified
(_D_v_K_e_y but no _D_v_A_u_t_o_R_e_p_e_a_t_M_o_d_e for keyboard Devices), or if an
invalid KeySym is specified for a string Device.
-
_B_a_d_V_a_l_u_e
-
Some numeric value falls outside the range of values accepted by the
_X_C_h_a_n_g_e_D_e_v_i_c_e_C_o_n_t_r_o_l request.
Unless a specific range is specified for an argument, the full range defined
by the argument's type is accepted. Any argument defined as a set of
alternatives can generate this error.
SEE ALSO
_P_r_o_g_r_a_m_m_i_n_g _W_i_t_h _X_l_i_b