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

Grabbing Extended Input Device Keys

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

To passively grab a particular key on an extended input device, use XHPGrabDeviceButton.

int XHPGrabDeviceKey(display, deviceid, keycode, modifiers,
grab_window, owner_events, pointer_mode, device_mode)
Display *display;
XID deviceid;
unsigned int keycode;
unsigned int modifiers;
Window grab_window;
Bool owner_events;
int pointer_mode, device_mode;

Title not available (Grabbing Extended Input Device Keys )

display

Specifies the connection to the X server.

deviceid

Specifies the ID of the desired device.

keycode

Specifies the code of the key that is to be grabbed. You can pass either the button or AnyKey.

modifiers

Specifies the set of keymasks. This mask is the bitwise inclusive OR of these keymask bits: ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, and Mod5Mask. You can also pass AnyModifier, which is equivalent to issuing the grab request for all possible modifier combinations (including the combination of no modifiers).

grab_window

Specifies the ID of a window associated with the device specified above.

owner_events

Specifies a boolean value of either True or False.

pointer_mode

Only the constant GrabModeAsync is currently supported.

device_mode

Only the constant GrabModeAsync is currently supported.

XHPGrabDeviceKey is provided to support the use of input devices other than the X keyboard and the X pointer device. It allows a client to establish passive grab on a button on an extended input device. That device must have previously been opened (turned on) using XHPSetInputDevice.

XHPGrabDeviceKey produces a BadAccess error if some other client has issued a XHPGrabDeviceKey with the same device and button combination on the same window. When using AnyModifier or AnyKey, the request fails completely and the X server generates a BadAccess error and no grabs are established if there is a conflicting grab for any combination.

This function cannot be used to grab a key on the X keyboard device. The core XGrabKey function should be used for that purpose.

XHPGrabDeviceKey can generate BadDevice, BadAccess, BadWindow, and BadValue errors.

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