kbdd
Supported keyboards | Setting up | Running directly | Todo | Source
Introduction
Keyboards on the iPAQ used to be supported using a series of kernel modules. This turned out to be a problem, because nobody was keen to maintain the modules (thus no support on pxa-based machines), and they didn't work with all environments. Enter Nils Faerber's keyboard daemon (kbdd). kbdd is a user-space program that connects to serial keyboards, and uses the uinput kernel module to forward keystrokes to the OS. It should work in any environment (console, GPE, Opie, etc.) and with any device (iPAQ, zaurus, simpad etc).
kbdd is installed by default in Familiar 0.8.1 and later.
Supported Keyboard Models
Currently the following keyboards are supported in kbdd:
| Keyboard | keyb-type | min. kbdd version |
| HP/Compaq Foldable Keyboard | foldable | 0.8 |
| Targus Stowaway Keyboard | stowaway | 0.8 |
| Stowaway XT | stowawayxt | 0.8 |
| Belkin/RipTide SnapNType | snapntype | 0.8 |
| SnapNType Bluetooth | snapntypebt | 0.11 |
| HP Slim sleeve keyboard | hpslim | 0.8 |
|
|
smartbt | 0.8 |
| Belkin IR (not IrDA) | belkinir | 0.8 |
| Flexis FX-100 keyboard | flexis | 0.8 |
| Benq G250 gamepad | g250 | 0.8 |
| GrandTec PocketVIK | pocketvik | 0.8 |
| Micro Innovations Foldaway keyboard | microfold | 0.8 |
| Micro Innovations Datapad | micropad | 0.8 |
| LIRC consumer IR | lirc | 0.8 |
| Compaq Microkeyboard | microkbd | 0.9 |
| Targus Universal Wireless Keyboard (SIR) | targusir | 0.10 |
| ipaq bluetooth foldable, qwerty layout | btfoldable | 0.12 |
| Freedom | freedom | 0.12 |
If you have a serial keyboard (or serial over IrDA) that isn't currently supported, it shouldn't be hard to add. Contact Nils Faerber (nils dot faerber _a_t_ kernelconcepts dot de) or PaulEggleton.
Note: help is needed to add support for SIR infra-red wireless keyboards such as the Targus Universal Wireless keyboard. If you can help with this, please contact PaulEggleton. Thanks!
Using kbdd
Setting up (Familiar 0.8.2 and later)
To get kbdd working with your keyboard you will need to do the following:
-
If your keyboard is a serial one (ie, it connects to the small socket on the bottom of the iPAQ) then you will need to make sure nothing is using the serial port. By default, Familiar has a serial console using it. To stop this, use the GPE Serial setup applet or use an editor such as vi to comment out (put a # at the start of) the line in /etc/inittab that looks similar to the following:
S:2345:respawn:/sbin/getty 115200 tts/0 vt100
-
Use the GPE Keys and Buttons applet or edit /etc/kbdd.conf and specify the port and type of keyboard you are using.
-
Valid keyboard types for the type: setting are listed in the table above, in the "keyb-type" column; running kbdd --help will also list them.
-
The port depends on what type of keyboard you are using (bluetooth, irda, serial).
-
If it is serial, on pxa-based iPAQs (h3900 and newer) the serial port is /dev/tts/0 and on older iPAQs use /dev/ttySA0.
-
For bluetooth keyboards use /dev/rfcomm0. You will also need to follow some other procedures (see smartbt).
-
For infra-red keyboards use /dev/tts/2
-
Reboot.
Your keyboard should now work in all places (console, Opie, GPE). Some symbols may not work yet (we still need to sort out kernel keymaps) but the majority of keys should be working. You should be able to plug in and unplug your keyboard at will.
Stowaway note: the Stowaway startup process is a little more complicated. Every time you plug it in, you will need to send SIGHUP to kbdd, restart it, or suspend/resume the iPAQ for the keyboard to work. Also, after 10 minutes of inactivity, the keyboard will go into sleep mode, and you will have to do the same thing to wake it up.
If you have problems, you may wish to run kbdd directly as described below, and specify the -d option.
Running kbdd directly
If you need to run kbdd directly (eg. for testing/debugging purposes), follow this procedure:
-
Make sure you have the uinput and keybdev kernel modules loaded.
modprobe keybdev modprobe uinput
-
Stop kbdd if it was already started at boot time (/etc/init.d/kbdd stop).
-
If the keyboard is serial, make sure nothing is using the serial port. (eg. the default serial console as above, or gpsd, etc.)
-
Run kbdd:
kbdd -p <port> -t <keyb-type>
Add the -d option to turn on debug output when a key is pressed. If you don't see anything at all when pressing keys, chances are kbdd wasn't able to properly connect to the keyboard or the codes aren't being recognised.
Smart Bluetooth Keyboard
The following guide I received support by email from Koen. I have tested with h3970 with GPE and Opie image, familiar v.0.8.1. It's working very well! Thanks to Koen so much. - ChanChonburi
-
Check address of keyboard
root@drone:~# hcitool scan Scanning ... 00:0A:3A:03:21:2A KEYBOARD -
Edit rfcomm.conf file
root@drone:~# cat /etc/bluetooth/rfcomm.conf # # RFCOMM configuration file. # # $Id: rfcomm.conf,v 1.1 2002/10/07 05:58:18 maxk Exp $ # rfcomm0 { # Automatically bind the device at startup bind yes; # Bluetooth address of the device device 00:0a:3a:03:21:2a; # RFCOMM channel for the connection channel 1; # Description of the connection comment "Smart BT keyboard"; } -
bind
root@drone:~# rfcomm bind rfcomm0
-
modprobe
root@drone:~# modprobe uinput root@drone:~# modprobe keybdev
-
run kbdd
root@drone:~# kbdd -p /dev/bluetooth/rfcomm/0 -t smartbt
-
Open new console to test, then.... type away!
-
Then you can make it run as service as above guide.
Note: it has a small 'stuck-key' problem on disconnects.
- KoenKooi
Development
Todo
We'd like to make the following improvements in kbdd:
-
Add support for more keyboards
-
Better tools to configure kbdd in graphical environments
-
GPE has a tool already for this
-
PaulEggleton is working on an Opie configuration program and control applet for kbdd, which should hopefully be
available soon.
-
Test and create kernel keymaps for various keyboards so that all symbols/function keys work. May require modifications to kbdd so that all keys send just one scancode to the kernel (as they should).
Getting source & compiling
If you want to hack kbdd to support a new keyboard, you'll need to get hold of the source and compile it. Because kbdd is a fairly simple application with almost no external dependencies, this is easy to do.
Either visit the new
project-page and check out the sources from SVN (instructions can be found on project's SVN page) or you can get the (slightly outdated) kbdd source by checking it out of handhelds.org CVS by doing the following (password is anoncvs):
export CVSROOT=:pserver:anoncvs@anoncvs.handhelds.org:/cvs cvs login cvs co apps/kbdd
You will need to cross-compile the source on your computer (see PrebuiltToolchains - the official 3.3.2 toolchain works fine):
cd apps/kbdd export PATH=$PATH:/usr/local/arm/3.3.2/bin export CC=arm-linux-gcc make
You can then copy the newly-created kbdd executable to your iPAQ and run it.