From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alexandre Garreau Newsgroups: gmane.emacs.devel Subject: Re: [External] : New key binding syntax Date: Thu, 18 Nov 2021 16:32:46 +0100 Message-ID: <2280585.9P59HiE1Uh@galex-713.eu> References: <20211004081724.6281.11798@vcs0.savannah.gnu.org> <4371985.yOQEpiRy8s@galex-713.eu> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1214"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Drew Adams , Stefan Kangas , Richard Stallman , Yuri Khan To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 18 16:35:55 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mnjS7-0000AV-Ce for ged-emacs-devel@m.gmane-mx.org; Thu, 18 Nov 2021 16:35:55 +0100 Original-Received: from localhost ([::1]:38614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mnjS5-0002Fy-Ix for ged-emacs-devel@m.gmane-mx.org; Thu, 18 Nov 2021 10:35:53 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnjPI-0000RE-Su for emacs-devel@gnu.org; Thu, 18 Nov 2021 10:33:00 -0500 Original-Received: from [2a00:5884:8305::1] (port=50324 helo=galex-713.eu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnjPG-0006iD-Iy; Thu, 18 Nov 2021 10:32:59 -0500 Original-Received: from gal by galex-713.eu with local (Exim 4.92) (envelope-from ) id 1mnjP5-0003Xs-9l; Thu, 18 Nov 2021 16:32:47 +0100 In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:5884:8305::1 (failed) Received-SPF: pass client-ip=2a00:5884:8305::1; envelope-from=galex-713@galex-713.eu; helo=galex-713.eu X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, RDNS_NONE=0.793, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:279681 Archived-At: Le jeudi 18 novembre 2021, 15:59:28 CET Yuri Khan a =C3=A9crit : > On Thu, 18 Nov 2021 at 21:36, Alexandre Garreau = =20 wrote: > > > Keys are not ASCII characters. > >=20 > > They can be related. You could set up a keymap layout where each key > > is capital, and pressing shift makes them lowercase, at the opposite > > of the normal working, or even something more weird. >=20 > Hey, millions of people I=E2=80=99d say millions if it was less than 10 millions, here I=E2=80=99d = rather say=20 hundreds of millions, or tenths of billion > deal daily with layouts where pressing the key > Q yields the character =D0=B9. Then it=E2=80=99s the key =D0=99, not the key Q. Qwerty is not in any way = =E2=80=9Cmore basic=E2=80=9D=20 or =E2=80=9Cmore low level=E2=80=9D than =D0=99=D1=86=D1=83=D0=BA=D0=B5=D0= =BD. What=E2=80=99s lower level are scancode=20 (arbitrary numbers, depending of position on keyboard + whether it=E2=80=99= s=20 pressed or released + history), translated to keycodes (not depending of=20 whether it=E2=80=99s pressed or released, used by keymap layouts definition= s),=20 translated, by a given keyboard layout (be it US qwerty, US dvorak,=20 programmer dvorak, standard russian =D0=B9=D1=86=D1=83=D0=BA=D0=B5=D0=BD=D0= =BF, polyglot reactionary =D0=B9=D1=86=D1=83=D0=BA=D0=B5=D0=BD=20 (what I use), french azerty, belgian azerty, french b=C3=A9po, german qwert= z,=20 swiss qwertz, etc.) to keysyms (which *are* characters, such as Q or =D0=99= ,=20 most of the time, but also can be other actions such as XF86AudioPlay) > In Emacs, one has to mess with > function-key-map so =D0=B9 translates to q which buries Dired. What about quail? Imho, when you are too often used to use a non-latin layout, using an=20 input-method may be useful, as these will translate keys to write text,=20 but not to enter keybindings > In an ideal > world, Dired would bind not the character q but the key Q, and it > would just work no matter the layout. You cannot do that. There is no =E2=80=9Ckey Q=E2=80=9D independent from a= character,=20 whatever the layout is. So either you would use quail and/or input-method= =20 to parametrize how emacs would translate keys, either (and that has been=20 stated as desirable but complex in the past) emacs would use lower-level=20 functions of terminal/X (just as, say, i3wm does) to use keycodes=E2=80=A6 = which=20 are *not* related to keys, hence are by default not related to letters/ characters, but only to a position on keyboard, so they *cannot* be=20 mnemonic just as emacs does by default=E2=80=A6 or then, you would have to= =20 *choose* manually one layout to take your key positions from, and=20 translate keysyms to keycodes=E2=80=A6 which is pretty unusual and esoteric= , but=20 could be done as well from a keymap layout definition (find yours in=20 something such as /usr/share/X11/xkb/symbols/ru)