« How to Trace the... | Main | setxkbmap in Nevada! »

I'm quite often answering questions related to keyboard input and how to switch the keyboard layout. First of all it is possible and it is not really as difficult ;) Solaris made a significant progress in keyboard input area and there is also a GUI and platform independent framework for it. So if you need a specific keyboard layout you have basically to options: 1) to use IIIMF and its preference editor 2) to set up a Xserver I recommend the first option, but there are some constrains. So if that doesn't work for you there is still the second option and you can set up a Xserver in the same way as it can be setup on all systems using Xorg.

1) Switching Keyboard Layout in Solaris using IIIMF

Constrains: JDS/CDE desktop, UTF-8 locale IIIMF - Internet Intranet Input Method Framework is openi18n.org project used by Solaris to provide national characters input originally targeted for Asian languages and designed by Hideki Hiura. Recently also support for European keyboards was added so this framework is covering all languages now. You can find European keyboard support there in OpenSolaris, Solaris Express Community and Developer Edition >b57 and Solaris 10 8/07.

To switch the keyboard layout look at Input Method Preference Editor (accessible by default from the panel clicking on Input Method Switcher applet or from terminal "$ iiim-properties";)

In the Input Method Preference Editor you can customize the list of required keyboard layouts

Once you have added layouts you need you can start using them. To switch to wanted layout select it in Input Method Switcher applet. The layout must be activated (use ctrl+space shortcut to activate/deactivate) otherwise default Xserver setting is used. You can easily recognize the layout is activated when "keyboard" keyword is displayed on the panel next to layout code.

If keyboard layout or input method is not activated the default Xserver is used. I recommend to not set anything regarding to keyboards and to use US-English layout as the default one. But it may happen you have selected the keyboard layout during installation process or you configured keyboard layout on the Xserver side. This couldn't cause problems, but if yes go again to Input Method Preference Editor and double check the setting if Xserver keyboard layout autodetection is correct. If not disable the autodetection and select your layout manually.



Switching Keyboard Layout in Solaris setting up the Xserver

 

In case you are working in non UTF-8 locale or using other window manager than JDS/CDE you will need to configure your Xserver to switch to keyboard layout. Solaris is using Xorg xserver on x86 and Xsun on Sparc, but in general both Xservers are available on both platforms, well the Xorg is the preferred one. There is couple of ways how to switch the layout.

If you don't need switching between keyboard layouts on the fly and you just need to set one permanently
 you can use "kbd -s" utility:
--------------------------
bash-3.2$ kbd -s
1. Albanian 22. Latvian
2. Belarusian 23. Macedonian
3. Belgian 24. Malta_UK
4. Bulgarian 25. Malta_US
5. Croatian 26. Norwegian
6. Czech 27. Polish
7. Danish 28. Portuguese
8. Dutch 29. Russian
9. Finnish 30. Serbia-And-Montenegro
10. French 31. Slovenian
11. French-Canadian 32. Slovakian
12. Hungarian 33. Spanish
13. German 34. Swedish
14. Greek 35. Swiss-French
15. Icelandic 36. Swiss-German
16. Italian 37. Taiwanese
17. Japanese-type6 38. TurkishQ
18. Japanese 39. TurkishF
19. Korean 40. UK-English
20. Latin-American 41. US-English
21. Lithuanian
To select the keyboard layout, enter a number [default 41]:
--------------------------
To pick up a layout you need to restart your Xserver (logout/login).

 

In most of case you need to switch between keyboard layouts on the fly. This is possible only on Xorg. You need to make manual setup in xorg.conf (/etc/X11/xorg.conf). If you don't have xorg.conf you have to create it. Again there is more options:

1) run "/usr/X11/bin/xorgconfig" -- interactive setting
2) run "/usr/X11/bin/Xorg -configure" -- non interactive

Once you have the xorg.conf you can customize it. Open it and look at the keyboard section. You should have something similar to below example there:

 # vi /etc/X11/xorg.conf
...
Option "XkbRules" "xorg"
Option "XkbModel" "sun_type6_euro_usb"
Option "XkbLayout" "us,de,es"
Option "XkbOptions" "grp:shifts_toggle"
Such settings enables you to toggle between US-English, German, Spanish keyboard layouts on the fly using defined shortcut. In shown example I use both shift keys. You can look at An Unreliable Guide to XKB Configuration written by Doug Palmer (http://www.charvolant.org/~doug/xkb/html/index.html) if you are interested in Xorg keyboard settings.

 



Switching Keyboard Layout in Solaris - Compose Key

 

If you don't need necessarily complete keyboard layout but need just time to time to input a special national character there is a compose key in Solaris. Some keyboards (e.g. Sun Type USB) have this key physically for other keyboards the compose key is mapped to the "menu key". The Compose key sequence is used to input characters with diacritical marks and other characters that are not shown on the keyboard key caps.

Mark                 Compose Key Combination                Example
Dieresis A               Compose A “ —> A with diaeresis        Ä
Caron v                  Compose Z v —> Z with caron            Ž
Breve u                  Compose G u —> G with breve            Ğ
Registered Sign          Compose R O —> Registered sign         ®
Copyright Sign           Compose c o —> Registered sign         ©
Inv. Exclamation Mark    Compose ! ! —> Inv. Exclamation Mark   ¡

 

To see all possible combinations look at Solaris 10 International Language Support Collection >> International Language Environments Guide (http://docs.sun.com/app/docs/doc/817-2521?l=en) or this is directly defined for each locale in /usr/openwin/lib/locale//Compose.

Comments:

Petr --

Any information about how to deal with keyboard layout in the non-GUI PC Console environment? I'm having trouble finding any docs on what files are used for keyboard layout when you answer the question about it after doing a "sys-unconfig".

Thanks!

Posted by D. J. Hagberg on December 19, 2007 at 08:08 PM CET #

Hi D.J.,

I believe it is not necessary to do "sys-unconfig".
As for x86 platform ther is a utility "kdmconfig". You can run kdmconfig to select Xsun and keyboard layout. Layout is set for console as well. Then run kdmconfig again and switch back to Xorg. The result is no change is made for desktop/Xorg, but only console keyboard is changed. you can do it manually as well by setting eeprom variable:
bash-3.00# eeprom
...
keyboard-layout=US-English

e.g.
bash-3.00# eeprom keyboard-layout=Spanish

to get the list of available layouts run
"kbd -s". or you can also edit:
"/boot/solaris/bootenv.rc".

As for kdmconfig the change is picked up inmediately after exiting kdmconfig. As for manual setting properties in boot/solaris/bootenv.rc via the eeprom(1M)
you will probobly need to restart something to pickup the change or to reboot.

Posted by Petr Hruska on January 03, 2008 at 03:21 PM CET #

Ups, forgot one thing:
I believe keyboard layouts for console are located at:
/usr/share/lib/keytables/

Posted by Petr Hruska on January 03, 2008 at 03:35 PM CET #

There is nothing clear how to do.

Posted by Andrius Burlega on August 14, 2008 at 05:52 PM CEST #

Just one question please. Why Languages/Scripts section is empty after installing English C 7 bits locale? It is only one default locale in installation meu.

Posted by Andrius Burlega on September 21, 2008 at 03:43 PM CEST #

Hi Andrius,

yes, the Input Method switcher cannot be used under non-UTF-8 locales and it contains an empty list intentionally. Under C locale you do not have all characters available.

As for installation menu, you need to select more regions/locales to be installed first and than (several screens after that) you can choose one of them as a default.

Posted by Ales Cernosek on September 21, 2008 at 09:15 PM CEST #

English locale with UTF-8 please. On Solaris 10.

Posted by Andrius Burlega on October 05, 2008 at 12:23 PM CEST #

HI, thanks for this huge help..

but i can't use my keyboard correctly, you see my keyboard have a different layout than standard spanish it's called "latinamerican layout". In linux and windows i can set it that way.

You know if there is a way to set it that way on Solaris?

Thanks ins advance for your time.

Posted by Christian Montero on October 14, 2008 at 10:23 PM CEST #

To set "latinamerican layout" you can use "setxkbmap" command:

$ /usr/X11/bin/setxkbmap la

('la' is the name of "Latin American" layout for Xorg server)

IIIMF (GIMLET) does not include "latinamerican layout" yet... Feel free to submit a bug requesting integration of this layout into IIIMF.

To submit a bug you can:
go to http://bugs.opensolaris.org and click "Report a bug or request a feature" dialog; (you must be logged in) fill the form describing the issue (in "category/subcategory" box, select "xserver/l10n-europe")

Posted by Javier on November 03, 2008 at 02:40 PM CET #

I have Solaris 10 on Ultra 10 (SPARC) and it looks like there is no way for me to switch layout on the fly in JDS? I did all mentioned and there is no Russian characters when I type...

Posted by Danil Smirnov on June 18, 2009 at 01:10 PM CEST #

What about dead keys for accented characters on a basically UK keyboard, uk-International as it's called? I don't see that...

Posted by mechanic on August 22, 2009 at 12:59 PM CEST #

Hi Danil,

sorry for the late reply .. well if you have S10 FCS on you box, you are true that above is not usable for you, but you should be still able to use previous revision of iiim, where Russian keyboard is available.

Please refer to (Russian ~ Cyrillic) http://docs.sun.com/app/docs/doc/817-2521/6mi67tj50?l=en&a=view&q=input+method

Posted by Petr Hruska on September 24, 2009 at 04:51 PM CEST #

I am new in the Solaris world, and feel like being thrown back a quarter of century, back to ASCII7 and EBCDIC (or whatever it was at IBM). Now, any Windows or SuSE or Ubuntu-Kubuntu lets you install extra languages of your choice and a keyboard switcher, usually even marked with flags, on the bottom of the screen, that works with a mouse click or hot keys of your choice. What's up with you people? Why does the SUN Solaris community expects me (almost) to do compiling by hand?
All I want, is to incorporate such a keyboard switch for English-US / FrenchCanadian /Ukrainian layouts. The last one, Ukrainian, I saw displayed as NEW on another page here somewhere. Just let me know, please, how to stick it into the Solaris 10 (preferably), or OpenSolaris (Solaris 11). Without asking me to become a circus acrobat... By the way, the Ukrainian layout as shown on the drawing is correct.

--
Mykola SEREDA

Posted by Mykola SEREDA on October 31, 2009 at 05:36 AM CET #

this is cool, this is what we want dude......

Posted by links london on November 27, 2009 at 03:37 AM CET #

Post a Comment:
  • HTML Syntax: NOT allowed