From 4e6368d019e2543e6bf792f182486732d6f5a3f5 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 29 Apr 2012 02:53:47 +0000 Subject: Proper key press and release support on X11. Clearer mouse callback API. --- pugl_test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'pugl_test.c') diff --git a/pugl_test.c b/pugl_test.c index f6d9ac2..63bc7d6 100644 --- a/pugl_test.c +++ b/pugl_test.c @@ -59,6 +59,7 @@ onDisplay(PuglWindow* win) static void onKeyboard(PuglWindow* win, bool press, uint32_t key) { + fprintf(stderr, "Key %c %s\n", (char)key, press ? "down" : "up"); if (key == 'q' || key == 'Q' || key == KEY_ESCAPE) { quit = 1; } @@ -73,9 +74,10 @@ onMotion(PuglWindow* win, int x, int y) } static void -onMouse(PuglWindow* handle, int button, int state, int x, int y) +onMouse(PuglWindow* handle, int button, bool press, int x, int y) { - fprintf(stderr, "Mouse %d at %d,%d\n", button, x, y); + fprintf(stderr, "Mouse %d %s at %d,%d\n", + button, press ? "down" : "up", x, y); } static void -- cgit v1.2.3