Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
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 16
Posts: 888
Join Date: Feb 2009
Location: Göteborg
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, 24 views)

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

report this ad
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...

XDA PORTAL POSTS

Careers in Android: Recruiter Reveals How Resumes are Chosen – XDA Developer TV

XDA Developer TV Producer Jayce released a video a … more

HttpClient Tutorial to Upload and Download with Your App

Developers wanting to interact with the Internet need to choose a package to do the … more

Profile Flow: A Tasker Alternative

By now, we’re all quite familiar with Tasker, the personal automation app that seems to be able to … more

More Tips to Help Promote Your Android App

With over 700,000 apps in the Google Play store and more than 48 billion app installs, it’s … more