Reverted mousewheel support in 1.2, since it breaks binary compatibility. SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Fri, 06 Jul 2007 13:39:03 +0000
branchSDL-1.2
changeset 4011f5794774970d
parent 4010 3aa1406620f6
child 4012 4e29535b821b
Reverted mousewheel support in 1.2, since it breaks binary compatibility.
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
     1.1 --- a/WhatsNew	Fri Jul 06 13:32:20 2007 +0000
     1.2 +++ b/WhatsNew	Fri Jul 06 13:39:03 2007 +0000
     1.3 @@ -7,8 +7,6 @@
     1.4  	Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling
     1.5  	of the screensaver on Mac OS X and X11.
     1.6  
     1.7 -	Added SDL_BUTTON_WHEELLEFT (6) and SDL_BUTTON_WHEELRIGHT (7)
     1.8 -
     1.9  1.2.10:
    1.10  	If SDL_OpenAudio() is passed zero for the desired format
    1.11  	fields, the following environment variables will be used
     2.1 --- a/docs.html	Fri Jul 06 13:32:20 2007 +0000
     2.2 +++ b/docs.html	Fri Jul 06 13:39:03 2007 +0000
     2.3 @@ -29,9 +29,6 @@
     2.4  	Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling of the screensaver on Mac OS X, Windows, and X11.
     2.5  </P>
     2.6  <P>
     2.7 -	Added SDL_BUTTON_WHEELLEFT (6) and SDL_BUTTON_WHEELRIGHT (7)
     2.8 -</P>
     2.9 -<P>
    2.10  	Fixed buffer overrun crash when resampling audio rates.
    2.11  </P>
    2.12  <P>
     3.1 --- a/include/SDL_mouse.h	Fri Jul 06 13:32:20 2007 +0000
     3.2 +++ b/include/SDL_mouse.h	Fri Jul 06 13:39:03 2007 +0000
     3.3 @@ -115,8 +115,6 @@
     3.4     Button 3:	Right mouse button
     3.5     Button 4:	Mouse wheel up	 (may also be a real button)
     3.6     Button 5:	Mouse wheel down (may also be a real button)
     3.7 -   Button 6:	Mouse wheel left (may also be a real button)
     3.8 -   Button 7:	Mouse wheel right (may also be a real button)
     3.9   */
    3.10  #define SDL_BUTTON(X)		(1 << ((X)-1))
    3.11  #define SDL_BUTTON_LEFT		1
    3.12 @@ -124,8 +122,6 @@
    3.13  #define SDL_BUTTON_RIGHT	3
    3.14  #define SDL_BUTTON_WHEELUP	4
    3.15  #define SDL_BUTTON_WHEELDOWN	5
    3.16 -#define SDL_BUTTON_WHEELLEFT	6
    3.17 -#define SDL_BUTTON_WHEELRIGHT	7
    3.18  #define SDL_BUTTON_LMASK	SDL_BUTTON(SDL_BUTTON_LEFT)
    3.19  #define SDL_BUTTON_MMASK	SDL_BUTTON(SDL_BUTTON_MIDDLE)
    3.20  #define SDL_BUTTON_RMASK	SDL_BUTTON(SDL_BUTTON_RIGHT)
     4.1 --- a/src/video/bwindow/SDL_sysevents.cc	Fri Jul 06 13:32:20 2007 +0000
     4.2 +++ b/src/video/bwindow/SDL_sysevents.cc	Fri Jul 06 13:39:03 2007 +0000
     4.3 @@ -294,23 +294,12 @@
     4.4  			float x, y;
     4.5  			x = y = 0;
     4.6  			if (msg->FindFloat("be:wheel_delta_x", &x) == B_OK && msg->FindFloat("be:wheel_delta_y", &y) == B_OK) {
     4.7 -				if ( y ) {
     4.8 -					if (y < 0) {
     4.9 -						SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELDOWN, 0, 0);
    4.10 -						SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_WHEELDOWN, 0, 0);
    4.11 -					} else {
    4.12 -						SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELUP, 0, 0);
    4.13 -						SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_WHEELUP, 0, 0);
    4.14 -					}
    4.15 -				}
    4.16 -				if ( x ) {
    4.17 -					if (x < 0) {
    4.18 -						SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELRIGHT, 0, 0);
    4.19 -						SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_WHEELRIGHT, 0, 0);
    4.20 -					} else {
    4.21 -						SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELLEFT, 0, 0);
    4.22 -						SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_WHEELLEFT, 0, 0);
    4.23 -					}
    4.24 +				if (x < 0 || y < 0) {
    4.25 +					SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELDOWN, 0, 0);
    4.26 +					SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_WHEELDOWN, 0, 0);
    4.27 +				} else if (x > 0 || y > 0) {
    4.28 +					SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELUP, 0, 0);
    4.29 +					SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_WHEELUP, 0, 0);
    4.30  				}
    4.31  			}
    4.32  			break;
     5.1 --- a/src/video/quartz/SDL_QuartzEvents.m	Fri Jul 06 13:32:20 2007 +0000
     5.2 +++ b/src/video/quartz/SDL_QuartzEvents.m	Fri Jul 06 13:39:03 2007 +0000
     5.3 @@ -932,24 +932,13 @@
     5.4                          Uint8 button;
     5.5                          dy = [ event deltaY ];
     5.6                          dx = [ event deltaX ];
     5.7 -			if ( dy ) {
     5.8 -				if ( dy > 0.0 ) /* Scroll up */
     5.9 -				    button = SDL_BUTTON_WHEELUP;
    5.10 -				else /* Scroll down */
    5.11 -				    button = SDL_BUTTON_WHEELDOWN;
    5.12 -				/* For now, wheel is sent as a quick down+up */
    5.13 -				SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);
    5.14 -				SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0);
    5.15 -			}
    5.16 -			if ( dx ) {
    5.17 -				if ( dx > 0.0 ) /* Scroll left */
    5.18 -				    button = SDL_BUTTON_WHEELLEFT;
    5.19 -				else /* Scroll right */
    5.20 -				    button = SDL_BUTTON_WHEELRIGHT;
    5.21 -				/* For now, wheel is sent as a quick down+up */
    5.22 -				SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);
    5.23 -				SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0);
    5.24 -			}
    5.25 +                        if ( dy > 0.0 || dx > 0.0 ) /* Scroll up */
    5.26 +                            button = SDL_BUTTON_WHEELUP;
    5.27 +                        else /* Scroll down */
    5.28 +                            button = SDL_BUTTON_WHEELDOWN;
    5.29 +                        /* For now, wheel is sent as a quick down+up */
    5.30 +                        SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);
    5.31 +                        SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0);
    5.32                      }
    5.33                      break;
    5.34                  case NSKeyUp:
     6.1 --- a/src/video/wincommon/SDL_sysevents.c	Fri Jul 06 13:32:20 2007 +0000
     6.2 +++ b/src/video/wincommon/SDL_sysevents.c	Fri Jul 06 13:39:03 2007 +0000
     6.3 @@ -520,12 +520,12 @@
     6.4  						break;
     6.5  					case WM_XBUTTONDOWN:
     6.6  						xbuttonval = GET_XBUTTON_WPARAM(wParam);
     6.7 -						button = SDL_BUTTON_WHEELRIGHT + xbuttonval;
     6.8 +						button = SDL_BUTTON_WHEELDOWN + xbuttonval;
     6.9  						state = SDL_PRESSED;
    6.10  						break;
    6.11  					case WM_XBUTTONUP:
    6.12  						xbuttonval = GET_XBUTTON_WPARAM(wParam);
    6.13 -						button = SDL_BUTTON_WHEELRIGHT + xbuttonval;
    6.14 +						button = SDL_BUTTON_WHEELDOWN + xbuttonval;
    6.15  						state = SDL_RELEASED;
    6.16  						break;
    6.17  					default: