Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

notify MTK about the changed keyboard layout

  • Loading branch information...
commit 4a592aefed27a50e1f001a83e13240fd2d93470a 1 parent 70b7807
Xiangfu Liu authored
1  src/main.c
View
@@ -87,6 +87,7 @@ static rtems_task gui_task(rtems_task_argument argument)
{
init_fb_mtk(has_autostart());
sysconfig_set_mtk_wallpaper();
+ sysconfig_set_mtk_keyboard_layout();
init_input();
input_add_callback(mtk_input);
init_shortcuts();
9 src/sysconfig.c
View
@@ -127,7 +127,7 @@ static struct sysconfig sysconfig = {
.resolution = SC_RESOLUTION_640_480,
.wallpaper = "/flash/comet.png",
.language = SC_LANGUAGE_ENGLISH,
- .keyboard_layout = SC_KEYBOARD_LAYOUT_GERMAN,
+ .keyboard_layout = MTK_KEYBOARD_LAYOUT_GERMAN,
.dhcp_enable = 0,
.ip = 0xc0a8002a,
.netmask = 0xffffff00
@@ -301,10 +301,15 @@ void sysconfig_set_language(int language)
sysconfig.language = language;
}
+void sysconfig_set_mtk_keyboard_layout()
+{
+ mtk_config_set_keyboard_layout(sysconfig.keyboard_layout);
+}
+
void sysconfig_set_keyboard_layout(int layout)
{
sysconfig.keyboard_layout = layout;
- /* TODO: notify MTK about the changed layout */
+ sysconfig_set_mtk_keyboard_layout();
}
static int dhcp_task_running;
7 src/sysconfig.h
View
@@ -32,12 +32,6 @@ enum {
SC_LANGUAGE_GERMAN
};
-enum {
- SC_KEYBOARD_LAYOUT_US,
- SC_KEYBOARD_LAYOUT_FRENCH,
- SC_KEYBOARD_LAYOUT_GERMAN
-};
-
void sysconfig_load();
void sysconfig_save();
@@ -54,6 +48,7 @@ void sysconfig_set_wallpaper(char *wallpaper);
void sysconfig_set_mtk_wallpaper();
void sysconfig_set_language(int language);
void sysconfig_set_keyboard_layout(int layout);
+void sysconfig_set_mtk_keyboard_layout();
void sysconfig_set_ipconfig(int dhcp_enable, unsigned int ip, unsigned int netmask);
void sysconfig_set_credentials(char *login, char *password);
void sysconfig_set_autostart(char *autostart);
12 src/sysettings.c
View
@@ -265,9 +265,9 @@ void init_sysettings()
mtk_bind(appid, "b_lang_french", "press", language_callback, (void *)SC_LANGUAGE_FRENCH);
mtk_bind(appid, "b_lang_german", "press", language_callback, (void *)SC_LANGUAGE_GERMAN);
- mtk_bind(appid, "b_kbd_us", "press", layout_callback, (void *)SC_KEYBOARD_LAYOUT_US);
- mtk_bind(appid, "b_kbd_french", "press", layout_callback, (void *)SC_KEYBOARD_LAYOUT_FRENCH);
- mtk_bind(appid, "b_kbd_german", "press", layout_callback, (void *)SC_KEYBOARD_LAYOUT_GERMAN);
+ mtk_bind(appid, "b_kbd_us", "press", layout_callback, (void *)MTK_KEYBOARD_LAYOUT_US);
+ mtk_bind(appid, "b_kbd_french", "press", layout_callback, (void *)MTK_KEYBOARD_LAYOUT_FRENCH);
+ mtk_bind(appid, "b_kbd_german", "press", layout_callback, (void *)MTK_KEYBOARD_LAYOUT_GERMAN);
mtk_bind(appid, "b_dhcp", "press", dhcp_callback, NULL);
@@ -315,9 +315,9 @@ static void update_layout()
layout = sysconfig_get_keyboard_layout();
- mtk_cmdf(appid, "b_kbd_us.set(-state %s)", layout == SC_KEYBOARD_LAYOUT_US ? "on" : "off");
- mtk_cmdf(appid, "b_kbd_french.set(-state %s)", layout == SC_KEYBOARD_LAYOUT_FRENCH ? "on" : "off");
- mtk_cmdf(appid, "b_kbd_german.set(-state %s)", layout == SC_KEYBOARD_LAYOUT_GERMAN ? "on" : "off");
+ mtk_cmdf(appid, "b_kbd_us.set(-state %s)", layout == MTK_KEYBOARD_LAYOUT_US ? "on" : "off");
+ mtk_cmdf(appid, "b_kbd_french.set(-state %s)", layout == MTK_KEYBOARD_LAYOUT_FRENCH ? "on" : "off");
+ mtk_cmdf(appid, "b_kbd_german.set(-state %s)", layout == MTK_KEYBOARD_LAYOUT_GERMAN ? "on" : "off");
}
static void update_network()
Please sign in to comment.
Something went wrong with that request. Please try again.