|
|
HP Xlib Extensions: > Chapter 5 X Input Device Extension FunctionsFocusing Extension Input Devices |
|
To get the focus for an extended input device, use XGetDeviceFocus.
Title not available (Getting Extended Input Device Focus )
The XGetDeviceFocus function returns the focus window and the current focus state. Not all input extensions can be focused. Attempting to query the focus state of a device that can't be focused results in a BadMatch error. A device that can be focused returns information for input class Focus when an XOpenDevice request is made. XGetDeviceFocus can generate BadDevice and BadMatch errors. To set the focus for an extended input device, use XSetDeviceFocus.
Title not available (Setting Extended Input Device Focus )
The XSetDeviceFocus function changes the focus of the specified device and its last-focus-change time. It has no effect if the specified time is earlier than the current last-focus-change time or is later than the current X server time. Otherwise, the last-focus-change time is set to the specified time (CurrentTime is replaced by the current X server time). XSetDeviceFocus causes the X server to generate DeviceFocusIn and DeviceFocusOut events. Depending on the focus argument, the following occurs:
The specified focus window must be viewable at the time XSetDeviceFocus is called, or a BadMatch error results. If the focus window later becomes not viewable, the X server evaluates the revert_to argument to determine the new focus window as follows:
When the focus reverts, the X server generates DeviceFocusIn and DeviceFocusOut events, but the last-focus-change time is not affected. Input extension devices are not required to support the ability to be focused. Attempting to set the focus of a device that does not support this request will result in a BadMatch error. Whether or not the specified device can support this request can be determined by the information returned by XOpenDevice. For those devices that support focus, XOpenDevice will return an XInputClassInfo structure with the input_class field equal to the constant FocusClass (defined in the file XI.h). XSetDeviceFocus can generate BadDevice, BadMatch, BadValue, and BadWindow errors. |
|