Added missing X1/X2 button support
authorSam Lantinga <slouken@libsdl.org>
Mon, 25 Aug 2008 06:58:34 +0000
changeset 2711 62e7af9b2b67
parent 2710 44e49d3fa6cf
child 2712 c4e697245676
Added missing X1/X2 button support
src/video/win32/SDL_win32events.c
--- a/src/video/win32/SDL_win32events.c	Mon Aug 25 06:33:00 2008 +0000
+++ b/src/video/win32/SDL_win32events.c	Mon Aug 25 06:58:34 2008 +0000
@@ -271,6 +271,16 @@
             } else if (flags & RI_MOUSE_BUTTON_3_UP) {
                 SDL_SendMouseButton(index, SDL_RELEASED, SDL_BUTTON_RIGHT);
             }
+            if (flags & RI_MOUSE_BUTTON_4_DOWN) {
+                SDL_SendMouseButton(index, SDL_PRESSED, SDL_BUTTON_X1);
+            } else if (flags & RI_MOUSE_BUTTON_4_UP) {
+                SDL_SendMouseButton(index, SDL_RELEASED, SDL_BUTTON_X1);
+            }
+            if (flags & RI_MOUSE_BUTTON_5_DOWN) {
+                SDL_SendMouseButton(index, SDL_PRESSED, SDL_BUTTON_X2);
+            } else if (flags & RI_MOUSE_BUTTON_5_UP) {
+                SDL_SendMouseButton(index, SDL_RELEASED, SDL_BUTTON_X2);
+            }
             if (flags & RI_MOUSE_WHEEL) {
                 if (raw->data.mouse.usButtonData != 0) {
                     SDL_SendMouseWheel(index, 0,