bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#43830: keyboard layout handling incompatible with rest of the OS


From: Arthur Miller
Subject: bug#43830: keyboard layout handling incompatible with rest of the OS
Date: Mon, 02 Nov 2020 05:41:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Paul Pogonyshev <pogonyshev@gmail.com>
>> Date: Sun, 1 Nov 2020 19:56:09 +0100
>> Cc: Juri Linkov <juri@linkov.net>, 43830@debbugs.gnu.org
>> 
>> > read-event will figure out by itself whether it should return the
>> > ASCII character or a non-ASCII character, and return that.
>> 
>> I'm not sure that is possible, because it doesn't really know how it
>> is going to be processed.
>
> It knows the binding of the character, and it knows other things.
>
> 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 similar as
raw_input in windows does? But I don't think Elisp programs really would
have use of scancodes anyway.

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

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 don't know if it is possible to automatically detect keyboard layout
change in all cases. I know that Emacs automatically switches to
different layout when I change keyboard with loadkeys or in vconsole.conf.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]