# GNOME KeyBoard Applet

Copyright © 2000 by Szabolcs (Shooby) BAN and Dan Mueth

# GNOME KeyBoard Applet

`GNOME KeyBoard Applet`, shown with its default configuration in Figure 1, allows you to easily and quickly change the keyboard map to those used in various different countries. To add this applet to a Panel, right-click on the Panel and choose Panel->Add to panel->Applet->Utility->GKB KeyBoard Switcher.

Figure 1. GNOME KeyBoard Applet

## Usage

Once configured, the `GNOME Keyboard` applet allows you to switch the keyboard mapping between any number of keyboard layout. Just left-click on the applet or press Alt-Shift to switch the keyboard mapping.

Right-clicking on the applet brings up a menu containing the following items:

- Properties… — opens the `Properties` dialog.

- Help — displays this document.

- About… — shows basic information about `GNOME KeyBoard Applet`, including the applet's version and the author's name.

## Customization

You can customize `GNOME KeyBoard` applet by right-clicking on it and choosing Properties…. This will open the Properties dialog (shown in Figure 2), which allows you to add, modify, and remove keymaps, as well as to configure the applet's appearance.

Figure 2. Properties dialog

The Properties dialog box has two tabs: `Keymaps` and `Options`. On the `Keymaps` tab, you can Add, Edit, Delete or change the order of keyboard layouts. On the `Options` tab you can set the appearance of the applet (flag, label or flag+label) and its size (Normal or Big), as well as the key sequence to use to get GKB to switch between keyboard layouts (see the section called Known Bugs and Limitations section.)

### Setting keyboard layouts for you language

Setting up keymaps can consist in one or more of the following steps:

- Adding a required keyboard layout — On the `Keymaps` tab, click on the Add button. The tree shown in Figure 3 allows you to choose the keymap best suited for you, based on the language and the country involved.

  Figure 3. Select Layout dialog

  To add a keymap, click on the + sign preceeding the languge you want to set. A list of coutries where the given language is used appears. Again, click on the + preceeding the country chosen, and a list of keymaps shows up. Select the keymap you would like to use and click Add. Your keymap gets added to the list on the GKB Properties window. You may add another keymap or click Close to close the Select Layout dialog.

- Editing an existing keyboard layout — Selecting a keymap and pressing the Edit brings up the Edit keymap window (see Figure 4).

  Figure 4. Edit keymap dialog

  On this dialog, you can modify different properties of the keymap. These properties are:

  - `Name`: The name of the keymap, as shown in the GKB Properties window and in the hint appearing when you move your mouse over the applet.

  - `Label`: This is the label that appears when you set "Label" or "Flag+Label" modes. See the section called Miscellaneous options for more details.

  - `Language`: This option will be used in Gnome 2.0. It has no effect right now.

  - `Country`: This option will be used in Gnome 2.0. It has no effect right now.

  - `Flag`: This is the place where you can set the flag to be displayed with the given keyboard layout.

  - `Architecture`:This option will be used in Gnome 2.0. It has no effect right now.

  - `Type`: This option will be used in Gnome 2.0. It has no effect right now.

  - `Code page`: This option will be used in Gnome 2.0. It has no effect right now.

  - `Command`: This is the command which `GNOME KeyBoard` will use to change the keymap. The default is to use the gkb_xmmap `xmodmap-file-extension` command, where `xmodmap-file-extension` should be replaced by the extension of the xmodmap file you want to use.

    | Finding keyboard layouts availble on your system
    | On a typical Linux system, xmodmap files can be found under the directory `/usr/share/xmodmap`.

    To set the keymap to a US 101 key keyboard, for example, you would use gkb_xmmap us-101.

    If this doesn't work, you may also try setting the keyboard using command setxkbmap `LC` where `LC` is the two letter country code of your locale. (for example, setxkbmap fr to use a French keyboard). Finally, if you have your own keyboard layout (xmodmap) file, set the command to xmodmap `xmodmap-filename` (for example, xmodmap ~/xrus/yawerty.koi8.xmm to use keyboard layout for Cyrillic letters in koi8 encoding). Please see the section called Technical information for more information.

- Removing a keyboard layout that is no longer needed — To remove a keyboard, select it (click on it in the GKB Properties window) and click the Delete button.

- Reordering keyboard layouts — The order in which the keyboard layouts become active as you click on the applet or press the hot key depends on the order they appear in the list in the Properties window. The layout that is displayed at the top of the list will become the default layout when you close the Properties window. To change the order in the list, select the keymap to be moved, and click Up or Down as appropriate.

After you have made all the changes you want, click on Apply to apply the changes or on OK to apply the changes and close the Properties dialog. To cancel the changes and return to previous values, click the Close button. The Help button brings up this chapter of the on-line help.

### Miscellaneous options

Different options allow you to customize the look of your applet. As a new feature, you can select between three different display modes:

- Flag mode — The flag associated to the keymap is displayed on the Panel.

- Label mode — No flag is displayed, only the label associated with the keymap.

- Flag and label mode — Both flag and label associated with the keymap are displayed.

Many users have reported, that the applet takes too much room on the panel. You can now set the applets size from the `Applet size` pull down list. Set the size to Normal if you want a smaller applet. If you have plenty of space or like nice big flags on you panel, set the option to Big.

An often formulated user wish was to implement the keymap switching using hotkeys. The developers proudly announce, that keyboard initiated switching now works. The hotkey combination that allows to change keymaps is set to Alt-Shift (Alt being the left Alt key). You can customize this hotkey sequence from the GKB Properties window's `Options` tab. Click on the Grab hotkey button and press the keys you want to set. The key combination is displayed in the input box near the button (you may see something like: Control-Shift_R). Finally, click on Apply or OK to finalize the new settings.

## Technical information

Normally you do not need these details - but if something is not working, or you are just curious, read on.

`GNOME Keyboard` switches the keyboard map by issuing a command to X Window System. X Window System has two mechanisms for setting keyboard mapping: older one called "xmodmap" and a newer one, based on the so-called "Xkb extension". If you have Xkb enabled, you should use it and switch keyboard layouts by issuing a command setxkbmap `LC`. It comes with a number of various keyboard layout files, usually in directory `/usr/X11R6/lib/X11/xkb/symbols`.

If you do not have Xkb extension enabled, or if it just does not cover the language you need, you should use the older xmodmap mechanism. In this case, you need to have a file which describes keyboard layout in a special format (see manual page for xmodmap for details), and the command should be xmodmap `filename` . `GNOME Keyboard` includes a number of keyboard layout files, which are installed in the directory `/usr/share/xmodmap`; these files have names like `xmodmap.de`. To use one of these files, you can use the command gkb_xmmap `LC` which is equivalent to xmodmap /usr/share/xmodmap/xmodmap.`LC`: for example, gkb_xmmap hu is the same as xmodmap /usr/share/xmodmap/xmodmap.hu.

## Known Bugs and Limitations

- Languages and countries showing up in the Select layout dialog are not sorted in alphabetical order.

- The program has very few error handling routines implemented. If you try to feed it something unusual, it may crash.

- If it does not crash, it returns the error: "The keymap switching returned an error". If the Edit window is open when this error appears and you press the OK button on this window, it is likely that nothing will happen. Try closing the Edit window first and then the error window.

## Authors

`GNOME KeyBoard` was written by Szabolcs Ban (`<shooby@gnome.hu>`). Please send all comments, suggestions, and bug reports to the GNOME bug tracking database. (Instructions for submitting bug reports can be found on-line). You can also use `Bug Report Tool` (bug-buddy), available in the Utilities submenu of Main Menu, for submitting bug reports.

This manual was originally written by Szabolcs (Shooby) Ban (`<shooby@gnome.hu>`) and Dan Mueth (`<d-mueth@uchicago.edu>`). It has been rewritten (strongly based on the original) by Emese Kovacs (`<emese@gnome.hu>`) to reflect changes from v1.2 to v1.4. The Technical Information section has been added by Alexander Kirillov (`<kirillov@math.sunysb.edu>`). Please send all comments and suggestions regarding this manual to the GNOME Documentation Project by sending an email to `<docs@gnome.org>`. You can also submit comments online by using the GNOME Documentation Status Table.

## License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

A copy of the GNU General Public License is included as an appendix to the GNOME Users Guide. You may also obtain a copy of the GNU General Public License from the Free Software Foundation by visiting their Web site or by writing to

Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307
USA