CLX provides the grab-keyboard and ungrab-keyboard functions for actively grabbing and releasing control of the keyboard.
If true, all client windows receive keyboard input normally.
Indicates whether the pointer is in synchronous or asynchronous mode.
Indicates whether the keyboard is in synchronous or asynchronous mode.
Actively grabs control of the keyboard. Further key events are reported only to the grabbing client. The request overrides any active keyboard grab by this client. grab-keyboard generates :focus-in and :focus-out events.
If :owner-p is nil, all generated key events are reported with respect to window. If :owner-p is true, then a generated key event that would normally be reported to this client is reported normally; otherwise the event is reported with respect to the window. Both :key-press and :key-release events are always reported, independent of any event selection made by the client.
If :sync-keyboard-p is nil, keyboard event processing continues normally (asynchronously); if the keyboard is currently frozen by this client, then processing of keyboard events is resumed. If :sync-keyboard-p is true, the keyboard (as seen via the protocol) appears to freeze, and no further keyboard events are generated by the server until the grabbing client issues a releasing allow-events request. Actual keyboard changes are not lost while the keyboard is frozen; they are simply queued for later processing.
If :sync-pointer-p is nil, pointer event processing is unaffected by activation of the grab. If :sync-pointer-p is true, the pointer (as seen via the protocol) appears to freeze, and no further pointer events are generated by the server until the grabbing client issues a releasing allow-events request. Actual pointer changes are not lost while the pointer is frozen; they are simply queued for later processing.
The grab can fail with a status of:
One of :already-grabbed, :frozen, :invalid-time, :not-viewable, or :success.
Releases the keyboard if this client has it actively grabbed (from either grab-keyboard or grab-key), and releases any queued events. The request has no effect if the specified time is earlier than the last-keyboard-grab time or is later than the current server time. An ungrab-keyboard is performed automatically if the event window for an active keyboard grab becomes not viewable.