Touchpad Bluetooth Keyboard

From WebOS Internals
Revision as of 01:54, 10 January 2012 by Sconix (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 ( Original kmap2qmap source file was downloaded from, then some changes from 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.

UK / US keyboard differences

UK keyboard has Alt Gr instead of Symbol key. To get that key work with the above kmap file you need to change the following line:

keycode 100 = Alt Alt Alt Alt Alt Alt Alt Alt Alt Alt
keycode 100 = AltGr AltGr AltGr AltGr AltGr AltGr AltGr AltGr AltGr AltGr

Naturally the kmap needs some other changes as well if you want to make the us kmap into proper uk one, but at least with this change you get the Alt Gr working as it should (i.e. the secondary keys start to work such as Alt Gr+a).