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

Getting the Key Mapping of Extended Input Devices

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

To get the key mapping of an extended input device, use XHPGetDeviceKeyMapping.

KeySym *XHPGetDeviceKeyMapping(display, deviceid,
first_keycode_wanted, keycode_count, keysyms_per_keycode_return)
Display *display;
XID deviceid;
KeyCode first_keycode_wanted;
int keycode_count;
int *keysyms_per_keycode_return;

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

display

Specifies the connection to the X server.

deviceid

Specifies the ID of the device whose keymap is to be returned.

first_keycode_wanted

Specifies the first keycode to be returned.

keycode_count

Specifies the number of keycodes that are to be returned.

keysyms_per_keycode_return

Specifies the number of keysyms per keycode.

XHPGetDeviceKeyMapping allows a client program to read and use 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_wanted, XHPGetDeviceKeyMapping returns the symbols for the specified number of KeyCodes. The specified first_keycode counted must be greater than or equal to min_keycode as reported by the XHPListInputDevices request. Also, max_keycode must be greater than first_keycode + keycode_count - 1. If either of these conditions is not met, the function returns a BadValue error. The number of elements in the KeySyms list is:

keycode_count * keysyms_per_code + N.

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

(K - first_keycode_wanted) * keysyms_per_keycode_return + N.

The specified keysyms_per_keycode_return can be chosen arbitrarily by the client to be large enough to hold all desired symbols. Using the special KeySym value of NoSymbol fills in unused elements for individual KeyCodes.

Use XFree to free the returned KeySym list when it is no longer needed.

XHPGetDeviceKeyMapping can generate BadDevice and BadValue errors.

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