[Home] [Credit Search] [Category Browser] [Staff Roll Call] | The LINUX.COM Article Archive |
Originally Published: Wednesday, 23 May 2001 | Author: William Lynch |
Published to: enhance_articles_desktops/General | Page: 1/1 - [Printable] |
Using Internet Keyboards with KDE
Dead keyboard? Want a new one anyway? Linux.com contributor William Lynch shows you the quickest way to get the new multimedia-enhanced keyboards working with Linux and your favorite applications.
|
Page 1 of 1 | |
One of the last fading PC legacies is the 101-key keyboard, which is ever so gradually being replaced by the multimedia-enhanced keyboards known as "Internet Keyboards". Most major vendors of console hardware have copied this keyboard, which was initially popularized by Microsoft. The primary function of the Internet keyboards is to provide extra buttons for one-touch Internet applications and multimedia controls. While many of the Internet features might be seen as nothing more than fluff, some of these additional buttons can be quite useful. For example, the author enjoys having a one-touch "mute" button for XMMS when answering the telephone. Similarly, the author has grown fond of the convenience provided by one-touch access to Google, especially when no web browsers are currently open.
How Do Internet Keyboards Work Under Linux?The extra buttons afforded Internet keyboards work just like additional keys on the keyboard. The kernel keyboard driver picks these up just the same as any other keys. While it's an involved process, one could modify xmodmap for these keyboards and assign special events to each of the Internet buttons. However, thanks to a package called HotKeys by Anthony Wong, configuration of these extra keys is much easier. HotKeys is simply a system daemon that intercepts the scancodes of the extended buttons on these Internet keyboards and maps them to an event or application.
Installing and Configuring HotKeysHotkeys is an easy to install and somewhat straightforward to configure software package. Aside from a few quirks it also seems remarkably stable. This section will detail how to install and configure the HotKeys package for KDE.
Identifying Supported Keyboards [fwl@laptop fwl]$ hotkeys -l Supported keyboards: (with corresponding options to --kbd-list or -l) acerwl - Acer Wireless Keyboard btc9000 - BTC 9000 itouch - Logitech Cordless iTouch/Internet/Cordless Desktop kb9963 - Compaq KB-9963 keyboard kbp8993 - Chicony KBP-8993 keyboard mck800 - Process MCK-800 msnatpro - Microsoft Natural Keyboard Pro msnet - Microsoft Internet Keyboard msnetpro - Microsoft Internet Pro Keyboard mx1998 - Memorex MX1998 Keyboard mx2500 - Memorex MX2500 Keyboard mx3000 - Memorex MX3000 Keyboard polypix - Polypix Keyboard sk2500 - Fujitsu/Logitech/Trust SK2500 Keyboard / Liteon-ak2500 sk2501a - Silitek SK5210A Keyboard sk2505 - SK-2505 Keyboard sk2800c - SK-2800C sk7100 - Silitek SK7100 Keyboard sk9925 - Silitek SK-9925 USB Keyboard [fwl@laptop fwl]$Note: The author is using the Logitech Internet Keyboard (itouch). According to the HotKeys documentation, Internet keyboards not listed here will probably work with the HotKeys software, provided the user maps out the keycodes into a keyboard definition file.
Package Dependencies However, libdb2 needs to be of a specific version, 2.7.7, which may not be so widely available. The Debian distribution contains the original source code for this package which should compile on any distribution. The libdb2 package does not follow the standard installation method exactly, and it must be compiled in a specific manner. After unpacking and expanding the archive, perform the following steps: [fwl@laptop db-2.7.7]$ ls LICENSE cxx/ db_printlog/ hash/ os/ README db/ db_recover/ hsearch/ os_win16/ btree/ db185/ db_stat/ include/ os_win32/ build_unix/ db_archive/ dbm/ java/ test/ build_vms/ db_checkpoint/ dist/ libdb_java/ txn/ build_win16/ db_deadlock/ docs/ lock/ xa/ build_win32/ db_dump/ examples/ log/ clib/ db_dump185/ examples_cxx/ mp/ common/ db_load/ examples_java@ mutex/ [fwl@laptop db-2.7.7]$ cd build_unix/ [fwl@laptop build_unix]$ ../dist/configure <output omitted> [fwl@laptop build_unix]$ make [fwl@laptop build_unix]$ su Password: <not echoed> [root@laptop build_unix]# make installOptional Features As an option, HotKeys can utilize an on-screen display if the XOSD package from this site is installed.
HotKeys Installation
Configuring HotKeys for KDEWhile HotKeys is intended to be multi-user compatible, the multiuser configurations may not always work properly, although the software works fine for a single user configuration. The main configuration file for HotKeys is /usr/local/etc/hotkeys.conf which applies to all users, but a local .hotkeys in a user's home directory is supposed to override these settings. The author was unable to verify this feature successfully.
To configure HotKeys for KDE, the following changes must be made to the Kbd=itouch WebBrowser=kfmclient exec /home/fwl Email=kmail Search=kfmclient openURL http://www.google.comNote that the setting for Kbd may vary depending on the sort of keyboard in use, as showed in the previous section. The author uses the Logitech iTouch Internet Keyboard for this example. The other lines will open a file browser in the author's home directory, the kmail client and the Google search engine, respectively. The author's home directory needs to be explicitly specified because the HotKeys software lacks the ability to expand either the "~" or the "$HOME" shortcuts.
Next, it may be desirable to modify the keyboard definition for the keyboard in use. Be sure to backup the original keyboard configuration first. Then, edit <VolUp keycode="176" adj="1"/> <VolDown keycode="174" adj="1"/> <userdef keycode="230" command="konsole %i %m">Konsole</userdef> The author modified the value of "adj" to "1" to allow for a finer grained control for the volume settings. Also, the "Go To URL" button, signified by a running man on the author's keyboard, is redefined to its new action in this section, rather that in the hotkeys.conf file. The author has configured this key to open a Konsole terminal window when pressed.
Configuring HotKeys for NetscapeUnfortunately, Netscape does not lend itself towards HotKey's use as easily as Konqueror and KMail, partially due to bugs in KDE and partially due to the way the Navigator application functions. There are some workarounds for these shortcomings but integration is not as tight as it could be.
KDE Bug #21043
As a workaround, the ID of the current Netscape process needs to be sent to the Netscape command line when issuing remote requests. There is a diff to the #!/bin/bash # A wrapper script for Netscape that passes the window ID to netscape # Written 05.15.01 by FWL ID=`xwininfo -root -all | grep Navigator | awk '{ print $1 }' | sort -r | head - # Use the ID if netscape is already running if [[ -n $ID ]]; then netscape -id $ID $@ else netscape fi exit 0Additionally, since there is no way to start a Netscape mail client session from the command line, at least not as specified in the Netscape documentation, there is no clean way to start Netscape Mail without starting a new message composition. As a result, if the "Mail" key in the Internet keyboard is used with a running Netscape session, a lock error will occur. Similarly, if a Netscape Mail session is already running and the "search" or "homepage" keys are pressed, the Netscape Mail client will exit and a new instance of the browser will be launched.
Netscape Configuration WebBrowser=netscape-wrap.sh -remote 'openURL(http://www.yahoo.com)' Email=netscape -mail Search=netscape-wrap.sh -remote 'openURL(http://google.com)'Note:The URL specified in the "openURL" can be any URL, though it should probably be configured identically to the browser's start page.
ConclusionWhile the added functionality of an Internet keyboard may not be sufficient to warrant its own purchase, these keyboards are handy enough to warrant purchase when replacing a failed keyboard. Clearly, with the help of Anthony Wong's HotKeys software, the KDE desktop can take advantage of these extra Internet and multimedia keys.
About the Author
| |
Page 1 of 1 |