From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.devel Subject: Re: Physical keyboard events Date: Thu, 31 Oct 2024 00:13:31 +0700 Message-ID: References: <86r07z58or.fsf@gnu.org> <86froe6eq3.fsf@gnu.org> <864j4u6bug.fsf@gnu.org> <86sesd4nmy.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="23218"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 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 18:14:49 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 1t6CHR-0005s1-2F for ged-emacs-devel@m.gmane-mx.org; Wed, 30 Oct 2024 18:14:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6CGU-0007zl-M3; Wed, 30 Oct 2024 13:13:50 -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 1t6CGS-0007za-Ni for emacs-devel@gnu.org; Wed, 30 Oct 2024 13:13:48 -0400 Original-Received: from mail-oo1-xc36.google.com ([2607:f8b0:4864:20::c36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t6CGR-0001Z6-2n; Wed, 30 Oct 2024 13:13:48 -0400 Original-Received: by mail-oo1-xc36.google.com with SMTP id 006d021491bc7-5ebc1af9137so69501eaf.2; Wed, 30 Oct 2024 10:13:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730308425; x=1730913225; 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=FRvA0tjuVJP7B9E02FKFN/asxF5PcHIEQD7zRaAreT0=; b=Q/xWq2gpU6h6NVSqaJkdJtdoAuUuPVtVYpSBTS+uMWJp4Jwrh4ARzcze3cU6U+rycl XzJchHg0Yx3UEcl4Alscg50sWOHr40OGjJdY7ICf1e8St4Lwf/jgu5+SyW4bD+E4m/Qw 7s3VbJJBlywhZFHicp/YW2MvaMrjI5F8agcXNSu1ey0NwonPamcc0ClfHlXtx+8tHel6 nFWIrqxiHjbEpos8P98v6SPRE6zX79/3bix2/5KMRizo2v4A2egmtsQCNgn9ZDUuRPE3 PAFI19rBEaR5npzudDkjdJcb/GPUxL+m/EOb2J8o2LcDlcauvDh5ePyzwo39Jfc6Ta58 4xhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730308425; x=1730913225; 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=FRvA0tjuVJP7B9E02FKFN/asxF5PcHIEQD7zRaAreT0=; b=IK0mYAMslvJ7ugiYYo6lwqS8gwrgD5ZzGTiRsa56wBT/ZdLIlTPJzi0nM+tx84l5Kq 5n0EL2vQYyI2F/C3Qmo+n0Ue1DU5Xa4HXMr++EeJkQpuvTq5HT33O1b0sfBuP8MPZBe0 bK896nYV895e1Eb7AyZb9ZbnX/XTlhjelGiiHf2L7+4aKB0wa8POaRg67Ad4K3Flu5Cn 9YefX83QU02IvAbRFCnLGzFI17il0I+bLlPeH9gn5YFtOG1qXdax4tKUlYtSjkV5LZMu 83hTxjYmD2I8bAYTGNaUtaEdHRp4wkBnGCpRZPMwrgmDRpFCts2KPeKiqD116znCQWam SAvQ== X-Forwarded-Encrypted: i=1; AJvYcCW+J6tppNLzcM3HVSgMq4NE95tzNKUZVS0LFsOqkAw8m9bxxTK/S7EqG+PtsHfqG+zL6yjuPTSKIK6uHQ==@gnu.org X-Gm-Message-State: AOJu0Yx7GjwC6cdb0rk/2KoYAp0hI1mZXLHLFrFxMj8+UlCuq2FbOjY7 xJT3GxjpuBkc2l0buFiT5pFOoA2Gn43zhaavfia6wmwSgZpbiRTHRP/vuGcksZI5kmwEH9ZqIT5 J59HwSnDvBRbYlXNGe8MOy2r53/bvf5/Q X-Google-Smtp-Source: AGHT+IGkmpx//U64s0vdQj6xS3/NZgalu/5pUTx9xqYU1CksElcobnrCW8cJEUGtAtGGsLIgioXjXa5GKBHcyhxFpv8= X-Received: by 2002:a05:6359:4587:b0:1aa:c73d:5a8a with SMTP id e5c5f4694b2df-1c3f9f04bd5mr809059955d.16.1730308424657; Wed, 30 Oct 2024 10:13:44 -0700 (PDT) In-Reply-To: <86sesd4nmy.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::c36; envelope-from=yurivkhan@gmail.com; helo=mail-oo1-xc36.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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, RCVD_IN_DNSWL_NONE=-0.0001, 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:324945 Archived-At: 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 for w= hich 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-based l= ayout if there > > is one and only one; the keycode if there is none; and some heuristic > > tiebreaker for the case where the user has more than one Latin-based > > 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 informatio= n 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 command specifically whitelisted, return that. * Look up the active modifiers + keysym from the Latin-based group. Return = that. 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 Cyrillic= layout, then the =E2=80=98/=E2=80=99 command shall be executed regardless of whether Latin or Cyrillic layout is active.