diff --git a/desmume/src/gtk/desmume_config.cpp b/desmume/src/gtk/desmume_config.cpp index bb5406c0b..b70a3f4f7 100644 --- a/desmume/src/gtk/desmume_config.cpp +++ b/desmume/src/gtk/desmume_config.cpp @@ -19,31 +19,13 @@ */ #include -#include #include "ctrlssdl.h" #include "desmume_config.h" static const gchar *desmume_config_file = ".desmume.ini"; -static const u16 gtk_kb_cfg[NB_KEYS] = { - GDK_x, // A - GDK_z, // B - GDK_Shift_R, // select - GDK_Return, // start - GDK_Right, // Right - GDK_Left, // Left - GDK_Up, // Up - GDK_Down, // Down - GDK_w, // R - GDK_q, // L - GDK_s, // X - GDK_a, // Y - GDK_p, // DEBUG - GDK_o // BOOST -}; - -GKeyFile *desmume_config_read_file() +GKeyFile *desmume_config_read_file(const u16 *kb_cfg) { gchar *config_file; GKeyFile *keyfile; @@ -59,7 +41,7 @@ GKeyFile *desmume_config_read_file() g_free(config_file); - load_default_config(gtk_kb_cfg); + load_default_config(kb_cfg); desmume_config_read_keys(keyfile); desmume_config_read_joykeys(keyfile); diff --git a/desmume/src/gtk/desmume_config.h b/desmume/src/gtk/desmume_config.h index 2fab74a48..ce131e56b 100644 --- a/desmume/src/gtk/desmume_config.h +++ b/desmume/src/gtk/desmume_config.h @@ -21,7 +21,7 @@ #ifndef _DESMUME_GTK_CONFIG #define _DESMUME_GTK_CONFIG -GKeyFile *desmume_config_read_file(); +GKeyFile *desmume_config_read_file(const u16 *); void desmume_config_dispose(GKeyFile *); gboolean desmume_config_update_keys(GKeyFile*); diff --git a/desmume/src/gtk/main.cpp b/desmume/src/gtk/main.cpp index 0a0eae667..6747766d1 100644 --- a/desmume/src/gtk/main.cpp +++ b/desmume/src/gtk/main.cpp @@ -379,6 +379,23 @@ GPU3DInterface *core3DList[] = { #endif }; +static const u16 gtk_kb_cfg[NB_KEYS] = { + GDK_x, // A + GDK_z, // B + GDK_Shift_R, // select + GDK_Return, // start + GDK_Right, // Right + GDK_Left, // Left + GDK_Up, // Up + GDK_Down, // Down + GDK_w, // R + GDK_q, // L + GDK_s, // X + GDK_a, // Y + GDK_p, // DEBUG + GDK_o // BOOST +}; + GKeyFile *keyfile; struct modify_key_ctx { @@ -1944,7 +1961,7 @@ common_gtk_main( struct configured_features *my_config) if (dTools_running != NULL) memset(dTools_running, FALSE, sizeof(BOOL) * dTools_list_size); - keyfile = desmume_config_read_file(); + keyfile = desmume_config_read_file(gtk_kb_cfg); /* Create the window */ pWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);