[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [m17n-list] Modifier Keys for fcitx-m17n?
From: |
Richard Wordingham |
Subject: |
Re: [m17n-list] Modifier Keys for fcitx-m17n? |
Date: |
Fri, 17 Nov 2017 00:52:16 +0000 |
On Thu, 16 Nov 2017 22:37:57 +0900
handa <address@hidden> wrote:
> Actually "FcitxKeyState_ScrollLock" is very mysterious, but it seems
> that fcitx-m17n somehow tries to generate an input key symbol modified
> by AltGr for m17n-lib. At the moment I can't try it because I don't
> know how to generate "AltGr"ed key on my Japanese keyboard.
It seems that fctix-m17n is innocent. The culprits seems to be higher
up in fcitx. For X, function XIMProcessKey() in ximhandler.c contains
the devastating sequence
kev = (XKeyEvent *) & call_data->event;
memset(strbuf, 0, STRBUFLEN);
keyCount = XLookupString(kev, strbuf, STRBUFLEN, &originsym, NULL);
const uint32_t originstate = kev->state;
state = kev->state - (kev->state & FcitxKeyState_NumLock) -
(kev->state & FcitxKeyState_CapsLock) - (kev->state &
FcitxKeyState_ScrollLock);
With a fairly common modifier mapping in X of:
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)
I am left with shift, control, alt and super. The application takes
alt, the desktop takes super (i.e. left and right Windows keys). Ctrl
is limited, partly by fcitx-m17n, and partly by something higher up.
If the characters are handled via the D-bus, then the assignment
state = originstate & FcitxKeyState_SimpleMask;
in function IPCProcessKey() in file ipc.c of fcitx does the damage.
The mask is defined as
FcitxKeyState_SimpleMask =
FcitxKeyState_Ctrl_Alt_Shift | FcitxKeyState_ Super |
FcitxKeyState_Super2 | FcitxKeyState_Hyper | FcitxKeyState_Meta,
My keyboards don't have physical keys for Super2, Hyper or Meta.
I haven't yet confirmed that state bit 7 (mysteriously called 'scroll
lock') gets through to XIMProcessKey() and IPAProcessKey(), but they
seem to be where the problem lies.
Richard.