synchronize default emu keys to the windows version

This commit is contained in:
matusz 2009-04-03 00:28:52 +00:00
parent 99fa5a3c76
commit c60ce7faa1
5 changed files with 64 additions and 27 deletions

View File

@ -106,18 +106,19 @@ const char * save_type_names[] = {
/* Our keyboard config is different because of the directional keys */
const u16 cli_kb_cfg[NB_KEYS] =
{ SDLK_c, // A
SDLK_x, // B
SDLK_BACKSPACE, // select
{
SDLK_x, // A
SDLK_z, // B
SDLK_RSHIFT, // select
SDLK_RETURN, // start
SDLK_RIGHT, // Right
SDLK_LEFT, // Left
SDLK_UP, // Up
SDLK_DOWN, // Down
SDLK_e, // R
SDLK_w, // L
SDLK_d, // X
SDLK_s, // Y
SDLK_w, // R
SDLK_q, // L
SDLK_s, // X
SDLK_a, // Y
SDLK_p, // DEBUG
SDLK_o // BOOST
};

View File

@ -60,28 +60,28 @@ const u16 default_joypad_cfg[NB_KEYS] =
-1 // BOOST
};
const u16 default_keyboard_cfg[NB_KEYS] =
const u16 plain_keyboard_cfg[NB_KEYS] =
{
97, // a
98, // b
65288, // backspace
65293, // enter
65363, // directional arrows
65361,
65362,
65364,
65454, // numeric .
65456, // numeric 0
120, // x
121, // y
112,
113
'x', // A
'z', // B
'y', // select
'u', // start
'l', // Right
'j', // Left
'i', // Up
'k', // Down
'w', // R
'q', // L
's', // X
'a', // Y
'p', // DEBUG
'o' // BOOST
};
/* Load default joystick and keyboard configurations */
void load_default_config( void)
void load_default_config(const u16 kbCfg[])
{
memcpy(keyboard_cfg, default_keyboard_cfg, sizeof(keyboard_cfg));
memcpy(keyboard_cfg, kbCfg, sizeof(keyboard_cfg));
memcpy(joypad_cfg, default_joypad_cfg, sizeof(joypad_cfg));
}

View File

@ -77,7 +77,7 @@ extern mouse_status mouse;
void set_mouse_coord(signed long x,signed long y);
#endif // !GTK_UI
void load_default_config( void);
void load_default_config(const u16 kbCfg[]);
BOOL init_joy( void);
void uninit_joy( void);
void set_joy_keys(const u16 joyCfg[]);

View File

@ -47,6 +47,24 @@ GtkWidget * pWindow;
GtkWidget * pDrawingArea, * pDrawingArea2;
GladeXML * xml, * xml_tools;
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
};
SoundInterface_struct *SNDCoreList[] = {
&SNDDummy,
&SNDFile,
@ -304,7 +322,7 @@ static int Read_ConfigFile()
GKeyFile * keyfile = g_key_file_new();
GError * error = NULL;
load_default_config();
load_default_config(gtk_kb_cfg);
g_key_file_load_from_file(keyfile, CONFIG_FILE, G_KEY_FILE_NONE, 0);

View File

@ -75,6 +75,24 @@ static const char *bad_glob_cflash_disk_image_file;
static SDL_sem *fps_limiter_semaphore;
static int gtk_fps_limiter_disabled;
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
};
enum {
MAIN_BG_0 = 0,
MAIN_BG_1,
@ -337,7 +355,7 @@ static int Read_ConfigFile(const gchar *config_file)
GKeyFile * keyfile = g_key_file_new();
GError * error = NULL;
load_default_config();
load_default_config(gtk_kb_cfg);
g_key_file_load_from_file(keyfile, config_file, G_KEY_FILE_NONE, 0);