From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: Physical keyboard events Date: Tue, 05 Nov 2024 09:31:14 +0800 Message-ID: <87wmhiihzx.fsf@yahoo.com> References: <31bdc55d-8c13-4de0-9cef-bd6cc4fb033f@imayhem.com> <19ab52d0-88bd-4378-8fa8-8603e01233e3@imayhem.com> <871pzrl4sn.fsf@yahoo.com> <87o72vjk1f.fsf@yahoo.com> <86fro7uo6h.fsf@gnu.org> <87bjyvjdk2.fsf@yahoo.com> <867c9juetb.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10077"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: cpardo@imayhem.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 05 02:32:12 2024 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 1t88QW-0002WB-HP for ged-emacs-devel@m.gmane-mx.org; Tue, 05 Nov 2024 02:32:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t88Po-0005eZ-Qz; Mon, 04 Nov 2024 20:31:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t88Pn-0005eO-Au for emacs-devel@gnu.org; Mon, 04 Nov 2024 20:31:27 -0500 Original-Received: from sonic316-21.consmr.mail.ne1.yahoo.com ([66.163.187.147]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t88Pl-0005Rq-2V for emacs-devel@gnu.org; Mon, 04 Nov 2024 20:31:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1730770282; bh=vLB2j1FVtc2bE6r1UyN8ad+jXvsvWQ4BqeSyG8dc4hg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=Ocmwn/XGTWMbxttzPTUcSsLSdnQeCr5AGAryvFjDBLR5HRH41A6o3sD7FuvVsxFNeWECSLPEeJTaGnYyPih52J12LLwmECgwm0wS7/YmQ0ZF//VXU8Nndl0tZzffOaAqavVSsOF+NXUv3u0eGnpH7KL7CdKUW2yeyz75O8lo0QnEIgHQR8RUa4YnY8//Puguj/6C5Nex6KhK+Yed+DVEpmIDpeE9V8RYavzqgOFkgS9pxyzXQM/WRVsbJ1+iv9g7uw6Bi3vr8UQyb9oCcrejSeqsuWROPkWkY2JoEqPeGAGtZhi3eVH5OP6I/c+zxad7NswpYQSsResohmJ/CGAJGA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1730770282; bh=eKudABIwjwhW+mIoJqKeFYU/Uo+FOFK1IEMeq4a4NYm=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=lg1G97E+LWwUhcpwZkP6cDAJJEge3yAc7cTvt3+aJxKGGs6As1z8mOtQs9o0WyCqraZe2XJNVzzLHSdWyFycGtnR9uzYD+7M9NDSQtKUhhzscWtp3GkjZFjaczGEVt3zS2cNwkya+udgp9t9OA+5HVh48NvnajIyNf9uXyGMbiHXYsN8mk4Cqt0DqAVj4EMKgaVjf04kQo0WUJGYz4mHLLzNMv5iAnvzkipM1ntWNOUQjJrjTiVTmC5LaJRClqa8yyDKgAryGmxU9JG4Aog6Zjxj3QAQcllvI2OsxKBjydUGA7Db3u8Pz0RkjxJo7ItnFiH0D+/cqoT+2NUfT0m0tQ== X-YMail-OSG: Y_q1SyUVM1n5IoQ807jjqp.bpYXecXsSuDDEoJbNMqGdRm1w4qhnk7hsPVw4VzK MhC1ApDyOpGau81FmJ9Ka5jeHSuyEkOiBZC55JbTY_PR0wIlkLgdx9qJnXMacAkwR196tLBI0mLg V_PhgiyWWDjVKDmTY95oZG0CSjrKSuqa1INATc3KpE3UsV0EdjsCdMcm1eG_qQxLAwUzq5UAg2n9 CqJvrXKjo5toqqNepqqaBOoSeWHw7a_VzZqgft18Mhw_BJ_qbz_B0da40oBIOwVojzBMGbohD9CU 2PXH7YIhwq6qaQIRbkhSkKfeZixsWISvbaiXxRsnTrjsd50MVJxWJjTt_myfVNAiyKMR_FPQUU5M skIorpiSGlL9eBF6GnkUElbwn0mqpPZOgY_SyXi.lPFwU5mUBqp.YsmsBy9Z9pxKAbfe82oEp08z WUv8L3mqtGIaGiuIK7YmcaogIst8korKJKa6c82R9KiRPJ.ug0Adu6VY2xZ3resu9jACeLn9aJJn uge.Yrs9k4yh5Hlk7Vh2ux9QvYQ1PS_awp4RJA0HYaGQ2.nuFLP6mzGoDQMyk33DE9bVfRO2fAGw dU46k4WIYhZTR160fQkOFJI2qhitkgstzJAeCNQ1pdqmhLMNA9uvqdEbC2yynwNz.ALmyfosa4_s 02CSQ4XfxNoT8618C4Q3XAdwVW.jfwioukxoKEYyaM7Q9OrtR05ayRy.4wQe2Tdme1PbDSSuCC_N fr6xC3RY6zX.iwkmPjrUyLtOySFj7jBiwahPeKrSVL8bLQ1dcAEHBNxBPE6oBk3uHs3GXTmNyQBo XHX_af2fIKN.ub7j5UJvIvZFPc6l3jQT9W1apT3W8d X-Sonic-MF: X-Sonic-ID: 2bb513b8-e995-4579-ac8a-7d070e6ec4b2 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.ne1.yahoo.com with HTTP; Tue, 5 Nov 2024 01:31:22 +0000 Original-Received: by hermes--production-sg3-5b7954b588-f8smd (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 515624c705c5e5af59ce8dd3a78a03df; Tue, 05 Nov 2024 01:31:18 +0000 (UTC) In-Reply-To: <867c9juetb.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 04 Nov 2024 18:46:56 +0200") X-Mailer: WebService/1.1.22806 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.187.147; envelope-from=luangruo@yahoo.com; helo=sonic316-21.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325126 Archived-At: Eli Zaretskii writes: >> From: Po Lu >> Cc: cpardo@imayhem.com, emacs-devel@gnu.org >> Date: Mon, 04 Nov 2024 22:09:33 +0800 >> >> Eli Zaretskii writes: >> >> >> My point is that users frequently customize or exchange the positions of >> >> these modifier keys, and it is the resultant modifiers that they expect >> >> Emacs to report, not the keysyms, in special events or elsewhere. >> > >> > They should not expect that with these physical events, IMO. >> >> Why not? If Caps Lock and Ctrl are exchanged, why should Emacs depart >> from every other program by not reporting Ctrl when the key labeled Caps >> Lock is depressed? > > On _physical_ level, there can be no "exchange of keys". That > exchange exists on the logical level, where Ctrl followed by A yield a > single event whose value is 1, instead of 4 events (2 keypresses and 2 > releases), none of which is 1. No, that is configuring Caps Lock to serve as a Ctrl latch. I'm speaking of remapping such a key to serve as _the_ Ctrl modifier, such that Caps_Lock+A yields an XK_Caps_Lock event that is discarded by Emacs as a modifier key, followed by a second event whose value is, yes, ^A, and with the Ctrl modifier bit set in its state. >> Or, if another key than Hyper itself (which is not >> to be found on PC keyboards) is configured to serve as the Hyper >> modifier, surely we want it to be reported as Hyper? > > Again, not on this level. > >> The only reasonable manner of reporting these key events is reporting >> the modifiers that Emacs will generate in response to them. The other >> correct approach, that of reporting X modifier bits uninterpreted, >> yields physical keys that are just as meaningless (ctrl, shift, mod1, >> mod2, mod3, and so forth) and with equally tenuous a relationship with >> the modifiers that users expect to receive from Emacs. > > They are presumably not meaningless to a Lisp program which wants to > receive such events. Or at least this is my understanding. I am interested to hear what use Lisp programs intend to make of a mod2, mod3, mod4, and mod5, whose meanings vary wildly from one machine to the next. On my system, for example: shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x25) mod1 Alt_L (0x40), Alt_L (0xcc), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 ISO_Level5_Shift (0xcb) mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c) while on another: shift 44 57 # Left Shift, Right Shift lock 30 # CapsLock control 58 64 # Control mod1 59 63 # Meta mod2 62 # AltGraph mod3 90 # NumLock mod4 60 # Left Alt mod5 65 # Compose Without consulting the X11 modifier keymap (which is impossible from Lisp), how should a Lisp program derive any meaning from these modifier bits, or the keys to which they are assigned? > I can also accept that in addition we should have some intermediate > level, whereby some key translations are performed. But then we'd > need to agree which translations are or aren't taken into > consideration. In the above example, does Ctrl+A produce 01 decimal? > does Ctrl-[ produce ESC? what do the keys produce when the keyboard's > language is not English? etc. And whether to perform this or not > should be controllable by Lisp. This reaches far beyond the scope of just reporting modifier activation that is usually discarded by Emacs (and which is always reported by the X server).