Remove All Ads from XDA
Honor 9 Lite

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

81 posts
Thanks Meter: 4
By jevring, Member on 10th April 2012, 10:58 AM
Post Reply Email Thread
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?
11th April 2012, 08:29 AM |#2  
ZilverZurfarn's Avatar
Senior Member
Flag Göteborg
Thanks Meter: 23
Yes, it is. Take a look at Swedroid's forum.
The Following User Says Thank You to ZilverZurfarn For This Useful Post: [ View ] Gift ZilverZurfarn Ad-Free
11th April 2012, 08:44 AM |#3  
OP Member
Thanks Meter: 4
Thumbs up
Excellent, thanks!
17th April 2012, 06:23 PM |#4  
OP Member
Thanks Meter: 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?
17th April 2012, 06:32 PM |#5  
OP Member
Thanks Meter: 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?
17th April 2012, 07:27 PM |#6  
OP Member
Thanks Meter: 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...
17th April 2012, 09:32 PM |#7  
OP Member
Thanks Meter: 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?
18th April 2012, 06:29 PM |#8  
OP Member
Thanks Meter: 4
Lightbulb 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
adb reboot

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

Edit: Credit where credit is due. I had some help from this thread:
Attached Files
File Type: zip - [Click for QR Code] (4.6 KB, 32 views)
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes