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

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

Re: Ctrl-[ ?


From: Óscar Fuentes
Subject: Re: Ctrl-[ ?
Date: Sat, 08 Jun 2019 23:38:53 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Francis Belliveau <f.belliveau@comcast.net> writes:

[snip]

> However, my development experience is that there are some bindings
> that are at the OS interface level and therefore invisible to the
> application.

That's true, but it is not the case of the keybindings we are discussing
here. For security reasons, the OS does not pass certain keys to
applications (Ctrl+Alt+DEL on MS-Windows, for instance; AFAIK GNU-Linux
is more customizable on this aspect).

[exposition of how ASCII codes work on a terminal elided]

> So what I believe that many of you are complaining about is the
> inability to separate the actions by specialized keys on your keyboard
> from the "control code" that they actually generate.
>
> What I am saying is that if EMACS cannot tell the difference, then it
> cannot provide you with the ability to bind them differently. To fix
> the problem you will need to go deeper into things than just a simple
> key-mapping like what happens when you hit C-z.

GUIs are quite more sophisticated than what you explained. To begin
with, the GUI keyboard handling system does not work on ASCII, but on
key codes. (Since decades ago GUIs are expected to support non-ASCII
keyboards out of the box.) Also, it is possible to detect things such as
pressing the left or right Shift key (without combining it with another
key) or simultaneous presses of "printable" keys.

You can monitor those low-level events. The OS usually provides some
facilities to translate those events to higher level events. I don't
know at which level Emacs works for GUIs, probably the later. But that's
irrelevant, because Emacs can detect equally well C-[ as C-t, because
them come from the exact same mechanism, and no GUI I know of will
intercept a C-something key combination (some desktop environments, such
as KDE, define keybindings that overlap with with Emacs', quite
annoyingly, BTW, but the user is free from removing those KDE
keybindings).

In short, thinking about this issue on terms of ttys is missing the
point, because the key here (pun intended) is, precisely, that GUIs have
a keyboard handling model that has nothing to do with ttys and are not
subject to their limitations.





reply via email to

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