Internally, Emacs records only single events in each keymap. Interpreting a key sequence of multiple events involves a chain of keymaps: the first keymap gives a definition for the first event, which is another keymap, which is used to look up the second event in the sequence, and so on. Thus, a prefix key such as
ESC has its own keymap, which holds the definition for the event that immediately follows that prefix.
The definition of a prefix key is usually the keymap to use for looking up the following event. The definition can also be a Lisp symbol whose function definition is the following keymap; the effect is the same, but it provides a command name for the prefix key that can be used as a description of what the prefix key is for. Thus, the binding of
C-x is the symbol
Control-X-prefix, whose function definition is the keymap for
C-x commands. The definitions of
ESC as prefix keys appear in the global map, so these prefix keys are always available.
Aside from ordinary prefix keys, there is a fictitious “prefix key" which represents the menu bar; see Menu Bar in The Emacs Lisp Reference Manual, for special information about menu bar key bindings. Mouse button events that invoke pop-up menus are also prefix keys; see Menu Keymaps in The Emacs Lisp Reference Manual, for more details.
Some prefix keymaps are stored in variables with names:
ctl-x-mapis the variable name for the map used for characters that follow
help-mapis for characters that follow
esc-mapis for characters that follow
ESC. Thus, all Meta characters are actually defined by this map.
ctl-x-4-mapis for characters that follow
mode-specific-mapis for characters that follow