summaryrefslogtreecommitdiff
path: root/pugl_test.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-04-29 02:53:47 +0000
committerDavid Robillard <d@drobilla.net>2012-04-29 02:53:47 +0000
commit4e6368d019e2543e6bf792f182486732d6f5a3f5 (patch)
tree4c2545feea12ebacfda281c9905a410820c55fe1 /pugl_test.c
parente346dc20fb1fcbc8f895d7c46e3ec54628d3db0c (diff)
Proper key press and release support on X11.
Clearer mouse callback API.
Diffstat (limited to 'pugl_test.c')
-rw-r--r--pugl_test.c6
1 files changed, 4 insertions, 2 deletions
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