From bf65a989fefd6b3434c307e047da4f971381c4fa Mon Sep 17 00:00:00 2001 From: "fabio.olimpieri" Date: Sun, 4 Jan 2015 18:40:33 +0000 Subject: [PATCH] Fixed a bug in the virtual keyboard and removed a useless check --- src/gui-sdl/gui-sdl.c | 3 +++ src/jd-sdl/joystick.c | 7 ++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui-sdl/gui-sdl.c b/src/gui-sdl/gui-sdl.c index 78c05d7..425e386 100644 --- a/src/gui-sdl/gui-sdl.c +++ b/src/gui-sdl/gui-sdl.c @@ -1462,6 +1462,8 @@ static void input_options(int joy) virtualkey = virtkbd_get_key(); if (virtualkey == NULL) return; + if (virtualkey->ev_name == NULL) + return; key = virtualkey->ev_name; switch(opt) @@ -1507,6 +1509,7 @@ static void virtual_keyboard(void) virtkey_t *key =virtkbd_get_key(); if (key) {key_code = key->sdl_code;} else return; + if (!key_code) return; SDL_Event event_key; diff --git a/src/jd-sdl/joystick.c b/src/jd-sdl/joystick.c index 33cb6a1..bba7add 100644 --- a/src/jd-sdl/joystick.c +++ b/src/jd-sdl/joystick.c @@ -125,11 +125,8 @@ static void read_joy (unsigned int nr) int bs = SDL_JoystickGetButton (joy, i) ? 1 : 0; setjoybuttonstate (nr, i, bs); #ifdef GEKKO - if (!gui_is_active) - { - if ((nr==0) && (currprefs.rumble[0])) Rumble (0,i, bs); - if ((nr==1) && (currprefs.rumble[1])) Rumble (1,i, bs); - } + if ((nr==0) && (currprefs.rumble[0])) Rumble (0,i, bs); + if ((nr==1) && (currprefs.rumble[1])) Rumble (1,i, bs); #endif } }