Linux.com

Feature

KMFL lets users change keyboards on the fly

By Bruce Byfield on March 21, 2006 (8:00:00 AM)

Share    Print    Comments   

Setting up support for international characters should be "seamless," several readers said in responses to my recent article, "Setting up international character support." Keyboard Mapping for Linux (KMFL), a free software project rapidly approaching its 1.0 release, is dedicated to providing that seamlessness by adding a keyboard layer to the GNU/Linux desktop that allows on-the-fly switching of keyboard mappings. Although configuring this layer is an arduous process, and the current lack of keyboard mappings makes things worse, the result promises to be far easier for the average user than lower-level configuration.

KMFL is a joint project of SIL International and Tavultesoft. SIL is an international Christian organization devoted to the study and preservation of minority languages. SIL's recent free software releases include high-quality Unicode fonts such as Gentium and Charis, and Sil's new Open Font License has received Free Software Foundation approval.

Tavultesoft, a small software company in Hobart, Australia, is best-known for Keyman and Keyman Developer, two long-established Windows programs that provide the same functionality as KMFL, but under proprietary licenses.

SIL and Tavultesoft share a long, informal history. John Durdin, father of Marc Durdin, Tavultesoft's main developer and opener, worked with SIL as an aid worker in Southeast Asia. In fact, Tavultesoft takes its name from a village where the Durdins lived in Papua New Guinea. Marc Durdin wrote the first version of Keyman in Laos -- as part of Lao Script for Windows -- when he was 14. Both Durdins have since developed additional language-related software, and SIL has remained one of the main supporters and customers for their efforts.

As Marc Durdin received requests for a similar tool for other languages, Keyman became a separate product. Today, he says, "Keyman is quite widely used -- in particular in the third world.... I have users in probably every country in the world." Already, the recently released Keyman 6.2 has more than 5,000 users -- only half of whom, Durdin estimates, are online.

SIL became interested in GNU/Linux several years ago, and approached Tavultesoft about doing a port of Keyman, according to Doug Rintoul, project leader for KMFL, who also worked with the Durdins on prior development projects. After the company decided that neither a proprietary version nor a shareware product made commercial sense, Tavultesoft opted to release KMFL under the GNU General Public License. "We considered that it was more likely that KMFL would be adopted by the community [that way]," Durdin says.

The project looked at several pieces of character mapping software as the basis for the software, Rintoul says. The project considered basing its efforts on XIM (X Input Method) or xcin (X Chinese Input), but ultimately settled on SCIM (Smart Common Input Method), judging that its modularity and high-level programming approach would speed development.

Currently, KMFL is at version 0.9-1. The official release is "three to four months down the road," says Rintoul. Ubuntu, Mandriva, and SUSE have all expressed interested in the software, and Rintoul says he hopes it will soon become part of other distributions as well.

Installation and configuration

The KMFL project page provides Debian packages for Ubuntu 5.04 (Hoary Hedgehog) for the latest version. These packages also work on Ubuntu 5.10 (Breezy Badger), but not on standard Debian. Alternatively, of course, users can compile from source.

Somewhat outdated installation and configuration instructions are available for Ubuntu, Fedora Core 2, SUSE 9.1, and unspecified versions of Gentoo and Mandriva. These instructions illustrate just how far distributions have diverged in their basic configuration methods. We'll skip detailed installation instructions here.

However, no matter what the distribution, setting up KMFL starts with installing SCIM and KMFL. Once both pieces of software are installed, administrators must configure each individual user account to start them automatically at login time. This configuration requires editing each user's .bash_profile (or, in SUSE's case, adding a three-line script), creating a one-line script to autostart SCIM, and setting it up to run automatically in KDE or GNOME.

Unlike Keyman, KMFL supports only Unicode keyboard mappings, so each account must also be configured to use a UTF-8 (eight-bit Unicode Transformation Format) locale. If the locale is not the default of en_US.UTF-8, then you must modify the global settings for SCIM in /etc/scim/global.

Although these steps are not difficult if you follow the instructions, less-experienced desktop users might find them intimidating. An install script, if not a GUI, would make installation and configuration easier, especially if it provided a way to configure all user accounts at the same time.

Installing keyboard mappings

KMFL comes with only English/European keyboard mappings; to test-drive the software, you need to install other keyboards. Currently, only a few keyboards are available for KMFL, and many of them are not in finished form. Two are available from the SIL site: One for the International Phonetic Alphabet, and another for Biblical Greek. In addition, because KMFL uses the same source format as Keyman, you can also search the keyboard downloads on the Tavultesoft site for the .kmn files for Unicode-compliant keyboards. You'll need to download both the keyboard file and the icon for it. Compiled keyboards for Keyman, whose files end in .kmx, are not usable in KMFL.

KMFL can also use keyboard mappings in its own format, with files that have a .kmfl extension. However, because KMFL can use uncompiled source files, you do not need to compile keyboards before using them with KMFL -- unless, perhaps, you are concerned about getting every last bit of speed from your system. The lag when using uncompiled files is not noticeable, even on the six-year-old machine I used to write this review.

Administrators must install keyboards separately for each user. To install a keyboard, create the directories ~/.scim/kmfl and ~/.scim/kmfl/icons in each user's home directory. Then copy the uncompiled or compiled keyboard file and its icons to the appropriate directory.

Using KMFL

Once KMFL is configured, it is available the next time you open an account. To start it, open a program, press Ctrl-Space, and a small KMFL tray opens above the desktop's panel. This is similar to the way Keyman opens from the Windows system tray.

Keyboards are listed on the tray in two sub-menus: English/Keyboard and Other. Switching between keyboards is a simple matter of clicking the KMFL sub-panel and selecting from the sub-menus. The current selection displays when the menus are closed.

Right-clicking the sub-panel opens the SCIM Setup panel. From this panel, you can enable hotkey switching between keyboard maps -- a feature that should be especially useful if you are combining languages in a single document. The setup menu also includes a tab for installing KMFL keyboards that is not enabled in the current version, as well as a configuration setting for the panel itself.

Using KMFL requires you to make some changes in your workflow, but is far more efficient than hunting and pecking on a character map -- providing, of course, that you have the fonts to take advantage of the program.

Conclusion

Despite a finicky configuration and lack of keyboard mappings, KMFL already shows promise. It bypasses the difficulty of using international keyboard mappings in many GTK-2 (GIMP Tool Kit) programs, as well the lack of support for UTF-8 in other programs. Just as importantly, users can write their own keyboard mappings with a minimum of instruction. Such custom keyboards can map frequently used diacritical marks so that they are easily available. They also provide an easy alternative to some of the awkward layouts that setting up international characters at a system level involves.

Some users, especially English-speaking ones, may see little need for tools like KMFL. However, with the increasing internationalization of the Internet, many will appreciate KFML's potential. If nothing else, it gives GNU/Linux parity with Windows in yet another area of the desktop.

Bruce Byfield is a course designer and instructor, and a computer journalist who writes regularly for NewsForge, Linux.com and IT Manager's Journal.

Bruce Byfield is a computer journalist who writes regularly for Linux.com.

Share    Print    Comments   

Comments

on KMFL lets users change keyboards on the fly

Note: Comments are owned by the poster. We are not responsible for their content.

Isn't this the same as the KDE keyboard tool?

Posted by: Anonymous Coward on March 21, 2006 06:33 PM
Maybe I just missed the point of what this software actually does, but it doesn't seem to offer much more than what's already available...

I already have this in KDE -- I have a little UK flag down in my system tray because I'm at work with a UK keyboard and if I click on it it becomes a US flag for when I don't have the external kb plugged in and I'm using my laptop's built-in US kb. (I also have german and french ones there to allow me to get accented characters when I need them.) I can switch keyboard layouts just by hitting a key combination.

(of course, I like having choices and it's nice to see companies investing in linux programs!)

#

Re:Isn't this the same as the KDE keyboard tool?

Posted by: Anonymous Coward on March 21, 2006 11:43 PM
This works if you use keyboards for the supported languages like English, German or French (and a lot of more). But there are a lot of languages that don't have a keyboard yet (and some probably won't even get an official one ever because they are spoken by only a few thousand people). The beauty of KFML is that it easily allows to define new keyboards (or modify existing ones).

#

Re:Isn't this the same as the KDE keyboard tool?

Posted by: Administrator on March 23, 2006 07:11 PM
(Quite) Some people don't use KDE you know...

#

nih?

Posted by: Anonymous Coward on March 21, 2006 09:05 PM
What's wrong with using 'setxkbmap' and perhaps wrapping some gui stuff around its options?

#

My curiosity

Posted by: Anonymous Coward on March 21, 2006 10:38 PM
I'm rather curious about the whole keyboard mapping issue. I frequently see statements about how lacking Linux is when referring to easy keyboard mapping applications. But, frankly I see lots of these applications out there. But the thing that I am most curious about is how many people are actually switching their keyboards on the fly?

In my world, the keyboard is selected at installation and it never changes. No one wants it changed either. I have NEVER been asked to change a keyboard or locale setting after installation.

Is there really so much demand for this kind of thing and, if so, why? It seems to me that a PC switching keyboards and locale settings would be an exception to the norm rather than a rule.

#

Re:My curiosity

Posted by: Anonymous Coward on March 21, 2006 11:01 PM
I use it moderately often. When typing scientific and mathematical papers, I often would like to type greek letters interspersed with regular latin ones. My preferred way to do this is to have a key which acts like a "greek-shift" key. So, I have an alternate (greek) keyboard layout set up, and while I hold down caps lock (the chosen key), anything I type is as if I were using a greek keyboard. Like this: λογος. I also like to use λ when programming in Scheme, because typing out lambda all the time is a pain. So I do

(define λ lambda)

#

Re:My curiosity

Posted by: Anonymous Coward on March 22, 2006 12:27 AM
On the fly keyboard switching is vital if you are using non-Roman script languages interspersed with a Roman Script language. Suppose someone wants to type an Arabic document that is right-to-left and needs to type in an English word, it is absolutely essential to be able to change the keyboard, type in the word or phrase and then change it back. Since they do not share any characters, a single keystroke (like alt-shift) to change the keyboard really opens the door to type in a variety of languages with different scripts.

#

Re:My curiosity

Posted by: Anonymous Coward on March 22, 2006 12:59 AM
One of the greatness of Linux is that large demand does not necessarily drive development. There are many situations where a multilingual environment is important. Consider the production of multilingual dictionaries, language learning materials, and technical papers on languages, multilingual web pages, multilingual newspapers. In fact much of the world is multilingual.

Also just because something might be the exception rather than the rule does not mean that there is no need to support the exception.

#

Re:My curiosity

Posted by: Anonymous Coward on March 24, 2006 05:35 AM
People, and especially tech people, in non-English speaking countries sometimes need to be able to use at least a little bit of English, or sometimes a lot of English, but at least some of the country's native language. Also there are bilingual (or multilingual) people who need to be able to communicate with people from both (all) of their language backgrounds from the same computer.

#

Re:My curiosity

Posted by: Anonymous Coward on March 28, 2006 12:54 AM
On-the-fly language support is an area where Windows GREATLY surpasses Linux. You can change keyboard languages with Shift-Ctrl and have the language change for only one application.

When I am programming, I do 100% of my work in English. When I am doing any kind of writing, I work about 40% of the time in French and about 60% of the time in English. The ability to switch on the fly is critical for me.

On Linux, I am constantly changing languages because I cannot do it on the fly (or I don't know how) and I cannot do it on a per-application basis. At times it becomes a real hassle.

I'm hoping this tool will bridge that gap a bit.

L

#

More Information on KMFL

Posted by: Anonymous Coward on March 22, 2006 06:25 AM
While the body of the article is pretty good on the whole there are some
inaccuracies. The title would imply that KMFL is all about switching
between keyboards when in fact this feature is provided by SCIM. One of
the key goals of KMFL to support complex minority writing systems which
are not addressed by input methods such as XKB. Languages such as Thai
require input sequence validation, and character reordering based on
surrounding context. KMFL also makes writing keyboards much easier than
trying to wade through the morass of XKB.

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya