On 2008-05-28, Tomá¹ Ebenlendr <[EMAIL PROTECTED]> wrote:
> Yes, xkb was very shitty last years, now sucks bit less:
> Option "XkbLayout" "us+cz:2+inet6720+group(switch)+group(shifts_toggle)"
>
> So I have us keyboard as group 1, czech keyboard as group 2,
> inet6720 defines additional keys on my usb keyboard, group(switch) changes
> AltGr to group modifier, and group(shifts_toggle) makes press of both
> shifts to be inerpreted as group-lock. Also I use xkbvleds swallowed by
> statusbar (as tray application) to indicate status of group-lock and
> all three standard locks. - my notebook doesn't have keyboard leds and also
> it is more comfortable to have the leds in front of my head instead of
> "below fingers".

So you can both lock groups, and switch to them while a modifier is
pressed, within the same keymap. Clearly it is not possible handle 
this right through XGrabKey, i.e. not grabbing combos when a group-switch
modifier is held (unless the modifier is bound to one of the standard
modifiers as well), but grabbing during lock group states. Xkb groups
are fucked up. Indication of different keymaps should be completely 
separate from modifier states. (That is, a modifier may be mapped 
to switch to a given group while pressed, but there is a separate 
bit indicating the modifier being pressed.)

Actually, there even seems to be variation in how X handles
grab masks and Mode_Switch: at home Ion receives combos with
Mod1Mask|Mode_Switch set, if it has grabbed on Mod1Mask, but
IIRC on the box at work it doesn't... Another interesting thing
is that even if I map Mode_Switch to the Mod3 modifier or
so, X still does not set this bit in the state, only the 0x2000 
bit! So there's no way to separate the modifier and group switching
bits, and Ion still receives the key, although it has grabbed only
the states with Mod1 or one of the lock modifiers set (Lock or
Mod2=Num_Lock... num lock should really be another group, BTW,
not tied to a modifier bit, as it is not a key that is typically 
held down. Lock should also not be interpreted in grabs as a modifier
bit, but rather a group bit, so it wouldn't be necessary to make
redundant grabs on Lock-combos too.) The original complainer
should therefore have no problems on the version of X I'm running
(from Etch), because the server simply masks the groups, or at
least the one tied to Mode_Switch, and for some reason Ion actually 
masks the state with KNOWN_MODIFIERS_MASK in the binding search code
although it does not ask as to grab things with other modifiers set.

It's all fucked up.

-- 
Tuomo

Reply via email to