changeset 4011:f5794774970d SDL-1.2

Reverted mousewheel support in 1.2, since it breaks binary compatibility.
author Sam Lantinga <slouken@libsdl.org>
date Fri, 06 Jul 2007 13:39:03 +0000
parents 3aa1406620f6
children 4e29535b821b
files WhatsNew docs.html include/SDL_mouse.h src/video/bwindow/SDL_sysevents.cc src/video/quartz/SDL_QuartzEvents.m src/video/wincommon/SDL_sysevents.c
diffstat 6 files changed, 15 insertions(+), 46 deletions(-) [+]
line wrap: on
line diff
--- a/WhatsNew	Fri Jul 06 13:32:20 2007 +0000
+++ b/WhatsNew	Fri Jul 06 13:39:03 2007 +0000
@@ -7,8 +7,6 @@
 	Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling
 	of the screensaver on Mac OS X and X11.
 
-	Added SDL_BUTTON_WHEELLEFT (6) and SDL_BUTTON_WHEELRIGHT (7)
-
 1.2.10:
 	If SDL_OpenAudio() is passed zero for the desired format
 	fields, the following environment variables will be used
--- a/docs.html	Fri Jul 06 13:32:20 2007 +0000
+++ b/docs.html	Fri Jul 06 13:39:03 2007 +0000
@@ -29,9 +29,6 @@
 	Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling of the screensaver on Mac OS X, Windows, and X11.
 </P>
 <P>
-	Added SDL_BUTTON_WHEELLEFT (6) and SDL_BUTTON_WHEELRIGHT (7)
-</P>
-<P>
 	Fixed buffer overrun crash when resampling audio rates.
 </P>
 <P>
--- a/include/SDL_mouse.h	Fri Jul 06 13:32:20 2007 +0000
+++ b/include/SDL_mouse.h	Fri Jul 06 13:39:03 2007 +0000
@@ -115,8 +115,6 @@
    Button 3:	Right mouse button
    Button 4:	Mouse wheel up	 (may also be a real button)
    Button 5:	Mouse wheel down (may also be a real button)
-   Button 6:	Mouse wheel left (may also be a real button)
-   Button 7:	Mouse wheel right (may also be a real button)
  */
 #define SDL_BUTTON(X)		(1 << ((X)-1))
 #define SDL_BUTTON_LEFT		1
@@ -124,8 +122,6 @@
 #define SDL_BUTTON_RIGHT	3
 #define SDL_BUTTON_WHEELUP	4
 #define SDL_BUTTON_WHEELDOWN	5
-#define SDL_BUTTON_WHEELLEFT	6
-#define SDL_BUTTON_WHEELRIGHT	7
 #define SDL_BUTTON_LMASK	SDL_BUTTON(SDL_BUTTON_LEFT)
 #define SDL_BUTTON_MMASK	SDL_BUTTON(SDL_BUTTON_MIDDLE)
 #define SDL_BUTTON_RMASK	SDL_BUTTON(SDL_BUTTON_RIGHT)
--- a/src/video/bwindow/SDL_sysevents.cc	Fri Jul 06 13:32:20 2007 +0000
+++ b/src/video/bwindow/SDL_sysevents.cc	Fri Jul 06 13:39:03 2007 +0000
@@ -294,23 +294,12 @@
 			float x, y;
 			x = y = 0;
 			if (msg->FindFloat("be:wheel_delta_x", &x) == B_OK && msg->FindFloat("be:wheel_delta_y", &y) == B_OK) {
-				if ( y ) {
-					if (y < 0) {
-						SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELDOWN, 0, 0);
-						SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_WHEELDOWN, 0, 0);
-					} else {
-						SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELUP, 0, 0);
-						SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_WHEELUP, 0, 0);
-					}
-				}
-				if ( x ) {
-					if (x < 0) {
-						SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELRIGHT, 0, 0);
-						SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_WHEELRIGHT, 0, 0);
-					} else {
-						SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELLEFT, 0, 0);
-						SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_WHEELLEFT, 0, 0);
-					}
+				if (x < 0 || y < 0) {
+					SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELDOWN, 0, 0);
+					SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_WHEELDOWN, 0, 0);
+				} else if (x > 0 || y > 0) {
+					SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELUP, 0, 0);
+					SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_WHEELUP, 0, 0);
 				}
 			}
 			break;
--- a/src/video/quartz/SDL_QuartzEvents.m	Fri Jul 06 13:32:20 2007 +0000
+++ b/src/video/quartz/SDL_QuartzEvents.m	Fri Jul 06 13:39:03 2007 +0000
@@ -932,24 +932,13 @@
                         Uint8 button;
                         dy = [ event deltaY ];
                         dx = [ event deltaX ];
-			if ( dy ) {
-				if ( dy > 0.0 ) /* Scroll up */
-				    button = SDL_BUTTON_WHEELUP;
-				else /* Scroll down */
-				    button = SDL_BUTTON_WHEELDOWN;
-				/* For now, wheel is sent as a quick down+up */
-				SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);
-				SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0);
-			}
-			if ( dx ) {
-				if ( dx > 0.0 ) /* Scroll left */
-				    button = SDL_BUTTON_WHEELLEFT;
-				else /* Scroll right */
-				    button = SDL_BUTTON_WHEELRIGHT;
-				/* For now, wheel is sent as a quick down+up */
-				SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);
-				SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0);
-			}
+                        if ( dy > 0.0 || dx > 0.0 ) /* Scroll up */
+                            button = SDL_BUTTON_WHEELUP;
+                        else /* Scroll down */
+                            button = SDL_BUTTON_WHEELDOWN;
+                        /* For now, wheel is sent as a quick down+up */
+                        SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);
+                        SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0);
                     }
                     break;
                 case NSKeyUp:
--- a/src/video/wincommon/SDL_sysevents.c	Fri Jul 06 13:32:20 2007 +0000
+++ b/src/video/wincommon/SDL_sysevents.c	Fri Jul 06 13:39:03 2007 +0000
@@ -520,12 +520,12 @@
 						break;
 					case WM_XBUTTONDOWN:
 						xbuttonval = GET_XBUTTON_WPARAM(wParam);
-						button = SDL_BUTTON_WHEELRIGHT + xbuttonval;
+						button = SDL_BUTTON_WHEELDOWN + xbuttonval;
 						state = SDL_PRESSED;
 						break;
 					case WM_XBUTTONUP:
 						xbuttonval = GET_XBUTTON_WPARAM(wParam);
-						button = SDL_BUTTON_WHEELRIGHT + xbuttonval;
+						button = SDL_BUTTON_WHEELDOWN + xbuttonval;
 						state = SDL_RELEASED;
 						break;
 					default: