# Keyboard Binding Commands

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## KEYBOARD BINDING COMMANDS

Keyboard binding allows key strokes to be associated with commands and macros such that when a bound key stroke sequence is recognized its associated (or bound) command is invoked, thereby controlling the editor. A set of Default Bindings exist for MicroEmacs which may be altered using the binding commands. There are three types of key bindings:

Global

Associates a key-stroke with a command for all buffers. Used to establish the standard keyboard controls i.e. cursor movement, search, replace etc.

Local

Associates a key-stroke with a command for a specified buffer only, i.e. a binding local to the buffer. Local bindings allow macro accelerators to be bound to keys without affecting other buffers containing different types of data. Local bindings are used extensively in the buffer hook commands.

Message Line

Associates a key binding for use on the command line only, allowing command completion to be diverted etc.

To bind a command to a key, the command and key names must be known, see Command Glossary for a complete list of commands and Key Names for a complete list of key names.

The binding related commands are defined as follows:

## Commands

buffer-bind-key(2) Create local key binding for current buffer
buffer-unbind-key(2) Remove local key binding for current buffer
command-apropos(2) (C-h a) List commands involving a concept
describe-bindings(2) (C-h b) Show current command/key binding
describe-key(2) (C-x ?) Report keyboard key name and binding
expand-iso-accents(3) Expand an ISO accent
global-bind-key(2) (esc k) Bind a key to a named command or macro
global-unbind-key(2) (esc C-k) Unbind a key from a named command or macro
iso-accents-mode(3) ISO accent expansion short-cut mode
ml-bind-key(2) Create key binding for message line
ml-unbind-key(2) Remove key binding from message line
osd-bind-key(2) Create key binding for OSD dialog
osd-unbind-key(2) Remove key binding from OSD dialog
set-char-mask(2) Set character word mask
translate-key(2) Translate key

## Variables

## Alt Key

The Alt Key has special binding priorities defined as follows:-

- Direct key binding (e.g. A-b executes file-browser)
- Main menu hot key (e.g. A-f opens the File menu)
- Meta key binding (e.g. A-space -> esc space -> set-mark)

If the `ALT` key is to be used strictly as the Emacs Meta key then the bindings for the menu should be over-ridden by Direct Key Bindings from the user configuration file i.e. to re-map the default MicroEmacs Alt key to equivalent `esc` keys then the following keys should be re-bound.

    global-bind-key forward-word "A-f"      ; Over-ride File menu binding
    :                                       ; For all of the other menu items.
    :
    global-bind-key backward-word "A-b"     ; Over-ride the file browser.
    global-bind-key replace-string "A-r"    ; Over-ride tools binding.

This creates a higher priority binding which overrides the underlying default. The commands that are displaced would have to be re-bound to different keys if required.

(c) Copyright JASSPA 2009
Last Modified: 2009/10/12
Generated On: 2009/10/12

</HMTL>