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 15:18:03 +0200 Message-ID: <86ldxzuohg.fsf@gnu.org> References: <31bdc55d-8c13-4de0-9cef-bd6cc4fb033f@imayhem.com> <19ab52d0-88bd-4378-8fa8-8603e01233e3@imayhem.com> <871pzrl4sn.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22850"; 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 14:18:53 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 1t7wyr-0005nM-Js for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Nov 2024 14:18:53 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7wy8-00074X-Dl; Mon, 04 Nov 2024 08:18:08 -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 1t7wy7-00073v-5O for emacs-devel@gnu.org; Mon, 04 Nov 2024 08:18:07 -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 1t7wy6-0007zb-Lb; Mon, 04 Nov 2024 08:18:06 -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=yFeI8/ibtzzmAznofYsKkAd4OTa4rRVRftk0/I6y8/Q=; b=Ujq7QZybbKCn uAb3XRoswGlruPoIt2jD8IP4fEqICrtjt78yyMxrUW+PqaPjmh4Ur59Au+V2HkT1d4V0cZDwgzZN/ QwK2Re748SAAlEAv25j1n+gG156ZBTPZ0/kB8dUCNrY/EbEJcs1y4WslQY0JCTyIIjVGfI/esgi4H nHInV98Y/uV7U7iXWkM2pFbOX4gvJHLnTMW3XrqIwvqhsRy0jPXrBAUyeA1GeVCX4f/0E3/QLa+fz 2xUCR8W8tHwHOEnv/k/ZzPVPfZuDfw16BpTRuRDAfhPl61CeAS1A7QIQQ+LdsoOu7c9+rulitN4li HGIu/ydcOIrS0EGyhmSwXw==; In-Reply-To: <871pzrl4sn.fsf@yahoo.com> (message from Po Lu on Mon, 04 Nov 2024 17:35:52 +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:325098 Archived-At: > From: Po Lu > Cc: emacs-devel@gnu.org > Date: Mon, 04 Nov 2024 17:35:52 +0800 > > Cecilio Pardo writes: > > >> ??? Code producing such events should not relay modifier keysyms > >> verbatim, but ought to detect the virtual modifiers to which they are > >> mapped, and convert them into Emacs modifiers, namely, meta, alt, ctrl, > >> hyper, super, and shift. Otherwise, Lisp will find it impossible > >> reliably to establish a correspondence between "physical key events" and > >> modifiers. > > > > This is about keys, not modifiers. For the use case of binding > > commands to keys, this remapping would be counterproductive. I can > > provide a function to make that conversion if needed. > > I must disagree. When Emacs has enough information to decide which > modifiers are produced by physical keys it receives, as it does here, it > should not confuse Lisp programmers with a view of the keyboard state > that runs contrary to their expectations, not to mention that the > disparity between X keysyms and X modifiers is very great, and users who > swap the positions of the Shift and Ctrl modifiers will not expect to > receive raw keyboard events which disregard their keyboard > configuration. I don't think I agree with you. I think I'm with Cecilio here. Physical key events means that Emacs doesn't perform any conversions, it leaves that to the Lisp program which receives such events. E.g., when I press the Alt key, I expect to see an event of pressing the Alt key, not a (non-existent) Meta. And if I press the Right Alt key, I expect to see AltGr, not Alt and not Meta. > BTW, if the intention is to forward just modifier key events to Lisp, > don't let's refer to them as "physical keyboard events", but in more > specific terms. Yes, I think the idea is to generate modifier key events and expose them to Lisp. What is more specific than "physical keyboard events"?