capslock led after upgrade to xorg-server-1.4.2,1

Andriy Gapon avg at icyb.net.ua
Thu Jun 19 17:39:49 UTC 2008


on 19/06/2008 18:58 Kevin Oberman said the following:
>> Date: Thu, 19 Jun 2008 15:37:18 +0200
>> From: "Paul B. Mahol" <onemda at gmail.com>
>> Sender: owner-freebsd-x11 at freebsd.org
>>
>> It is upstream issue/regression. I liked how it was before ... but
>> Xorg devs have different opinion.
> 
> Hmm. They have the opinion that busted is good?
> 
> This has been annoying for a while. I swap CapsLock with LeftCtrl. I
> have done this ever since Microsoft decided to "hide" it down below the
> shift key. It has always worked fine, but it "broke" with xorg 7.2
> (or maybe 7.3). Now, to get ALT+CTRL to work, I need to press ALT first
> and then CTRL, which is not my natural tendancy. It's very annoying.
> 
> I have confirmed with xev that all of the press/release events are
> proper, so it's something in the processing of the events that is
> foobar. 

I think that this is a result of how XKB works. After you swapped CAPS 
and LCTL the latter stopped being a modifier key, so when it is pressed 
  "CTRL" modifier flag is not set and there is no magic about CTRL+ALT. 
On the other hand ALT is still a modifier key, so ALT+CTRL can still be 
magic.
I think that you can still make CTRL+ALT work through some configuration 
hackery for ALT key. And pressing CAPS+ALT should work right now 
(because CAPS now sets the modifier flag).

What can not be changed, and you are completely correct here, is that a 
key a press has an effect on XKB state as soon as it is pressed. Only 
previous key presses can affect current key press, but current key press 
can not wait for future key presses. So for XKB ALT+CTRL and CTRL+ALT 
are always different sequences, but "normally" they can be made to have 
the same effect.

E.g. see /usr/local/share/X11/xkb/symbols/group:

partial modifier_keys
xkb_symbols "ctrl_alt_toggle" {
     virtual_modifiers Alt;
     key <LALT> {
         type[Group1]="PC_CONTROL_LEVEL2",
         symbols[Group1]= [ NoSymbol,    ISO_Prev_Group ],
         virtualMods= Alt
     };
     key <RALT> {
         type[Group1]="PC_CONTROL_LEVEL2",
         symbols[Group1]= [ NoSymbol,    ISO_Next_Group ],
         virtualMods= Alt
     };
     key <LCTL> {
         type[Group1]="PC_ALT_LEVEL2",
         symbols[Group1]= [ Control_L,   ISO_Prev_Group ]
     };
     key <RCTL> {
         type[Group1]="PC_ALT_LEVEL2",
         symbols[Group1]= [ Control_R,   ISO_Next_Group ]
     };
};

First two "key" clauses define what happens when ALTs are pressed while 
CTRL modifier is in effect, two others define the opposite situation.

In any case, this does not seem to be related to my original report.

-- 
Andriy Gapon


More information about the freebsd-x11 mailing list