Touchpad Bluetooth Keyboard

From WebOS Internals
Jump to navigation Jump to search

HP Touchpad Bluetooth Keyboard

Keycode/Scancode for Media/Specialty Keys

Hopefully this information will make it easier to implement support for the HP Touchpad Bluetooth Keyboard on other devices such as a Pre2 or Veer.

Key Keycode Scancode (Decimal) Scancode (Hex)
Notifications 1
Search 217 786977 0xC0221
Keyboard 204
Brightness Down 224
Brightness Up 225
Rewind 168 786612 0xC00B4
Play/Pause 164 786637 0xC00CD
Forward 208 786611 0xC00B3
Mute 113 786658 0xC00E2
Volume Down 114 786666 0xC00EA
Volume Up 115 786665 0xC00E9
Power 142 65666 0x10082

Using various tools under Ubuntu 11.04, I haven't been able to get info for Keyboard, Brightness Down, and Brightness Up. These keys may need a Touchpad device to get the information for, as the keys are known working there. --SineOtter 07:34, 9 September 2011 (UTC)

Keyboard layouts

The keymaps are located in the /usr/share/qt4/keymaps directory. There are 3 of them: keymap-us.qmap, keymap-de.qmap, keymap-fr.qmap. The keymap is loaded after the keyboard was successfully paired with the touchpad.

kmap2qmap is a tool to generate keymaps in qmap format (http://doc.qt.nokia.com/latest/qt-embedded-kmap2qmap.html). Original kmap2qmap source file was downloaded from http://svn.netlabs.org/repos/qt4/trunk/tools/kmap2qmap/main.cpp, then some changes from http://palm.cdnetworks.net/opensource/3.0.2/qt4-4.7.1-patches.gz were applied. Download the patched kmap2qmap.cpp[1] and compile it:

gcc -o kmap2qmap kmap2qmap.cpp -I/usr/include/qt4 -I/usr/include/qt4/QtCore -lQtCore

Now grab the kmap[2] file, modify it if you want and generate the qmap file with:

./kmap2qmap us.kmap keymap-us.qmap

The us.kmap file was generated with ckbcomp (it's in the console-setup package in Debian) and then the touchpad related keys were added:

ckbcomp -keycodes evdev -layout us -compact > us.kmap

There is also a modified kmap file[3] with CapsLock changed to Control key, added AltGr and germanic umlauts mapped to AltGr+[aous]. You can take this kmap as a reference or just diff it with the us.kmap to see what should be changed.


It is possible to create new layouts (with dvorak, colemak, cyrillic or whatever you want), but there is still no way to switch layouts on the fly.