keyboard layout switching in Android

338 views
Skip to first unread message

zergio

unread,
Mar 9, 2009, 5:03:32 PM3/9/09
to android-platform
Hi,

I like Android platform a lot. However, one of the things, IHMO,
Android
lacks a lot at the moment, is an ability to dynamically switch
keyboard layouts. It
seems this was not even considered in Android design... OK, I am sure
it was, but simply cannot find any info on how this can be done.

Right now, the switch can be "implemented" by substituting trout-
keypad-v3.kcm.bin file with Cyrillic version of the file and replacing
it back with out-of-the-box version when English layout is required.
However, the keychar file is cached, so the change is not instantly
visible. Therefore this solution is far from being perfect.

Here are the links to the work of 'worry' on this:
http://forum.xda-developers.com/showthread.php?t=468703
http://forum.xda-developers.com/showthread.php?t=458473

Actually, the http://www.kandroid.org/android_pdk/keymaps_keyboard_input.html
doc suggests the the layout/keychar switching was considered, but
unfortunately the following command does NOT switch the keychar map to
be used.

setprop android.keychar.trout-keypad-v3 /system/usr/keychars/
qwerty_ru.kcm.bin

So my question is

-- What are the plans to enable keyboard layout switching in Android?

Sorry if I am missing something. Any information is much appreciated.

Thanks,
zergio

Dianne Hackborn

unread,
Mar 9, 2009, 5:17:54 PM3/9/09
to android-...@googlegroups.com
Hi, switching keyboard layouts is currently not supported, though we wouldn't be adverse to considering patches.  It's a little problematic to do a general solution, though, because a particular keymap is tied very closely to the hardware -- for example the current qwerty keymap makes sense for the G1, but probably not for most future android devices that have a hard keyboard.
--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support.  All such questions should be posted on public forums, where I and others can see and answer them.

zergio

unread,
Mar 9, 2009, 5:39:46 PM3/9/09
to android-platform
Thank you for the reply Dianne!

I understand this is a tricky one as it depends on the hardware.
However, I think it should be possible to implement a generic,
property driven way, to switch active keylayout and/or ketchar map.
Actually, from the following guide it looks like this approach was
considered. Not sure if it is official guide or not though.
http://www.kandroid.org/android_pdk/keymaps_keyboard_input.html

I am interested in investigating this topic more. Could you please
give me any pointers to the code which handles keylayout/keychar
selection?

Thank you very much in advance!

Regards,
zergio
> hack...@android.com

Dianne Hackborn

unread,
Mar 9, 2009, 6:22:34 PM3/9/09
to android-...@googlegroups.com
If you want to dig into it, I would suggest starting at the C++ EventHub.cpp code and the Java KeyCharacterMap code (which is mostly a JNI wrapper around the native impl).
hac...@android.com

zergio

unread,
Mar 10, 2009, 6:34:26 AM3/10/09
to android-platform
Thank you very much, Dianne!

I will let you know how my investigation goes.

Regards,
zergio
Reply all
Reply to author
Forward
0 new messages