5,604,219 Members 49,512 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
jevring
Old
#1  
Member - OP
Thanks Meter 2
Posts: 69
Join Date: Apr 2012
Question [Q] Changing Desire Z hardware keyboard to swedish (with )

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?
 
ZilverZurfarn
Old
#2  
ZilverZurfarn's Avatar
Senior Member
Thanks Meter 18
Posts: 893
Join Date: Feb 2009
Location: Gteborg
Yes, it is. Take a look at Swedroid's forum.
ADP1 ADS_Magpie (retired)
Desire Z CM 7.2
HTC One X (stock)
KFHD 8.9
Dreaming of electric sheep
Get DropBox!

The Following User Says Thank You to ZilverZurfarn For This Useful Post: [ Click to Expand ]
 
jevring
Old
#3  
Member - OP
Thanks Meter 2
Posts: 69
Join Date: Apr 2012
Excellent, thanks!
 
jevring
Old
#4  
Member - OP
Thanks Meter 2
Posts: 69
Join Date: Apr 2012
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
Old
#5  
Member - OP
Thanks Meter 2
Posts: 69
Join Date: Apr 2012
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
Old
#6  
Member - OP
Thanks Meter 2
Posts: 69
Join Date: Apr 2012
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
Old
#7  
Member - OP
Thanks Meter 2
Posts: 69
Join Date: Apr 2012
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
Old
(Last edited by jevring; 18th April 2012 at 05:35 PM.) Reason: Give credit to my sources
#8  
Member - OP
Thanks Meter 2
Posts: 69
Join Date: Apr 2012
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:

Quote:
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/showthr...entbord&page=2
Attached Files
File Type: zip vision-keypad-wwe-swedish-chars.zip - [Click for QR Code] (4.6 KB, 30 views)

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Wearables Walkthrough: Tasker on the Samsung Galaxy Gear – XDA Developer TV

The future certainly looks like it is full of wearables. … more

WinDroid HTC Toolkit Lets You Root, Unlock, and Flash ROMs on Various HTC Devices

Plenty of users nowadays have more than one mobile device. … more

When Using GitHub, Don’t Skimp on Commit History

GitHub has become the epicenter of most open source development work that is posted … more

Verizon Droid DNA to Receive 4.4.2 KitKat + Sense 5.5 OTA This Thursday

The HTC Droid DNAis Verizon’s close cousin to the JapaneseHTC … more