From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.help Subject: Re: Ctrl-[ ? Date: Sat, 08 Jun 2019 23:38:53 +0200 Message-ID: <874l4zoiz6.fsf@telefonica.net> References: <08AC8151-5911-40FA-8B20-818B839D00AB@traduction-libre.org> <86h892nk2g.fsf@zoho.eu> <9379C01B-80E3-49DD-B830-46CED773DC2C@traduction-libre.org> <83lfydrkde.fsf@gnu.org> <874l51q0s4.fsf@telefonica.net> <83ef45rdij.fsf@gnu.org> <87zhmto6fa.fsf@telefonica.net> <20190607163017.GA32029@tuxteam.de> <96B116FC-8007-4C42-9AE6-585530D0C76E@comcast.net> <87muisor2h.fsf@telefonica.net> <63F9D100-CD25-445B-8184-93A25DB0FC38@comcast.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="257835"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jun 08 23:39:41 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hZj3t-0014z8-BJ for geh-help-gnu-emacs@m.gmane.org; Sat, 08 Jun 2019 23:39:41 +0200 Original-Received: from localhost ([::1]:60778 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZj3s-0001Gm-68 for geh-help-gnu-emacs@m.gmane.org; Sat, 08 Jun 2019 17:39:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38613) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZj3L-0001Gd-Ly for help-gnu-emacs@gnu.org; Sat, 08 Jun 2019 17:39:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZj3K-0004RY-JP for help-gnu-emacs@gnu.org; Sat, 08 Jun 2019 17:39:07 -0400 Original-Received: from [195.159.176.226] (port=36150 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hZj3K-0004QG-Bp for help-gnu-emacs@gnu.org; Sat, 08 Jun 2019 17:39:06 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1hZj3H-0014PR-Pm for help-gnu-emacs@gnu.org; Sat, 08 Jun 2019 23:39:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Cancel-Lock: sha1:VO1RQUtB7hktCGBtMyNYqtquCVs= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:120852 Archived-At: Francis Belliveau 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.