KMFL lets users change keyboards on the fly

168

Author: Bruce Byfield

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.