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

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

Re: Using AltGr as standard modifier key in emacs


From: Yuri Khan
Subject: Re: Using AltGr as standard modifier key in emacs
Date: Wed, 14 Oct 2015 12:05:18 +0600

On Tue, Oct 13, 2015 at 7:11 PM, Shahab Shahsavari Alavidjeh
<zzgraph@gmail.com> wrote:
> Why I don't simply use my D.E. input method support and keyboard layout
> switcher instead?
>
> I'm currently using it, that's my best option right now, but then I
> should switch keyboard layouts whenever I want to run a command in emacs
> or even when I want to save a file to disk.

I want to expand on Shahab’s description of the problem.

1. Assume a user who works with more than one script (e.g. Latin and
Arabic, or Latin and Cyrillic, or Latin and Greek.) Not just
occasionally entering non-Latin characters, but actually writing whole
words, sentences, paragraphs and chapters in a language using a script
other than Latin.

2. Assume also that Emacs is used as an application in a desktop
environment, rather than as a desktop environment in and of itself.
Assume multiple other applications.


(1) is typically facilitated by providing multiple keyboard layouts,
called groups in X parlance. Groups are modal, that is, after one
group is activated, it remains active until the next switch. It is a
matter of user preference whether the active group is global to the
desktop or local to each application window. The set of groups is
typically kept constant.

Emacs provides a similar facility, called input methods. Input methods
are typically switched with C-\\, are local to Emacs, and never affect
other applications on the desktop.

In light of (2), it is desirable that (a) the layouts in Emacs and the
desktop environment are identical, (b) the keys to switch layouts are
identical, and (c) the scope of layout switching is consistent. All
three conditions are easiest satisfied by exclusively using the
desktop-provided keyboard layout mechanism and ignoring Emacs input
methods completely. (Shahab is asking for a way to emulate the
desktop’s layouts using Emacs input methods, but I believe that is a
dead end approach. There should be one, and preferably only one,
implementation of keyboard layout mechanism over the whole desktop.)

However, this comes at a cost. Because of the way modifiers work in
Emacs when running as a GUI application, the user has no way of
pressing e.g. C-c or C-x or M-x when a non-Latin layout is active.
Instead, Emacs interprets the keypresses as being C- or M-modified
letters of the active layout.


It would be a great help if modifiers and certain prefixes caused
Emacs to ignore the active layout and interpret the base keys
according to the primary layout, which will be one of Latin layouts in
most cases. (Which exact Latin layout will vary from user to user — US
QWERTY, German QWERTZ, French AZERTY, Dvorak, Colemak, etc.)

There are workarounds involving key-translation-map to make Emacs
pretend that it got C-q when it gets C-й, but they are ugly,
unreliable, and incomplete. Ideally, it should happen at the
underlying OS integration boundary.



reply via email to

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