Go to the first, previous, next, last section, table of contents.


Types of Keymap

There are two different types of keymap; one for keymaps which contain only a few bindings, the other providing a more efficient method of storing larger numbers of bindings.

Key lists
These are used for keymaps which only contain a few bindings; they are lists whose first element is the symbol keymap. All subsequent elements define bindings, they are represented by three-element vectors. The first two are the contents of the cons cell representing the input event, the other element is the command to be invoked. For example,
(keymap [120 9 some-command])
Since the event (120 . 9) is the key press Ctrl-x, this keymap binds the command some-command to the key press Ctrl-x.
Key tables
Key tables are used for keymaps which contain a larger number of bindings. They are vectors of 127 elements, a hash function is used to hash each event contained in the keymap into one of the 127 buckets. Each bucket is a list of key bindings in the same form as a key list (but without the keymap symbol).


Go to the first, previous, next, last section, table of contents.