From 65cdf97bfa10f94915787f08a2f7c7fe278b12ac Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 27 Oct 2013 21:12:16 +0000 Subject: [PATCH] SDL: Add SDL scancode -> ASCII value translation for the "key FIFO" for ESCAPE. This fixes ESC in certain situations such as the editor map selection menu. git-svn-id: https://svn.eduke32.com/eduke32@4117 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/sdlayer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/polymer/eduke32/build/src/sdlayer.c b/polymer/eduke32/build/src/sdlayer.c index 657b36604..698a65545 100644 --- a/polymer/eduke32/build/src/sdlayer.c +++ b/polymer/eduke32/build/src/sdlayer.c @@ -2043,6 +2043,7 @@ int32_t handleevents(void) if (ev.key.type == SDL_KEYDOWN && (ev.key.keysym.scancode == SDL_SCANCODE_RETURN || ev.key.keysym.scancode == SDL_SCANCODE_KP_ENTER || + ev.key.keysym.scancode == SDL_SCANCODE_ESCAPE || ev.key.keysym.scancode == SDL_SCANCODE_BACKSPACE || ev.key.keysym.scancode == SDL_SCANCODE_TAB) && !keyascfifo_isfull()) @@ -2051,6 +2052,7 @@ int32_t handleevents(void) switch (ev.key.keysym.scancode) { case SDL_SCANCODE_RETURN: case SDL_SCANCODE_KP_ENTER: keyvalue = '\r'; break; + case SDL_SCANCODE_ESCAPE: keyvalue = 27; break; case SDL_SCANCODE_BACKSPACE: keyvalue = '\b'; break; case SDL_SCANCODE_TAB: keyvalue = '\t'; break; default: keyvalue = 0; break;