GNU Info

Info Node: (efaq)Binding combinations of modifiers and function keys

(efaq)Binding combinations of modifiers and function keys


Next: Meta key does not work in xterm Prev: Compose Character Up: Key bindings
Enter node , (file) or (file)node

How do I bind a combination of modifier key and function key?
=============================================================

   With Emacs 19 and later, you can represent modified function keys in
vector format by adding prefixes to the function key symbol.  For
example (from the on-line documentation):

     (global-set-key [?\C-x right] 'forward-page)

where `?\C-x' is the Lisp character constant for the character `C-x'.

   You can use the modifier keys <Control>, <Meta>, <Hyper>, <Super>,
<Alt>, and <Shift> with function keys.  To represent these modifiers,
prepend the strings `C-', `M-', `H-', `s-', `A-', and `S-' to the
symbol name.  Here is how to make `H-M-RIGHT' move forward a word:

     (global-set-key [H-M-right] 'forward-word)

   * Not all modifiers are permitted in all situations.  <Hyper>,
     <Super>, and <Alt> are not available on Unix character terminals.
     Non-ASCII keys and mouse events (e.g. `C-=' and `Mouse-1') also
     fall under this category.


   Note: Binding keys to commands, for general key binding
instructions.


automatically generated by info2www version 1.2.2.9