summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2009-10-06 01:26:01 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2009-10-06 01:26:01 +0000
commit8b6161b24b642ce6ac7e74218de1f64728f747f9 (patch)
tree78d9b6d64c4a3c29358c75e83fff2cb7fc1a0a6d /uisimulator
parent6a12b82a8533e8e0a835f6d1ee1e1076f8ef2df6 (diff)
downloadrockbox-8b6161b24b642ce6ac7e74218de1f64728f747f9.tar.gz
rockbox-8b6161b24b642ce6ac7e74218de1f64728f747f9.tar.bz2
rockbox-8b6161b24b642ce6ac7e74218de1f64728f747f9.zip
Simulator: Fix scrollwheel targets.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22977 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/sdl/button-sdl.h1
-rw-r--r--uisimulator/sdl/button.c23
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 @@
bool button_hold(void);
void button_init_sdl(void);
-intptr_t button_get_data_sdl(void);
#undef button_init_device
#define button_init_device() button_init_sdl()
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)
break;
}
+ /* Call to make up for scrollwheel target implementation. This is
+ * not handled in the main button.c driver, but on the target
+ * implementation (look at button-e200.c for example if you are trying to
+ * figure out why using button_get_data needed a hack before).
+ */
+#if defined(BUTTON_SCROLL_FWD) && defined(BUTTON_SCROLL_BACK)
+ if((new_btn == BUTTON_SCROLL_FWD || new_btn == BUTTON_SCROLL_BACK) &&
+ pressed)
+ {
+ queue_post(&button_queue, new_btn, 1<<24);
+ }
+#endif
+
if (pressed)
btn |= new_btn;
else
btn &= ~new_btn;
}
-#ifdef HAVE_BUTTON_DATA
+#if defined(HAVE_BUTTON_DATA) && defined(HAVE_TOUCHSCREEN)
int button_read_device(int* data)
{
-#if defined(HAVE_TOUCHSCREEN)
- *data=mouse_coords;
-#else
- /* pass scrollwheel acceleration to the button driver */
- *data = 1<<24;
-#endif
-
+ *data = mouse_coords;
#else
int button_read_device(void)
{