From: Holger Schemel Date: Tue, 25 Jul 2017 23:12:21 +0000 (+0200) Subject: added leaving game controller configuration screen by using 'backspace' key X-Git-Tag: 4.0.1.0~17 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=26e7b7362a984abbe5852a792a52b8e58e11420e;p=rocksndiamonds.git added leaving game controller configuration screen by using 'backspace' key --- diff --git a/src/screens.c b/src/screens.c index b13890a1..ba5a2119 100644 --- a/src/screens.c +++ b/src/screens.c @@ -6777,14 +6777,19 @@ static boolean ConfigureJoystickMapButtonsAndAxes(SDL_Joystick *joystick) if (event.key.keysym.sym == KSYM_BackSpace || event.key.keysym.sym == KSYM_Back) { - /* undo this step */ - if (i > 0) + if (i == 0) { - prev_step = &steps[--i]; - strcpy(mapping, prev_step->mapping); - next = TRUE; + /* leave screen */ + success = FALSE; + done = TRUE; } + /* undo this step */ + prev_step = &steps[i - 1]; + strcpy(mapping, prev_step->mapping); + i--; + next = TRUE; + break; } @@ -6801,6 +6806,7 @@ static boolean ConfigureJoystickMapButtonsAndAxes(SDL_Joystick *joystick) if (event.key.keysym.sym == KSYM_Escape) { + /* leave screen */ success = FALSE; done = TRUE; }