diff src/video/wincommon/SDL_sysevents.c @ 61:994ed1d668e7

Mouse wheel sends mouse button (4/5) events on Windows
author Sam Lantinga <slouken@lokigames.com>
date Sat, 16 Jun 2001 01:01:42 +0000
parents 13ee9f4834ea
children 29a638dc26db
line wrap: on
line diff
--- a/src/video/wincommon/SDL_sysevents.c	Mon Jun 11 22:54:34 2001 +0000
+++ b/src/video/wincommon/SDL_sysevents.c	Sat Jun 16 01:01:42 2001 +0000
@@ -321,6 +321,34 @@
 		}
 		return(0);
 
+
+#if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
+		case WM_MOUSEWHEEL: 
+			if ( SDL_VideoSurface && ! DINPUT_FULLSCREEN() ) {
+				Sint16 x, y;
+				Uint8 button = 0;
+				int move = (short)HIWORD(wParam);
+				if(move > 0)
+					button = 4;
+				else if(move < 0)
+					button = 5;
+				if(button)
+				{
+					if ( mouse_relative ) {
+					/*	RJR: March 28, 2000
+						report internal mouse position if in relative mode */
+						x = 0; y = 0;
+					} else {
+						x = (Sint16)LOWORD(lParam);
+						y = (Sint16)HIWORD(lParam);
+					}
+					posted = SDL_PrivateMouseButton(
+								SDL_PRESSED, button, x, y);
+				}
+			}
+			return(0);
+#endif
+
 #ifdef WM_GETMINMAXINFO
 		/* This message is sent as a way for us to "check" the values
 		 * of a position change.  If we don't like it, we can adjust