all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Arthur Miller <arthur.miller@live.com>
Cc: 43830@debbugs.gnu.org, pogonyshev@gmail.com, juri@linkov.net
Subject: bug#43830: keyboard layout handling incompatible with rest of the OS
Date: Mon, 02 Nov 2020 17:38:22 +0200	[thread overview]
Message-ID: <83d00vepld.fsf@gnu.org> (raw)
In-Reply-To: <VI1PR06MB4526B8451AD5287CFBC7522196100@VI1PR06MB4526.eurprd06.prod.outlook.com> (message from Arthur Miller on Mon, 02 Nov 2020 05:41:06 +0100)

> From: Arthur Miller <arthur.miller@live.com>
> Cc: Paul Pogonyshev <pogonyshev@gmail.com>,  43830@debbugs.gnu.org,
>   juri@linkov.net
> Date: Mon, 02 Nov 2020 05:41:06 +0100
> 
> > Nothing else makes sense to me, because exposing this info to Lisp
> > means every Lisp program which deals with input will have to decide
> > what to do with such events.
> 
> Couldn't Emacs just pack scancodes into some event structure

That's what I was prfoposing to do, on the C level.

> Would it be possible to use scancodes for the shortcuts internally in
> the interpreter itself?

I don't think I understand what shortcuts you have in mind here.

> Shortcuts could be specified by users and scripts as they are now
> (as keys/characters); but when Emacs starts, it could populate a lookup
> table based on the current layout with scancodes, and then translate
> shortcuts from keys to scancodes for internal usage. If user chagnes
> keyboard layout on the fly, new lookup table would be generated, because
> virtual keys would change but scancodes would stay same; so it wouldn't
> matter if some key jumps from one physical key to another. That wouldn't
> require to expose scancodes to Lisp either. But that would mean that
> routines for inserting text in buffers would have to work differently
> from shortcut handling routines, with regard to input; I don't know if
> that is case now or if it is possible.
> 
> Is something like that possible to implement in current Emacs? Woukd it
> be too much work?

I think you are forgetting how many different methods are there on a
modern system to generate keyboard input.  There are system input
methods, there are virtual keyboards, etc. etc.  And I don't think we
can easily read keyboard on scancode level, either, even if we wanted
to.  But I'm not an expert.

> I don't know if it is possible to automatically detect keyboard layout
> change in all cases.

AFAIK, we only support that on MS-Windows.

> I know that Emacs automatically switches to different layout when I
> change keyboard with loadkeys or in vconsole.conf.

That's because we read characters, and those don't change.





  reply	other threads:[~2020-11-02 15:38 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-06 15:34 bug#43830: keyboard layout handling incompatible with rest of the OS Paul Pogonyshev
2020-10-06 17:26 ` Eli Zaretskii
2020-10-06 17:48   ` Paul Pogonyshev
2020-10-06 18:00     ` Eli Zaretskii
2020-10-06 18:46 ` Juri Linkov
2020-10-06 18:59   ` Paul Pogonyshev
2020-10-06 20:34     ` Juri Linkov
2020-10-06 21:05       ` Paul Pogonyshev
2020-10-07  8:16         ` Juri Linkov
2020-10-07  8:51           ` Eli Zaretskii
2020-10-07 19:01             ` Juri Linkov
2020-10-08  8:50               ` Eli Zaretskii
2020-10-08 13:58                 ` Paul Pogonyshev
2020-10-28  0:43                   ` Paul Pogonyshev
2020-10-28 15:06                     ` Eli Zaretskii
2020-10-28 16:16                       ` Paul Pogonyshev
2020-10-28 16:31                         ` Eli Zaretskii
2020-11-01  0:19                           ` Paul Pogonyshev
2020-11-01 15:09                             ` Eli Zaretskii
2020-11-01  7:53                         ` Juri Linkov
2020-11-01 15:11                           ` Eli Zaretskii
2020-11-01 18:27                             ` Juri Linkov
2020-11-01 18:49                               ` Eli Zaretskii
2020-11-01 16:51                           ` Paul Pogonyshev
2020-11-01 17:24                             ` Eli Zaretskii
2020-11-01 18:56                               ` Paul Pogonyshev
2020-11-01 19:32                                 ` Eli Zaretskii
2020-11-01 20:06                                   ` Paul Pogonyshev
2020-11-02  4:41                                   ` Arthur Miller
2020-11-02 15:38                                     ` Eli Zaretskii [this message]
2020-11-01  7:48                   ` Juri Linkov
2020-10-07 10:37           ` Paul Pogonyshev
2020-10-07 19:04             ` Juri Linkov
2020-10-07 20:08               ` Paul Pogonyshev
2020-10-07 20:25                 ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83d00vepld.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=43830@debbugs.gnu.org \
    --cc=arthur.miller@live.com \
    --cc=juri@linkov.net \
    --cc=pogonyshev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.