summaryrefslogtreecommitdiff
path: root/uisimulator/sdl/button.c
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator/sdl/button.c')
-rw-r--r--uisimulator/sdl/button.c23
1 files changed, 15 insertions, 8 deletions
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)
1212int button_read_device(int* data) 1225int 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
1222int button_read_device(void) 1229int button_read_device(void)
1223{ 1230{