Getting your Chicony KB-8993 to work with Linux
For a long time ago I bought a cheap keyboard with extra multimedia buttons - a Chicony KB-8993. It was great to suddenly be able to control the applications without the use of abitrary keyboard shortcuts or the mouse. However, the drivers for the keyboard weren't worth much and they only worked with Windows 95 and 98. Chicony never saw any reasons to continue development thus leaving Windows 2000, Windows XP, and Linux users who wanted to use the extra buttons out in the cold.
Easy access keyboards in Linux
One way to enable the extra buttons on your (easy access / multimedia / internet) keyboard is to use LinEAK, Linux support for Easy Access and Internet Keyboards. It already comes with configurations for a lot of keyboards from big vendors like Logitech, IBM, and Compaq. The complete list has them all. However, the Chicony KB-8993 is not on the list, but luckily the LinEAK documentation tells how to find and configure your own keyboard. That was what I did and what I will try to guide you through here.
Switching on the extra keys
The Chicony KB-8993 is a little tricky. When I followed the guide and executed the xev program, I got no response when pressing the extra keys. I went over to the alltime favorite search engine, Google, and searched away. I didn't expect any results since I had been searching for drivers and the like for Windows a couple of times before without luck. This time, I actually found a great page about scancodes for the keyboard. It turned out that a Dutch guy named Matthijs Melchior had found out that in order to enable the keyboard, a scancode has to be sent. Combined with the source code for a program that actually sends commands to the keyboard controller contributed by Dennis Bjorklund from Sweden, I was now good to go.
The keyboard commander program
Using the program, the Chicony KB-8993 can now be turned on like this (You must be root for it to work):
[root@krath bin]# ./send_to_keyboard ea 71
Other codes are: ea 70 (disable), eb 00 01 (turn on moon led), eb 00 00 (turn off moon led). You can find the rest of the scan codes on the above-mentioned page.
Whenever I boot Linux the above command is automatically run. In Red Hat Linux 8.0 I appended the following to the file /etc/rc.local which contains all system-wide commands to be run after the Linux kernel is loaded:
/home/krath/bin/send_to_keyboard ea 71
New: Using the kernel to enable the extra keys
Since Linux kernel version 2.6.5, it has been possible to do the above without the send_to_keyboard application. By passing a few parameters to the kernel at boot, the ea 71 command is send to the keyboard. The parameters are the following:
i8042.direct=1 atkbd.set=3 atkbd.extra=1
If you use Lilo, these parameters can be sent to the kernel with an append line in lilo.conf.
This great tip was given by Alberto Mardegan <mardy+despammed.com>.
For installation of LinEAK you can either compile from source or use the .deb's or the rpm's. lineakd 0.4pre3 i586 binary RPM (NB: SourceForge Mirror list) is what I installed. You might also want the graphical configuration utility lineakconfig 0.1 i386 binary RPM (NB: SourceForge Mirror list).
I will not go further in to detail with the installation of LinEAK. Please read the LinEAK Documentationfor that.
After enabling the extra keys I finally had better luck with xev. If you want, you can download my lineakkb.def and replace the one from LinEAK. Otherwise, here is what you should append to the keyboard definitions file (Usually located in /usr/local/etc/lineakkb.def):
brandname = "other"
modelname = "Chicony KB-8993 (14 keys)"
Moon = 165
WWW = 178
DOS = 176
MyDOC = 151
Menu = 166
zzZ = 158
Close = 174
Stop = 164
Back = 163
Play/Pause = 162
Forward = 161
Mute = 160
Volumedown = 146
Volumeup = 153
# end Chicony KB-8993 (14 keys) [Thomas Kilde Krath]
You can see if the appending of the above went alright by running lineakd -l and locating the Chicony KB-8993 in the list.
When succeeded, you then have to run lineakd -c CY8993 to configure the keyboard
Now you are able to run lineakconfig or edit the file ~/.lineak/lineakd.conf. You can also just download my configuration file.
To run LinEAK type lineakd -b.
Running LinEAK at startup
Usually it is very nice to have LinEAK run at startup. LinEAK, however, must be started when you login to X. That means you should edit .xsession or configure the startup programs in your desktop environment. Under GNOME that means the configuration item called "Sessions" which either navigate to through the menu structure or simply get by running gnome-session-properties.
A screenshot of the configuration utility gnome-session-properties
Summary of files and links
My compiled send_to_keyboard to be used in /etc/rc.local
I hope you can use this. If you do get it to work, have any comments, or questions feel free to e-mail me.