You are not logged in.

#1 2008-10-28 04:54:53

mhd
Member
Registered: 2008-02-06
Posts: 21

AltGr and XKB group switching

I'm currently trying to replicate the keyboard layout switching that Mac OS or Windows do (and I think I had this working ages ago under Linux). I've got  my old German Model M keyboard, and want to use the US layout for programming -- where brackets and braces are more useful than umlauts for example...

So the general idea would be pressing some key combination like Alt+Shift to toggle the layouts. I've got this working in X11, but once I enable this, the right Alt key (AltGr) is used to switch layouts, too. So when I press right alt and one key, I get the key as set under the currently inactive layout.
Which isn't very helpful, as I kinda need that key with the German layout, where it's used to access characters like the at-sign and tilde. I could access them via the US layout, but that seems rather troublesome.

The relevant section from my xorg.conf looks like this

Section "InputDevice"
        Identifier  "Keyboard1"
        Driver      "kbd"
        Option      "AutoRepeat" "500 30"
        Option      "XkbRules" "xorg"
        Option      "XkbModel" "pc102"
        Option      "XkbLayout" "de,us"
        Option      "XkbVariant" "nodeadkeys"
        Option      "XkbOptions" "ctrl:nocaps,grp_led:scroll,eurosign:e,grp:switch,grp:alt_shift_toggle"
EndSection

It seems the 'grp:switch' option is responsible for the AltGr remapping, but if I omit it, the group toggle won't work.

I googled this, but haven't seen a solution that would fit my problem, so if anyone could lend a hand...

Last edited by mhd (2008-10-28 05:05:05)

Offline

#2 2008-10-28 06:56:48

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,328

Re: AltGr and XKB group switching

I think you definitely don't want grp:switch there, since that one exactly causes the behavior you described with altgr. Have a look at /usr/share/X11/xkb/symbols/group
The real question is why grp:alt_shift_toggle doesn't work then.
I don't have a good idea what could cause the problem. I'd probably try some other combinations to try to narrow down the problem - eg some other key combinations with grp:, or try to leave out some other options...
[I use grp:menu_toggle,grp_led:caps and all is good.]

EDIT: I noticed something: when you give the XkbVariant, I think it should be specified for which Layout do you want it, so probably should be (notice the comma)
XkbVariant "nodeadkeys,"

Last edited by bender02 (2008-10-28 06:59:18)

Offline

#3 2008-10-28 14:59:32

mhd
Member
Registered: 2008-02-06
Posts: 21

Re: AltGr and XKB group switching

bender02 wrote:

EDIT: I noticed something: when you give the XkbVariant, I think it should be specified for which Layout do you want it, so probably should be (notice the comma)
XkbVariant "nodeadkeys,"

Thanks, it looks like that made the config somewhat invalid and gave me some problems. I deleted all options, added them back one by one, making sure that everything was working fine and finally got the the point where everything works as intended.

Offline

Board footer

Powered by FluxBB