From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Cecilio Pardo Newsgroups: gmane.emacs.devel Subject: Re: Physical keyboard events Date: Tue, 5 Nov 2024 08:15:27 +0100 Message-ID: <7c1b4258-447f-433c-939e-21df7f9eeec3@imayhem.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> <87wmhiihzx.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32213"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: emacs-devel@gnu.org To: Po Lu , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 05 08:16:07 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 1t8DnK-0008E8-C9 for ged-emacs-devel@m.gmane-mx.org; Tue, 05 Nov 2024 08:16:06 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8Dmo-0004s6-Nd; Tue, 05 Nov 2024 02:15:34 -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 1t8Dmn-0004rT-3I for emacs-devel@gnu.org; Tue, 05 Nov 2024 02:15:33 -0500 Original-Received: from mail.imayhem.com ([82.223.54.191] helo=zealous-pike.82-223-54-191.plesk.page) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8Dml-0005yO-0C; Tue, 05 Nov 2024 02:15:32 -0500 Original-Received: from [192.168.68.102] (111.red-88-21-7.staticip.rima-tde.net [88.21.7.111]) by zealous-pike.82-223-54-191.plesk.page (Postfix) with ESMTPSA id 650B0800F2; Tue, 5 Nov 2024 07:15:28 +0000 (UTC) Authentication-Results: zealous-pike.82-223-54-191.plesk.page; spf=pass (sender IP is 88.21.7.111) smtp.mailfrom=cpardo@imayhem.com smtp.helo=[192.168.68.102] Received-SPF: pass (zealous-pike.82-223-54-191.plesk.page: connection is authenticated) Content-Language: es-ES In-Reply-To: <87wmhiihzx.fsf@yahoo.com> Received-SPF: pass client-ip=82.223.54.191; envelope-from=cpardo@imayhem.com; helo=zealous-pike.82-223-54-191.plesk.page X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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:325129 Archived-At: On 05/11/2024 2:31, Po Lu wrote: > 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? The idea is to report Shift_L, Shift_R, Alt_L, Meta_L not shift or alt. Maybe those keys are mapped to modifiers, maybe not.