From bb79dbaa983013b4a6d36a46b58f77140da86fd5 Mon Sep 17 00:00:00 2001 From: Themaister Date: Sun, 13 Mar 2011 00:44:49 +0100 Subject: [PATCH] Getting ready for an eventual XVideo driver. --- input/sdl.c | 4 +++- input/ssnes_sdl_input.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/input/sdl.c b/input/sdl.c index 52c5feb540..bd34fc71eb 100644 --- a/input/sdl.c +++ b/input/sdl.c @@ -61,6 +61,8 @@ static void* sdl_input_init(void) } } + sdl->use_keyboard = true; + return sdl; } @@ -141,7 +143,7 @@ static bool sdl_axis_pressed(sdl_input_t *sdl, int port_num, uint32_t joyaxis) static bool sdl_is_pressed(sdl_input_t *sdl, int port_num, const struct snes_keybind *key) { - if (sdl_key_pressed(key->key)) + if (sdl->use_keyboard && sdl_key_pressed(key->key)) return true; if (sdl->joysticks[port_num] == NULL) return false; diff --git a/input/ssnes_sdl_input.h b/input/ssnes_sdl_input.h index 7bacb87400..6f1ee6769f 100644 --- a/input/ssnes_sdl_input.h +++ b/input/ssnes_sdl_input.h @@ -27,6 +27,7 @@ typedef struct sdl_input unsigned num_buttons[MAX_PLAYERS]; unsigned num_hats[MAX_PLAYERS]; unsigned num_joysticks; + bool use_keyboard; // A video driver could pre-init with the SDL driver and have it handle resizing events... bool *quitting;