HPlogo HP Xlib Extensions: > Chapter 6 HP Input Device Extension Functions

Setting Control Attributes of Extended Input Devices

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

To set control attributes of an extended input device, use XHPChangeDeviceControl.

int XHPChangeDeviceControl(display, deviceid, value_mask,
values)
Display *display;
XID deviceid;
unsigned long value_mask;
XHPDeviceControl *values;

Title not available (Setting Control Attributes of Extended Input Devices)

display

Specifies the connection to the X server.

deviceid

Specifies the ID of the device whose attributes are to be changed.

value_mask

Specifies which attributes are to be changed. Each bit in the mask specifies one attribute of the specified device.

values

Specifies a pointer to the XHPDeviceControl structure containing the values to be changed.

XHPChangeDeviceControl allows the control attributes of input devices (other than the X keyboard and X pointer devices) to be changed. The specified device must have previously been opened (turned on) with XHPSetInputDevice.

The attributes to be changed are specified in the XHPDeviceAttributes structure. They are not actually changed unless the corresponding bit is set in the value_mask parameter. The following masks can be ORed into the value_mask:

#define DVKeyClickPercent       (1L<<0)
#define DVBellPercent (1L<<1)
#define DVBellPitch (1L<<2)
#define DVBellDuration (1L<<3)
#define DVLed (1L<<4)
#define DVLedMode (1L<<5)
#define DVKey (1L<<6)
#define DVAutoRepeatMode (1L<<7)
#define DVAccelNum (1L<<8)
#define DVAccelDenom (1L<<9)
#define DVThreshold (1L<<10)

The fields of the XHPDeviceControl structure are defined as follows:

typedef struct {
int key_click_percent;
int bell_percent;
int bell_pitch;
int bell_duration;
int led;
int led_mode;
int key;
int auto_repeat_mode;
int accelNumerator;
int accelDenominator;
int threshold;
} XHPDeviceControl;

The key_click_percent and bell_percent members set the volume for key clicks or a bell. Allowed values are 0 (off) through 100 (loud). The bell_pitch member sets the pitch (in Hz) of the bell, if possible. The bell_duration member sets the duration (in milliseconds) of the bell, if possible. A value of -1 for any of these members restores the respective default value. Any other negative value generates a BadValue error.

If both the led and led_mode members are specified, the state of that LED is changed, if possible. The led_mode member can be set to LedModeOn or LedModeOff. If only led_mode is specified, the state of all LEDs are changed, if possible. At most, 32 LEDs (counting from one) are supported. No standard interpretation of LEDs is defined. If an led is specified without an led_mode, a BadMatch error is generated.

If both the auto_repeat_mode and key members are specified, the key and auto_repeat_mode members are specified, the auto_repeat_mode of that key is changed according to AutoRepeatModeOn, AutoRepeatModeOff, or AutoRepeatModeDefault, if possible. If only auto_repeat_mode is specified, the global auto_repeat mode for the entire device is changed and does not affect the per_key settings. If a key is specified without an auto_repeat_mode, a BadMatch error is generated.

© 1995 Hewlett-Packard Development Company, L.P.