Skip to content

Commit

Permalink
Use SDL_Log() for keyboard debugging.
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jan 15, 2025
1 parent 49dd24e commit 9657571
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/events/SDL_keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
#include "SDL_keymap_c.h"
#include "../video/SDL_sysvideo.h"

// #define DEBUG_KEYBOARD
#if 0
#define DEBUG_KEYBOARD
#endif

// Global keyboard information

Expand Down Expand Up @@ -217,7 +219,7 @@ void SDL_ResetKeyboard(void)
int scancode;

#ifdef DEBUG_KEYBOARD
printf("Resetting keyboard\n");
SDL_Log("Resetting keyboard\n");
#endif
for (scancode = SDL_SCANCODE_UNKNOWN; scancode < SDL_SCANCODE_COUNT; ++scancode) {
if (keyboard->keystate[scancode]) {
Expand Down Expand Up @@ -514,7 +516,7 @@ static bool SDL_SendKeyboardKeyInternal(Uint64 timestamp, Uint32 flags, SDL_Keyb
const Uint8 source = flags & KEYBOARD_SOURCE_MASK;

#ifdef DEBUG_KEYBOARD
printf("The '%s' key has been %s\n", SDL_GetScancodeName(scancode), down ? "pressed" : "released");
SDL_Log("The '%s' key has been %s\n", SDL_GetScancodeName(scancode), down ? "pressed" : "released");
#endif

// Figure out what type of event this is
Expand Down

0 comments on commit 9657571

Please sign in to comment.