diff options
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; |