in_sdl: add some debug logging for key events (only if DEBUG_INPUT is defined)

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1108 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Eric Wasylishen 2014-10-13 03:21:40 +00:00
parent 1e4291192c
commit bd07399747
1 changed files with 11 additions and 0 deletions

View File

@ -624,6 +624,9 @@ void IN_SendKeyEvents (void)
#endif
#if defined(USE_SDL2)
case SDL_TEXTINPUT:
#if defined(DEBUG_INPUT)
printf ("SDL_TEXTINPUT '%s'\n", event.text.text);
#endif
// SDL2: We use SDL_TEXTINPUT for typing in the console / chat.
// SDL2 uses the local keyboard layout and handles modifiers
// (shift for uppercase, etc.) for us.
@ -640,6 +643,14 @@ void IN_SendKeyEvents (void)
case SDL_KEYUP:
down = (event.key.state == SDL_PRESSED);
#if defined(DEBUG_INPUT)
#if defined(USE_SDL2)
printf ("%s '%s'\n", down ? "SDL_KEYDOWN" : "SDL_KEYUP", SDL_GetScancodeName(event.key.keysym.scancode));
#else
printf ("%s '%s'\n", down ? "SDL_KEYDOWN" : "SDL_KEYUP", SDL_GetKeyName(event.key.keysym.sym));
#endif
#endif
#if defined(USE_SDL2)
// SDL2: we interpret the keyboard as the US layout, so keybindings
// are based on key position, not the label on the key cap.