XAllowDeviceEvents.txt revision 37eb1ca1
1c27c18e8SmrgXALLOWDEVICEEVENTS(libmansuffix)
2c27c18e8Smrg================================
3c27c18e8Smrg
4c27c18e8SmrgNAME
5c27c18e8Smrg----
6c27c18e8Smrg
7c27c18e8Smrg   XAllowDeviceEvents - release queued events
8c27c18e8Smrg
9c27c18e8SmrgSYNOPSIS
10c27c18e8Smrg------
11c27c18e8Smrg
12c27c18e8Smrg   #include <X11/extensions/XInput.h>
13c27c18e8Smrg
14c27c18e8Smrg   int XAllowDeviceEvents( Display *display,
15c27c18e8Smrg                           XDevice *device,
16c27c18e8Smrg                           int event_mode,
17c27c18e8Smrg                           Time time);
18c27c18e8Smrg   display
19c27c18e8Smrg          Specifies the connection to the X server.
20c27c18e8Smrg
21c27c18e8Smrg   device
22c27c18e8Smrg          Specifies the device from which events are to be
23c27c18e8Smrg          allowed.
24c27c18e8Smrg
25c27c18e8Smrg   event_mode
26c27c18e8Smrg          Specifies the event mode.You can pass AsyncThisDevice,
27c27c18e8Smrg          SyncThisDevice, ReplayThisDevice, AsyncOtherDevices,
28c27c18e8Smrg          SyncAll,or AsyncAll.
29c27c18e8Smrg
30c27c18e8Smrg   time
31c27c18e8Smrg          Specifies the time.You can pass either a timestamp or
32c27c18e8Smrg          CurrentTime.
33c27c18e8Smrg
34c27c18e8SmrgDESCRIPTION
35c27c18e8Smrg-----------
36c27c18e8Smrg
3737eb1ca1SmrgThe XAllowDeviceEvents function releases some queued events if
3837eb1ca1Smrgthe client has caused a device to freeze. It has no effect if
3937eb1ca1Smrgthe specified time is earlier than the last-grab time of the
4037eb1ca1Smrgmost recent active grab for the client and device, or if the
4137eb1ca1Smrgspecified time is later than the current X server time.
42c27c18e8Smrg
4337eb1ca1SmrgThe following describes the processing that occurs depending on
4437eb1ca1Smrgwhat constant you pass to the event_mode argument.
45c27c18e8Smrg
4637eb1ca1Smrg   * AsyncThisDevice - If the specified device is frozen by the
47c27c18e8Smrg   client, event processing for that device continues as usual. If
48c27c18e8Smrg   the device is frozen multiple times by the client on behalf of
49c27c18e8Smrg   multiple separate grabs, AsyncThisDevice thaws for
50c27c18e8Smrg   all.AsyncThisDevice has no effect if the specified device is
51c27c18e8Smrg   not frozen by the client, but the device need not be grabbed by
52c27c18e8Smrg   the client.
53c27c18e8Smrg
5437eb1ca1Smrg   * SyncThisDevice - If the specified device is frozen and actively
55c27c18e8Smrg   grabbed by the client, event processing for that device
56c27c18e8Smrg   continues normally until the next key or button event is
57c27c18e8Smrg   reported to the client. At this time, the specified device
58c27c18e8Smrg   again appears to freeze. However, if the reported event causes
59c27c18e8Smrg   the grab to be released, the specified device does not freeze.
60c27c18e8Smrg   SyncThisDevice has no effect if the specified device is not
61c27c18e8Smrg   frozen by the client or is not grabbed by the client.
62c27c18e8Smrg
6337eb1ca1Smrg   * ReplayThisDevice - If the specified device is actively grabbed by
64c27c18e8Smrg   the client and is frozen as the result of an event having been
65c27c18e8Smrg   sent to the client (either from the activation of a
66c27c18e8Smrg   GrabDeviceButton or from a previous AllowDeviceEvents with mode
67c27c18e8Smrg   SyncThisDevice, but not from a GrabDevice), the grab is
68c27c18e8Smrg   released and that event is completely reprocessed. This time,
69c27c18e8Smrg   however, the request ignores any passive grabs at or above
70c27c18e8Smrg   (toward the root) that the grab-window of the grab just
71c27c18e8Smrg   released. The request has no effect if the specified device is
72c27c18e8Smrg   not grabbed by the client or if it is not frozen as the result
73c27c18e8Smrg   of an event.
74c27c18e8Smrg
7537eb1ca1Smrg   * AsyncOtherDevices - If the remaining devices are frozen by the
76c27c18e8Smrg   client, event processing for them continues as usual. If the
77c27c18e8Smrg   other devices are frozen multiple times by the client on behalf
78c27c18e8Smrg   of multiple grabs, AsyncOtherDevices "thaws" for all.
79c27c18e8Smrg   AsyncOtherDevices has no effect if the devices are not frozen
80c27c18e8Smrg   by the client.
81c27c18e8Smrg
8237eb1ca1Smrg   * SyncAll - If all devices are frozen by the client, event
83c27c18e8Smrg   processing (for all devices) continues normally until the next
84c27c18e8Smrg   button or key event is reported to the client for a grabbed
85c27c18e8Smrg   device, at which time all devices again appear to freeze.
86c27c18e8Smrg   However, if the reported event causes the grab to be released,
87c27c18e8Smrg   then the devices do not freeze. If any device is still grabbed,
88c27c18e8Smrg   then a subsequent event for it will still cause all devices to
89c27c18e8Smrg   freeze. SyncAll has no effect unless all devices are frozen by
90c27c18e8Smrg   the client. If any device is frozen twice by the client on
91c27c18e8Smrg   behalf of two separate grabs, SyncAll thaws for both. A
92c27c18e8Smrg   subsequent freeze for SyncAll will only freeze each device
93c27c18e8Smrg   once.
94c27c18e8Smrg
9537eb1ca1Smrg   * AsyncAll - If all devices are frozen by the client, event
96c27c18e8Smrg   processing for all devices continues normally. If any device is
97c27c18e8Smrg   frozen multiple times by the client on behalf of multiple
98c27c18e8Smrg   separate grabs, AsyncAll thaws for all. AsyncAll has no effect
99c27c18e8Smrg   unless all devices are frozen by the client.
100c27c18e8Smrg
10137eb1ca1SmrgAsyncThisDevice, SyncThisDevice, and ReplayThisDevice have no
10237eb1ca1Smrgeffect on the processing of events from the remaining
10337eb1ca1Smrgdevices.AsyncOtherDevices has no effect on the processing of
10437eb1ca1Smrgevents from the specified device. When the event_mode is
10537eb1ca1SmrgSyncAll or AsyncAll, the device parameter is ignored.
10637eb1ca1Smrg
10737eb1ca1SmrgIt is possible for several grabs of different devices by the
10837eb1ca1Smrgsame or different clients to be active simultaneously. If a
10937eb1ca1Smrgdevice is frozen on behalf of any grab, no event processing is
11037eb1ca1Smrgperformed for the device. It is possible for a single device to
11137eb1ca1Smrgbe frozen because of several grabs. In this case, the freeze
11237eb1ca1Smrgmust be released on behalf of each grab before events can again
11337eb1ca1Smrgbe processed.
11437eb1ca1Smrg
11537eb1ca1SmrgXAllowDeviceEvents can generate a BadDevice or BadValue error.
116c27c18e8Smrg
117c27c18e8SmrgDIAGNOSTICS
118c27c18e8Smrg-------------
119c27c18e8Smrg
120c27c18e8Smrg   BadDevice
121c27c18e8Smrg          An invalid device was specified. The specified device
122c27c18e8Smrg          does not exist or has not been opened by this client via
123c27c18e8Smrg          XOpenInputDevice. This error may also occur if the
124c27c18e8Smrg          specified device is the X keyboard or X pointer device.
125c27c18e8Smrg
126c27c18e8Smrg   BadValue
127c27c18e8Smrg          An invalid mode was specified on the request.
128c27c18e8Smrg
129c27c18e8SmrgSEE ALSO
130c27c18e8Smrg--------
131c27c18e8Smrg
132c27c18e8Smrg   XGrabDevice(libmansuffix)
133c27c18e8Smrg
134