PDA

View Full Version : Changing to a non-english keyboard layout [cupcake support]


Keychar
15th April 2009, 05:40 PM
I WILL NOT TAKE ANY RESPONSABILITY FOR WHAT HAPPENS TO YOUR PHONE. THIS IS AT YOUR OWN RISK. THIS IS ONLY TRIED ON VERSION 1.1, 1.5 AND 1.6 ON THE DEVELOPER PHONE.

I was fed up with having to hold a and o for my swedish chars, so couple of hours ago I decided to create a swedish layout, and here's how you can do it too. You need an unlocked android phone, such as the Dev1. I will also assume that you have and know how to use the SDK. Connect your phone to your computer and run:
adb shell
In the shell run getprop and find hw.keyboards.0.devname. This for me is trout-keypad-v3. If it's the same for you, do the following, otherwise change accordingly.
adb pull /system/usr/keychars/trout-keypad-v3.kcm.bin Desktop/
You now have a copy of the keychar-binary on your desktop, make sure to backup it. Open it in a binary editor, and you will find a file coded with an intro followed by lots of data coded as below (not documented, therefore not guarantied, but I feel pretty certain it's right, dots are 0x00):
..char.numberchar.smallchar.bigchar.smallspecial.b igspecial.(keycode+1).
For example, my A looked like:
..A.2.a.A.a.A.?.
What I want it to look like is:
..A.2.a.A.å.Å.?.
If your hex-editor allows that then congrats to you, mine didn't. What I had to do was to use a ascii-table (http://www.ascii-code.com/) and use teh hex code.
00 00 41 00 32 00 61 00 41 00 61 00 41 00 1E 00
...should therefore be...
00 00 41 00 32 00 61 00 41 00 E5 00 C5 00 1E 00

I now have å and Å on my a-button. The next button for me, Z, could be done using the exact same tactic. The fun part came with X. Notice the coding:
00 00 58 00 39 00 78 00 58 00 78 00 00 EF 35 00
The problem here is EF, which is there to make sure that there is not a ... in the middle of the char-code. What we do here is therefore to change the EF to 00 when we change the 00 before it. The result would therefore be:
00 00 58 00 39 00 78 00 58 00 F6 00 D6 00 35 00

Now let's save the file. We can send it to the device with the following code. THIS WILL REPLACE YOUR CURRENT LAYOUT.
adb root
adb remount
adb push trout-keypad-v3.kcm.bin /system/usr/keychars/
For security reasons I would recommend you to always reboot your phone after running adb remount, since this will leave your /system more vulnerable then usual.

Now we can restart the phone, and hopefully it will have a new working layout. If the layout is totally different from yours (for example alt+a is #) that means the encoding of the new file is wrong, and another layout is used. If this happens I recommend you start from the beginning, it doesn't take much time, and small errors can be avoided. You can do as above to reset your old layout:
adb root
adb remount
adb push trout-keypad-v3.kcm.bin.backup /system/usr/keychars/trout-keypad-v3.kcm.bin

My working swedish layout is attached. alt+a => å, alt+z => ä, alt+x => ö.
Hope you will appreciate this as much as I do. :)

Thanks to Joushou for all the help in #android.

i9zero
15th April 2009, 06:53 PM
Thank you! this is fantastic. I just have to figure out how this would work with asian fonts

imfloflo
15th April 2009, 06:54 PM
Thanks maybe everybody can put the different layout in this thread.
In France we have azerty layout.

Dimath
15th April 2009, 07:28 PM
Great thanks!
Would be interesting to be able to SWITCH layouts.

theorion
24th April 2009, 10:54 PM
I salute you sir for this easy guide!! Though using notepad ++ i didnt even use hex view! but just chose to see through the null null crap on the screen!! Total matrixe experience! But i definetly vote to get this a sticky for easy goofing with keyboard layouts!

Acidnator
30th April 2009, 10:11 PM
Works great on Haykuro 1.5, changed a to ä and z to ö. Writing finnish on a mobile phone has never been so easy ;)

Tack ska du ha!

emms007
30th April 2009, 10:30 PM
Now that would be fun to do the same but by modifying the on-screen keyboard :)

maxisma
26th May 2009, 05:15 PM
Just modified the keypad for qwertz to work with haykuro 6hr1.
Download is in the attachment!

karthikkann
27th May 2009, 11:01 PM
Hello-
Does any one have the text version of qwertz.kcm.bin?
Thanks.

Hamdan919
2nd June 2009, 12:43 AM
Hey,

If I've changed that layout will that effect the virtual keyboard layout in 1.5.
If it's not, how can I change the layout for the virtual keyboard.

regards :)

Keychar
2nd June 2009, 12:55 AM
Nice to see that this is appreciated.

Hey,

If I've changed that layout will that effect the virtual keyboard layout in 1.5.
If it's not, how can I change the layout for the virtual keyboard.

regards :)
No, it will not. To change the virtual layout you have to program a new layout, or wait for someone else to do it. There are alternative virtual keyboards to download from the market. Make sure that the virtual keyboard does not have internet privileges though, since the virtual keyboard can listen to every single key you push, even on the hardware keyboard. This means that the virtual keyboard can modify the hardware keyboard though, but I haven't seen that except for a bug in a layout.

DJ_Spray
2nd June 2009, 07:57 AM
I don't mind programming the french layout, can you tell me where to find the default qwerty keyboard to alter for the VK?
Right now I have the french layout for the physical keyboard and just miss the VK on my jf1.51 build.

Regards

Keychar
2nd June 2009, 08:45 AM
I don't mind programming the french layout, can you tell me where to find the default qwerty keyboard to alter for the VK?
Right now I have the french layout for the physical keyboard and just miss the VK on my jf1.51 build.

Regards
http://android.git.kernel.org/?p=platform/packages/inputmethods/LatinIME.git;a=summary

Rey-619
22nd July 2009, 05:05 AM
Sry for refreshing such an old Thread but i want to ask something.

Is there any way to do this, without adb?

Keychar
22nd July 2009, 09:48 AM
Sry for refreshing such an old Thread but i want to ask something.

Is there any way to do this, without adb?

As long as you have root. Get into your phone, write:
dd if=/system/usr/keychars/trout-keypad-v3.kcm.bin of=/sdcard/keypad

Now you can get the file off your sdcard, and do back it up. When you are ready just put it back. Before you can put it back you will have to remount your /system mount with write access. Run mount and look what is before /system. In my case the line looks like:
/dev/block/mtdblock3 /system yaffs2 ro 0 0
In my case I would therefore write:
su
mount -o rw,remount /dev/block/mtdblock3 /system
dd if=/sdcard/keypad of=/system/usr/keychars/trout-keypad-v3.kcm.bin
This should work as well as the adb method described in original post.

Rey-619
23rd July 2009, 04:34 AM
dd if=/system/usr/keychars/trout-keypad-v3.kcm.bin of=/sdcard/keypad


-> /keypad: canot open for write: Read-only file system


I have root.

Have i type this in terminal commander? right? ore in Bootloader?

Keychar
23rd July 2009, 08:46 AM
dd if=/system/usr/keychars/trout-keypad-v3.kcm.bin of=/sdcard/keypad


-> /keypad: canot open for write: Read-only file system


I have root.

Have i type this in terminal commander? right? ore in Bootloader?

You are supposed to put it into a terminal. You do have a sdcard, right? Is it mounted to the computer when you try to run the command? If it is, the unmount it and try again.

Rey-619
23rd July 2009, 11:15 AM
i tryed both ^^

damn i need the german keyboard layout xD

Keychar
23rd July 2009, 11:18 AM
i tryed both ^^

damn i need the german keyboard layout xD

Could you give me the output of mount that includes /sdcard as second argument?

Rey-619
23rd July 2009, 12:10 PM
mhm.... xD


$ mount
rootfs /dev tmpfs rw,mode=755 0 0
devpts /dev/pts devpts rw,mode=600 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /sqlite_smt_journals tmpfs rw=,size=4096k 0 0
/dev/block/mtdblock3 /system yaffs2 ro 0 0
/dev/block/mtdblock5 /data yaffs2 rw,nosiud,nodev 0 0
/dev/block/mtdblock4 /cache yaffs2 rw,nosuid,nodev 0 0
/dev/block/mmcblk0p2 /system/sd ext3 rw,noatime,nodiratime,errors=continue,data=ordered 0 0
/dev/block//vold/179:1 /sdcard vflat rw,dirsync,nosuid,nodev noexec,uid=100,gid=1000,fmask=0000,dmask=0000,allo w_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8 0 0
#

Keychar
23rd July 2009, 12:15 PM
dd if=/system/usr/keychars/trout-keypad-v3.kcm.bin of=/sdcard/keypad


-> /keypad: canot open for write: Read-only file system


I have root.

Have i type this in terminal commander? right? ore in Bootloader?

Are you sure that you wrote /sdcard/keypad and not /keypad?

FireFart
23rd July 2009, 12:48 PM
i have a litte gscript sh file (requires su), to change the keyboard to a qwertz

I use this on the cyanogen builds

This must be executed after each flash

echo "Mounting System as read/write:"
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
echo "Done"
echo "Copy Keychars:"
cp /system/usr/keychars/trout-keypad-qwertz.kcm.bin /system/usr/keychars/trout-keypad-v3.kcm.bin
cp /system/usr/keychars/trout-keypad-qwertz.kcm.bin /system/usr/keychars/qwerty.kcm.bin
cp /system/usr/keychars/trout-keypad-qwertz.kcm.bin /system/usr/keychars/qwerty2.kcm.bin
cp /system/usr/keychars/trout-keypad-qwertz.kcm.bin /system/usr/keychars/trout-keypad-v2.kcm.bin
cp /system/usr/keychars/trout-keypad-qwertz.kcm.bin /system/usr/keychars/trout-keypad.kcm.bin
echo "Done"

echo "Copy Keylayout:"
cp /system/usr/keylayout/trout-keypad-qwertz.kl /system/usr/keylayout/trout-keypad-v3.kl
cp /system/usr/keylayout/trout-keypad-qwertz.kl /system/usr/keylayout/trout-keypad-v2.kl
cp /system/usr/keylayout/trout-keypad-qwertz.kl /system/usr/keylayout/trout-keypad.kl
cp /system/usr/keylayout/trout-keypad-qwertz.kl /system/usr/keylayout/qwerty.kl
cp /system/usr/keylayout/trout-keypad-qwertz.kl /system/usr/keylayout/h2w_headset.kl
cp /system/usr/keylayout/trout-keypad-qwertz.kl /system/usr/keylayout/AVRCP.kl
echo "Done"
echo "rebooting..."
reboot

Rey-619
23rd July 2009, 01:26 PM
nice :) i hope this will work.

I will try it ;)

farmatito
23rd July 2009, 03:28 PM
Thanks maybe everybody can put the different layout in this thread.
In France we have azerty layout.

Italian layout.

ollip79
23rd July 2009, 03:43 PM
i have a litte gscript sh file (requires su), to change the keyboard to a qwertz

I use this on the cyanogen builds

This must be executed after each flash

echo "Mounting System as read/write:"
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
echo "Done"
echo "Copy Keychars:"
cp /system/usr/keychars/trout-keypad-qwertz.kcm.bin /system/usr/keychars/trout-keypad-v3.kcm.bin
cp /system/usr/keychars/trout-keypad-qwertz.kcm.bin /system/usr/keychars/qwerty.kcm.bin
cp /system/usr/keychars/trout-keypad-qwertz.kcm.bin /system/usr/keychars/qwerty2.kcm.bin
cp /system/usr/keychars/trout-keypad-qwertz.kcm.bin /system/usr/keychars/trout-keypad-v2.kcm.bin
cp /system/usr/keychars/trout-keypad-qwertz.kcm.bin /system/usr/keychars/trout-keypad.kcm.bin
echo "Done"

echo "Copy Keylayout:"
cp /system/usr/keylayout/trout-keypad-qwertz.kl /system/usr/keylayout/trout-keypad-v3.kl
cp /system/usr/keylayout/trout-keypad-qwertz.kl /system/usr/keylayout/trout-keypad-v2.kl
cp /system/usr/keylayout/trout-keypad-qwertz.kl /system/usr/keylayout/trout-keypad.kl
cp /system/usr/keylayout/trout-keypad-qwertz.kl /system/usr/keylayout/qwerty.kl
cp /system/usr/keylayout/trout-keypad-qwertz.kl /system/usr/keylayout/h2w_headset.kl
cp /system/usr/keylayout/trout-keypad-qwertz.kl /system/usr/keylayout/AVRCP.kl
echo "Done"
echo "rebooting..."
reboot

a bit too much for my liking ;)
cp /system/usr/keychars/trout-keypad-qwertz.kcm.bin /system/usr/keychars/trout-keypad-v3.kcm.bin
cp /system/usr/keylayout/trout-keypad-qwertz.kl /system/usr/keylayout/trout-keypad-v3.kl
these 2 lines should be enough.
AVRCP.kl for example is the keylayout for headset media keys if I understand it right.

Rey-619
24th July 2009, 08:46 AM
This time with succes ;)

I used this gscript:


echo "Mounting System as read/write:"
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
echo "Done"
echo "Copy Keychars:"
cp /sdcard/trout-keypad-v3.kcm.bin /system/usr/keychars/trout-keypad-v3.kcm.bin
cp /sdcard/trout-keypad-v3.kcm.bin /system/usr/keychars/qwerty.kcm.bin
cp /sdcard/trout-keypad-v3.kcm.bin /system/usr/keychars/qwerty2.kcm.bin
cp /sdcard/trout-keypad-v3.kcm.bin /system/usr/keychars/trout-keypad-v2.kcm.bin
cp /sdcard/trout-keypad-v3.kcm.bin /system/usr/keychars/trout-keypad.kcm.bin
echo "Done"
echo "rebooting..."
reboot


and the file of an other use wrote above...

Now it seems to work fine :)
Thx to all who helped

Now i'm realy happy!!

PS: Reason for the other script: With this file in attach all of the keys are now correct, not only inverted "Z" and "Y" ;)

chronos83
1st September 2009, 09:38 AM
Hi,

For quickly and easy change to french layout, you can use this update with recovery.

++

siriuz
15th September 2009, 11:36 AM
okay, i must also refresh this thread... i love to have it in english but i want to have a german keyboard layout and a german on-screen keyboard...is this possible?

siriuz
18th September 2009, 08:20 PM
nobody? am i the only german that want to use english as language but want to type "umlauts"

Keychar
18th September 2009, 08:26 PM
nobody? am i the only german that want to use english as language but want to type "umlauts"

Well, you do have a guide on how to create it yourself, but when it comes to the onscreen keyboard you will have to find it on the market. It may be that it will fix the hardware layout automatically, so I'd recommend that you try that first.

wingmanjd
11th December 2009, 06:40 AM
Could someone assist me? I'm not sure where to go from this point. Here's my output from the mount command (done via telnet):

# mount
rootfs on / type rootfs (rw)
/dev/block/mmcblk0p1 on /sdcard type vfat (rw,noatime,nodiratime,fmask=0000,dmask=0000,allow _utime=0022,codepage=cp437,iocharset=iso8859-1,flush)
/dev/block/loop2 on / type ext2 (rw,sync,noatime,nodiratime,errors=continue)
tmpfs on /dev type tmpfs (rw,size=100k)
proc on /proc type proc (rw)
sys on /sys type sysfs (rw)
/dev/block/mmcblk0p1 on /sdcard type vfat (rw,noatime,nodiratime,fmask=0000,dmask=0000,allow _utime=0022,codepage=cp437,iocharset=iso8859-1,flush)
/dev/block/mmcblk0p1 on /cache type vfat (rw,noatime,nodiratime,fmask=0000,dmask=0000,allow _utime=0022,codepage=cp437,iocharset=iso8859-1,flush)
/dev/block/loop0 on /data type ext2 (rw,sync,noatime,nodiratime,errors=continue)
/dev/block/loop1 on /system type squashfs (ro)
/dev/block/loop0 on /etc type ext2 (rw,sync,noatime,nodiratime,errors=continue)
/dev/block/loop0 on /shared_prefs type ext2 (rw,sync,noatime,nodiratime,errors=continue)
/dev/block/mmcblk0p1 on /tmp type vfat (rw,noatime,nodiratime,fmask=0000,dmask=0000,allow _utime=0022,codepage=cp437,iocharset=iso8859-1,flush)
/dev/block/loop0 on /lib/modules type ext2 (rw,sync,noatime,nodiratime,errors=continue)
/dev/block/mmcblk0p1 on /system/build.prop (deleted) type vfat (rw,noatime,nodiratime,fmask=0000,dmask=0000,allow _utime=0022,codepage=cp437,iocharset=iso8859-1,flush)
/dev/block/loop2 on /system/bin/su type ext2 (ro,sync,noatime,nodiratime,errors=continue)
/dev/block/loop2 on /system/xbin/su type ext2 (ro,sync,noatime,nodiratime,errors=continue)
/dev/block/loop0 on /smodem type ext2 (rw,sync,noatime,nodiratime,errors=continue)
tmpfs on /dev type tmpfs (rw,mode=755)
devpts on /dev/pts type devpts (rw,mode=600)
tmpfs on /sqlite_stmt_journals type tmpfs (rw,size=4096k)
none on /dbgfs type debugfs (rw)
#

I'm on an ATT Fuze running Donut via haret.exe. I'm attempting to change the keyboard layout to match the labels on the keys better. I've got to this point in my list thus far: Google Doc (http://spreadsheets.google.com/ccc?key=0Anr2-635mtlwdHkwQ2ZnejBwMEVJWlRtV25fYy0yTmc&hl=en)

Thanks for any help available.

Keychar
12th December 2009, 10:00 AM
It looks like you should be able to write:
mount -o remount,rw /dev/block/loop1 /system

wingmanjd
14th December 2009, 08:38 PM
It looks like you should be able to write:
mount -o remount,rw /dev/block/loop1 /system

Alas, it seems like I am running on a squashfs system filesystem (read-only). Any suggestions of how to go about changing my keyboard?

Nico de Vries
1st January 2010, 03:37 PM
I bought a German G1 on Ebay but wanted Querty anyway. So this is a German layout with Y and Z switched, all the other symbols like { and } are where the keys say they are. Perhaps it is useful to someone else as well.

flawlezz
23rd January 2010, 01:43 AM
Hi!

How do I modify this file so that I can use menu button combinations to get ÅÄÖ chars?
I would like to use Menu + Q = å, Menu + W = ä, Menu + e = Ö.
Is this possible?

Thank you!

mejorguille
23rd January 2010, 03:33 AM
I usually use Aysoftkeyboard from the market if I want to change the language. Its super simple to use and to switch back and forth between keyboards. It looks almost exactly like stock, but for me it functions better.