GNU bug report logs -
#43830
keyboard layout handling incompatible with rest of the OS
Previous Next
Full log
Message #107 received at 43830 <at> debbugs.gnu.org (full text, mbox):
> From: Arthur Miller <arthur.miller <at> live.com>
> Cc: Paul Pogonyshev <pogonyshev <at> gmail.com>, 43830 <at> debbugs.gnu.org,
> juri <at> 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.
This bug report was last modified 3 years and 346 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.