[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How does the Meta/Alt-Key work behind the scenes?

From: Thorsten Jolitz
Subject: How does the Meta/Alt-Key work behind the scenes?
Date: Wed, 31 Oct 2012 09:44:01 +0100
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.0.93 (gnu/linux)

Hi List, 

I'm trying to emulate the (most basic) Emacs keybindings for the
commandline of another Lisp dialect. Most of the functionality is
already there, I only have to adopt the keybindings. This works fine
with the 'Control' prefix, e.g. 'C-f' or 'C-b' (I can write them down as
^f and ^b). I can even emulate key-chords by waiting for the second key,
e.g. 'C-x', wait 500, if next key is 'u' -> undo (C-x u).

But I would like to have 'M-f', 'M-b', 'M-d' etc. as well, and maybe
even 'C-M-f' and 'C-M-b'. 

Now, I'm writing this in Emacs/GNUS in a TMUX managed console session, and I
can use my ALT keys for all the 'M-<x>' keybindings given in the last
paragraph, and of course it works in an X11 session too. Even bindings
like 'M-S-5' ('M-%') work on the console. 

However, I was told to hardcode the Meta/Alt-Keybindings as ESC-key
sequences, e.g. '^[', wait 500, then 'f', so that they can either be
used as 'ALT-f' or as 'ESC f'. But only the latter (very uncomfortable)
option works for me, and any keybindings that include the SHIFT key
don't work at all.

How did they do it in Emacs to make the 'M' and 'S' bindings work even
on the console? My keyboard seems to send the right signals, how would
Emacs recognize the keys otherwise - but why do 'M' and 'S' seem to be
dead in my own implementation?

Thanks for any hints. 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]