1
0
Fork 0
forked from len0rd/rockbox

Simulator: Fix scrollwheel targets.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22977 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Karl Kurbjun 2009-10-06 01:26:01 +00:00
parent 6a12b82a85
commit 8b6161b24b
2 changed files with 15 additions and 9 deletions

View file

@ -34,7 +34,6 @@
bool button_hold(void); bool button_hold(void);
void button_init_sdl(void); void button_init_sdl(void);
intptr_t button_get_data_sdl(void);
#undef button_init_device #undef button_init_device
#define button_init_device() button_init_sdl() #define button_init_device() button_init_sdl()

View file

@ -1203,21 +1203,28 @@ void button_event(int key, bool pressed)
break; 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) if (pressed)
btn |= new_btn; btn |= new_btn;
else else
btn &= ~new_btn; btn &= ~new_btn;
} }
#ifdef HAVE_BUTTON_DATA #if defined(HAVE_BUTTON_DATA) && defined(HAVE_TOUCHSCREEN)
int button_read_device(int* data) int button_read_device(int* data)
{ {
#if defined(HAVE_TOUCHSCREEN)
*data = mouse_coords; *data = mouse_coords;
#else
/* pass scrollwheel acceleration to the button driver */
*data = 1<<24;
#endif
#else #else
int button_read_device(void) int button_read_device(void)
{ {