help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Terminal and event-apply-control-modifier


From: Stefan Monnier
Subject: Re: Terminal and event-apply-control-modifier
Date: Sat, 30 Jun 2018 09:48:54 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> 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 via email to

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