7

I recently upgraded to Ubuntu 13.10. In Ubuntu 12.04, I was able to define a key which, while holding it, temporarily switched to a different keyboard layout. I haven't been able to find a way to get that functionality in 13.10: the only option seems to be to toggle between different layouts using the "Switch to next source" shortcut.

Is there a way to get the "hold a key to temporarily switch to a different keyboard layout" functionality in 13.10?

Jake
  • 171

3 Answers3

2
  • With Gnome 3.6, layout setting method changed. So Ubuntu 13.10 and later, has different behavior then before. This should work well in Gnome (Tested Ubuntu 13.10/14.04).

  • Unity seems not to use xkb-options (Tested it in Ubuntu 13.10/14.04). Even using for example:

    setxkbmap us,ara -option grp:rctrl_switch
    

    It just works for seconds, then it is reseted.

    Edit /usr/share/X11/xkb/symbols/pc, Remove rctrl from ctrl binding:

    //modifier_map Control{ Control_L, Control_R };
    modifier_map Control{ Control_L };
    

    again:

    setxkbmap us,ara -option grp:rctrl_switch
    

    It just works, till it I use change my layout using Super+Space or directly from indicator. So as workaround for Unity, Disable layout toggle shortcuts (layout indicator could removed too) then add a -option grp:..._toggle to setxkbmap .

So for Gnome:

  1. Use dconf-editor → org → gnome → desktop → input-sources

  2. Add setxkbmap options to xkb-options, example:

    ['grp:rctrl_switch']
    

To see all possible options:

more /usr/share/X11/xkb/rules/xorg.lst | grep grp:

enter image description here

user.dz
  • 49,176
1

Please follow these steps:

  1. Select System Settings... from system menu; snap1

  2. Select Keyboard; snap2

  3. Under the tab labelled Typing click Layout Settings; snap3

  4. In the Keyboard settings window, under Shortcuts tab, select Typing. The default for Switch to next source is Super+SPACE; clicking on it will ask you to assign a New Accelerator..., press the desired key combination to change to next Layout (I used Super+L.) and it will be assigned to change to next layout.

    (Then I assigned something similar for Switch to previous source using the same preferred layout, and then began to test them. Switching from the preferred layout to the alternate worked but the reverse did not. Please refer the next step for the fix.) saucy1

  5. In the same window you can select/assign Compose key. The preferred one is Right Alt composeKey

  6. After assigning Super+L for "Switch to next source" using my preferred layout, I changed my keyboard layout to the alternative layout and then assigned the combination to "Switch to previous source" (for which I used Shift+Super+L). Then I tested them, and they work fine.

    The new accelerators for the key combos that I used looks like this: saucy2


Useful Links:

  • How can I enable Compose key?

  • How can I type accentuated characters like ë? alt. How to use compose keys?

    Summary:

    Using compose key, here assigned to Rt. Alt:

    • For ö you press Compose followed by Shify+' then o keys; putting the same other way it's Compose " o or Rt. Alt " o .
    • For ß you press Compose followed by s then s keys.

    (..here you'd have to remember the two character combination)

    You can get the combination for compose key (and Unicode number) with this command in terminal:

    cat /usr/share/X11/locale/en_US.UTF-8/Compose | grep ö
    

    (where ö should be replaced by the character of your choice.)

    which would output something like:

    <Multi_key> <quotedbl> <o>          : "ö"   odiaeresis
    

    (where <Multi_Key> is the Compose (Shift or Shift+Rt.Alt) key, <quotedbl> is the double quote - " i.e. Shift+' and <o> is the lowercase o i.e. o. For upper case Ö use O i.e. Shift+o and instead for the last character of compose combo.)

    Using hexadecimal Unicode character code point:

    • Press (and release) Shift+Ctrl+U, then, while underlined u is displayed, enter the hexadecimal Unicode character code point followed by Return or Space.

    e.g. Ctrl+Shift+u followed by 2 6 3 b and then Return or Space for ☻ .

    (..so this one would require you to remember the Unicode number)

☻ cheers...

rusty
  • 16,917
0

Since asking the question, I've switched to Linux Mint 17 with the Cinnamon desktop. The Cinnamon desktop provides the same options for temporarily switching layouts that were available on Ubuntu 12.04, including the option to hold a particular key to temporarily switch keyboard layouts.

Jake
  • 171