[Mod][NOR] Lang characters for hardware keyboard v0.3 - G2 and Desire Z Android Development

Hi all!
After searching the wide web of the world I didn't find anyone who cared to program the special characters for nordic keyboards (æ,ø and å). The norwegian stock ROM has got these mapped to own keys, but I've never liked to use stock ROM, so I was stuck with the "long press method".
If you screw up your phone trying to adb push, cp -f these files I'm not responsible yada yada yada (nothing wrong should happend, really)
What I've done is taking the modified files from teferi, and added my own editing for the quick keys (as I had to make place for the chars I removed from jkl) and the special chars of course.
Confirmed on my G2 (running the CM and Sense ROMs)
Code:
*Norwegian*
version 0.3:
-Fixed issue with , and ; didn't work on hardware keyboard.
version 0.2:
Quick change to the "Z" button, since "`" is used in command substitutions.
-alt-z is still "^", alt-shift-z = "`"
version 0.1:
-alt+j,k,l = æ,ø,å (alt+shift gives capitol letter).
- make ".com" a TAB key, as it ought to be
- left softkey is now "\" "|" "/"
- right softkeys are now "[" "(" "<" and "]" ")" ">"
- alt-z is now "^"
INSRUCTIONS:
- download file
- unzip g2-nordic_01.zip
- adb push vision-keypad.kl /sdcard/
- adb push vision-keypad.kcm.bin /sdcard/
- adb shell
- su (if you don't have ro.secure turned off)
- mount -o remount,rw /dev/block/mmcblk0p25 /system
- cp -f /sdcard/vision-keypad.kl /system/usr/keylayout/
- cp -f /sdcard/vision-keypad.kcm.bin /system/usr/keychars/
- reboot
Btw... backup of original keymapping is included... just rename them without .orig, and follow the procedure above
Code:
Guide to make your own keys:
Download a hex editor (i prefer xvi32), open the "kcm.bin", and alter the symbols shown in the attached .jpg. If you wish to alter the "main" char of the key, you can change that in the .kl file with notepad. You can find the original untouched files in the nordic...zip
Thanks to teferi for the base files

adb shell
I keep getting this, im sure the files on are on the sdcard
Code:
# cp -f /sdcard/vision-keypad.kl /system/usr/keylayout/
cp -f /sdcard/vision-keypad.kl /system/usr/keylayout/
cp: not found
#

Make sure you have busybox installed (to get the cp function)... easiest way
I'll also update that in the OP.
You can also just copy it over to the respective folders with root explorer etc.
Sent from my HTC Vision using XDA App

won't quite work on DZ - the keyboard device name is vision-keypad-wwe on that model. renaming them ought to work, but I don't have something to test it on.

teferi said:
won't quite work on DZ - the keyboard device name is vision-keypad-wwe on that model. renaming them ought to work, but I don't have something to test it on.
Click to expand...
Click to collapse
Renaming the bin/kl still don't "trick" the system into using the files. At least from my experience. I'm just trying to get the original g2 layout that includes www/.com, along with the 3 user keys to work on the z rom.

eViL D: said:
Renaming the bin/kl still don't "trick" the system into using the files. At least from my experience. I'm just trying to get the original g2 layout that includes www/.com, along with the 3 user keys to work on the z rom.
Click to expand...
Click to collapse
I've used the kl./.kcm files from G2 to make the G2-norwegian layout, and DZ files to make the esp-version... which is why I removed the esp from this thread...
I think it should be possible to port the keys if you use the base files from each device, and edit the .kl/.kcm files the way you want them. Then add them both to the ROM... G2 will use the vision-keypad.* files, DZ will use vision-keypad-wwe.* files (but I think you already know this)

Related

[FIX] Desire Z Scandinavian keyboard layout

There's occasional all-caps ÄÖÅ problem with hardware keyboard, but closing keyboard and opening software keyboard and back to hardware keyboard fixes that. Or you can try this.
Update: This seems to fix irssi connectbot and all caps scandinavian characters problem also. Fixed Norwegian AE and O with dash.
This is what I did:
First you have to get root, I used these instructions and they worked for me (Finland, Saunalahti):
http://forum.xda-developers.com/showthread.php?t=843014
Want to know more about modifying keymaps, see here:
http://forum.xda-developers.com/showthread.php?t=837002
And this old post is still valid for modifying keymaps-file with hexeditor:
http://forum.xda-developers.com/archive/index.php/t-504710.html
And that's basically what I did.
After you have root:
Download the attachment vision-keypad-nor.kcm.bin.zip and unzip it.
On PC run:
adb pull /system/usr/keychars/vision-keypad-nor.kcm.bin /tmp (for backup, store the file somewhere safe)
Copy modified version to /sdcard (the file you downloaded)
adb push vision-keypad-nor.kcm.bin /sdcard/
adb shell
su
mount -o rw,remount -t ext3 /dev/block/mmcblk0p25 /system
cp -f /sdcard/vision-keypad-nor.kcm.bin /system/usr/keychars/
sync
reboot
(few finnish words for finnish googlers: desire z ääkköset skandit)
when i try this part:
"adb shell
su
mount -o rw,remount -t ext3 /dev/block/mmcblk0p25 /system
cp -f /sdcard/vision-keypad-nor.kcm.bin /system/usr/keychars/
sync
reboot"
i get "Permission Denied" when i write SU. my phone IS rooted and have S-off.. any clue on what can cause this problem?
what state should the phone be in? "disk drive" right?
Problem solved: i had to open my super user application on my phone to allow before i could continue
Did everything like in instructions, and now my touchscreen is mirrored!
If I push the left side of the screen it registers it on the right side and vice versa. And worst thing is that I don't have the original file anymore
edit: I found the original backed up file, thank god! Nice gag
Samusalo, are you serious? Shouldn't have anything to do with touchscreen calibration.
Exanimus, did it work for you after all?
Should not have anything to do with touchscreen calibration.
Also fixes wrong keyboard mapping or capacitive buttons not working in G2 based roms.
I posted a repaired file somewhere alrdy, and this is 5th thread after mine
thanks for getting this started
more than the scandinavian characters i was annoyed by the total LACK of certain keys on the keyboard
as a linux user <, > and | are essential!
so i cobbled this together (also fixes the capital char issue)
changes;
æ -> [
æ +shift -> {
æ +shift+fn -> æ
ø -> ]
ø +shift -> }
ø +shift+fn -> ø
ä +fn -> <
ö +fn -> >
å +fn -> \
å +shift+fn -> ^
. +shift+fn -> | (pipe)
these remain the same;
æ +fn = ?
ø +fn = !
it appears we can still add shift+fn keys for the whole keyboard if more are needed
any suggestions?
installation;
adb push vision-keypad-nor.kcm.bin /sdcard/
adb push vision-keypad-nor.kl /sdcard/
adb shell
su
mount -o rw,remount -t ext3 /dev/block/mmcblk0p25 /system
cp -f /sdcard/vision-keypad-nor.kl /system/usr/keylayout/
cp -f /sdcard/vision-keypad-nor.kcm.bin /system/usr/keychars/
sync
reboot
be sure to backup originals
Shole, great stuff! Thanks. Will try your keymaps.
shole, you're awesome! Thank you, Jusii too.
I would be more interested in changing Æ or Ø to a second fn.
Is that easy to fix?
Sent from my HTC Vision using Tapatalk
shole said:
it appears we can still add shift+fn keys for the whole keyboard if more are needed
any suggestions?
Click to expand...
Click to collapse
Shortcut for "~" would be awesome to have too. I've got no idea what shortcut to use tho, since your layout seems awesome already and it's taking pretty much all the spare combinations available.
~ is at [email protected] already in the stock phone, and these mods
a second fn would be trivial to add to replace, say, å, but you would lose that button entirely for fn role only
the keyboard is already short of keys and the fn and shift keys are sticky by default so i don't really see it as a need at all
the menu key on the physical keyboard is entirely redundant though(you need it rarely and the other one is only a short thumb move away on the screen half), but it's right next to the existing fn-key so that's not much use
right side shift key would be redundant if it wasn't used by connectbot as tab
tattevajoo said:
Shortcut for "~" would be awesome to have too. I've got no idea what shortcut to use tho, since your layout seems awesome already and it's taking pretty much all the spare combinations available.
Click to expand...
Click to collapse
I'd map it to [email protected] ...
EDIT: Oops, I was late.
Ahhh my bad, should of looked more carefully ~ thanksss (again).
Sent from my HTC Vision using XDA App
Any way to add back key to layout? Taking gloves off allways when need to use back button is annoying...
Fubaaarrr said:
Any way to add back key to layout? Taking gloves off allways when need to use back button is annoying...
Click to expand...
Click to collapse
That would be one helluva improvement to this phone. Adding left and right arrows and it would complete for my use.
this looks nice...
did anyone so far start working on a German version of this, and would mind sharing?
the stock Desire Z German version annoys me as hell.
I set the phone to English, but use the German keyboard layout.
first of all, I can't input capital Umlaute (ÄÖÜ), no combination of Fn+shift+j/k/l works. especially bad if i want to input a new word.
changing the keymap should fix my woes here, right?
also for general use, I'm lacking <, >, ~, | and some others - maybe someone modified the german keyboard for this already?
on the other hand - the phone specifically has a combination (Fn+search -> Symbols) - why does this only contain like 1/3 of the 2 pages available in the soft keyboard?
does anyone know a way to add the whole bunch from the soft keyboard to the selection screen that pops up when hitting fn+search?
kind regards,
sub
Irssi connectbot does not need rooting it has a fix for scandinavian characters of its own, just enable it in the settings. The fix also repairs ~
It also contains ^ < > | etc characters in its longpress-menu
Thanks for the fix! It works on Gingervillain 1.4.
I prefer using adb push:
Code:
adb remount
adb push /vision-keypad-nor.kcm.bin /system/usr/keychars
adb reboot
Thanks Jusii for the fix!
rollex said:
Thanks Jusii for the fix!
Click to expand...
Click to collapse
Jusii's fix worked me for a long time in Froyo (Virtuous 1.0.2), but then I updated to Gingerbread and Virtuous 2.0.0 and got problems shole described. Installed shole's keypad fixed all the problems.
I would thank you all participated but for some reason there is no THANKS -button below your messages. So once I again I thank here. Thank you!

[Q] QWERTZ -> QWERTY on a Desire Z

I recently obtain a Desire Z and immediately rooted and installed various ROMS. All is working great.
The problem is the hardware keyboard is a qwertz one (I bought the phone in Switzerland) and not a qwerty one. I want to the switch the keymap around such that z prints y and vice versa. I've set the keyboard setting to UK and US English but it has no effect on the h/w k/b.
I'm familiar with adb but don't know which files to hack on. Please can someone point me in the right direction?
Thanks!
the hardware keyboard layout is fixed.
the setting in menu is only changing the software keyboard.
Thanks for the reply.
But I don't buy it. This can be changed somehow and someone knows how. I'll keep hacking and post back with any useful results.
I have a sneaking feeling that it should be able to be cooked in. Even on Winmo, you can change your keyboard's layout, i don't see why android, a platform that is much more advanced, would not be able to do that.
This is just a hunch, but you probably just need to modify /system/usr/keylayout/vision-keypad.kl and possibly /system/usr/keylayout/qwerty.kl (they're both plain text files, but with unix line endings)
On a UK QWERTY Desire Z:
Key 21 is Y
Key 44 is Z
If your files have them round the other way, it should just be a simply case of swapping them and rebooting (nandroid first though!)
Great. I tried those files and no good so I went for the heavy handed approach after mounting system as rw and su'ing:
cd /system/usr/keylayout
sed -i s/Y/--/ *
sed -i s/Z/Y/ *
sed -i s/--/Z/ *
Job done! Thanks for your help
For the almost-beginners:
Connect your phone in sync-mode, run cmd, navigate do adb directory (search forum for adb if you didn't get it) and type:
Code:
adb shell
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
cd /system/usr/keylayout
sed -i s/Y/--/ *
sed -i s/Z/Y/ *
sed -i s/--/Z/ *
Best regards to all
DRuMah said:
For the almost-beginners:
Connect your phone in sync-mode, run cmd, navigate do adb directory (search forum for adb if you didn't get it) and type:
Code:
adb shell
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
cd /system/usr/keylayout
sed -i s/Y/--/ *
sed -i s/Z/Y/ *
sed -i s/--/Z/ *
Best regards to all
Click to expand...
Click to collapse
shall be rooted to run these?
am getting access denied!!!!!11111
Well obviously you need root to write to /system/ partition.
DRuMah said:
For the almost-beginners:
Connect your phone in sync-mode, run cmd, navigate do adb directory (search forum for adb if you didn't get it) and type:
Code:
adb shell
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
cd /system/usr/keylayout
sed -i s/Y/--/ *
sed -i s/Z/Y/ *
sed -i s/--/Z/ *
Best regards to all
Click to expand...
Click to collapse
Hi, I've tried this on my Desire Z and it indeed switched the 'y' and 'z' character keys on the hardware keyboard.
The downside is that is also changes the corresponding FN symbols (i.e. number six character '6' and underscore character '_').
Do you know wether it is possible to switch the letters but not the symbols?
I don't know about the symbols. My guess is you have to live with it. I do. Yes, it's annoying but IMO about 10% as annoying as the original problem.
I would also add that on ICS, the above changes b0rked the keyboard (probably due to the sed script replacing stuff it ought not have). So I used this instead:
Code:
adb shell
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
cd /system/usr/keylayout
sed -i s/'key 44 '/'key XX '/g *
sed -i s/'key 21 '/'key 44 '/g *
sed -i s/'key XX '/'key 21 '/g *
adb reboot
If I have to do this one more time, I'm going to make an app.....
In the end I managed to fix the symbols by editing some hex file I can't recall right now. I can check it out later and post what I did if anyone is interested.
Couldn't come up with a simple command like yours though, and edited it by hand by downloading to the PC and uploading after modification. It can probably be done using regular expressions, but they are not my biggest strength
Good job I'm certainly interested. If you could post specific details that would be great!
Cheers.
Sorry for the delay, but I've had quite a busy week...
The file that I modified was /system/usr/keychars/vision-keypad-ger.kcm.bin My phone was bought from Germany, so if you have a different region phone the specific file you need to edit might be a different one.
I edited it on Windows with xvi32 hex editor (GHex on Ubuntu works fine as well), and the nice thing about it is that you can see the hexadeciman values on the left and their ASCII counterparts on the right. It was quite easy to find the sections 'yY__' and 'zZ66'. You only need to change those to 'yY66' and 'zZ__' and voilá.
If you already have your 'y' and 'z' keys swapped (but the symbols out of place), you should changed change the '6's and '_'s. If you have the letters on their original positions you should then change the letters instead, and the symbols will stay where they are.
Hope that helps.
Great job
little help
migueluli said:
Sorry for the delay, but I've had quite a busy week...
The file that I modified was /system/usr/keychars/vision-keypad-ger.kcm.bin My phone was bought from Germany, so if you have a different region phone the specific file you need to edit might be a different one.
I edited it on Windows with xvi32 hex editor (GHex on Ubuntu works fine as well), and the nice thing about it is that you can see the hexadeciman values on the left and their ASCII counterparts on the right. It was quite easy to find the sections 'yY__' and 'zZ66'. You only need to change those to 'yY66' and 'zZ__' and voilá.
If you already have your 'y' and 'z' keys swapped (but the symbols out of place), you should changed change the '6's and '_'s. If you have the letters on their original positions you should then change the letters instead, and the symbols will stay where they are.
Hope that helps.
Click to expand...
Click to collapse
hi. how you manage to change permission of file vision-keypad-ger.kcm.bin ?
I tried with adb, it's not working.
needubad said:
hi. how you manage to change permission of file vision-keypad-ger.kcm.bin ?
I tried with adb, it's not working.
Click to expand...
Click to collapse
You need to mount the /system partition as rw to be able to modify that file. You can do that with
Code:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
while logged as root in the adb shell.
If you already did that and are still unable to modify the file then I'm afraid I cannot be of much help
I'd like to do an oposite thing: QWERTY --> QWERTZ
for us, noobs, could someone please simillar commands for this operation?
thanks in advance
HoradricCZ said:
I'd like to do an oposite thing: QWERTY --> QWERTZ
for us, noobs, could someone please simillar commands for this operation?
thanks in advance
Click to expand...
Click to collapse
... for noobs you'd think you would just flip the placement of Z and Y.

[Q] How do I get a £ sign with CM7 on a UK DZ?

Hi there,
Recently converted to CM7 after years of Sense ROMs and I'm loving it. But I have one question, how do I make FN-z on the physical keyboard produce a £ sign?
I've got the keyboard language set to English (United Kingdom) but that doesn't seem to make any difference.
Regards,
Richard
Change the characterlayout in /system/usr/keychars
In all *.kcm files add these lines to the Z key:
Code:
alt: '\u00A3'
shift+alt:'\u00A3'
To make it look like this:
Code:
key Z {
label:'Z'
base:'z'
shift, capslock:'Z'
alt: '\u00A3'
shift+alt:'\u00A3'
}
Do so in all files, to make sure it's loaded whatever keyboard file you're using.
Ah, I notice this is the case in MIUI roms as well.
Would this work there also? I see the kcm files are bin files, how exactly are we editing them, just open as text file I assume?
It should work on any custom rom, unless the keymapping is done diffrent then usally. Just try it, and if it doesn't work or your phone won't start anymore (enters a bootloop) , just reflash your custom rom, without wiping. Then only homescreen settings and system settings will get lost. Personal and data settings will not be touched.
Just to confirm though, are you editing it as a txt file or what? I have no knowledge of editing bin files which the kcm files seem to be.
Eg: vision-keypad-ell.kcm.bin
As textfile yes, but they should be just plain *.kcm files, not *.bin as I believe, let me check that, to be sure.
--Edit:
They are just *.kcm, not *.bin, but I'm not sure how that's done in other Roms..
If there are only *.bin files, then I don't know how to edit those.. I know that *.kcm can be edited as plain text file.
Cool, I'll look into it.
I notice you put '*.kcm'. My memory is failing me but doesn't this mean hidden files? In which case I didn't look for them.
EDIT: Nah just looked, they are all BIN files. Looks like MIUI does things differently.
Oh well.
The star doesn't mean they're hidden, it is a joker sign. Just means all filenames that end with .kcm (wich is the extention). The .bin files are packed files, binary files. But I can't remember how to edit those as plain text... Try to do it with something like hexeditor on the pc.
lineaira said:
Change the characterlayout in /system/usr/keychars
In all *.kcm files add these lines to the Z key:
Code:
alt: '\u00A3'
shift+alt:'\u00A3'
To make it look like this:
Code:
key Z {
label:'Z'
base:'z'
shift, capslock:'Z'
alt: '\u00A3'
shift+alt:'\u00A3'
}
Do so in all files, to make sure it's loaded whatever keyboard file you're using.
Click to expand...
Click to collapse
All the files that I have in the folder you specified are *.kcm.bin. I guess I need to find the .kcm source files some where and compile them?
Regards,
Richard
You can pull them from your phone with adb. Then edit them with a program like hexeditor.
I can't explain how, as I do not have any *.bin files on my phone or other rom.
If I can find one somewhere in a download or something (you are on CM7 if I'm right) I'll post instructions tomorrow about how to do it. If you'd like me to, that is.
lineaira said:
You can pull them from your phone with adb. Then edit them with a program like hexeditor.
I can't explain how, as I do not have any *.bin files on my phone or other rom.
If I can find one somewhere in a download or something (you are on CM7 if I'm right) I'll post instructions tomorrow about how to do it. If you'd like me to, that is.
Click to expand...
Click to collapse
If you could I would be interested
HOW TO: remap the £ back to FN+Z
Okay here we go.
Before we begin, I suppose that you all know how to set up an adb session with your phone..
And you need this program to be installed on your PC:
Free Hex Editor Neo
You should make a backup of your current working ROM with your favorite recovery, so if something goes wrong, you can just reflash the backup, instead of loosing all your data and settings.
Now start a cmd prompt on your pc (Windowskey+R, type "cmd" hit enter)
browse to your platform-tools directory (cd path-to-platformtools)
Make sure your phone is connected:
Code:
adb devices
And execute these lines:
Code:
adb shell
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
exit
You can now read and write to the /system folder on your phone.
Next you need to pull the *.kcm.bin file you'd like to edit. (For the OP this is most likely the "vision-keypad.kcm.bin" or the "vision-keypad-wwe.kcm.bin", but if they aren't the ones used.. then try and edit the "qwerty.kcm.bin" or "generic.kcm.bin" files)
This is done by entering the following:
Code:
adb pull /system/usr/keychars/vision-keypad-wwe.kcm.bin /tmp/vision-keypad-wwe.kcm.bin
Or one of the many other files if this one isn't working.
Minimize the cmd screen for now and browse on your computer to the platform-tools folder (or the folder where you executed the adb from) there should be an new folder called "tmp", in that folder you'll find the file you just pulled from your phone.
Hit it with a right mouse-click and click "Edit with HDD Hex Editor Neo". (If that option is not available, start the Hex Editor and open the file from within the editor)
The first row and columns are blue, except for the first one on the far left-top side, this one is white.
Click it and type: "0000027c" and hit enter.
Now there are some hexadecimals selected in green. On the far right side of that row should be something like this: "6...Z.9.z.Z"
(If that isn't the case, find the line that does look like that and edit that line)
In the green field you've got, change the value to: "a3" (just type)
The cursor will automatically go to the next value, which is "00" leave that.
Press the arrow-key to the right once and edit that value to "a3" as well.
The field on the right side should now display something like: "6...Z.9.z.Z.£.£."
That's it, save the file and push it back to your phone by entering the following in the cmd window you minimized:
Code:
adb push /tmp/vision-keypad-wwe.kcm.bin /system/usr/keychars/vision-keypad-wwe.kcm.bin
Then restart the phone and it should be working!
----
I used the file in the .zip attached as my example file, to see how to do it.
Where do you get the list of codes ? Need the Euro Symbol code ? __=€
Thanks
Edit google is my friend,tried 80 which shows in my file but just get a blank keypress?
bombadier said:
Where do you get the list of codes ? Need the Euro Symbol code ? __=€
Thanks
Edit google is my friend,tried 80 which shows in my file but just get a blank keypress?
Click to expand...
Click to collapse
The Euro € sign is set in the X key.
That line is: "4...X.x.X."
If you want it in the Z key, type "0000027c" in the left top box and hit enter, type "ac20ac20" That'll give you the euro sign. Then the field on the right looks like this: "6...Z.z.Z.- - "
If you want it in the X key, type "0000025c" in the left top box and hit enter, type "ac20ac20" That'll give you the euro sign. (string on the right looks like: "4...X.x.X.- - ")
Thanks for that!
It'll be fun trying this on Linux.
I'll let you know how I get on when I find the time.
Myrmidon83 said:
Thanks for that!
It'll be fun trying this on Linux.
I'll let you know how I get on when I find the time.
Click to expand...
Click to collapse
For linux you can do the same as you need to do for windows. The only thing is that you have to find software which can edit binary files. A nice GUI based editor is ghex.
it's available in the universe repository.
Code:
$ sudo apt-get install ghex
Lineaira,
Thanks for this info. It worked fine! I now have a GBP sign on Fn-Z.
Regards,
Richard
Easier way. Download the attached file, unzip it and place the contained file on the root of your sdcard, then type in the following commands using Terminal Emulator:
su
mount -o rw,remount /system
busybox cp /sdcard/vision-keypad-wwe.kcm.bin /system/usr/keychars
reboot
Found this over at the Cyanogenmod forums ages ago
setspeed said:
Easier way. Download the attached file, unzip it and place the contained file on the root of your sdcard, then type in the following commands using Terminal Emulator:
su
mount -o rw,remount /system
busybox cp /sdcard/vision-keypad-wwe.kcm.bin /system/usr/keychars
reboot
Found this over at the Cyanogenmod forums ages ago
Click to expand...
Click to collapse
It is easier, but not as much fun and satisfying as doing it yourself, I'd say;p
lineaira said:
It is easier, but not as much fun and satisfying as doing it yourself, I'd say;p
Click to expand...
Click to collapse
Exactly,I wanted to learn how to do it myself and now that I know I would say it is just as easy to pull the file from the phone make my edits push it back and job done don't even have to reboot,thanks again for the guidance Lineaira

[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?
Yes, it is. Take a look at Swedroid's forum.
Excellent, thanks!
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?
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?
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...
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?
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
Click to expand...
Click to collapse
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

[Q] Hardware keyboard remap on Andromadus CM10.1

Hello.
I would like to remap keyboard buttons on hardware qwerty keyboard (to qwertz...) on Andromadus CM 10.1 - JB 4.2.2
I have tried to modify every .kcm file in /system/usr/keychars/ and restart phone but nothing happend.
On Andromadus Mimicry - JB 4.0.4 this worked.
Do you know about some other method to do it, or I am just modifying bad files?
Thanks
Keyboard Map QWERTZ for Vision
fishead.sk said:
Hello.
I would like to remap keyboard buttons on hardware qwerty keyboard (to qwertz...) on Andromadus CM 10.1 - JB 4.2.2
I have tried to modify every .kcm file in /system/usr/keychars/ and restart phone but nothing happend.
On Andromadus Mimicry - JB 4.0.4 this worked.
Do you know about some other method to do it, or I am just modifying bad files?
Thanks
Click to expand...
Click to collapse
so this was, what helped me:
Rooted HTC Vision!
1. Install HTC driver:
1.a.Download HTC Sync:
support.htc. com/alerts_downloads/en/HTC_Sync_and_Sync_Manager_for_all_HTC_Android_Phones
1.b. Start install - USB driver will get installed first, then the installation of HTC sync starts. You can stop Install of HTC Sync if you don't want it.
2. Download Android SDK and extract
developer.android. com/sdk/index.html
3. Connect via Commandline to Vision
{c:\Path\to\SDK}\platform-tools>adb shell
4. activate root
$ su
5. remount system + change rights
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# chmod 777 /system
# exit
6. Push Keypad file (extract attachment)
{c:\Path\to\SDK}\platform-tools>adb push vision-keypad-wwe.kl /system/usr/keylayout/vision-keypad-wwe.kl
changes in this file:
-Buttons Y and Z are switched.
-Button "search" is remapped to "slash"
{c:\Path\to\SDK}\platform-tools>adb push vision-keypad-wwe.kcm /system/usr/keychars/vision-keypad-wwe.kcm
changes in this file: renamed "vision-keypad-ger.kcm" file
7. Set Hardware Keyboard Settings:
Settings - Language and Input - select vision-keypad-wwe - setup keyboard layouts - uncheck everything!
8. Reboot
worked for me...
Bug: search/symbol button is not working. couldn't find the right keycode for this button
PS: i was not allowed to post "outside links" so this is why you have to copy/paste the links and remove spaces to the sdk & driver download.

Categories

Resources