changeset 3545:6d91cff0ec79

Added mouse position for button handling
author Sam Lantinga <slouken@libsdl.org>
date Sat, 12 Dec 2009 00:08:02 +0000
parents 71189305cd33
children 65848493e08e
files test/testwm.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/testwm.c	Sat Dec 12 00:07:26 2009 +0000
+++ b/test/testwm.c	Sat Dec 12 00:08:02 2009 +0000
@@ -214,9 +214,10 @@
             visible = !visible;
             SDL_ShowCursor(visible);
         }
-        printf("Mouse button %d has been %s\n",
+        printf("Mouse button %d has been %s at %d,%d\n",
                event->button.button,
-               (event->button.state == SDL_PRESSED) ? "pressed" : "released");
+               (event->button.state == SDL_PRESSED) ? "pressed" : "released",
+               event->button.x, event->button.y);
         return (0);
 
         /* Show relative mouse motion */