Problem statement : We need to load English keyboard layout if the LANG environment variable is set to for example to en_US.UTF-8 and German keyboard layout if LANG is set to de_DE.UTF-8 .
Solution : That to do this we have to do some little coding in matchbox-keyboard.c file.
Change following code
kb->selected_layout
= (MBKeyboardLayout *)util_list_get_nth_data(kb->layouts, 0);
to
char* lang = getenv("LANG");Also edit the keyboard.xml file to contain English and German keyboard layouts in my case. Approximately with this format.
if (!strcmp(lang, "en_US.UTF-8")) {
kb->selected_layout
= (MBKeyboardLayout *)util_list_get_nth_data(kb->layouts, 1);
} else {
kb->selected_layout
= (MBKeyboardLayout *)util_list_get_nth_data(kb->layouts, 0);
}
...
|
...
...
....
Sorry for not so detailed instructions ... time is killing ...
Adios !
shit ... xml code is eaten by browser ... so to view is look the sources of page :)
ReplyDeleteI search my week but I cannot find anywhere tell complete to change the layout. Could you favour to send me sample of xml codeto my email?
Delete