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

Setting the Modifier Mapping of Extended Input Devices

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

To change the modifier mapping of an extended input device, use XHPSetDeviceModifierMapping.

int XHPSetDeviceModifierMapping(display, deviceid,
modmap)
Display *display;
XID deviceid;
XModifierKeymap *modmap;

Title not available (Setting the Modifier Mapping of Extended Input Devices)

display

Specifies the connection to the X server.

deviceid

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

modmap

Specifies a pointer to an XModifierKeymap structure.

XHPSetDeviceModifierMapping allows a client program to define the keycodes that are to be used as modifiers for 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.

XHPSetDeviceModifierMapping specifies the KeyCodes of the keys, if any, that are to be used as modifiers for the specified input device. X permits up to eight modifier keys. If more than eight are specified in the XModifierKeymap structure, a BadLength error is generated.

There are eight modifiers, and the modifiermap member of the XModifierKeymap structure contains eight sets of max_keypermod KeyCodes, one for each modifier in the order Shift, Lock, Control, Mod1, Mod2, Mod3, Mod4, and Mod 5. Only nonzero KeyCodes have meaning in each set (zero KeyCodes are ignored). If a nonzero KeyCode is given outside the range specified by min_keycode and max_keycode as returned by XHPListInputDevices, or a KeyCode appears more than once in the entire map, a BadValue error is generated.

An X server can impose restrictions on how modifiers can be changed (for example, if certain keys do not generate up transitions in hardware or if multiple modifier keys are not supported). If such a restriction is violated, the status reply is MappingFailed, and none of the modifiers are changed. If the new KeyCodes specified for a modifier differ from those currently defined and any (current or new) keys for that modifier are in the logically down state, the status reply is MappingBusy, and no modifier is changed. XHPSetDeviceModifierMapping generates a HPDeviceMappingNotify event when it returns MappingSuccess.

XHPSetDeviceModifierMapping can generate BadDevice, BadLength, and BadValue errors.

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