(lemacs.info)Representing Keystrokes

Next: Key Sequences Prev: Intro to Keystrokes Up: Keystrokes

Representing Keystrokes

   Lucid Emacs represents keystrokes as lists. Each list consists of an
arbitrary combination of modifiers followed by a single keysym at the
end of the list.  If the keysym corresponds to an ASCII character, you
can use its character code.  (A keystroke may also be represented by an
event object, as returned by the `read-key-sequence' function;
non-programmers need not worry about this.)

   The following table gives some examples of how to list
representations for keystrokes.  Each list consists of sets of
modifiers followed by keysyms:

`(control a)'
     Pressing CTRL and `a' simultaneously.

`(control ?a)'
     Another way of writing the keystroke `C-a'.

`(control 65)'
     Yet another way of writing the keystroke `C-a'.

     Pressing the BREAK key.

`(control meta button2up)'
     Release the middle mouse button, while pressing CTRL and META.
Note: As you define keystrokes, you can use the `shift' key only as a
modifier with characters that do not have a second keysym on the same
key, such as `backspace' and `tab'.  It is an error to define a
keystroke using the shift modifier with keysyms such as `a' and `='.
The correct forms are `A' and `+'.

automatically generated by info2www