From aaa1636a8b17ab9ad1e5026c490ca1066280284a Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Thu, 26 Aug 2010 11:43:51 +0000 Subject: Move to a proper sdl key config instead of using the d2 pad. make the mouse wheel work, middle click is "select" and right click is "back" git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27891 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/hosted/sdl/button-sdl.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'firmware/target/hosted/sdl/button-sdl.c') diff --git a/firmware/target/hosted/sdl/button-sdl.c b/firmware/target/hosted/sdl/button-sdl.c index ee16e55fd1..519ac8d7c5 100644 --- a/firmware/target/hosted/sdl/button-sdl.c +++ b/firmware/target/hosted/sdl/button-sdl.c @@ -112,9 +112,16 @@ static void mouse_event(SDL_MouseButtonEvent *event, bool button_up) if(button_up) { switch ( event->button ) { +#ifdef HAVE_SCROLLWHEEL + case SDL_BUTTON_WHEELUP: + case SDL_BUTTON_WHEELDOWN: +#endif + case SDL_BUTTON_MIDDLE: + case SDL_BUTTON_RIGHT: + button_event( event->button, false ); + break; /* The scrollwheel button up events are ignored as they are queued immediately */ case SDL_BUTTON_LEFT: - case SDL_BUTTON_MIDDLE: if ( mapping && background ) { printf(" { SDLK_, %d, %d, %d, \"\" },\n", x, y, (int)sqrt( SQUARE(x-(int)event->x) + SQUARE(y-(int)event->y)) @@ -137,14 +144,13 @@ static void mouse_event(SDL_MouseButtonEvent *event, bool button_up) { #ifdef HAVE_SCROLLWHEEL case SDL_BUTTON_WHEELUP: - button_event( SDLK_UP, true ); - break; case SDL_BUTTON_WHEELDOWN: - button_event( SDLK_DOWN, true ); - break; #endif - case SDL_BUTTON_LEFT: case SDL_BUTTON_MIDDLE: + case SDL_BUTTON_RIGHT: + button_event( event->button, true ); + break; + case SDL_BUTTON_LEFT: if ( mapping && background ) { x = event->x; y = event->y; -- cgit v1.2.3