Revision 4 as of 2008-01-29 15:28:31

Clear message

The Multimedia Scroll Keyboard KB-2200 manufactured by Trust, is a USB keyboard, with a plethora of extra keys — sometimes referred to as multimedia keys — that can be used to launch applications, or to perform other useful actions. This document provides information on how to configure your Ubuntu system to make use of all these keys.

TableOfContents(3)

attachment:IconsPage/IconControlCenter2.png This document is currently under construction and is incomplete at the moment.

Introduction

The KB-2200 is a budget keyboard, and is available in many a bargain bin or budget shop. Without any configuration, the keyboard will work under any modern computer, but a number of the extra keys will not function without some further actions. This is perhaps due to the odd technical design of the keyboard. As far as our computer is concerned, this piece of hardware is a USB keyboard with a lot of keys, and a USB mouse with some more keys (or buttons), all in one.

attachment:IconsPage/IconNote.png I have found no other information on the Internet about using this keyboard under Linux. If you follow this guide and find mistakes, or even if it all works or if you know of a better, easier method, please contact the author (ubuntu@jeroenhoek.nl). I would appreciate the feedback.

If we look at the input device entries our computer found for this keyboard, we see something like the following output:

{{{# ls /dev/input/by-id -l usb-062a_USB-compliant_keyboard-event-kbd -> ../event1 usb-062a_USB-compliant_keyboard-event-mouse -> ../event2 usb-062a_USB-compliant_keyboard-mouse -> ../mouse1}}}

The mouse device will automatically work under Gnome or KDE. Most of the time the X windowing system already uses the combined /dev/input/mice device, so all mice connected will work.

Of the two event interfaces, however, only one is used by default. There are nine keys that send their signals through the second interface, so we need to use it as well if we want all the keys to work.

Configuring all the relevant software

attachment:IconsPage/warning.png There is no easy way to make this keyboard work completely under Linux at the moment of writing. The actions below affect your system and a mistake can disable your graphical environment. This document requires some experience with the command line interface.

Without using the evdev driver in the X configuration, some of the keys on the keyboard do not generate keyevents. So first we need to configure X to use the keyboard through the evdev driver. After that, a number of keys will be mapped to the wrong keysyms — for instance, the Up key is mapped to Print Screen — so we have to load a mapping for this keyboard using xmodmap. Finally, because a number of keys behave like mouse buttons, we link these to the keysyms we want to assign them using xbindkeys.

The X server

We want to add the two event interfaces as input devices for the graphical environment, but because we are working with a USB device, we do not know for sure if it will always be assigned the exact same device names. Ostensibly, the symlinks in /dev/input/by-id are persistent and therefore useful, but unfortunately — at least up to Ubuntu 7.10 Gutsy Gibbon — the evdev' driver we will use in the X server configuration does not accept those paths as an argument for the device. We can also refer to the name of the device, which is unique, but as noted above, we need to assign two event devices for this one keyboard, and they both share the same name. To solve this, we refer to them by their physical path as well. The whole physical path is different for every USB port on your computer, but the last bit is always the same for these two devices, namely /input0 and /input1.

By referring to the devices in this manner, we can plug the keyboard into another USB port, and it will work without any changes in the configuration.

Open the X configuration file in /etc/X11/xorg.conf and add the following two devices:

{{{Section "InputDevice"

  • Identifier "USB Keyboard part 1" Driver "evdev" Option "Name" "USB-compliant keyboard" Option "Phys" "*/input0"

    Option "SendCoreEvents" "true"

EndSection

Section "InputDevice"

  • Identifier "USB Keyboard part 2" Driver "evdev" Option "Name" "USB-compliant keyboard" Option "Phys" "*/input1"

    Option "SendCoreEvents" "true"

EndSection}}}

Also, add the these new devices to the server layout section in the same file:

{{{Section "ServerLayout"

  • Identifier "Default Layout" screen 0 "Default Screen" 0 0 Inputdevice "Configured Mouse"

    Inputdevice "USB Keyboard part 1" "SendCoreEvents" Inputdevice "USB Keyboard part 2" "SendCoreEvents"

EndSection}}}

attachment:IconsPage/IconNote.png In my case, this keyboard is the only keyboard attached to the computer. I removed the Inputdevice line referencing the kbd driver, to prevent conflicts between the evdev and kbd driver using the same device.

Xmodmap

under construction

Xbindkeys

If xbindkeys is not installed, do so first:

sudo apt-get install xbindkeys

under construction

Finishing up

In Gnome, you can safely use the Preferences » Keyboard Shortcuts configuration tool to use your keys to launch applications. However, for some reason, this configuration tool refuses to accept the keys from the second event interface — that is, the ones we mapped through xbindkeys. We can still use them, but you have to set them directly with gconf-editor or gconftool-2.

  • The path for the Metacity keybindings in Gconf is /apps/metacity/global_keybindings/.

  • The application launch keybindings are in /apps/gnome_settings_daemon/keybindings.

If you used the same keysyms as in the xmodmap and xbindkeys configuration above, we can for example use the row of four little buttons above the F7, F8 and F9 keys to switch workspaces:

{{{gconftool-2 --type string -s /apps/metacity/global_keybindings/switch_to_workspace_1 XF86Launch0 gconftool-2 --type string -s /apps/metacity/global_keybindings/switch_to_workspace_2 XF86Launch1 gconftool-2 --type string -s /apps/metacity/global_keybindings/switch_to_workspace_3 XF86Launch2 gconftool-2 --type string -s /apps/metacity/global_keybindings/switch_to_workspace_4 XF86Launch3}}}

attachment:IconsPage/IconNote.png The first three of those buttons can be set through Preferences » Keyboard Shortcuts, but the fourth is a “mouse button”, so the configuration tool ignores it. It works perfectly fine though, once set through GConf.

Issues

When everything is set up, you can no longer use the Preferences » Keyboard configuration tool in Gnome, because it will override our xmodmap. This should not be a problem, because we can set most of the options in there through our own xmodmap, but you may want to remove the entry from the menu so your users do not accidentally try to use it.

Related links