From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74423: Low level key events Date: Fri, 06 Dec 2024 09:01:30 +0800 Message-ID: <87ttbhhbf9.fsf@yahoo.com> References: <31bdc55d-8c13-4de0-9cef-bd6cc4fb033f@imayhem.com> <705fabb8-1ea0-4894-8c32-05097ab822c9@imayhem.com> <868qsvz07i.fsf@gnu.org> <162dada7-ad54-4ca5-8f11-d55dd6dccb3c@imayhem.com> <867c8ezny3.fsf@gnu.org> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21304"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 74423@debbugs.gnu.org, Cecilio Pardo , monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 06 02:02:22 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1tJMjd-0005PL-Re for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 06 Dec 2024 02:02:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tJMjM-0008Py-I3; Thu, 05 Dec 2024 20:02:04 -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 1tJMjL-0008PX-07 for bug-gnu-emacs@gnu.org; Thu, 05 Dec 2024 20:02:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tJMjK-0007IU-Nn for bug-gnu-emacs@gnu.org; Thu, 05 Dec 2024 20:02:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=wot3N9HJoiOKKiXzVLp1AHhbn16sqh+MK1T/zx+0l68=; b=ObNKbfH3vpmYNc0xUBJ5Bhg3+L8tHgc8TPOBHYQ8xaeLk/Mv0p6HpJs0rDK3cDMj/NAKsCPMTHmKqwhqtKEQmw2KR8r7TA4XjiHidFTLVlsTVonmWzz+FqjX9+NET+++STPS7CuuyAFAEqJJPi6Sgkn5J2ctFh+80zn7x9SPH3dvDKUt7+wrHlNFvGAINu88+WO8qKF49cWPo9hzZ+EKrrcMSu8y93t3CgIfXQ2lKzi15e9QrSDyy2vo+udg7vOw97KVQ+EK0MM3r3VI5okctiJQ4TyNVUfPQxajJz0Ga0po683xCQQp9LkQsxmt8iq4HitlGJKXVi9BeqjZ6/dYFA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tJMjK-0006Bl-9j for bug-gnu-emacs@gnu.org; Thu, 05 Dec 2024 20:02:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Dec 2024 01:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74423 X-GNU-PR-Package: emacs Original-Received: via spool by 74423-submit@debbugs.gnu.org id=B74423.173344691223769 (code B ref 74423); Fri, 06 Dec 2024 01:02:02 +0000 Original-Received: (at 74423) by debbugs.gnu.org; 6 Dec 2024 01:01:52 +0000 Original-Received: from localhost ([127.0.0.1]:41455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tJMjA-0006BJ-7M for submit@debbugs.gnu.org; Thu, 05 Dec 2024 20:01:52 -0500 Original-Received: from sonic311-25.consmr.mail.ne1.yahoo.com ([66.163.188.206]:34409) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tJMj5-0006B1-LT for 74423@debbugs.gnu.org; Thu, 05 Dec 2024 20:01:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1733446902; bh=wot3N9HJoiOKKiXzVLp1AHhbn16sqh+MK1T/zx+0l68=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=gkl6hw1ipDIIzceQPWApKU7i0A5J6KZPgmCvRUxd8KIjIkzknreLy9S15kXKRcodGnRbn8QXWY0YIzDtETZrVvx0Z2Vhi5fFoEVCD6vL9C8cTSOo/YjcMUVD1In9wWsxBIa4QL1vpt4Joyf/xBcl+i4p5+ZCpLcuUPh8CtY2FE2HUj+O95g03QNTmEVLlu9zQSNFt6D+kE42l/GT3s1qh6iDKWF4kNAEObpXqYQgIQbVcXPe66e2YImSW2bt9Ot1UpIF1IefC1+5QLNEvsfQwc3tkFTOrcPy8TbZORvYWFXn01BJOrJKhNWhYFEjWJTMly6DxOWVTn9cPVBkDEQ3+g== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1733446902; bh=8gGcnD6+loDkOU4gGEPjIFVKG7MEiEaoiEx0pMdThrh=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=eGdl1xKk7nr/kvAsi/X6K8QbgQN7Wdaohw8a4ypCN0U0UFW8tH6ZbTBD+N9KGv10f+rHlJoWgWpMmSnHeiP69fHepvk8PPrvW1XzAK4s+iq5fJt03aVWWSJY88o9hA8hOJRgF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Sonic-MF: X-Sonic-ID: 3af35865-82eb-4e4d-94d0-14a11474d139 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.ne1.yahoo.com with HTTP; Fri, 6 Dec 2024 01:01:42 +0000 Original-Received: by hermes--production-sg3-5b7954b588-bd2kk (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 1c6f5a6351711b82c513ede023a0beb1; Fri, 06 Dec 2024 01:01:35 +0000 (UTC) In-Reply-To: <867c8ezny3.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 05 Dec 2024 07:41:24 +0200") X-Mailer: WebService/1.1.23040 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:296486 Archived-At: Eli Zaretskii writes: >> Date: Wed, 4 Dec 2024 22:25:32 +0100 >> Cc: monnier@iro.umontreal.ca, luangruo@yahoo.com, 74423@debbugs.gnu.org >> From: Cecilio Pardo >> >> On 04/12/2024 21:01, Eli Zaretskii wrote: >> >> + DEFVAR_LISP ("enable-low-level-key-events", Venable_low_level_key_events, >> >> + doc: /* If non-nil, reception of low-level key events is enabled. >> >> + >> >> +The value configures the set of keys that are handled: >> >> + >> >> +If t, send events for all keys. >> >> + >> >> +If a number, send events for the corresponding keysym. When calling >> >> +'llk-init', a set of variables with the xk- prefix is initialized with >> >> +the numeric values for keysyms. This numbers are platform dependent. >> > >> > This seems to say that it is impossible to make the value do the same >> > on all platforms? If so, I think it's less useful than it could be, >> > because Emacs generally tries to abstract platform-specific issues as >> > much as possible, to facilitate platform-independent Lisp programs >> > that work the same on all supported systems. >> > >> > Also, there's no information here where to find the list of these xk- >> > numbers. >> >> Those are variables, like xk-shift-l, xk-a, xk-f1. There is also >> llk-keysyms, that has a list of all xk-* symbols and their numeric values. >> >> llk-init initializes all of these variables, using numbers that are >> platform dependent (XK_* constant KeySyms for X, VK_* "virtual keys" for >> windows. GDK keys match X keys. >> >> Numbers are different, but users should use the variables, not the >> numbers, for binding and comparing to event values. > > This should be explicitly told in the doc string. Also, if the xk-* > variables are platform-independent, the rule to map their names to > keyboard keys should be explained somewhere, perhaps in the manual, so > that Lisp programmers could easily know how to identify the keys which > they stand for. > >> I can translate the Windows numbers to the X equivalents, so that they >> are equal on both platforms. > > I'm not sure this is needed, if the xk-* names are the same. > >> In any case, I will document this better, with a manual change >> proposal. > > Thanks. This facility definitely needs to be in the ELisp manual > before we install it. I suggest calling XKeysymToString rather than interning the numerical value of keysyms received. This gives users some indication of the identity of these keysyms without tediously referring to (at times vendor-specific) keysymdef.h files.