Size: 10652
Comment:
|
Size: 9784
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 11: | Line 11: |
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. | 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 the 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. |
Line 23: | Line 23: |
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. |
The {{{mouse}}} device will automatically work. 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 handled by the standard keyboard driver 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. |
Line 32: | Line 32: |
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}}} and {{{xvkbd}}}. | 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 as well as the standard {{{kbd}}} keyboard driver. After that, a number of keys will be mapped to the wrong ''keysyms'' and a couple of keysyms appear twice, which causes some difficulty with the keyboard shortcuts configuration tool in Gnome, so we have to load a mapping for this keyboard using {{{xmodmap}}}. Finally, because a number of keys accessed through the evdev driver behave like mouse buttons, we link these to the keysyms we want to assign them using {{{xbindkeys}}} and {{{xvkbd}}}. |
Line 35: | Line 35: |
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}}}. | We want to add the second {{{event}}} interfaces as an input device 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 name. Ostensibly, the ''symlinks'' found 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, there is more than one event device for this one keyboard, and they 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 part is always the same for the device we want to use, namely {{{/input1}}}. |
Line 39: | Line 39: |
Open the X configuration file in {{{/etc/X11/xorg.conf}}} and add the following two devices: | Open the X configuration file in {{{/etc/X11/xorg.conf}}} and add the following two device: |
Line 42: | Line 42: |
Identifier "USB Keyboard part 1" Driver "evdev" Option "Name" "USB-compliant keyboard" Option "Phys" "*/input0" Option "SendCoreEvents" "true" EndSection Section "InputDevice" |
|
Line 55: | Line 47: |
Option "evBits" "+0-3 -4-23" | |
Line 57: | Line 50: |
Also, add the these new devices to the server layout section in the same file: | Also, add the this new device to the server layout section in the same file: |
Line 63: | Line 56: |
Inputdevice "USB Keyboard part 1" "SendCoreEvents" | |
Line 67: | Line 59: |
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. |
After restarting the X server, every button should generate some output when pressed if you run {{{xev}}} in a terminal. |
Line 71: | Line 62: |
''under construction'' {{{/etc/X11/Xmodmap}}} Lines starting with a {{{!}}} are comments. {{{ ! Normal keys ! Add the Euro sign to 5 keycode 14 = 5 percent EuroSign ! Main key block (only 5 of the modifiers on the bottom row are configured, the rest is correct) keycode 133 = Super_L Hyper_L keycode 108 = Multi_key Meta_R Alt_R keycode 134 = Mode_switch Hyper_R Super_R keycode 135 = Menu keycode 105 = Control_R ! Print screen, Scroll lock, Pause keycode 107 = Print Sys_Req keycode 78 = Scroll_Lock keycode 127 = Pause Break ! Key block above arrow keys keycode 118 = Insert keycode 119 = Delete keycode 110 = Home keycode 115 = End keycode 112 = Page_Up keycode 117 = Page_Down ! Arrow keys keycode 113 = Left keycode 114 = Right keycode 111 = Up keycode 116 = Down ! Keypad (only 2, the rest is correct) keycode 106 = KP_Divide XF86_Ungrab keycode 104 = KP_Enter ! Special keys (applications, etc.) ! The missing keys are sent as mouse buttons through the other event interface, handled by xbindkeys ! They are marked as [x] in this file ! The [F] key ! [x] ! Mouse-like keys ! [x] ! [x] ! Four launch keys on the left keycode 131 = XF86LaunchA keycode 132 = XF86LaunchB ! [x] ! [x] ! Upper row application keys keycode 180 = XF86Explorer keycode 163 = XF86Mail |
Some of the multimedia keys are already recognized by the X server, but some of them are mapped to two keycodes. With Xmodmap we can assign the proper keysyms to all the keys. A good place to put the following configuration is in {{{/etc/X11/Xmodmap}}}, because the login manager GDM will also use it automatically: {{{ keycode 14 = 5 percent EuroSign keycode 29 = y Y U00A5 keycode 98 = Up Up U2191 keycode 100 = Left Left U2190 keycode 102 = Right Right U2192 keycode 104 = Down Down U2193 keycode 113 = Multi_key Meta_R Alt_R keycode 116 = Mode_switch Super_R keycode 117 = Hyper_R Menu keycode 118 = keycode 121 = XF86AudioMute keycode 122 = XF86AudioLowerVolume keycode 123 = XF86AudioRaiseVolume keycode 124 = XF86PowerDown keycode 125 = keycode 126 = keycode 127 = keycode 128 = keycode 129 = XF86Launch1 keycode 131 = XF86Launch0 keycode 132 = keycode 133 = XF86LaunchB |
Line 135: | Line 89: |
keycode 150 = XF86ScreenSaver | |
Line 136: | Line 91: |
! [x] | keycode 153 = keycode 156 = keycode 159 = keycode 160 = keycode 161 = keycode 162 = keycode 163 = XF86Mail keycode 164 = XF86Tools keycode 165 = keycode 171 = XF86AudioNext keycode 172 = XF86AudioPlay keycode 173 = XF86AudioPrev keycode 174 = keycode 176 = keycode 178 = keycode 179 = XF86AudioStop keycode 180 = XF86Explorer |
Line 138: | Line 109: |
keycode 164 = XF86Tools ! [x] ! Workspace switcher keys above F7, F8 and F9 keycode 102 = XF86Launch0 keycode 100 = XF86Launch1 keycode 101 = XF86Launch2 ! [x] ! Playback control keys keycode 179 = XF86AudioStop keycode 173 = XF86AudioPrev keycode 122 = XF86AudioLowerVolume keycode 123 = XF86AudioRaiseVolume keycode 121 = XF86AudioMute keycode 172 = XF86AudioPlay keycode 171 = XF86AudioNext ! Power keys ! [x] keycode 150 = XF86ScreenSaver keycode 124 = XF86PowerDown ! Set up our modifiers clear control add control = Control_L add control = Control_R |
keycode 204 = keycode 205 = keycode 208 = XF86Launch2 keycode 209 = XF86LaunchA keycode 223 = keycode 229 = keycode 230 = keycode 231 = keycode 232 = keycode 233 = keycode 234 = keycode 235 = keycode 236 = keycode 237 = keycode 247 = XF86Launch3 keycode 248 = XF86Launch4 keycode 249 = XF86Launch5 keycode 250 = XF86Launch6 keycode 251 = XF86Launch7 keycode 252 = XF86Launch8 keycode 253 = XF86Launch9 keycode 254 = XF86LaunchC keycode 255 = XF86LaunchD clear mod1 add mod1 = Alt_L clear mod4 add mod4 = Super_L clear mod3 add mod3 = Hyper_R clear mod5 add mod5 = Mode_switch }}} The keycodes from 247 onwards are used for a number of the multimedia keys which are seen as mouse buttons. These codes are not used, but if we don’t define their keysyms somewhere some applications — most notably, the Gnome keyboard shortcut manager — will ignore the keys. You can change this xmodmap to suit your own needs. I have added the Euro currency sign to the 5 key, because it has a label for it. You can access it by simultaniously pressing the right “Windows” key and the 5. I also added the Yen currency sign to the Y key, and the arrow characters to the arrow keys in the same way. The Alt Gr key is defined as the [compose] key. To make this keymap available to all users, you can simply create a symlink to the above file in their home folder: {{{ ln -s /etc/X11/Xmodmap /home/user/.Xmodmap |
Line 176: | Line 161: |
# Multimedia keys on the second event interface "xvkbd -text '\[F17]'" |
"xvkbd -text '\[XF86Launch4]'" |
Line 180: | Line 163: |
"xvkbd -text '\[F18]'" | "xvkbd -text '\[XF86Launch5]'" |
Line 182: | Line 165: |
# Two of the buttons on the far left |
|
Line 188: | Line 169: |
"xvkbd -text '\[F19]'" |
"randomkitten" |
Line 191: | Line 171: |
"xvkbd -text '\[F20]'" | "xvkbd -text '\[XF86Launch7]'" |
Line 193: | Line 173: |
"xvkbd -text '\[F21]'" | "gnome-terminal" |
Line 195: | Line 175: |
# the fourth little button above F9 |
|
Line 199: | Line 177: |
"xvkbd -text '\[F23]'" |
"gnome-character-map" |
Line 202: | Line 179: |
# Other examples: "xset dpms force suspend" XF86ScreenSaver "scim-tomoe" XF86LaunchA "gjiten" XF86Tools "nautilus --browser computer:///" XF86MyComputer |
|
Line 205: | Line 195: |
''under construction'' ''automatically run xmodmap and xbindkeys for all users after login in through GDM'' 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}}}. == Metacity == 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. |
In Gnome, you can safely use the {{{Preferences » Keyboard Shortcuts}}} configuration tool to use your keys to launch applications. An excellent usage of the four little keys above the F7, F8 and F9 keys is to use them to switch to another workspace. |
Line 228: | Line 198: |
If you use {{{mpd}}} to play music, the following binds for {{{xbindkeys}}} might be useful. Add these to {{{/etc/xbindkeys.conf}}}: | If you use {{{mpd}}} to play music, the following binds for {{{xbindkeys}}} might be useful. Add these to {{{.xbindkeysrc}}}: |
Line 244: | Line 214: |
When everything is set up, you should no longer use the {{{Preferences » Keyboard}}} configuration tool in Gnome, because it will override our xmodmap settings. 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. I have not been able to get the LED lights on the keyboard to work, but the caps lock key does work properly. |
When everything is set up, you should probably no longer use the {{{Preferences » Keyboard}}} configuration tool in Gnome, because it will override our xmodmap settings. 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. |
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.
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 the 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. 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 handled by the standard keyboard driver 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 as well as the standard kbd keyboard driver. After that, a number of keys will be mapped to the wrong keysyms and a couple of keysyms appear twice, which causes some difficulty with the keyboard shortcuts configuration tool in Gnome, so we have to load a mapping for this keyboard using xmodmap. Finally, because a number of keys accessed through the evdev driver behave like mouse buttons, we link these to the keysyms we want to assign them using xbindkeys and xvkbd.
The X server
We want to add the second event interfaces as an input device 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 name. Ostensibly, the symlinks found 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, there is more than one event device for this one keyboard, and they 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 part is always the same for the device we want to use, namely /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 device:
{{{Section "InputDevice"
- Identifier "USB Keyboard part 2" Driver "evdev" Option "Name" "USB-compliant keyboard" Option "Phys" "*/input1"
Option "SendCoreEvents" "true" Option "evBits" "+0-3 -4-23"
EndSection}}}
Also, add the this new device 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 2" "SendCoreEvents"
EndSection}}}
After restarting the X server, every button should generate some output when pressed if you run xev in a terminal.
Xmodmap
Some of the multimedia keys are already recognized by the X server, but some of them are mapped to two keycodes. With Xmodmap we can assign the proper keysyms to all the keys. A good place to put the following configuration is in /etc/X11/Xmodmap, because the login manager GDM will also use it automatically:
keycode 14 = 5 percent EuroSign keycode 29 = y Y U00A5 keycode 98 = Up Up U2191 keycode 100 = Left Left U2190 keycode 102 = Right Right U2192 keycode 104 = Down Down U2193 keycode 113 = Multi_key Meta_R Alt_R keycode 116 = Mode_switch Super_R keycode 117 = Hyper_R Menu keycode 118 = keycode 121 = XF86AudioMute keycode 122 = XF86AudioLowerVolume keycode 123 = XF86AudioRaiseVolume keycode 124 = XF86PowerDown keycode 125 = keycode 126 = keycode 127 = keycode 128 = keycode 129 = XF86Launch1 keycode 131 = XF86Launch0 keycode 132 = keycode 133 = XF86LaunchB keycode 144 = XF86Search keycode 148 = XF86Calculator keycode 150 = XF86ScreenSaver keycode 152 = XF86MyComputer keycode 153 = keycode 156 = keycode 159 = keycode 160 = keycode 161 = keycode 162 = keycode 163 = XF86Mail keycode 164 = XF86Tools keycode 165 = keycode 171 = XF86AudioNext keycode 172 = XF86AudioPlay keycode 173 = XF86AudioPrev keycode 174 = keycode 176 = keycode 178 = keycode 179 = XF86AudioStop keycode 180 = XF86Explorer keycode 181 = XF86WWW keycode 204 = keycode 205 = keycode 208 = XF86Launch2 keycode 209 = XF86LaunchA keycode 223 = keycode 229 = keycode 230 = keycode 231 = keycode 232 = keycode 233 = keycode 234 = keycode 235 = keycode 236 = keycode 237 = keycode 247 = XF86Launch3 keycode 248 = XF86Launch4 keycode 249 = XF86Launch5 keycode 250 = XF86Launch6 keycode 251 = XF86Launch7 keycode 252 = XF86Launch8 keycode 253 = XF86Launch9 keycode 254 = XF86LaunchC keycode 255 = XF86LaunchD clear mod1 add mod1 = Alt_L clear mod4 add mod4 = Super_L clear mod3 add mod3 = Hyper_R clear mod5 add mod5 = Mode_switch
The keycodes from 247 onwards are used for a number of the multimedia keys which are seen as mouse buttons. These codes are not used, but if we don’t define their keysyms somewhere some applications — most notably, the Gnome keyboard shortcut manager — will ignore the keys.
You can change this xmodmap to suit your own needs. I have added the Euro currency sign to the 5 key, because it has a label for it. You can access it by simultaniously pressing the right “Windows” key and the 5. I also added the Yen currency sign to the Y key, and the arrow characters to the arrow keys in the same way. The Alt Gr key is defined as the [compose] key.
To make this keymap available to all users, you can simply create a symlink to the above file in their home folder:
ln -s /etc/X11/Xmodmap /home/user/.Xmodmap
Xbindkeys and Xvkbd
If Xbindkeys and Xvkbd are not installed, do so first:
sudo apt-get install xbindkeys xvkbd
under construction
"xvkbd -text '\[XF86Launch4]'" b:22 "xvkbd -text '\[XF86Launch5]'" b:26 "xvkbd -text '\[XF86LaunchC]'" b:27 "xvkbd -text '\[XF86LaunchD]'" b:28 "randomkitten" b:29 "xvkbd -text '\[XF86Launch7]'" b:30 "gnome-terminal" b:31 "xvkbd -text '\[XF86Launch3]'" b:32 "gnome-character-map" b:33 # Other examples: "xset dpms force suspend" XF86ScreenSaver "scim-tomoe" XF86LaunchA "gjiten" XF86Tools "nautilus --browser computer:///" XF86MyComputer
Finishing up
In Gnome, you can safely use the Preferences » Keyboard Shortcuts configuration tool to use your keys to launch applications. An excellent usage of the four little keys above the F7, F8 and F9 keys is to use them to switch to another workspace.
Music player daemon (mpd)
If you use mpd to play music, the following binds for xbindkeys might be useful. Add these to .xbindkeysrc:
under construction
"mpc next" XF86AudioNext "mpc prev" XF86AudioPrev "mpc stop" XF86AudioStop "mpc toggle" XF86AudioPlay
Open issues
When everything is set up, you should probably no longer use the Preferences » Keyboard configuration tool in Gnome, because it will override our xmodmap settings. 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
[http://www.trust.com/15036 The product page of the Trust Multimedia Scroll Keyboard KB-2200]