1
XSETDEVICEFOCUS(libmansuffix)
2
=============================
7
XSetDeviceFocus, XGetDeviceFocus - control extension input
13
#include <X11/extensions/XInput.h>
15
XSetDeviceFocus( Display *display,
21
XGetDeviceFocus( Display *display,
24
int *revert_to_return,
30
Specifies the connection to the X server.
33
Specifies the device whose focus is to be queried or
37
Specifies the window, PointerRoot, FollowKeyboard,or
41
Returns the focus window, PointerRoot, FollowKeyboard,or
45
Specifies where the input focus reverts to if the window
46
becomes notviewable.You can pass RevertToParent,
47
RevertToPointerRoot, RevertToFollowKeyboard,or
51
Returns the current focus state RevertToParent,
52
RevertToPointerRoot, RevertToFollowKeyboard,or
56
Returns the last_focus_time for the device.
59
Specifies the time.You can pass either a timestamp or
65
The XSetDeviceFocus request changes the focus of the specified
66
device and its last-focus-change time. It has no effect if the
67
specified time is earlier than the current last-focus-change
68
time or is later than the current X server time. Otherwise, the
69
last-focus-change time is set to the specified time CurrentTime
70
is replaced by the current X server time). XSetDeviceFocus
71
causes the X server to generate DeviceFocusIn and
72
DeviceFocusOut events.
74
Depending on the focus argument, the following occurs:
75
* If focus is None , all device events are discarded until a
76
new focus window is set, and the revert_to argument is
78
* If focus is a window, it becomes the device's focus window.
79
If a generated device event would normally be reported to
80
this window or one of its inferiors, the event is reported
81
as usual. Otherwise, the event is reported relative to the
83
* If focus is PointerRoot, the focus window is dynamically
84
taken to be the root window of whatever screen the pointer
85
is on at each event from the specified device. In this
86
case, the revert_to argument is ignored.
87
* If focus is FollowKeyboard, the focus window is dynamically
88
taken to be the window to which the X keyboard focus is set
91
The specified focus window must be viewable at the time
92
XSetDeviceFocus is called, or a BadMatch error results. If the
93
focus window later becomes not viewable, the X server evaluates
94
the revert_to argument to determine the new focus window as
96
* If revert_to is RevertToParent, the focus reverts to the
97
parent (or the closest viewable ancestor), and the new
98
revert_to value is taken to be RevertToNone.
99
* If revert_to is RevertToPointerRoot,
100
RevertToFollowKeyboard, or RevertToNone, the focus reverts
101
to PointerRoot, FollowKeyboard, or None, respectively.
103
When the focus reverts, the X server generates DeviceFocusIn
104
and DeviceFocusOut events, but the last-focus-change time is
107
Input extension devices are not required to support the ability
108
to be focused. Attempting to set the focus of a device that
109
does not support this request will result in a BadMatch error.
110
Whether or not given device can support this request can be
111
determined by the information returned by XOpenDevice. For
112
those devices that support focus, XOpenDevice will return an
113
XInputClassInfo structure with the input_class field equal to
114
the constant FocusClass (defined in the file XI.h).
116
XSetDeviceFocus can generate BadDevice, BadMatch, BadValue, and
119
The XGetDeviceFocus request returns the focus window and the
122
Not all input extension devices can be focused. Attempting to
123
query the focus state of a device that can't be focused results
124
in a BadMatch error. A device that can be focused returns
125
information for input Class Focus when an XOpenDevice request
128
XGetDeviceFocus can generate BadDevice, and BadMatch errors.
134
An invalid device was specified. The specified device
135
does not exist or has not been opened by this client via
136
XOpenInputDevice. This error may also occur if the
137
specified device is the X keyboard or X pointer device.
140
Some numeric value falls outside the range of values
141
accepted by the request. Unless a specific range is
142
specified for an argument, the full range defined by the
143
argument's type is accepted. Any argument defined as a
144
set of alternatives can generate this error.
147
A value for a Window argument does not name a defined
151
This error may occur if an XGetDeviceFocus or
152
XSetDeviceFocus request was made specifying a device
153
that the server implementation does not allow to be