summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-11-11 01:50:18 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-11-11 01:50:18 +0000
commit50a8308ded33e7ff7397f7117fe1e4f16920de3d (patch)
treea26cf5cbb016b577186c0da2f6a4094221cdf309 /uisimulator
parentd430955e158bc61492ac3ce35d413ea54d57bd98 (diff)
downloadrockbox-50a8308ded33e7ff7397f7117fe1e4f16920de3d.tar.gz
rockbox-50a8308ded33e7ff7397f7117fe1e4f16920de3d.tar.bz2
rockbox-50a8308ded33e7ff7397f7117fe1e4f16920de3d.zip
fix fs#8131 - if --debugwps is used with the sim, the mouse coordinates will be displayed in the console when it is clicked
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15565 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/sdl/button.c3
-rw-r--r--uisimulator/sdl/uisdl.c8
2 files changed, 11 insertions, 0 deletions
diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c
index 193d89c528..504533bc3a 100644
--- a/uisimulator/sdl/button.c
+++ b/uisimulator/sdl/button.c
@@ -820,6 +820,7 @@ intptr_t button_get_data(void)
}
#ifdef HAVE_TOUCHPAD
+extern bool debug_wps;
void mouse_tick_task(void)
{
static int last_check = 0;
@@ -831,6 +832,8 @@ void mouse_tick_task(void)
{
mouse_coords = (x<<16)|y;
button_event(BUTTON_TOUCHPAD, true);
+ if (debug_wps)
+ printf("Mouse at: (%d, %d)\n", x, y);
}
else if (lastbtn == BUTTON_TOUCHPAD)
{
diff --git a/uisimulator/sdl/uisdl.c b/uisimulator/sdl/uisdl.c
index 15fc1333cb..de6089b648 100644
--- a/uisimulator/sdl/uisdl.c
+++ b/uisimulator/sdl/uisdl.c
@@ -107,6 +107,14 @@ void gui_message_loop(void)
button_event(event.key.keysym.sym, false);
sim_exit_irq_handler();
break;
+#ifndef HAVE_TOUCHPAD
+ case SDL_MOUSEBUTTONDOWN:
+ if (debug_wps && event.button.button == 1)
+ {
+ printf("Mouse at: (%d, %d)\n", event.button.x, event.button.y);
+ }
+ break;
+#endif
case SDL_QUIT:
done = true;
break;