Most keyboards also have function keys---keys that have names or
symbols that are not characters. Function keys are represented in Emacs
Lisp as symbols; the symbol's name is the function key's label, in lower
case. For example, pressing a key labeled F1 places the symbol
f1
in the input stream.
The event type of a function key event is the event symbol itself. See section Classifying Events.
Here are a few special cases in the symbol-naming convention for function keys:
backspace
, tab
, newline
, return
, delete
tab
.
Most of the time, it's not useful to distinguish the two. So normally
function-key-map
(see section Translating Input Events) is set up to map
tab
into 9. Thus, a key binding for character code 9 (the
character C-i) also applies to tab
. Likewise for the other
symbols in this group. The function read-char
likewise converts
these events into characters.
In ASCII, BS is really C-h. But backspace
converts into the character code 127 (DEL), not into code 8
(BS). This is what most users prefer.
left
, up
, right
, down
kp-add
, kp-decimal
, kp-divide
, ...
kp-0
, kp-1
, ...
kp-f1
, kp-f2
, kp-f3
, kp-f4
kp-home
, kp-left
, kp-up
, kp-right
, kp-down
home
, left
, ...
kp-prior
, kp-next
, kp-end
, kp-begin
, kp-insert
, kp-delete
You can use the modifier keys ALT, CTRL, HYPER, META, SHIFT, and SUPER with function keys. The way to represent them is with prefixes in the symbol name:
Thus, the symbol for the key F3 with META held down is
M-f3
. When you use more than one prefix, we recommend you
write them in alphabetical order; but the order does not matter in
arguments to the key-binding lookup and modification functions.
Go to the first, previous, next, last section, table of contents.