GNU Info

Info Node: (sawfish.info)Events

(sawfish.info)Events


Next: Commands Prev: Popup Menus Up: Top
Enter node , (file) or (file)node

Events
******

   Events refer to input events from X that the window manager receives,
either for the root window, the window frames it creates, or grabbed
from the client windows themselves. Each event induced by the mouse or
keyboard has a Lisp representation.

   Each input event is represented by a cons cell containing two
integers, these integers encode the actual input event. The encoding is
opaque; the only way to access an event meaningfully is via the
functions provided.

 - Function: eventp object
     This function returns `t' if its argument is an input event.

   Each event has a name, a string. This string contains zero or more
modifier descriptions separated by hyphens, and then the name of the
key itself. The standard X modifier names are provided, as well as
three special modifiers <Meta>, <Alt> and <Hyper> that are mapped to
the keysyms of the same name.

   The following table lists the possible modifier prefixes:

`C'
     The control modifier

`M'
     The meta modifier

`A'
     The alt modifier

`S'
     The shift modifier

`H'
     The hyper modifier

`ModK'
     The standard X modifiers, for K between 1 and 5

`ButtonK'
     The K'th mouse button is currently pressed

   Note that the `M' and `A' modifiers are virtual modifiers assigned
dynamically, according to the X server's `xmodmap' configuration. The
`A' virtual modifier is assigned to the X modifier with either the
<Alt_L> or <Alt_R> keysym assigned to it. The `M' virtual modifier is
assigned to the X modifier with either <Meta_L> or <Meta_R> assigned to
it. If either of these two virtual modifiers would be unassigned it is
set identically to the other virtual modifier.

   There are two special modifiers: the `Any' prefix matches any set of
modifiers; the `Release' modifier matches key-release events instead of
the default key-presses.

   Generally keys have the same names as their X keysyms, there are
several specially defined keys:

   `SPC', `TAB', `RET', `ESC', `BS', `DEL', `Up', `Down', `Left',
`Right'.

Also, there are several pseudo-keys for describing mouse events:

   `Click1', `Click2', `Click3', `Off', `Move'.

So, for example, a single click of the left mouse button with the
<Meta> key held would be described as `M-Button1-Click1', while
pressing the <RET> key with <Shift> held would be described as `S-RET'.

   Functions are available to convert between the name of an event and
the actual event itself, and vice versa.

 - Function: lookup-event event-name
     Create and return a new input event whose name is EVENT-NAME.

          (lookup-event "C-x")
              => (120 . 65540)
          
          (lookup-event "C-M-Button1-Click1")
              => (1 . 131340)

 - Function: event-name event
     This function returns a string naming the input event EVENT.

          (event-name (lookup-event "C-x"))
              => "C-x"

   The keysyms generating the two virtual modifiers may be identified
through the following variables:

 - Variable: meta-keysyms
     A list defining the names of the X keysyms generating the virtual
     `M' modifier.

 - Variable: alt-keysyms
     A list defining the names of the X keysyms generating the virtual
     `A' modifier.

 - Variable: hyper-keysyms
     A list defining the names of the X keysyms generating the virtual
     `H' modifier.


automatically generated by info2www version 1.2.2.9