all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: Terminal and event-apply-control-modifier
Date: Sat, 30 Jun 2018 09:48:54 -0400	[thread overview]
Message-ID: <jwvy3ew4cm4.fsf-monnier+gmane.emacs.help@gnu.org> (raw)
In-Reply-To: CALn3zoiQ_S5LCx8oA4=g0iCEAh3g=fVidFi=862=L462C9Rw9g@mail.gmail.com

> I have an understanding problem with ~event-apply-*-modifier~. Are the
> following differences ~<C-return>~ vs. ~C-RET~ and ~<S-return>~ vs.
> ~RET~ between GUI and terminal intentional?

For the RET key, terminals send the ascii code 13 (which Emacs prints as
"RET" in the context of key bindings), which is also the code for
"control m" (for historical reasons) and hence is also the same as what
the terminal sends when you hit C-m.

In GUI frames, Emacs can tell the difference between "return" and
"control m" on the other hand, and since it can be useful, we
intentionally don't treat those two as one and the same there.
More specifically, on GUI frames, the "return" key sends the
`return` event.

Combining "shift" with an ASCII control char like C-m is tricky
(actually, the shift modifier in general is tricky because we sometimes
want to treat it as a modifier and sometimes we want to simply make it
appear like we hit a different key, as in the difference between `A`
and `S-a`).  The way we do it is probably not completely consistent, but
there's a good chance that "fixing" one case will break another, so we
tend to try and leave that mess alone.


        Stefan




      reply	other threads:[~2018-06-30 13:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-26 13:16 Terminal and event-apply-control-modifier Michael Brand
2018-06-30 13:48 ` Stefan Monnier [this message]

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=jwvy3ew4cm4.fsf-monnier+gmane.emacs.help@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --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.