From 706166497d2cc2f71fd417c398630fe8790a23e7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 23 Jul 2017 11:16:04 +0200 Subject: Print Unicode code points in standard format --- pugl_test.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pugl_test.c b/pugl_test.c index 367e7a4..b0ea04d 100644 --- a/pugl_test.c +++ b/pugl_test.c @@ -156,9 +156,9 @@ onEvent(PuglView* view, const PuglEvent* event) quit = 1; break; case PUGL_KEY_PRESS: - fprintf(stderr, "Key %u (char %u) press (%s)%s\n", - event->key.keycode, event->key.character, event->key.utf8, - event->key.filter ? " (filtered)" : ""); + fprintf(stderr, "Key %u (char U+%04X special U+%04X) press (%s)%s\n", + event->key.keycode, event->key.character, event->key.special, + event->key.utf8, event->key.filter ? " (filtered)" : ""); if (event->key.character == 'q' || event->key.character == 'Q' || event->key.character == PUGL_CHAR_ESCAPE) { @@ -166,9 +166,9 @@ onEvent(PuglView* view, const PuglEvent* event) } break; case PUGL_KEY_RELEASE: - fprintf(stderr, "Key %u (char %u) release (%s)%s\n", - event->key.keycode, event->key.character, event->key.utf8, - event->key.filter ? " (filtered)" : ""); + fprintf(stderr, "Key %u (char U+%04X special U+%04X) release (%s)%s\n", + event->key.keycode, event->key.character, event->key.special, + event->key.utf8, event->key.filter ? " (filtered)" : ""); break; case PUGL_MOTION_NOTIFY: xAngle = -(int)event->motion.x % 360; -- cgit v1.2.1