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

Getting Control Attributes of Extended Input Devices

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

To get the control attributes of an extended input device, use XHPGetDeviceControl.

int XHPGetDeviceControl(display, deviceid, values_return)
Display *display;
XID deviceid;
XHPDeviceState *values_return;

Title not available (Getting 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 queried.

values_return

Specifies a pointer to the XHPDeviceState structure in which the device values will be returned.

XHPGetDeviceControl returns the control attributes of input devices (other than the X keyboard and X pointer devices). The specified device must have previously been opened (turned on) with XHPSetInputDevice.

XHPGetDeviceControl returns the control attributes of the device in the XHPDeviceState structure, which is defined as follows:

typedef struct {
int key_click_percent;
int bell_percent;
unsigned int bell_pitch;
unsigned int bell_duration;
unsigned long led_mask;
int global_auto_repeat;
int accelNumerator;
int accelDenominator;
int threshold;
char auto_repeats[32];
} XHPDeviceState;

For the LEDs, the least significant bit of led_mask corresponds to LED one, and each bit set to 1 in led_mask indicates an LED that is lit. The auto_repeats member is a bit vector. Each bit set to 1 indicates that auto_repeat is enabled for the corresponding key. The vector is represented as 32 bytes. Byte N (counting from zero) contains the bits for keys 8N to 8N+7, with the least significant bit in the byte representing key 8N. The global_auto_repeat member can be set to either AutoRepeatModeOn or AutoRepeatModeOff.

This function generates a BadValue error if the specified device does not exist, was not previously enabled with XHPSetInputDevice, or is the X system pointer or X system keyboard.

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