# HP wireless bluetooth keyboard



## angrymanhands (Aug 16, 2011)

I am running CM7 alpha 3 on my touchpad. I am able to sync the bluetooth keyboard with the tablet, but as im sure some of you know, not all the buttons work. I have found multiple threads on various forums about remapping keys. I am, however, unable to find the .kl file for the HP bluetooth keyboard. I know where the standard files are. system/usr/keylayout, but all I see is AVRCP.kl, gpoi-keys.kl, handset.kl, and qwerty.kl. I have tried modifying the querty and gpio-keys kl files with no success. 
My question is, am I missing something, or am I looking in the wrong place, or is it that it just cant be done?

Thanks!


----------



## dspcap (Oct 13, 2011)

Qwerty.kl is the file you want to change. Here's a link to the fixed .kl.

http://code.google.com/p/cmtouchpad/issues/detail?id=73

Be sure to fix permissions.


----------



## Aganar (Oct 29, 2011)

Any equivalent for an apple-styled BT keyboard? I could always try one myself but I'm sure someone else has done one better.


----------



## angrymanhands (Aug 16, 2011)

dspcap said:


> Qwerty.kl is the file you want to change. Here's a link to the fixed .kl.
> 
> http://code.google.c...es/detail?id=73
> 
> Be sure to fix permissions.


thank you for the link!
As far as fixing permissions, do you mean from rom manager? I read the post, but couldn't figure out what was ment. it is kinda vague to me.


----------



## angrymanhands (Aug 16, 2011)

Ok, Ive got it all figured out. This is awesome! I even mapped the play/pause, previous and next buttons to control the music app. This is fun. If I could find more commands i would try and program more dead buttons.


----------



## brotbuexe (Oct 14, 2011)

angrymanhands said:


> Ok, Ive got it all figured out. This is awesome! I even mapped the play/pause, previous and next buttons to control the music app. This is fun. If I could find more commands i would try and program more dead buttons.


Could you share what you did to map this buttons, or is it included in the files already at google code?


----------



## brotbuexe (Oct 14, 2011)

Playing a little bit with that stuff.

For correct landscape cursor keys with touchpad bt keyboard try this file. http://code.google.com/p/cmtouchpad/issues/detail?id=73#c35

HP_TouchPad_Wireless_Keyboard.kl and HP_TouchPad_Wireless_Keyboard.kcm.bin are used together when using this hp touchpad keyboard.

the qwerty.kcm.bin and .kl are only used if android didn't find the device. (you could check for your keyboard by running "keyevent" from the market, enable logcat and press some keys. Logcat should show some "W/KeyCharacterMap" lines.

The .kl file have only the dpad fixed.
I'll try getting to make the other buttons on the hp touchpad keyboard work.

Because I have a german version I'll try to make a kcm.bin. Don't know yet if creating a new one with makekcharmap, or editing the binary file is faster for me...


----------



## brotbuexe (Oct 14, 2011)

Looks like I'll better wait for cm9:

http://source.android.com/tech/input/key-character-map-files.html
* Compatibility Note*

Prior to Android Honeycomb 3.0, the Android key character map was specified using a very different syntax and was compiled into a binary file format (.kcm.bin) at build time.
Although the new format uses the same extension .kcm, the syntax is quite different (and much more powerful).
As of Android Honeycomb 3.0, all Android key character map files must use the new syntax and plain text file format that is described in this document. The old syntax is not supported and the old .kcm.bin files are not recognized by the system.

Till then I go with fixing some of the german chars I often need directly in the bin file...


----------



## brotbuexe (Oct 14, 2011)

Tried a little bit more but have issues with some keys:

Anyone knows why MEDIA keys doesnt work?

its in http://developer.android.com/reference/android/view/KeyEvent.html
and in api level 10 but I can't get it work:

key 168 MEDIA_PREVIOUS
key 164 MEDIA_PLAY_PAUSE
key 208 MEDIA_NEXT

some other keys (keyboardkey, brightness up/down) doesnt work at all, they didnt generate key events.

Found a kcm.bin for german version: http://forum.xda-developers.com/showpost.php?p=9386074&postcount=70
Just rename to HP_TouchPad_Wireless_Keyboard.kcm.bin and put it in /system/usr/keychars/


----------



## brotbuexe (Oct 14, 2011)

Okay, the media keys works fine.
Had astro player installed and it hooked the keys. Right after uninstall they worked.

If you like rewind/fast forward just change the lines:

key 168 MEDIA_PREVIOUS
key 164 MEDIA_PLAY_PAUSE
key 208 MEDIA_NEXT

into

key 168 MEDIA_REWIND
key 164 MEDIA_PLAY_PAUSE
key 208 MEDIA_FAST_FORWARD

Now next question, how to make key combination Shift+Forward for MEDIA_NEXT and Forward for MEDIA_FAST_FORWARD?


----------



## angrymanhands (Aug 16, 2011)

brotbuexe said:


> Playing a little bit with that stuff.
> 
> For correct landscape cursor keys with touchpad bt keyboard try this file. http://code.google.com/p/cmtouchpad/issues/detail?id=73#c35
> 
> ...


For reference, I did not use the kcm.bin file you are talking about. Instead I decided to remap the keys for the arrow keys. The only problem I see with that is that if I ever get a different keyboard I would have to remap again, but I don't forsee doing that, plus its easy once you know what's going on.

One thing that I think should be mentioned is that you should save the original qwerty.kl somewhere on your sd card. Every time you modify the qwerty.kl it saves the version you had previously as qwerty.kl.bak so if you screw something up you can go back to the previous file. 
Also, once you make the changes on the file you have to reboot. I also read it is advisable to unpair and then pair the keyboard to get the new keyboard layout.

I hope this helps

Also, check the permissions on the qwerty.kl file and make sure they match the rest of the permissions in the directory. You can check this with root explorer by long pressing on the file and in the sub menu choose permissions.


----------

