diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/pugl_cairo_test.c | 4 | ||||
-rw-r--r-- | test/pugl_test.c | 4 | ||||
-rw-r--r-- | test/test_utils.h | 17 |
3 files changed, 10 insertions, 15 deletions
diff --git a/test/pugl_cairo_test.c b/test/pugl_cairo_test.c index 524e8b0..47907db 100644 --- a/test/pugl_cairo_test.c +++ b/test/pugl_cairo_test.c @@ -129,9 +129,7 @@ onEvent(PuglView* view, const PuglEvent* event) { switch (event->type) { case PUGL_KEY_PRESS: - if (event->key.character == 'q' || - event->key.character == 'Q' || - event->key.character == PUGL_CHAR_ESCAPE) { + if (event->key.key == 'q' || event->key.key == PUGL_KEY_ESCAPE) { quit = 1; } break; diff --git a/test/pugl_test.c b/test/pugl_test.c index fdf78c1..a609027 100644 --- a/test/pugl_test.c +++ b/test/pugl_test.c @@ -103,9 +103,7 @@ onEvent(PuglView* view, const PuglEvent* event) quit = 1; break; case PUGL_KEY_PRESS: - if (event->key.character == 'q' || - event->key.character == 'Q' || - event->key.character == PUGL_CHAR_ESCAPE) { + if (event->key.key == 'q' || event->key.key == PUGL_KEY_ESCAPE) { quit = 1; } break; diff --git a/test/test_utils.h b/test/test_utils.h index 285cc83..fb04f4b 100644 --- a/test/test_utils.h +++ b/test/test_utils.h @@ -101,16 +101,15 @@ printEvent(const PuglEvent* event, const char* prefix) { switch (event->type) { case PUGL_KEY_PRESS: - return fprintf(stderr, "%sKey %u (char U+%04X special U+%04X) press (%s)%s\n", - prefix, - event->key.keycode, event->key.character, event->key.special, - event->key.string, event->key.filter ? " (filtered)" : ""); - + return fprintf(stderr, "%sKey press code %3u key U+%04X\n", + prefix, event->key.keycode, event->key.key); case PUGL_KEY_RELEASE: - return fprintf(stderr, "%sKey %u (char U+%04X special U+%04X) release (%s)%s\n", - prefix, - event->key.keycode, event->key.character, event->key.special, - event->key.string, event->key.filter ? " (filtered)" : ""); + return fprintf(stderr, "%sKey release code %3u key U+%04X\n", + prefix, event->key.keycode, event->key.key); + case PUGL_TEXT: + return fprintf(stderr, "%sText entry code %3u char U+%04X (%s)\n", + prefix, event->text.keycode, + event->text.character, event->text.string); case PUGL_BUTTON_PRESS: case PUGL_BUTTON_RELEASE: return (fprintf(stderr, "%sMouse %d %s at %f,%f ", |