[Q] Changing Desire Z hardware keyboard to swedish (with åäö)

Search This thread

jevring

Senior Member
Apr 6, 2012
81
4
As we can provide new key mappings with custom roms, should it not be possible to do something like this instead? I'm fairly certain the keyboard has the equivalent buttons, but they're mapped to other useless stuff like shortcuts.

Would it be possible to include a swedish keymap in a rom and have it work "automatically"? I.e. are keymaps nothing more than a mapping turning a key (presumably an identifier) into a character?
 

jevring

Senior Member
Apr 6, 2012
81
4
I found some stuff there, and I've gotten to the point where I can modify my keymap. I know this, because I've managed to unmap a key. However, I'm unable to map the keys to the actual output I desire. I need the codes for å, ä and ö, respectively. According to that I found, they're FUNC_8, 7 and 5, but that simply doesn't work. I get nothing when I push the buttons when they are pointed to those mappings.

Any ideas?
 

jevring

Senior Member
Apr 6, 2012
81
4
Looking at vision-keymap-nor.kl, which contains the norweigian keymaps, the FUNC codes are the same. The question is, what do they point to?
 

jevring

Senior Member
Apr 6, 2012
81
4
So I looked at the files in /system/usr/keychars, and I found a human-readable file that looks like what I need. It looks like it's what defines the "aliases" being referenced in the keylayout file.

The only problem with that is that, when I uploaded my changed keychars file and rebooted, I reverted to some keymap with hardly anything but the basic keys in them. Only 4-5 keys produce anything while Fn is held...
 

jevring

Senior Member
Apr 6, 2012
81
4
I'm fairly certain I can edit the layout properly. I think, however, that it defaults back to Generic.kcm. I wonder why that is. Does anybody know how android selects which keymap to use?
 

jevring

Senior Member
Apr 6, 2012
81
4
I found the problem

I found the problem.

I had tried to use custom keycodes, A_RING, A_DOTS and O_RING in my vision-keypads-wwe.kcm, but it turns out that this is not allowed. You have to stick to ones that exist. I looked at vision-keypads-nor.kcm, and found that it used BUTTON_1, BUTTON_2 and BUTTON_3 for this. Once I switched from my custom keycodes to ones that exist, it immediately accepted the programming.

Result: I now have native åäö mapped to the bottom row of my keyboard in ICS.
As this maps SYM to 'å', you can get SYM bu doing Fn+Shift+SYM

If you want the same, I've attached my .kl and .kcm files. To put use them, do the following:

adb push vision-keypad-wwe.kl /sdcard/
adb push vision-keypad-wwe.kcm /sdcard/
adb shell
mount -o rw,remount -t ext3 /dev/block/mmcblk0p25 /system
cp /system/usr/keylayout/vision-keypad-wwe.kl /sdcard/vision-keypad-wwe.kl.orginal
cp /system/usr/keychars/vision-keypad-wwe.kcm /sdcard/vision-keypad-wwe.kcm.orginal
cp -f /sdcard/vision-keypad-wwe.kl /system/usr/keylayout/vision-keypad-wwe.kl
cp -f /sdcard/vision-keypad-wwe.kcm /system/usr/keychars/vision-keypad-wwe.kcm
mount -o ro,remount -t ext3 /dev/block/mmcblk0p25 /system
exit
adb reboot

If you need help, don't hesitate to ask.

Edit: Credit where credit is due. I had some help from this thread: http://www.swedroid.se/forum/showthread.php?t=26289&highlight=desire+svenskt+tangentbord&page=2
 

Attachments

  • vision-keypad-wwe-swedish-chars.zip
    4.6 KB · Views: 33
Last edited:

Top Liked Posts