*

Welcome, Guest. Please login or register.

Get your own OLPC - Buy an XO laptop on eBay!
Pages: [1]
Print
Author Topic: How to toggle keyboard layouts  (Read 12724 times)

How to toggle keyboard layouts

bethf
Commenter

Posts: 26


WWW
December 21, 2007, 12:53:13 PM

Can somebody explain how to toggle between different keyboard layouts?

I finally found this page: http://wiki.laptop.org/go/Customizing_NAND_images

and it has section about how to configure the keyboard layout for the system, pointing to the file that is actually being used (/etc/sysconfig/keyboard).

I created a copy of the keyboard file in home/olpc/.kbd, with the following content:

KEYTABLE="us"
XKB_MODEL="olpc"
XKB_LAYOUT="dk,us"
XKB_VARIANT="olpc"
XKB_OPTIONS="grp:alt_shift_toggle"

This actually gives me a Danish keyboard (instead of the default US keyboard the system can with), but the toggle does not work - and no other keyboard combination seems to work. The URL above has the example with multiple keyboard layouts, but absolutely no information about how to actually toggle (my attempt above is just from xorg.conf examples). So I am at a loss here...

Anybody have any experience or advice?
 
Logged

#1 Re: How to toggle keyboard layouts

darius
Commenter

Posts: 23


WWW
December 21, 2007, 01:01:01 PM

I don't know about that kind of configuration, but I've been able to change my layout a different way. Start up a terminal and enter "xsetkbmap dvorak" for the Dvorak layout. Changing "dvorak" to "us" is supposed to take it back to the US layout, though I haven't tried it. I realize this is much more awkward than a keyboard shortcut would be -- hopefully someone who knows more will come along.
Logged

#2 Re: How to toggle keyboard layouts

bethf
Commenter

Posts: 26


WWW
December 21, 2007, 01:14:48 PM

Well yes, I have been able to do that too (using xsetkbmap). I should have said that. However, since I want to use keyboard layouts like Bangla, Hindi, etc. it doesn't work too well - there is no way to type the xsetkbmap command (or any other command, for that matter) since I couldn't find a way to toggle between the Bangla keyboard and Latin characters.
Logged

#3 Re: How to toggle keyboard layouts

darius
Commenter

Posts: 23


WWW
December 21, 2007, 01:57:09 PM

Here's a horrible idea: you can use the up-arrow key in the terminal to get back a previous command you entered. So, enter an "xsetkbmap us", then the layout you want to use, then to get back hit up-arrow twice and then return. Ridiculous, I know, but workable as a stopgap?
Logged

#4 Re: How to toggle keyboard layouts

bethf
Commenter

Posts: 26


WWW
December 21, 2007, 02:08:53 PM

He he, ingenious. You are right, it's a rather horrible idea, but better than nothing right now.

But please, don't let this stop other people from coming up with the real solution, mind you  Wink

There's gotta be a way to do this (I hope...).
Logged

#5 Re: How to toggle keyboard layouts

bethf
Commenter

Posts: 26


WWW
December 22, 2007, 01:53:25 PM

Found a little more information, I think it looks like a bug:

I found the following warning in the startup messages:

Quote
Multiple names for keycode 211
Using <1211>, ignoring <AB11>

And then this snippet from a ticket here: http://dev.laptop.org/ticket/663

     
Quote
Jim had previously added the following to XF86keysym.h I see no reason not to use them. We do not need to define a language key--it is already there as AB11, assigned to the proper action.

I am not positive that these got into the builds, if so then we should definitely be using them.

If not....

This seems to indicate that <AB11> is supposed to be assigned to the language key, and for some reason there's a conflict, with the result that the key is assigned to something else.

Does anybody have this language key working? Would be curious to know whether it's just me.
Logged

#6 Re: How to toggle keyboard layouts

bethf
Commenter

Posts: 26


WWW
December 22, 2007, 02:51:57 PM

OK, I finally got this to work. It turned out that I didn't have the XKB_VARIANT options specified in the correct order, and that some of the keyboards I was trying to use didn't have the correct keymap definition for the language key. After updating those, it now works. Smiley
Logged

#7 Re: How to toggle keyboard layouts

skyc
Commenter

Posts: 7


March 02, 2008, 02:19:01 AM

Could you give a bit more detail on what you changed? I'm trying to get it so I can toggle between Greek and English. I can do it temporarily by typing:

setxkbmap -layout "us,gr" -option "grp:alt_shift_toggle"

Next time I reboot, though, I have to type it again (or up-arrow) to get the greek keyboard back.

I've tried modifying /etc/sysconfig/keyboard so that it reads:

KEYTABLE="us"
XKBMODEL="olpc"
XKBLAYOUT="us,gr"
XKBVARIANT="olpc2,olpc"
XKBOPTION="grp:alt_shift_toggle"

but it doesn't seem to have any effect.

Thanks for any advice you can offer.
Logged

#8 Re: How to toggle keyboard layouts

mavrothal
Administrator
OLPC News Forum Expert
*****
Posts: 1289


August 06, 2008, 12:48:00 AM

You have probably found it by now but here is how it worked in my case (without changing any other file before).
In the terminal as a user, create (or  edit if the file is there with different content) the invisible ".kbd" file in your home directory  with the command at the prompt:
nano .kbd
enter  these 2 lines in the file as shown
XKB_LAYOUT="us,gr"
XKB_VARIANT="none -option grp:ctrl_shift_toggle"

crtl-X (to exit the editor)
y (to save at the prompt)
reboot sugar to activate the change.
If you also want the interface in another language create the ".i18n" file as above with this 1 line in the file
LANG=el_GR.UTF-8
These worked for me from build-656 to joyride-2235
Obviously these work for any other language combo by changing the respective points ('gr' and  'el_GR.UTF-8'). Also you can use other key combinations like 'alt-shift'. 'crtl_shift' is a double edge sword in the XO, you can do it with one finger but also by mistake depending on your finger size and typing ability  Tongue

PS: For the record, I was told of this  hack by  Alexios Zavras.
Logged

XO-1: Is never going to run Flash, but is certainly flashy!
(If you want Flash, get an XO-1.5 running OLPC 11.2.0 or XOpup Grin )
Pages: [1]
Print
Jump to:  

Members
Total Members: 2406
Latest: sembik
Stats
Total Posts: 31943
Total Topics: 3843
Online Today: 12
Online Ever: 238
(April 18, 2011, 09:48:50 PM)
Users Online
Users: 0
Guests: 14
Total: 14