mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
in_sdl: add some debug logging for key events (only if DEBUG_INPUT is defined)
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1108 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
c07fb885f9
commit
da24855356
1 changed files with 11 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue