summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2008-05-30 22:55:24 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2008-05-30 22:55:24 +0000
commit944219bb7764206b59a5ea6e44ec52db39793161 (patch)
tree2de70412d29edff70d7cf68c2c9722195f581536 /uisimulator
parent48b47801e737202b575aeadb39b8bb99942f85a2 (diff)
downloadrockbox-944219bb7764206b59a5ea6e44ec52db39793161.tar.gz
rockbox-944219bb7764206b59a5ea6e44ec52db39793161.tar.bz2
rockbox-944219bb7764206b59a5ea6e44ec52db39793161.zip
(Simulator) Touchscreen improvements.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17662 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/sdl/button.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c
index 76a1f2f10c..ba19f30061 100644
--- a/uisimulator/sdl/button.c
+++ b/uisimulator/sdl/button.c
@@ -166,6 +166,13 @@ void button_event(int key, bool pressed)
case SDLK_KP3:
new_btn = BUTTON_BOTTOMRIGHT;
break;
+ case SDLK_F10:
+ if(pressed)
+ {
+ touchpad_mode = (touchpad_mode == TOUCHPAD_POINT ? TOUCHPAD_BUTTON : TOUCHPAD_POINT);
+ printf("Touchpad mode: %s\n", touchpad_mode == TOUCHPAD_POINT ? "TOUCHPAD_POINT" : "TOUCHPAD_BUTTON");
+ }
+ break;
#endif
case SDLK_u:
@@ -1080,6 +1087,15 @@ void mouse_tick_task(void)
last_check = current_tick;
if (SDL_GetMouseState(&x, &y) & SDL_BUTTON(SDL_BUTTON_LEFT))
{
+ if(background)
+ {
+ x -= UI_LCD_POSX;
+ y -= UI_LCD_POSY;
+
+ if(x<0 || y<0 || x>UI_LCD_WIDTH || y>UI_LCD_HEIGHT)
+ return;
+ }
+
mouse_coords = (x<<16)|y;
button_event(BUTTON_TOUCHPAD, true);
if (debug_wps)