sdl12-compat: checkkeys: Unconditionally display the scancode

From a309f3bd5d1629eb4602e9be3e92db38de84a1f0 Mon Sep 17 00:00:00 2001
From: David Gow <[EMAIL REDACTED]>
Date: Thu, 10 Jun 2021 17:48:50 +0800
Subject: [PATCH] checkkeys: Unconditionally display the scancode

It's useful for debugging what scancodes are used by SDL 1.2
(particularly across different platforms) if checkkeys displays it even
when it does successfully map it to an SDLKey.

In addition, print the scancode in hex as well as decimal, as the
hardcoded values we're using in sdl12-compat are all in hex.
---
 test/checkkeys.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/checkkeys.c b/test/checkkeys.c
index 8dbb24f..b37da93 100644
--- a/test/checkkeys.c
+++ b/test/checkkeys.c
@@ -54,10 +54,10 @@ static void PrintKey(SDL_keysym *sym, int pressed)
 {
 	/* Print the keycode, name and state */
 	if ( sym->sym ) {
-		printf("Key %s:  %d-%s ", pressed ?  "pressed" : "released",
-					sym->sym, SDL_GetKeyName(sym->sym));
+		printf("Key %s:  %d-%s (scancode = %d [0x%x])", pressed ?  "pressed" : "released",
+					sym->sym, SDL_GetKeyName(sym->sym), sym->scancode, sym->scancode);
 	} else {
-		printf("Unknown Key (scancode = %d) %s ", sym->scancode,
+		printf("Unknown Key (scancode = %d [0x%x]) %s ", sym->scancode, sym->scancode,
 					pressed ?  "pressed" : "released");
 	}