HPlogo HP Xlib Extensions: > Chapter 5 X Input Device Extension Functions

Changing the Core X Devices

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

Changing the X Keyboard Device

To change the X keyboard device, use XChangeKeyboardDevice.

Status XChangeKeyboardDevice(display, device)
Display *display;
XDevice *device;

Title not available (Changing the X Keyboard Device )

display

Specifies the connection to the X server.

device

Specifies the device to be used as the X keyboard.

The XChangeKeyboardDevice function causes the server to use the specified device as the X keyboard. The server implementation must support focusing of the new device, or a BadDevice error will be returned. Whether or not a given device can be focused can be determined by examining the information returned by the XOpenDevice request. For those devices that can be focused, XOpenDevice will return an XInputClassInfo structure with the input_class field equal to the constant FocusClass (defined in the file XI.h).

If the specified device is grabbed by another client, AlreadyGrabbed is returned. If the specified device is frozen by a grab on another device, GrabFrozen is returned. If the request is successful, Success is returned.

A ChangeDeviceNotify event is sent to all clients that have selected that event. A MappingNotify event with request = MappingKeyboard is sent to all clients. The specified device becomes the X keyboard and the old X keyboard becomes accessible through the input extension protocol requests.

XChangeKeyboardDevice can generate a BadDevice or a BadMatch error.

Changing the X Pointer Device

To change the X pointer device, use XChangePointerDevice.

Status XChangePointerDevice(display, device, xaxis, yaxis)
Display *display;
XDevice *device;
int xaxis;
int yaxis;

Title not available (Changing the X Pointer Device )

display

Specifies the connection to the X server.

device

Specifies the device to be used as the X pointer.

xaxis

Specifies the axis of the device to be used as the X pointer x-axis.

yaxis

Specifies the axis of the device to be used as the X pointer y-axis.

The XChangePointerDevice function causes the server to use the specified device as the X pointer.

If the specified device is grabbed by another client, AlreadyGrabbed is returned. If the specified device is frozen by a grab on another device, GrabFrozen is returned. If the request is successful, Success is returned.

A ChangeDeviceNotify event is sent to all clients that have selected that event. A MappingNotify event with request = MappingPointer is sent to all clients. The specified device becomes the X pointer, and the old X pointer becomes accessible through the input extension protocol requests.

XChangePointerDevice can generate BadDevice and BadMatch errors.

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