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

Changing the Key Mapping of Extended Input Devices

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

To change the key mapping of an extended input device, use XHPChangeDeviceKeyMapping.

int XHPChangeDeviceKeyMapping(display, deviceid,
first_keycode, keysyms_per_keycode, keysyms, num_codes)
Display *display;
XID deviceid;
int first_keycode;
int keysyms_per_keycode;
KeySyms *keysyms;
int num_codes;

Title not available (Changing the Key Mapping of Extended Input Devices)

display

Specifies the connection to the X server.

deviceid

Specifies the ID of the device whose key map is to be changed.

first_keycode

Specifies the first keycode that is to be changed.

keysyms_per_keycode

Specifies the number of keysyms per keycode.

keysyms

Specifies a pointer to an array of keysyms that are to be used.

num_codes

Specifies the number of keycodes that are to be changed. XHPDeviceState structure in which the device values will be returned.

XHPChangeDeviceKeyMapping allows a client program to define the key symbols for the keycodes generated by an extended input device (other than the X keyboard and X pointer devices). The specified device must have previously been opened (turned on) with XHPSetInputDevice.

Starting with first_keycode, XHPChangeDeviceKeyMapping defines the symbols for the specified number of keycodes. The symbols for keycodes outside this range remain unchanged. The number of elements must be: num\\_codes * keysyms\\_per\\_keycode. (Otherwise, a BadLength error is generated.)

The specified first_keycode must be greater than or equal to min_keycode as reported by the XHPListInputDevices request. Also, max_keycode must be greater than first_keycode + (num_codes / keysyms_per_keycode) - 1. If either of these conditions is not met, the function returns a BadValue error.

KeySym number N (counting from zero) for KeyCode K has the following index in keysyms:

(K - first_keycode) * keysyms_per_keycode + N.

The specified keysyms_per_keycode can be chosen arbitrarily by the client to be large enough to hold all desired symbols. A special KeySym value of NoSymbol should be used to fill in unused elements for individual KeyCodes. NoSymbol may appear in nontrailing positions of the effective list for a KeyCode. XHPChangeDeviceKeyMapping generates a MappingNotify event.

There is no requirement that the X server interpret this mapping. It is merely stored for reading and writing by clients.

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