Next: Default Key Bindings, Up: Keystrokes
All keystrokes exist inside a keymap. When you press the prefix key you are accessing the `root' keymap. By default all commands reside in the `root' key map and are accessed by pressing C-t.
There is also a top level key map, `top'. Any keystroke in this key map can be accessed simply by pressing the key. This is where the prefix key resides.
The following example adds a C-x b key binding to switch windows, much like C-x b in Emacs. See the functions below for full descriptions.
# Create the key map newkmap ctrl-x # Bind b to 'select' on our new key map definekey ctrl-x b select # Attach our keymap to the top level key map via C-x. definekey top C-x readkey ctrl-x
The following functions control creating, editing, and deleting key maps.
Bind a key to a ratpoison command on the `root' keymap. This command takes two arguments: the key to bind and the command to run. For example, to bind C-t R to restart ratpoison:
bind R restart
definekey works exactly like bind except that it can bind keys on any key map (not just `root').
Read a key from the keyboard and execute the command associated with it in the keymap, kmap.
Call the command that key is bound to. For instance link C-t would call the command other and switch to the last window.