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
This commit is contained in:
helixhorned 2013-10-27 21:12:16 +00:00
parent 70f0100ac2
commit 65cdf97bfa

View file

@ -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;