The event loop reads all X events received on any of the windows that
Sawfish is aware off. Many of these events invoke hooks, as described
in Standard Hooks. Keyboard and pointer events are translated to
their Lisp equivalents (see Events) and then used to scan all
active keymaps for a binding. If a binding is found, the associated
command is invoked through the
The active keymaps are determined as follows:
override-keymapis non-nil, then this is the only keymap searched
keymapproperty of the currently “clicked” frame part if there is one,
keymapproperty of the currently focused window
Note that for
ButtonRelease events, the frame part’s keymap is
only searched if the pointer is actually within the frame part when the
release event occurs.
If no binding may be found in any of the active keymaps, then the
unbound-key-hook hook is called. This is an
hook—the first function that returns non-nil will terminate the hook
Perform the usual binding lookup for the event object object.
Returns the command found, or
nil if no binding exists.
By default, both key-release events, and events that are bound to modifier keys (e.g. Control_L), are ignored. However, this behavior may be changed:
When non-nil, key events bound to modifier keys are evaluated.
When non-nil, key-release events are evaluated.
While a command is being evaluated, information about the event that caused it may be found:
Return the event which caused the current command to be invoked
Returns the string which the current event would usually insert.
Extract the owning window of the current X event (this is a window
object, or the symbol
root for the root window, or
if there is no window or no event). This is stored internally as the
current event window, and returned.
If the optional argument win is a window, then it will be returned as the current event window.
Return the previous event which occurred.
Send the current X event to window, either a window object, a
numeric window id, or the symbol
root. If a
event the pointer grab will be released first.
Mask may be an integer defining the X event mask to pass to the
XSendEvent function. If not defined, a mask is chosen that would
usually be used to select the type of event being proxied.
Propagate is a flag (
nil) passed directly
to an underlying
XSendEvent call. (And if someone would like
to explain what that means, please do so ...
This is a wrapper for the
XAllowEvents function. The mode
parameter may be one of the following symbols:
Events that have to be grabbed to be received (i.e. all bindings in the
global-keymap and the
window-keymap) are grabbed
synchronously. This means that no more events will be received until
either the command returns, or
allow-events is called.
This is normally not important, but if the command expects to receive
further events it must call
allow-events. See the interactive
move and resize functions for an example.
Cause the next button press to be treated as a single click event, no matter how soon it occurs after the prevous button-press event.
Handle any X events received. If mask is non-nil then only events matching this numeric value are handled (see the X header files for details).
Returns the number of X events waiting to be handled.