SDB:Using the Extra Keys on the Keyboard

Şuraya atla: kullan, ara


Using the Extra Keys on the Keyboard
or
Customize Keyboard Layout (enter unicode character directly)

Situation

You want to use the extra keys on your new multimedia keyboard, but you do not know how. These keys do not have any effect out-of-the-box.

or

You want to customize your keyboard layout (e.g. to have the possibility to directly enter unicode characters like non-breaking space, non-breaking hyphen or combining diacritic marks).

Procedure

No actions have been assigned to the keycodes produced by the keys yet. You have to take over this process by way of the program xmodmap. (Unfortunately a topical/relevant manpage is missing.(?)) To do this, first save the keyboard layout currently active by using the command:

    xmodmap -pke > ~/Xmodmap.standard

Now make a copy:

    cp ~/Xmodmap.standard ~/Xmodmap.customized

Now you can use a small tool to find out the keycodes produced by your extra keys. To do this, start the program xev in a terminal program such as xterm or konsole. When you press a key, you will see how xev displays that key's keycode on the terminal. For example, the output for the key A is:

    KeyPress event, serial 23, synthetic NO, window 0x2800001,
    root 0x62, subw 0x0, time 3131034, (-212,59), root:(276,76),
    state 0x0, keycode 38 (keysym 0x61, a), same_screen YES,
    XLookupString gives 1 characters:  "a"

As you see, the keycode for the key A is 38. Now you could, for example, edit the file ~/Xmodmap.customized previously saved and assign B to the keycode 38. By doing this, the result of pressing the key A would be B. (In your xmodmap-file the first column after the equal-sign is assigned to the key pressed alone, the second column to the key pressed while pressing shift too.)

The same procedure applies for the extra keys: you can find out their keycode and assign still unused function keys (such as F13) to them.

But you can use for one key more characters/functions than two. (characters have names (or numbers) and Functions have Names (beginning with Capital)). (Unfortunately a list of all functions and there effect is missing.(?)) The character/function given in the third/fifth column will be asigned to the key pressed together with Alt Gr and the fourth/sixth column belongs to the key pressed together with Shift and Alt Gr. (As long as Mode_switch/ISO_Level3_Shift is assigned to the keycode of Alt Gr - if you assign Mode_switch and ISO_Level3_Shift to different keys, you can assign up to six characters to one key!).

You can assign unicode characters to a key using their names (if they have one) or their number in the form: 0x01nmijkl, where nmijkl is the hexadecimal number of the character in the unicode system (e.g. idotless for the dotless small i, 0x01000327 for the combining cedilla or 0x01002011 for the non-breaking hyphen).

Use the following command to test and reread the xmodmap-file:

   xmodmap ~/Xmodmap.customized

or

   xmodmap ~/Xmodmap.standard

to get back your out-of-the-box keyboard.

To enter combined characters first enter the character, then the diacritic mark.

Once you are comfortable with your keyboard layout, you can copy or move the file ~/Xmodmap.customized to ~/.Xmodmap, where it will be read in everytime the graphical interface starts.

The reaction of your window manager/desktop environment to the new function keys may vary. For example, KDE 3.x enables you to set many different actions in its Control Center -> Look & Feel -> Key Bindings. You can also assign single applications to the new function keys in the KDE Menu Editor, which can be accessed with the right mouse button on the menu button.

An alternative would be using a program only responsible for such functions like, for example, bbkeys. The use of bbkeys, included in the package bbtools in recent versions of SuSE Linux, is actually intended for the window manager blackbox. However, it also works with other window managers/desktop environments. For more information on the configuration of bbkeys, please refer to the web site.

See also the example xmodmap-file and keyboard-layout at [1]

<keyword>logitech,keyboard,key,extra,multimedia,play,stop,internet,unicode,combining, diacritic,keyboard layout</keyword>