diff options
| -rw-r--r-- | firmware/drivers/button.c | 4 | ||||
| -rw-r--r-- | uisimulator/sdl/button.c | 20 |
2 files changed, 7 insertions, 17 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 088ba0a..71cd472 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c @@ -385,11 +385,7 @@ long button_get_w_tmo(int ticks) intptr_t button_get_data(void) { -#if defined(SIMULATOR) - return button_get_data_sdl(); -#else return button_data; -#endif } void button_init(void) diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c index 5bda8a3..ee0a240 100644 --- a/uisimulator/sdl/button.c +++ b/uisimulator/sdl/button.c @@ -1211,7 +1211,13 @@ void button_event(int key, bool pressed) #ifdef HAVE_BUTTON_DATA int button_read_device(int* data) { - (void)data; +#if defined(HAVE_TOUCHSCREEN) + *data=mouse_coords; +#else + /* pass scrollwheel acceleration to the button driver */ + *data = 1<<24; +#endif + #else int button_read_device(void) { @@ -1264,19 +1270,7 @@ void mouse_tick_task(void) printf("Mouse at: (%d, %d)\n", x, y); } } - -#endif - -intptr_t button_get_data_sdl(void) -{ -#ifdef HAVE_TOUCHSCREEN - /* pass the mouse coordinates to the button driver */ - return mouse_coords; -#else - /* pass scrollwheel acceleration to the button driver */ - return 1<<24; #endif -} void button_init_sdl(void) { |