diff options
Diffstat (limited to 'uisimulator/sdl')
-rw-r--r-- | uisimulator/sdl/button.c | 16 |
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) | |||
166 | case SDLK_KP3: | 166 | case SDLK_KP3: |
167 | new_btn = BUTTON_BOTTOMRIGHT; | 167 | new_btn = BUTTON_BOTTOMRIGHT; |
168 | break; | 168 | break; |
169 | case SDLK_F10: | ||
170 | if(pressed) | ||
171 | { | ||
172 | touchpad_mode = (touchpad_mode == TOUCHPAD_POINT ? TOUCHPAD_BUTTON : TOUCHPAD_POINT); | ||
173 | printf("Touchpad mode: %s\n", touchpad_mode == TOUCHPAD_POINT ? "TOUCHPAD_POINT" : "TOUCHPAD_BUTTON"); | ||
174 | } | ||
175 | break; | ||
169 | 176 | ||
170 | #endif | 177 | #endif |
171 | case SDLK_u: | 178 | case SDLK_u: |
@@ -1080,6 +1087,15 @@ void mouse_tick_task(void) | |||
1080 | last_check = current_tick; | 1087 | last_check = current_tick; |
1081 | if (SDL_GetMouseState(&x, &y) & SDL_BUTTON(SDL_BUTTON_LEFT)) | 1088 | if (SDL_GetMouseState(&x, &y) & SDL_BUTTON(SDL_BUTTON_LEFT)) |
1082 | { | 1089 | { |
1090 | if(background) | ||
1091 | { | ||
1092 | x -= UI_LCD_POSX; | ||
1093 | y -= UI_LCD_POSY; | ||
1094 | |||
1095 | if(x<0 || y<0 || x>UI_LCD_WIDTH || y>UI_LCD_HEIGHT) | ||
1096 | return; | ||
1097 | } | ||
1098 | |||
1083 | mouse_coords = (x<<16)|y; | 1099 | mouse_coords = (x<<16)|y; |
1084 | button_event(BUTTON_TOUCHPAD, true); | 1100 | button_event(BUTTON_TOUCHPAD, true); |
1085 | if (debug_wps) | 1101 | if (debug_wps) |