emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Yuri Khan <yuri.v.khan@gmail.com>
To: Jean-Christophe Helary <jean.christophe.helary@gmail.com>
Cc: Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>,
	Org-mode <emacs-orgmode@gnu.org>
Subject: Re: keybindings again...
Date: Fri, 30 Jun 2017 13:22:56 +0700	[thread overview]
Message-ID: <CAP_d_8V5YQdjT_EjQDJgjJirHMjtc_gHRPnOrUX7eGRohgGv9Q@mail.gmail.com> (raw)
In-Reply-To: <3BA1EFA7-056C-4DD6-8D53-85088F901263@gmail.com>

On Fri, Jun 30, 2017 at 12:10 PM, Jean-Christophe Helary
<jean.christophe.helary@gmail.com> wrote:

>> I'm trying to assign M-S-RET to org-insert-todo-heading because for some reason it is not assigned by default: every time I hit ESC S-RET I get ESC RET only.
>>
>> It's the limitation of the terminal.
>
> Do you mean that Shift is not recognized as a modified key by the terminal ?

A brief recap of terminal limitations, from a guy who has never used a
real hardware terminal.

The protocol by which a terminal passes keystrokes to an application
is that of an ASCII character stream, with only minor extensions
(these days it’s a UTF-8-encoded character stream). It predates the
notion of keyboard as an interactive input device.

In that protocol, there are 32 control characters with codes 0 through
31 (decimal). They are associated with Ctrl+@, Ctrl+A, …, Ctrl+Z,
Ctrl+[, Ctrl+\, Ctrl+], Ctrl+^ and Ctrl+_, and terminals pass these
character codes when these key combinations are pressed, with or
without Shift. Also, there is the control character 127, sometimes
written as Ctrl+?.

Additionally, the most frequent of these control characters have been
given single keys. These are RET = Ctrl+M, TAB = Ctrl+I, ESC = Ctrl+[,
sometimes BS = Ctrl+H, and sometimes DEL = Ctrl+?.

It follows that many terminals emit identical character codes for C-m,
C-M, RET and S-RET; C-i, C-I, TAB and S-TAB; C-[, C-{, ESC and S-ESC;
and C-?, DEL and S-DEL; the application running on the other side
cannot distinguish them.


GUI systems, on the other hand, were developed after keyboards had
been available for many years. Thus, most of they do allow
applications to distinguish any keys with any modifiers.

Some GUI terminal emulators have taken advantage of their GUI nature,
and started passing distinct escape sequences for some key
combinations. For example, Xterm emits ESC [ Z when I press Shift+Tab.

Some GUI terminal emulators also let the user customize which
character sequences they send on which keys.

  parent reply	other threads:[~2017-06-30  6:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-30  2:42 keybindings again Jean-Christophe Helary
2017-06-30  2:51 ` Kaushal Modi
2017-06-30  5:10   ` Jean-Christophe Helary
2017-06-30  5:27     ` Nicolas Goaziou
2017-06-30  7:23       ` Jean-Christophe Helary
2017-06-30 22:08         ` Emanuel Berg
2017-06-30  7:56       ` Jean-Christophe Helary
2017-06-30  8:14         ` Nicolas Goaziou
2017-06-30  8:40           ` Jean-Christophe Helary
2017-06-30  9:56             ` Michael Ax
2017-06-30  5:33     ` Kaushal Modi
2017-06-30  6:17     ` Eli Zaretskii
2017-06-30  7:28       ` Jean-Christophe Helary
2017-06-30  6:22     ` Yuri Khan [this message]
2017-06-30 21:55     ` Emanuel Berg
2017-07-01  0:00       ` Emanuel Berg

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.orgmode.org/

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

  git send-email \
    --in-reply-to=CAP_d_8V5YQdjT_EjQDJgjJirHMjtc_gHRPnOrUX7eGRohgGv9Q@mail.gmail.com \
    --to=yuri.v.khan@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=jean.christophe.helary@gmail.com \
    /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/org-mode.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).