From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Physical keyboard events Date: Mon, 04 Nov 2024 18:46:56 +0200 Message-ID: <867c9juetb.fsf@gnu.org> 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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17601"; mail-complaints-to="usenet@ciao.gmane.io" Cc: cpardo@imayhem.com, emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Nov 04 17:48:26 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 1t80Fc-0004KP-LL for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Nov 2024 17:48:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t80El-0002yA-Aj; Mon, 04 Nov 2024 11:47:31 -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 1t80Ek-0002y0-CO for emacs-devel@gnu.org; Mon, 04 Nov 2024 11:47:30 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t80Ej-00043i-Hz; Mon, 04 Nov 2024 11:47:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=mq1DONZxwEiu9wuqOLN+a94peq0YLkpGxgey8hAgZ3A=; b=bGtxWB4pAdD0 uHvr8cU6ANT7WUYN+iOHf1UxYbatVXur4xz5OpSN8UkX1t2LT96/hBbbnRuUjzJHdJIehZrbW0Ztq Yt6FBmYHukAfCPIUE4eZ0sgkbb7QqzXRAwOY2o+By7qsirWllzaa/+IO63QzHr6HmwoQQgTzq2tZa G0Gc9PjmOf4eCflyjApjVnfcnfHdQ4QzkKblts6RYMw5l/4JHB+NHQOav6AIXlz/rGoHN4OU1Ql7s SsEveEjErdewaFt7Zd0F0POaiU1iVCovFhGf6FO9X+p/dpu434HDSSoz7qr/uqTdVJFw7I4oxcySg GwAit1N9/4Mj6wQFaIDZDQ==; In-Reply-To: <87bjyvjdk2.fsf@yahoo.com> (message from Po Lu on Mon, 04 Nov 2024 22:09:33 +0800) 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:325108 Archived-At: > 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. > 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 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.