all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thorsten Jolitz <tjolitz@googlemail.com>
To: help-gnu-emacs@gnu.org
Subject: How does the Meta/Alt-Key work behind the scenes?
Date: Wed, 31 Oct 2012 09:44:01 +0100	[thread overview]
Message-ID: <878vanvxny.fsf@googlemail.com> (raw)


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. 

-- 
cheers,
Thorsten





             reply	other threads:[~2012-10-31  8:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-31  8:44 Thorsten Jolitz [this message]
     [not found] <mailman.12043.1351673061.855.help-gnu-emacs@gnu.org>
2012-10-31 15:02 ` How does the Meta/Alt-Key work behind the scenes? Stefan Monnier
2012-10-31 16:24   ` Thorsten Jolitz
     [not found]   ` <mailman.12074.1351700673.855.help-gnu-emacs@gnu.org>
2012-10-31 16:51     ` William Gardella
2012-10-31 17:43       ` Thorsten Jolitz
2012-10-31 18:00     ` Stefan Monnier
2012-10-31 19:32       ` Thorsten Jolitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878vanvxny.fsf@googlemail.com \
    --to=tjolitz@googlemail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.