PDA

View Full Version : [SOLVED] Can not set "key to switch layout"



alexeik
3rd January 2013, 06:50 PM
Currently I have F16 installed on my home machine. I am native russian, and have an alternative keyboard layout to enter cyrillic letters. I use a combination "Alt-left + Shift" as a switch between layouts. In F16 I can setup this via System setting -> Region and Language -> Options -> Key(s) to change layout.
This recipe works on F17 as well. But I can not find a way to setup this feature on TC3 of F18.
Could someone please shed some light on this matter?

Many thanks!

AdamW
5th January 2013, 08:54 AM
this is being worked on in upstream GNOME for 3.8. for now I think you can set this up via gnome-tweak-tool, if I recall correctly.

MuadNu
8th January 2013, 04:07 PM
Gnome-tweak-tool helps with that. But what I have not found a way to do is to set up a key so that the layout is changed while the key is pressed. I used to have the right-alt set up like that, so I could type accents more easily in my English keyboard, but seemingly there's no way to do it easily in Gnome 3.6. I'd appreciate to know about any workaround...

christian_l
8th January 2013, 10:20 PM
Gnome-tweak-tool helps with that. But what I have not found a way to do is to set up a key so that the layout is changed while the key is pressed. I used to have the right-alt set up like that, so I could type accents more easily in my English keyboard, but seemingly there's no way to do it easily in Gnome 3.6. I'd appreciate to know about any workaround...

Here's a somewhat different approach: for accents and umlauts I use the compose key feature. To get for example an "", I press right alt(=my compose key), followed by " and a. See http://en.wikipedia.org/wiki/Compose_key#Common_compose_combinations for some of the sequences that get you the different characters. You can choose which key shall be your compose key in System settings - keyboard - shortcuts - typing - compose key.

Edit: yes, this might not work for the initial poster to get cyrillic letters. But if you know of a command or script that you can run to toggle your keyboard layout, you should be able to create a shortcut to run this command in System settings - keyboard - shortcuts - custom shortcuts.

AdamW
8th January 2013, 10:58 PM
also note that you can set up a layout switch key combination during installation at the Keyboard spoke. To get technical for a minute, this configures the switch combination *at the X level* - it gets written into an xorg.conf.d snippet - so it should work in any X environment, so long as it's not overridden at some higher configuration level. If you are using a layout like Russian where it's pretty much expected that you switch between the 'native' layout and an English layout for entering Roman characters, make sure you add both the native and English layouts during install, and set up a switch combination, or else you'll likely get stuck at root password entry or firstboot. There'll be a commonbugs entry for this. More background at https://bugzilla.redhat.com/show_bug.cgi?id=892110 , it's a rather tricky problem. Note that in previous Fedora releases, when you picked such a keyboard layout, anaconda would automatically enable both X keymaps and configure 'both shift keys' as a layout switch combo, so you hit both shift keys together to toggle layouts in X.

MuadNu
9th January 2013, 12:24 AM
Thanks, christian_I, that does it.

Nevertheless, it is slightly more convenient for me to do it the "old way". So AdamW, regarding your answer, I wonder whether it can still be done after installation...

AdamW
9th January 2013, 02:55 AM
muadnu: I don't know if there's any interactive utility that can do it, but you could certainly edit the keyboard config file in /etc/X11/xorg.conf.d manually. https://wiki.archlinux.org/index.php/Xorg#Switching_between_keyboard_layouts has some useful details that apply to Fedora. The /usr/share/X11/xkb/rules/xorg.lst file it mentions lists all the possible settings for the layout switch key/combo.

sea
9th January 2013, 02:17 PM
These 2 GUI may help:
system-config-language
system-config-keyboard

AdamW
9th January 2013, 07:44 PM
sea: those are badly broken for f18, I recommend not using them.

christian_l
9th January 2013, 10:16 PM
I think I found a solution. Try running this from the command line:

setxkbmap -option grp:lalt_lshift_toggle us,ru

This allows you to toggle between US and RU layout whenever you press the left Alt and left Shift keys together. More options can be found in /usr/share/X11/xkb/rules/base.lst. Now just start gnome-session-properties, and add a new startup program. Name it something like "switch keyboard", and enter your full setxkbmap command in the command field. That should make it run automatically each time you log into Gnome (or Cinnamon). :)

AdamW
10th January 2013, 04:00 AM
christian: that's just the runtime version of what I described above. It's basically the same mechanism - you can configure it 'permanently' in an xorg.conf.d snippet.

christian_l
10th January 2013, 04:04 AM
christian: that's just the runtime version of what I described above. It's basically the same mechanism - you can configure it 'permanently' in an xorg.conf.d snippet.

Ah, right - I didn't look at that...

alexeik
12th January 2013, 07:43 AM
Hi, Everybody.
Thanks for Your help.
gnome-tweak-tool solved the problem.
Thanks again!