From f2be8e2b47e95748f8c4bc8ab522d89ef604f1ec Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 21 Oct 2023 12:11:05 +0200 Subject: Print modifiers for key events in test and example programs --- test/test_utils.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/test/test_utils.h b/test/test_utils.h index 45df7b4..80f28a0 100644 --- a/test/test_utils.h +++ b/test/test_utils.h @@ -293,17 +293,19 @@ printEvent(const PuglEvent* event, const char* prefix, const bool verbose) case PUGL_UNREALIZE: return fprintf(stderr, "%sUnrealize\n", prefix); case PUGL_KEY_PRESS: - return PRINT("%sKey press code %3u key U+%04X (%s)\n", - prefix, - event->key.keycode, - event->key.key, - keyString(event->key.key)); + return (PRINT("%sKey press code %3u key U+%04X (%s) ", + prefix, + event->key.keycode, + event->key.key, + keyString(event->key.key)) + + printModifiers(event->scroll.state)); case PUGL_KEY_RELEASE: - return PRINT("%sKey release code %3u key U+%04X (%s)\n", - prefix, - event->key.keycode, - event->key.key, - keyString(event->key.key)); + return (PRINT("%sKey release code %3u key U+%04X (%s) ", + prefix, + event->key.keycode, + event->key.key, + keyString(event->key.key)) + + printModifiers(event->scroll.state)); case PUGL_TEXT: return PRINT("%sText entry code %3u char U+%04X (%s)\n", prefix, -- cgit v1.2.1