Fremantle Bluetooth Keyboard Layout

Bluetooth keyboards are not officially supported on the N900, that is Maemo Fremantle, but it is possible to get them working with some hacking.

Contents

Devices

Device Product Link Success Reports
iGo Stowaway Keyboard Amazon: [1] [2]
Nokia SU-8W Nokia: [3] [4]
Neos BluSlim Bluetooth Compact Keyboard BTK-1 Neos: [5] [6]
Rocketfish RF-BTKB2 Rocketfish: [7] [8]

Procedure

  • Enable HID support as described here. Note that the DisablePlugins line needs to be there, but it should not include the "input" keyword.
  • As root, download the tar file from [9] and extract it:
sudo gainroot
cd /usr/share/X11/
wget http://talk.maemo.org/attachment.php?attachmentid=5221 -O xkb-chinook.tar
tar xf xkb-chinook.tar
cp -i xkb-chinook/symbols/pc xkb/symbols/.
cp -i xkb-chinook/symbols/us xkb/symbols/.
cp -i xkb-chinook/geometry/pc xkb/geometry/.
  • You need to know your keyboard ID
hildon-im-xkbtool --list

will show the device #

  • Every time the keyboard connects, you need to run setxkbmap:
setxkbmap -device 4 -I -I/usr/share/X11/xkb-chinook -rules base -model pc105 -layout us

For the Nokia SU-8W keyboard, use "nokiasu8w" instead of "pc105".

After running this command, press any key on the N900's internal keyboard, and you should be able to type numbers and symbols on the bluetooth keyboard.

Setting Layout Automatically

There is a python script written by jakoleh which seems to work. Copy it out of this post and save it as bluetooth-keyboard.py:

http://talk.maemo.org/showthread.php?p=525721

You need to set the KEYBOARDNAME, DEVICE, MODEL and LAYOUT parameters for your keyboard. To do this go to the /var/lib/bluetooth directory. There should be a directory there named after your device's bluetooth ID, such as "08:00:69:02:01:FC". Change into that directory and find your keyboard in the file called "names". For example:

00:03:C9:3D:7D:B0 Think Outside Keyboard

In this case, you would set

KEYBOARDNAME = "Think Outside Keyboard"
DEVICE = "dev_00_03_C9_3D_7D_B0"

The MODEL and LAYOUT depend on your keyboard. For a standard 105-key layout, you might do:

MODEL = "pc105"
LAYOUT = "us"

Now open a terminal and run the command in the background like this:

python bluetooth-keyboard.py &

Now whenever you connect the keyboard it should automatically set the correct layout. It should also give you a helpful yellow notification message saying that the keyboard connected.

Starting daemon script automatically

Put this in /etc/init.d/bluetooth-keyboard. You need to replace bluetooth-keyboard.py with the absolute path.

#!/bin/sh
 
case "$1" in
start)
       python bluetooth-keyboard.py &
       ;;
stop)
       kill $(ps ax | grep 'python bluetooth-keyboard.py' | grep -v grep | awk '{print $1}')
       ;;
restart)
       echo "$0: not implemented"
       exit 1
       ;;
force-reload)
       echo "$0: not implemented"
       exit 1
       ;;
*)
       echo "Usage: $0 {start|stop}"
       exit 1
       ;;
esac

Make it executable and hook into init system

chmod a+x /etc/init.d/bluetooth-keyboard
update-rc.d bluetooth-keyboard defaults

Next steps

It would be nice to build a package to do all of this.

References

  • General procedure: [10]
  • DisablePlugins is required: [11]
  • Installing the tarball: [12]
  • Special copy commands: [13]
  • Script to automatically run the setxkbmap command: [14]