chain-to-keymap in keymap%

Multiple keymaps can be chained off one keymap using chain-to-keymap. When keymaps are chained to a main keymap, then events handled by the main keymap are passed to the chained keymaps until a chained keymap handles the events. Keymaps can be chained together in an arbitrary acyclic graph.

Keymap chaining is useful because multiple-event sequences are handled correctly by chained groups. Dispatching each individual event to separate keymaps is problematic without chaining because keymaps may acquire state that must be reset when a callback is invoked in one of the keymaps. This state can be manually cleared with break-sequence, but this also invokes the handler installed by set-break-sequence-callback.