From: Richard Wordingham <richard.wordingham@ntlworld.com>
To: help-gnu-emacs@gnu.org
Subject: AltGr and Basic Quail Input Method
Date: Sat, 30 Dec 2017 16:48:46 +0000 [thread overview]
Message-ID: <20171230164846.6f06b7be@JRWUBU2> (raw)
It has long irked me that the basic quail input methods, the ones
defined by maps from 'sequences of keystrokes' to strings introduced
by macro quail-define-rules, do not support the 'Alt Gr' modifier key.
I am using GNU/Linux, to be precise Ubuntu 16.04.3 with, I believe, the
Unity desk top. My locale is en_GB.utf8, The general input method
system is fcitx, my default keyboard is the X11 English (US) keyboard,
with the additional 4 system-provided X11 keyboards:
English (UK); Thai - Thai (TIS-820.2538); Khmer (Cambodia); Lao
and two X11 keyboard composed myself:
Thai - Tham Kesmanee and Newa (Newa script).
Unfortunately, under X11 one can only map keysyms to codepoints, not to
user-perceived characters.
I also have some M17N keyboards on my pick list that I run from fcitx.
(I had to patch fcitx to get it to work with AltGr.)
I generally use Emacs 24.4, the version I modified to support stepping
into Indic clusters.
I have dug deeper, and found that there seem to be two obstacles to
using the 'AltGr' modifier key with basic quail input methods. Firstly,
the modifier map I get for my selection of input method and reported by
xmodmap -pm, is:
shift Shift_L (0x32), Shift_R (0x3e)
lock Caps_Lock (0x42)
control Control_L (0x25), Control_R (0x69)
mod1 Alt_L (0x40), Meta_L (0xcd)
mod2 Num_Lock (0x4d)
mod3
mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf)
mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)
This results in Emacs seeing only shift, control, meta and super
modifiers. The right Alt key is variously engraved as 'Alt' and 'Alt
Gr', but the associated keysym is ISO_Level3_Shift. I have not
identified the 'Mode_switch' key on my physical keyboards.
I have found a solution to the first problem. I launch Emacs from a
terminal emulation, and prior to starting it I issue the command:
xmodmap -e 'keysym Mode_switch = Mode_switch Alt_R'
This then has the effect that Emacs now also sees an alt modifier, which
it registers when I use the AltGr key.
Is there any reason not to change Emacs to treat the ISO_Level3_Shift
if it has rejected the other candidate alt keys? (Alt_L is rejected
because it is bound to the same modifier as Meta_L - the left alt key
is consequently interpreted by Emacs as a 'meta' key.) Could this
change be effected more simply in the user's start-up script?
On the quail side, the problem seems to be that input keystrokes are
being stored as a string rather than as a vector. Is there any reason
not to hope that one can convert the quail input method to deal with
full keystrokes rather than just with characters? A more ambitious
solution would be to use an input method direct from M17N, but I think
that has a high risk of failure.
Richard.
reply other threads:[~2017-12-30 16:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20171230164846.6f06b7be@JRWUBU2 \
--to=richard.wordingham@ntlworld.com \
--cc=help-gnu-emacs@gnu.org \
/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.