[Top][All Lists]

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

Re: Ignoring keyboard modes for key chords

From: Eli Zaretskii
Subject: Re: Ignoring keyboard modes for key chords
Date: Sun, 16 Oct 2016 10:09:33 +0300

> From: Yuri Khan <address@hidden>
> Date: Sun, 16 Oct 2016 12:45:52 +0600
> On at least some platforms and toolkits (observed on
> Gtk+/X11/GNU/Linux), pressing a key chord such as C-s while a
> non-Latin keyboard layout is active produces an event with the correct
> modifiers but the base character interpreted according to that layout.
> For example:
>     $ setxkbmap en,ru , grp:ctrl_shift_toggle
>     $ emacs -Q
>     Ctrl+Shift
>     Ctrl+s
>     ⇒ C-ы is undefined

This problem doesn't exist on MS-Windows, FWIW.

> ## Expected behavior
> The general expectation among users is that the base key in a chord
> should be interpreted according to the installed Latin layout. In the
> above example, Ctrl+s should produce C-s, even though the Russian
> layout is active.

Why is this expected to be solved by Emacs, and not by some option on
the level of the OS keyboard driver?  I'm guessing that doing this in
Emacs would require messing with low-level keyboard interfaces,
something Emacs is better off without, IMO.

Moreover, the expected behavior, if implemented in Emacs, will have at
least 2 disadvantages:

  . it will disallow keystrokes with modifiers that use non-ASCII
    characters, such as C-ы
  . it will not solve the case of multi-key sequences, such as
    "C-x ы"
  . it may not be possible at all on a TTY, or at least I expect the
    problems there to be more prominent, since on many terminals M-x
    is sent to Emacs as "ESC x", which are 2 keys

So it could only be a partial solution at best.

I would expect solutions for this to exist already for GNU/Linux and
other free OSes, isn't that so?  If such solutions exist, why not use
them instead?

> 2: It may not be possible to confidently detect layout-based
> reinterpretation after the fact. For example, using the above en,ru
> example, pressing C-/ while the Russian layout is active will generate
> a C-. event.

Isn't there an X event already that announces the keyboard layout
change?  There is such an event on Windows, and Emacs already includes
support for it, albeit only in the Windows build.

reply via email to

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