diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2010-08-26 11:43:51 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2010-08-26 11:43:51 +0000 |
commit | aaa1636a8b17ab9ad1e5026c490ca1066280284a (patch) | |
tree | d3ab4701aae8639b949b4ec24f9f8da09b0f4cd9 /firmware/target/hosted/sdl/button-sdl.c | |
parent | 1d613bee0fd4b3bb6266a7ad93aade2aaeb3705c (diff) | |
download | rockbox-aaa1636a8b17ab9ad1e5026c490ca1066280284a.tar.gz rockbox-aaa1636a8b17ab9ad1e5026c490ca1066280284a.zip |
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
Diffstat (limited to 'firmware/target/hosted/sdl/button-sdl.c')
-rw-r--r-- | firmware/target/hosted/sdl/button-sdl.c | 18 |
1 files changed, 12 insertions, 6 deletions
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) | |||
112 | if(button_up) { | 112 | if(button_up) { |
113 | switch ( event->button ) | 113 | switch ( event->button ) |
114 | { | 114 | { |
115 | #ifdef HAVE_SCROLLWHEEL | ||
116 | case SDL_BUTTON_WHEELUP: | ||
117 | case SDL_BUTTON_WHEELDOWN: | ||
118 | #endif | ||
119 | case SDL_BUTTON_MIDDLE: | ||
120 | case SDL_BUTTON_RIGHT: | ||
121 | button_event( event->button, false ); | ||
122 | break; | ||
115 | /* The scrollwheel button up events are ignored as they are queued immediately */ | 123 | /* The scrollwheel button up events are ignored as they are queued immediately */ |
116 | case SDL_BUTTON_LEFT: | 124 | case SDL_BUTTON_LEFT: |
117 | case SDL_BUTTON_MIDDLE: | ||
118 | if ( mapping && background ) { | 125 | if ( mapping && background ) { |
119 | printf(" { SDLK_, %d, %d, %d, \"\" },\n", x, y, | 126 | printf(" { SDLK_, %d, %d, %d, \"\" },\n", x, y, |
120 | (int)sqrt( SQUARE(x-(int)event->x) + SQUARE(y-(int)event->y)) | 127 | (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) | |||
137 | { | 144 | { |
138 | #ifdef HAVE_SCROLLWHEEL | 145 | #ifdef HAVE_SCROLLWHEEL |
139 | case SDL_BUTTON_WHEELUP: | 146 | case SDL_BUTTON_WHEELUP: |
140 | button_event( SDLK_UP, true ); | ||
141 | break; | ||
142 | case SDL_BUTTON_WHEELDOWN: | 147 | case SDL_BUTTON_WHEELDOWN: |
143 | button_event( SDLK_DOWN, true ); | ||
144 | break; | ||
145 | #endif | 148 | #endif |
146 | case SDL_BUTTON_LEFT: | ||
147 | case SDL_BUTTON_MIDDLE: | 149 | case SDL_BUTTON_MIDDLE: |
150 | case SDL_BUTTON_RIGHT: | ||
151 | button_event( event->button, true ); | ||
152 | break; | ||
153 | case SDL_BUTTON_LEFT: | ||
148 | if ( mapping && background ) { | 154 | if ( mapping && background ) { |
149 | x = event->x; | 155 | x = event->x; |
150 | y = event->y; | 156 | y = event->y; |