GNOME Bugzilla – Bug 705721
Non-Gnome-ish keyboard layout settings doesn't work when English layout is active
Last modified: 2013-09-16 10:29:37 UTC
My desired settings: Be able to switch between fa and us layouts using alt+shift, switch while Capslock is pressed, and having CapsLock LED on when ir layout is active. I configured the desired settings in Fedora installer, so corresponding Xorg config was created during installation, and works fine outside Gnome. Gnome selected Super+Space for switching in addition to my settings. But things didn't work correctly. CapsLock LED was not on when ir was active, and it didn't switch the layout when pressed when us layout was active (but it DID switch the layout when ir was active). Also, both Alt+Shift and Super+Space did change the layout (however the OSD appeared only when Super+Space is used), and also changed the current selected layout in gnome shell top bar. Now, I played a little with both Gnome typing settings and settings in tweak tool. In tweak tool it is not possible to select both switching with Alt+Shift and CapsLock when pressed. Therefore, I selected "CapsLock when pressed (Alt+CapsLock for original CapsLock Behaviour)" in tweak tool, and also CapsLock LED to be turned on in alternative layouts. In Gnome Type settings I selected Alt+Shift as the Modifier only switcher keys. I also left Super+Space enabled. Now I get a very special! behaviour: us layout is active. Alt+Shift doesn't change layouts. CapsLock doesn't do ANYTHING (not selecting ir layout, and not even changing the letters to capital). Now I switch the layout to ir using Super+Space. 'fa' layout is shown in Gnome Shell top bar and I can type Persian. Now, I can switch the layouts using Alt+Shift. CapsLock LED turns on when us layout is selected. The layout specifier in gnome shell top bar still shows 'fa' (while I'm typing English). I can also use Alt+Shift to switch back to 'fa'. Also, CapsLock works as intended: switching the layout when pressed. It is the behavior I'd like to always have, with two exceptions:LED turns on when 'us' is active, rather than when 'ir' is active; and gnome shell top bar doesn't show the current layout, but shows 'fa'. I can switch to 'us' using Super+Space, but I'll lose all other functionality. setxkbmap -print output when us layout is active: xkb_keymap { xkb_keycodes { include "evdev+aliases(qwerty)" }; xkb_types { include "complete" }; xkb_compat { include "complete+ledcaps(group_lock)" }; xkb_symbols { include "pc+us+inet(evdev)+capslock(groupshift)+group(alt_shift_toggle)+terminate(ctrl_alt_bksp)" }; xkb_geometry { include "pc(pc104)" }; }; When ir layout is active: xkb_keymap { xkb_keycodes { include "evdev+aliases(qwerty)" }; xkb_types { include "complete" }; xkb_compat { include "complete+ledcaps(group_lock)" }; xkb_symbols { include "pc+ir+us:2+inet(evdev)+capslock(groupshift)+group(alt_shift_toggle)+terminate(ctrl_alt_bksp)" }; xkb_geometry { include "pc(pc104)" }; };
Can you please be more specific? I get lost in your descriptions. Please outline only what you consider a bug or would like to see working.
Notice that my main keyboard layout is 'us'(en) and the alternative one is 'ir'(fa). Bugs in the first case (before playing with settings in gnome tweak too) (configuring desired shortcuts in X initially, and running gnome with default settings): 1. The OSD for keyboard layout selection didn't appear when using Alt+Shift for changing layouts. But it appeared when using Super+Space. Expected behavior: OSD should also appear when using Alt+Shift to change layouts 2. CapsLock LED didn't turn on when switched to 'ir' layout. Expected: it should turn on when 'ir' layout got activated. 3. When 'us' layout is active, CapsLock doesn't change the keyboard layout while pressed (as configured in X). But when 'ir' layout is active, it changes the layout to 'us' while pressed. Expected: it should always change the layout while pressed. Bugs in the second case (after changing settings in tweak tool and Gnome's modifier only keys for changing keyboard layouts): B.1. When 'us' layout is active (and gnome shows 'en' as the current keyboard language): B.1.1. CapsLock doesn't do anything. Not even its default behavior. (expected: change layouts while pressed) B.1.2. Alt+Shift no longer changes the layout to 'ir'. Only Super+Space works. Expected: Alt+Shift should change the active layout to 'ir'. B.1.3 Using Super+Space, the layout changes to 'ir', but CapsLock LED doesn't turn on B.2. When 'ir' layout is active (Gnome shows 'fa' as the current language): B.2.1. I can use Alt+Shift to switch the layout to 'us'. However, Gnome still shows 'fa' in top bar. It doesn't recognize the change to 'us' layout. If I use Super+Space, it does recognize that and goes into the above state (B.1). So, when Gnome thinks that 'ir' layout is active, I can change the layout to 'us' and change back to 'ir' using Alt+Shift but Gnome doesn't recognize any changes. Expected: Gnome should recognize changing layouts with Alt+Shift just like when Super+Space is pressed. B.2.2. CapsLock does change the active layout while pressed. However, again, Gnome doesn't recognize any changes. Expected: Gnome should recognize changes. I hope that it clarifies the current state.
(In reply to comment #2) > 1. The OSD for keyboard layout selection didn't appear when using Alt+Shift for > changing layouts. But it appeared when using Super+Space. Expected behavior: > OSD should also appear when using Alt+Shift to change layouts Not generally possible given the constraints. See bug 697447. > 2. CapsLock LED didn't turn on when switched to 'ir' layout. Expected: it > should turn on when 'ir' layout got activated. This is an X server feature that GNOME doesn't support currently - and I don't really see a reason to support it TBH. Note how that feature isn't exposed in gnome-control-center. > 3. When 'us' layout is active, CapsLock doesn't change the keyboard layout > while pressed (as configured in X). But when 'ir' layout is active, it changes > the layout to 'us' while pressed. Expected: it should always change the layout > while pressed. Switching layout only while a key is pressed is, again, an XKB feature not supported in GNOME. > Bugs in the second case (after changing settings in tweak tool and Gnome's > modifier only keys for changing keyboard layouts): Some of the XKB options work fine with the current GNOME implementation while others don't. Exposing them in gnome-tweak-tool is a best effort thing, not a guarantee that they work. Marking as WONTFIX until there's a good argument, with a clear design, to implement support for these features.
I wonder what can be considered a 'good argument'. For me, the (usually not used) keyboard LEDs like CapsLock LED and ScrollLock LED (which is a visual sign) can be checked much faster and easier than looking at the GUI to discover the active keyboard layout (which is text). I always used this feature until Gnome decided to remove it. And switching layout when a key is pressed is a great convenience in writing mixed language text. A good example is when working in shell. most of what you write in shell are usually in us script; and sometimes you need to write a few characters in another language. For example, you want to 'cd' to a directory which is named in native language. You should type 'cd', then usually the first letter (or a few beginning letters) of directory name and press tab. It is usually "too much" to use the usual switch layout key combination to write a single letter in the other layout. Using "switch while pressed" will increase your typing speed a lot.