From f0802ed7660e2c88d1ab6049cb09046520ba8552 Mon Sep 17 00:00:00 2001 From: David Capello Date: Sun, 16 Mar 2014 19:24:49 -0300 Subject: [PATCH] Trace unknown scancodes in allegro/src/keyboard.c --- src/allegro/src/keyboard.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/allegro/src/keyboard.c b/src/allegro/src/keyboard.c index cc40a2eba..a3eb490c6 100644 --- a/src/allegro/src/keyboard.c +++ b/src/allegro/src/keyboard.c @@ -21,6 +21,11 @@ +#define PREFIX_I "al-keyboard INFO: " +#define PREFIX_W "al-keyboard WARNING: " +#define PREFIX_E "al-keyboard ERROR: " + + KEYBOARD_DRIVER *keyboard_driver = NULL; /* the active driver */ int _keyboard_installed = FALSE; @@ -493,8 +498,10 @@ void _handle_key_release(int scancode) } ASSERT(scancode < KEY_MAX); - if (scancode >= KEY_MAX) - return; + if (scancode >= KEY_MAX) { + TRACE(PREFIX_I "Scancode out of range %d\n", scancode); + return; + } if ((keyboard_driver->poll) || (!keyboard_polled)) { /* process immediately */