unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan <monnier@iro.umontreal.ca>
Cc: help-gnu-emacs@gnu.org, Kai Grossjohann <kai@emptydomain.de>,
	Emacs-Devel <emacs-devel@gnu.org>,
	bug-gnu-emacs@gnu.org, rms@gnu.org
Subject: Re: read-key-sequence(-vector) on Shift left/right gives[left]/[right], not [S-left]/[S-right] ?
Date: Tue, 07 Sep 2004 10:47:16 -0400	[thread overview]
Message-ID: <m1r7pe16wg.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <FDELKNEBLPKKDCEBEJCBCEECCHAA.drew.adams@oracle.com> (Drew Adams's message of "Tue, 7 Sep 2004 07:32:50 -0700")

> 3) The Emacs manual says, in node Window Handling Convenience Features and
> Customization: "Not all terminals support shifted arrow keys".  Without
> knowing that the read-key-* functions drop the shift modifier if that key
> sequence is currently unbound, someone could easily think that the terminal
> just doesn't support shifted arrow keys.  Convenience or confusion?

Under X11, if I do C-h k S-up, I get a hel buffer that starts with:

   <up> (translated from <S-up>) runs the command previous-line

so it tells you right there.  But it admittedly, doesn't show you that S-up
intermediate step when running on a terminal (and it doesn't show you the
ESC sequence either because RMS thought it would be confusing).

> 4) Is this really a good thing, anyway? If I want a command that reads key
> sequences, should I really have to pre-bind (and later unbind, to clean up)
> such "exceptional" keys, just to be able to read the input key sequence
> correctly (to see what the user pressed)? At the least, shouldn't there be
> an option in read-key-sequence and read-key-sequence-vector to _not_ ignore
> the shift modifier?

Read-key-sequence does not return "what the user pressed", because of things
like function-key-map, key-translation-map, input-methods, events and
modifiers dropped, ... and also because it has to decide "when is it
finished" and it does that based on the currently active keymaps.

If you want to see what the user presses, try something like read-event
or this-command-keys.  But on a terminal, this will not tell you S-up
either, instead you'll get the ESC sequence.

> 5) What does key binding have to do with reading key input? Shouldn't code
> be able to read user input without paying attention to key bindings (and
> whether or not keys are bound)?

When do you stop?  After one key, two keys, three?


        Stefan

  reply	other threads:[~2004-09-07 14:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-07  0:02 read-key-sequence(-vector) on Shift left/right gives [left]/[right], not [S-left]/[S-right] ? Drew Adams
2004-09-07 11:55 ` Kai Grossjohann
2004-09-07 14:32   ` read-key-sequence(-vector) on Shift left/right gives[left]/[right], " Drew Adams
2004-09-07 14:47     ` Stefan [this message]
2004-09-07 15:47       ` Drew Adams
2004-09-08  0:22     ` Richard Stallman
2004-09-08  0:47       ` Drew Adams

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=m1r7pe16wg.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=kai@emptydomain.de \
    --cc=rms@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).