diff options
Diffstat (limited to 'uisimulator')
-rw-r--r-- | uisimulator/sdl/button-sdl.h | 1 | ||||
-rw-r--r-- | uisimulator/sdl/button.c | 23 |
2 files changed, 15 insertions, 9 deletions
diff --git a/uisimulator/sdl/button-sdl.h b/uisimulator/sdl/button-sdl.h index 5a0a7e2620..8159d24729 100644 --- a/uisimulator/sdl/button-sdl.h +++ b/uisimulator/sdl/button-sdl.h | |||
@@ -34,7 +34,6 @@ | |||
34 | 34 | ||
35 | bool button_hold(void); | 35 | bool button_hold(void); |
36 | void button_init_sdl(void); | 36 | void button_init_sdl(void); |
37 | intptr_t button_get_data_sdl(void); | ||
38 | #undef button_init_device | 37 | #undef button_init_device |
39 | #define button_init_device() button_init_sdl() | 38 | #define button_init_device() button_init_sdl() |
40 | 39 | ||
diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c index ee0a24008b..f8889bafb8 100644 --- a/uisimulator/sdl/button.c +++ b/uisimulator/sdl/button.c | |||
@@ -1203,21 +1203,28 @@ void button_event(int key, bool pressed) | |||
1203 | break; | 1203 | break; |
1204 | } | 1204 | } |
1205 | 1205 | ||
1206 | /* Call to make up for scrollwheel target implementation. This is | ||
1207 | * not handled in the main button.c driver, but on the target | ||
1208 | * implementation (look at button-e200.c for example if you are trying to | ||
1209 | * figure out why using button_get_data needed a hack before). | ||
1210 | */ | ||
1211 | #if defined(BUTTON_SCROLL_FWD) && defined(BUTTON_SCROLL_BACK) | ||
1212 | if((new_btn == BUTTON_SCROLL_FWD || new_btn == BUTTON_SCROLL_BACK) && | ||
1213 | pressed) | ||
1214 | { | ||
1215 | queue_post(&button_queue, new_btn, 1<<24); | ||
1216 | } | ||
1217 | #endif | ||
1218 | |||
1206 | if (pressed) | 1219 | if (pressed) |
1207 | btn |= new_btn; | 1220 | btn |= new_btn; |
1208 | else | 1221 | else |
1209 | btn &= ~new_btn; | 1222 | btn &= ~new_btn; |
1210 | } | 1223 | } |
1211 | #ifdef HAVE_BUTTON_DATA | 1224 | #if defined(HAVE_BUTTON_DATA) && defined(HAVE_TOUCHSCREEN) |
1212 | int button_read_device(int* data) | 1225 | int button_read_device(int* data) |
1213 | { | 1226 | { |
1214 | #if defined(HAVE_TOUCHSCREEN) | 1227 | *data = mouse_coords; |
1215 | *data=mouse_coords; | ||
1216 | #else | ||
1217 | /* pass scrollwheel acceleration to the button driver */ | ||
1218 | *data = 1<<24; | ||
1219 | #endif | ||
1220 | |||
1221 | #else | 1228 | #else |
1222 | int button_read_device(void) | 1229 | int button_read_device(void) |
1223 | { | 1230 | { |