From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Pogonyshev Newsgroups: gmane.emacs.bugs Subject: bug#43830: keyboard layout handling incompatible with rest of the OS Date: Sun, 1 Nov 2020 01:19:57 +0100 Message-ID: References: <87h7r78a5y.fsf@mail.linkov.net> <87imbn2iwm.fsf@mail.linkov.net> <87y2kisawy.fsf@mail.linkov.net> <83362qa073.fsf@gnu.org> <87blhdrhww.fsf@mail.linkov.net> <83362p85l3.fsf@gnu.org> <83y2jqcrvn.fsf@gnu.org> <83d012cnx2.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000a782ff05b300977f" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14972"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43830@debbugs.gnu.org, Juri Linkov To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 01 01:21:16 2020 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 1kZ17T-0003la-S2 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 01 Nov 2020 01:21:15 +0100 Original-Received: from localhost ([::1]:48300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZ17S-0000xW-DL for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 31 Oct 2020 20:21:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZ17H-0000tw-12 for bug-gnu-emacs@gnu.org; Sat, 31 Oct 2020 20:21:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51638) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kZ17G-0001sI-Kc for bug-gnu-emacs@gnu.org; Sat, 31 Oct 2020 20:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kZ17G-0005Kn-G2 for bug-gnu-emacs@gnu.org; Sat, 31 Oct 2020 20:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Pogonyshev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Nov 2020 00:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43830 X-GNU-PR-Package: emacs Original-Received: via spool by 43830-submit@debbugs.gnu.org id=B43830.160419001720440 (code B ref 43830); Sun, 01 Nov 2020 00:21:02 +0000 Original-Received: (at 43830) by debbugs.gnu.org; 1 Nov 2020 00:20:17 +0000 Original-Received: from localhost ([127.0.0.1]:34951 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZ16X-0005Jb-4a for submit@debbugs.gnu.org; Sat, 31 Oct 2020 20:20:17 -0400 Original-Received: from mail-wm1-f43.google.com ([209.85.128.43]:55507) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZ16V-0005JM-1x for 43830@debbugs.gnu.org; Sat, 31 Oct 2020 20:20:16 -0400 Original-Received: by mail-wm1-f43.google.com with SMTP id c9so4517286wml.5 for <43830@debbugs.gnu.org>; Sat, 31 Oct 2020 17:20:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NreP2nRP5nkIm0mo9OtHjhlSu5uyr+QX1ZG7Lbz3NWg=; b=HHa8BHtV5IU8ab016dWV4ZCF+YGeOVRg4MWG5Z1Hpk9L3c213CNoGbP1/hrTDSz1+v O/0xM21JM6M3/w1255AwbZ49uJnIhXpvVZrYrrVUG2PG2aohrEH8pTDqNd6Q8qqCtfBc Bcd9y6dKJtvp/LC05YMyUUQS8bfM9HGFgQGm45/81iLu3cRYLk8ZdYthxqbS9Z5SdoYi 3rcZI8rM/4q0w3kKbwgUOK32yyTbKA8bJbR1YyCf6RW7FkPnOsi0yy9xO8cWvc7UUK+j LivxH0t6H3RgsFhU3/tWfMCXPszUsZjgaLRcmjUfzTFhf8gtapVl4aLTZN9i/NddNq26 S3tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NreP2nRP5nkIm0mo9OtHjhlSu5uyr+QX1ZG7Lbz3NWg=; b=GFA3UxOCCBe7GzT8W8jAAGC4YqBlhDkBzcOsVOUIBEatMcVNcwQsT4fiYblq6IUw6T 7O7NG5E+a6NFfvfNLIKKkN6DEglE1rRIUMcSx91wSdU7SinrqIQssmrpgrURmguTanUq H9edtiH88ulIG2yG9n9jJ0NryQWq0Fylq4BkDznQ9rk8Itteftm8OxCXdgvGR5sb8sNh Mv8siEdUEC0ITFgKQ4PbYmaGWQtA4rjhbRZuUWuNsK8J+2LDwaW3RzwRtmD/VKcaGJiM ewERz65n0AYP9sfAyDbJ9PuZmQRFp9bEZQD0mlWKx6y6bBWYQcS4YGdWXTa1GLcCY3ze wEaA== X-Gm-Message-State: AOAM531FONJr6TfW1KU/NY9wz9T80t3KsxKGEkUrX7iqKMMXWvNcUjsV IjIYLhTvuBlx4z/8euLeI24tzyZ5qZFmp9IIdg== X-Google-Smtp-Source: ABdhPJyEJeoG5rJoxMxC4dIcXdQm11gzcHYuENt2t5JVAHWTU7oxvcXOOaYq5iXnw7bb9XzY5Dbesye1bxVGx3rXoq0= X-Received: by 2002:a1c:df89:: with SMTP id w131mr9822967wmg.164.1604190009261; Sat, 31 Oct 2020 17:20:09 -0700 (PDT) In-Reply-To: <83d012cnx2.fsf@gnu.org> 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" Xref: news.gmane.io gmane.emacs.bugs:192319 Archived-At: --000000000000a782ff05b300977f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > No, AFAIR this is all done in C. What about functions like `read-event'? It returns integers if I press M-[letter] or C-[letter]. Paul On Wed, 28 Oct 2020 at 17:31, Eli Zaretskii wrote: > > From: Paul Pogonyshev > > Date: Wed, 28 Oct 2020 17:16:59 +0100 > > Cc: Juri Linkov , 43830@debbugs.gnu.org > > > > > > However, in Elisp this is further complicated by there being no > > > > real KeyEvent structure, instead it's a single integer as far as I > > > > can see. > > > > > > Why would you need that? If we decide to use XkbTranslateKeyCode, we > > > could translate the keycode in C, according to some logic that took > > > into account the modifiers and perhaps also some user options, and > > > returned the resulting translated character. > > > > The point is that the character is not enough, you need to know both > > the character and the physical key (you cannot reconstruct the key > > from the character alone). E.g. suppose I type '=D0=B9' in Russian layo= ut. > > If it is a self-inserting command, character '=D0=B9' should be added t= o the > > active buffer. But if I'm typing a multikey binding, it should be > > interpreted as 'q' (it's the same physical key), so that e.g. 'C-=D1=87= =D0=B9' is > > translated to 'C-x q'. Without looking, I'm pretty sure this goes well > > into Elisp part of Emacs > > No, AFAIR this is all done in C. > --000000000000a782ff05b300977f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> No, AFAIR this is all done in C.

What about functions like `read-event'? It returns integers if I pre= ss
M-[letter] or C-[letter].

Paul
<= /div>
O= n Wed, 28 Oct 2020 at 17:31, Eli Zaretskii <eliz@gnu.org> wrote:
> From: Paul Pogonyshev <pogonyshev@gmail.com>
> Date: Wed, 28 Oct 2020 17:16:59 +0100
> Cc: Juri Linkov <juri@linkov.net>, 43830@debbugs.gnu.org
>
> > > However, in Elisp this is further complicated by there being= no
> > > real KeyEvent structure, instead it's a single integer a= s far as I
> > > can see.
> >
> > Why would you need that?=C2=A0 If we decide to use XkbTranslateKe= yCode, we
> > could translate the keycode in C, according to some logic that to= ok
> > into account the modifiers and perhaps also some user options, an= d
> > returned the resulting translated character.
>
> The point is that the character is not enough, you need to know both > the character and the physical key (you cannot reconstruct the key
> from the character alone). E.g. suppose I type '=D0=B9' in Rus= sian layout.
> If it is a self-inserting command, character '=D0=B9' should b= e added to the
> active buffer. But if I'm typing a multikey binding, it should be<= br> > interpreted as 'q' (it's the same physical key), so that e= .g. 'C-=D1=87 =D0=B9' is
> translated to 'C-x q'. Without looking, I'm pretty sure th= is goes well
> into Elisp part of Emacs

No, AFAIR this is all done in C.
--000000000000a782ff05b300977f--