From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dov Grobgeld Newsgroups: gmane.emacs.devel Subject: Re: Physical keyboard events Date: Wed, 30 Oct 2024 21:26:21 +0200 Message-ID: References: <86r07z58or.fsf@gnu.org> <86froe6eq3.fsf@gnu.org> <864j4u6bug.fsf@gnu.org> <86sesd4nmy.fsf@gnu.org> <86frod4hl9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40680"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yuri Khan , manikulin@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Oct 30 20:27:36 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 1t6ELw-000APS-R8 for ged-emacs-devel@m.gmane-mx.org; Wed, 30 Oct 2024 20:27:36 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6EL3-0007Hf-JA; Wed, 30 Oct 2024 15:26:41 -0400 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 1t6EL1-0007HV-SL for emacs-devel@gnu.org; Wed, 30 Oct 2024 15:26:39 -0400 Original-Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t6EKz-0001p9-M6; Wed, 30 Oct 2024 15:26:38 -0400 Original-Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-539f0f9ee49so247596e87.1; Wed, 30 Oct 2024 12:26:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730316394; x=1730921194; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=cPUQM4CEUGgnWdMTxrs/4WF2dqrq8HSukpNE4WZKFdU=; b=j5GAi8Da0rGoZ3INXkyk7HtxudzkHB/Gpyt0qTSPzF0h9+f5aM9K0W0eCSDL6+pAdC 3Nf3UVkEKp0td3aaZgLGvdNjFEcAMHBaPEEpIF4dF78qBdhZctCCO6HUGZZSrdsQdqRi XIXEzwrDcTeotz4AbnOSSaG/LEYaEnotQHmt9jDYmuTR+ON8qFM7xUY3sUyylRj/4fc2 pu6h64RuDQeg/5Q422dg3+K6fsD2gB/c0xJz9yakoqpsqnuqk2RaqMRpOs9hOu+aDXsH nxRQN7KMj7khYir+1BxF4fCGvTKj17LsB4pNcwjkfInwe8e1BWhywzLkY74PSnESiFTc 9g1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730316394; x=1730921194; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cPUQM4CEUGgnWdMTxrs/4WF2dqrq8HSukpNE4WZKFdU=; b=YWpCKEInpn1AhxX+oJnoMhBmLJJE8RlllyF5frTCqbOIVk0qrxdd/ckVo2cMGQJHT+ 6NbeerDzcrEnXQH0MXpd4W/u5XFagYqsaL+pXDhYzWHTlg8ij/d31UUfsLpHHekAyDHh NkZIWXEOyQdjgdJjS1E2m47uD2lRroR5xz0idIS4NkYjb5q41C4IQdDiYHcv3iBbfneE tEFiRsP8tLwmbyE3ZiuX5kuHGWWrlGLV4DrLtLorQz69Xv/qFvCcir/tOfk7oJPMYa+k yWRdyNuZWPkCwUUOxsDvHwe5SQYOFoFnuVyS5DhYQmK9JrAhPuP5OODHJeoRVg4VACz1 mg2w== X-Forwarded-Encrypted: i=1; AJvYcCVkz2MEgCBXhoikgYrbUQvoziJxl43sWXYlyPJcgoEbBxkjdTUkd05j5bC7yiveshav6i9G/3j55yzplg==@gnu.org X-Gm-Message-State: AOJu0YyTDjcjBICfBEXSKqH1QWlnRHzeg6X/CCAgbJlNR3oEX/vJN+c8 dekzs2Pq8qLQDMn54Oar2qD0UDSja0dQ745EqrzXL6kjZ+9JmRgN6h7aXCXhvI0jWFUC45jX0hJ opQdU+ZizdLpYncYtLQjXtJB+8WWeB7Tlv+Q= X-Google-Smtp-Source: AGHT+IEpShS9rcoZor8fFJZNrJVskWf3/jqTLx6P/s+t0r46MKfEd7d+ChJKFBr/b6cu6K/Yi3Qj1Gg4jogRrliR/Vw= X-Received: by 2002:a05:6512:1390:b0:539:e6bf:ca9a with SMTP id 2adb3069b0e04-53b348b7e12mr8591122e87.6.1730316394089; Wed, 30 Oct 2024 12:26:34 -0700 (PDT) In-Reply-To: <86frod4hl9.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=dov.grobgeld@gmail.com; helo=mail-lf1-x12b.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:324949 Archived-At: Switching to a different keyboard language causes all navigation keyboard shortcuts to fail by default. This is why I found myself adding the following to my .emacs file. I agree it would be nice if there was some automatic way of creating this mapping, but using keycodes, does not seem to be a correct way to do it. ;; some motion bindings in Hebrew mode that reflect key ;; positions for Dvorak. (global-set-key [(control ?=D7=A9)] 'move-beginning-of-line) (global-set-key [(control ?=D7=92)] 'move-end-of-line) (global-set-key [(control ?=D7=A8)] 'previous-line) (global-set-key [(control ?=D7=9A)] 'next-line) (global-set-key [(control ?=D7=94)] 'kill-line) (global-set-key [(control ?=D7=A3)] 'isearch-forward) (global-set-key [(control ?=D7=9D)] 'isearch-backward) (global-set-key [(control ?=D7=A5)] 'scroll-up-command) (global-set-key [(meta ?=D7=A5)] 'scroll-down-command) (global-set-key [(meta ?=D7=98)] 'forward-word) (global-set-key [(control ?=D7=98)] 'forward-char) (global-set-key [(meta ?=D7=9E)] 'backward-word) (global-set-key [(control ?=D7=9E)] 'backward-char) (define-key isearch-mode-map [(control ?=D7=A3)] 'isearch-repeat-forward) (define-key isearch-mode-map [(control ?=D7=9D)] 'isearch-repeat-backward) (global-set-key [(control ?=D7=A0) (control ?=D7=A3)] 'save-buffer) On Wed, Oct 30, 2024 at 7:38=E2=80=AFPM Eli Zaretskii wrote: > > > From: Yuri Khan > > Date: Thu, 31 Oct 2024 00:13:31 +0700 > > Cc: manikulin@gmail.com, emacs-devel@gnu.org > > > > On Wed, 30 Oct 2024 at 22:27, Eli Zaretskii wrote: > > > > > > From: Yuri Khan > > > > Date: Wed, 30 Oct 2024 13:28:20 +0700 > > > > Cc: emacs-devel@gnu.org > > > > > > I=E2=80=99m going to posit the hypothesis that the *only* command f= or which it > > > > makes sense to use the keysym of the current layout is > > > > =E2=80=98self-insert-command=E2=80=99. > > > > > > > > Everything else wants the keysym of =E2=80=9Cthe=E2=80=9D Latin-bas= ed layout if there > > > > is one and only one; the keycode if there is none; and some heurist= ic > > > > tiebreaker for the case where the user has more than one Latin-base= d > > > > layout configured. > > > > > > How do you suggest to arrange for a low-level keyboard interface to > > > know which kind of Emacs command attempted to read the keyboard? > > > > Since it=E2=80=99s not clairvoyant, it would need to save enough inform= ation > > for the keymap lookup code downstream. Specifically (XKB/X11 case): > > state of modifiers, keycode, keysym according to the currently active > > group, and keysym according to the appropriate Latin-based group. > > > > Then, at the time of keymap lookup: > > > > * Look up the active modifiers + active group keysym. > > * If this yields =E2=80=98self-insert-command=E2=80=99 or another com= mand > > specifically whitelisted, return that. > > * Look up the active modifiers + keysym from the Latin-based group. Ret= urn that. > > How do you know which keymap to look up and for which character, > before you decide which character to produce? > > > Test case: If a mode keymap binds both =E2=80=98/=E2=80=99 and =E2=80= =98.=E2=80=99, and a key produces > > =E2=80=98/=E2=80=99 in the Latin layout and =E2=80=98.=E2=80=99 in Cyri= llic layout, then the =E2=80=98/=E2=80=99 > > command shall be executed regardless of whether Latin or Cyrillic > > layout is active. > > What if '/' is bound to self-insert-command, but '.' to something > else: what do you return then? >