aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfalkTX <falktx@falktx.com>2023-10-21 12:11:05 +0200
committerDavid Robillard <d@drobilla.net>2023-10-21 09:56:17 -0400
commitf2be8e2b47e95748f8c4bc8ab522d89ef604f1ec (patch)
treefdff0bf80c23cee23d96b5b64d62535578849403
parent757e15e5c25dabfb4b204339bacdeba9728117dc (diff)
downloadpugl-f2be8e2b47e95748f8c4bc8ab522d89ef604f1ec.tar.gz
pugl-f2be8e2b47e95748f8c4bc8ab522d89ef604f1ec.tar.bz2
pugl-f2be8e2b47e95748f8c4bc8ab522d89ef604f1ec.zip
Print modifiers for key events in test and example programs
-rw-r--r--test/test_utils.h22
1 files 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,