Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have three keyboard layouts: en, ru and ua. Now I switch between layouts by pressing Ctrl+Shift (en->ru->ua->en->ru...). Here is part of my xorg.conf
I'm not sure if it can be done with any regular keyboard mapping tool. The standard X switching mechanism seems to be a simple rotate.
It appears, however, that you can instead use one of the input method frameworks, uim or scim, to work with languages that have different keboard mappings, and these can be configured with separate shortcuts for each layout. I've never personally tried either of them for languages like that though.
Here is one way to do it, which involves hacking the files in /usr/share/X11/xkb (alternatively you could set up your own keymap files). This is to select four keyboard layouts, but it will work for three.
First, add in a CapsLock selector type to the default xkb_types section in xkb/types/extra (this will be used to allow the CapsLock to select up to 4 different actions)
Then add in group set actions to the default xkb_compatibility section in xkb/compat/iso9995 (reinterpreting these somewhat so that they set a fixed group number)
Many thanks, neonsignal! This is what I need.
But I have a small problem with this. When I switch first layout by pressing CapsLock it switches correctly, then I press CapsLock+Shift to switch to the second layout and it switches correctly too. But when I press CapsLock again I get third layout instead of first. When I switch from third layot to first all works fine.
This is because I have only three layouts I'm right?
But I have a small problem with this. When I switch first layout by pressing CapsLock it switches correctly, then I press CapsLock+Shift to switch to the second layout and it switches correctly too. But when I press CapsLock again I get third layout instead of first.
It isn't because of only three layouts (I tested that case). It is more likely to be a problem with the "FOUR_LEVEL_CAPS" not being right, or not getting loaded. The way to test this is to see if ctrl-CapsLock is working.
I'm assuming that you didn't make any changes to the above. It would be worth looking at the Xorg log to see if there were any errors (these may also appear on the ctrl-alt-F1 terminal window).
Last edited by neonsignal; 02-15-2010 at 09:25 PM.
It isn't because of only three layouts (I tested that case). It is more likely to be a problem with the "FOUR_LEVEL_CAPS" not being right, or not getting loaded. The way to test this is to see if ctrl-CapsLock is working.
Ctrl+CapsLock is working, I can switch to third layout.
Switching from first to second layout works. Switching from first to third and from third to first works too.
When I switch from second layout to first I get third layout and need to press CapsLock again to perform switching.
Quote:
Originally Posted by neonsignal
I'm assuming that you didn't make any changes to the above. It would be worth looking at the Xorg log to see if there were any errors (these may also appear on the ctrl-alt-F1 terminal window).
I made changes in xkb files as you tell. When I discover this problem I check my changes twice and seems all edits are correct. Here is files with my edits.
Also I've look in Xorg.log and as I can see there are no errors related to the keyboard
Ctrl+CapsLock is working, I can switch to third layout. Switching from first to second layout works. Switching from first to third and from third to first works too.
When I switch from second layout to first I get third layout and need to press CapsLock again to perform switching.
I've been able to replicate the problem. On my system, running setxkbmapafter X windows starts (even without any parameters) fixes the problem (ie, CapsLock switches back to the first layout immediately).
This explains why I didn't see it earlier, because I was running setxkbmap to try out different combinations.
I don't know why setxkbmap would make a difference. My guess is that the setup order must be slightly different when X windows first starts, and something else is adding a definition to the capslock.
==EDIT==
Looking at the keymap (using xkbcomp) after X windows starts, CAPS is set to:
Which makes it look like the first group is wrapping into the second (perhaps because it was originally allocated only 2 entries by the pc keymap?). Running setxkbmap changes this to the way it should be:
[CODE]
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.