Fix the RETURN and KP_ENTER keys under SDL2.

git-svn-id: https://svn.eduke32.com/eduke32@4083 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2013-10-07 10:04:16 +00:00
parent 22490587f0
commit d781c4ad94

View file

@ -1981,6 +1981,7 @@ int32_t handleevents(void)
if (ev.key.type == SDL_KEYDOWN && if (ev.key.type == SDL_KEYDOWN &&
(ev.key.keysym.scancode == SDL_SCANCODE_RETURN || (ev.key.keysym.scancode == SDL_SCANCODE_RETURN ||
ev.key.keysym.scancode == SDL_SCANCODE_KP_ENTER ||
ev.key.keysym.scancode == SDL_SCANCODE_BACKSPACE || ev.key.keysym.scancode == SDL_SCANCODE_BACKSPACE ||
ev.key.keysym.scancode == SDL_SCANCODE_TAB) && ev.key.keysym.scancode == SDL_SCANCODE_TAB) &&
((keyasciififoend+1)&(KEYFIFOSIZ-1)) != keyasciififoplc) ((keyasciififoend+1)&(KEYFIFOSIZ-1)) != keyasciififoplc)
@ -1988,7 +1989,7 @@ int32_t handleevents(void)
char keyvalue; char keyvalue;
switch (ev.key.keysym.scancode) switch (ev.key.keysym.scancode)
{ {
case SDL_SCANCODE_RETURN: keyvalue = '\n'; break; case SDL_SCANCODE_RETURN: case SDL_SCANCODE_KP_ENTER: keyvalue = '\r'; break;
case SDL_SCANCODE_BACKSPACE: keyvalue = '\b'; break; case SDL_SCANCODE_BACKSPACE: keyvalue = '\b'; break;
case SDL_SCANCODE_TAB: keyvalue = '\t'; break; case SDL_SCANCODE_TAB: keyvalue = '\t'; break;
default: keyvalue = 0; break; default: keyvalue = 0; break;