Commit e2d89e30 authored by Sam Lantinga's avatar Sam Lantinga

Reverted mousewheel support in 1.2, since it breaks binary compatibility.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%402430
parent cf458d63
...@@ -7,8 +7,6 @@ Version 1.0: ...@@ -7,8 +7,6 @@ Version 1.0:
Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling
of the screensaver on Mac OS X and X11. of the screensaver on Mac OS X and X11.
Added SDL_BUTTON_WHEELLEFT (6) and SDL_BUTTON_WHEELRIGHT (7)
1.2.10: 1.2.10:
If SDL_OpenAudio() is passed zero for the desired format If SDL_OpenAudio() is passed zero for the desired format
fields, the following environment variables will be used fields, the following environment variables will be used
......
...@@ -28,9 +28,6 @@ SDL 1.2.12 is a minor bug fix release. ...@@ -28,9 +28,6 @@ SDL 1.2.12 is a minor bug fix release.
<P> <P>
Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling of the screensaver on Mac OS X, Windows, and X11. Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling of the screensaver on Mac OS X, Windows, and X11.
</P> </P>
<P>
Added SDL_BUTTON_WHEELLEFT (6) and SDL_BUTTON_WHEELRIGHT (7)
</P>
<P> <P>
Fixed buffer overrun crash when resampling audio rates. Fixed buffer overrun crash when resampling audio rates.
</P> </P>
......
...@@ -115,8 +115,6 @@ extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); ...@@ -115,8 +115,6 @@ extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
Button 3: Right mouse button Button 3: Right mouse button
Button 4: Mouse wheel up (may also be a real button) Button 4: Mouse wheel up (may also be a real button)
Button 5: Mouse wheel down (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(X) (1 << ((X)-1))
#define SDL_BUTTON_LEFT 1 #define SDL_BUTTON_LEFT 1
...@@ -124,8 +122,6 @@ extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); ...@@ -124,8 +122,6 @@ extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
#define SDL_BUTTON_RIGHT 3 #define SDL_BUTTON_RIGHT 3
#define SDL_BUTTON_WHEELUP 4 #define SDL_BUTTON_WHEELUP 4
#define SDL_BUTTON_WHEELDOWN 5 #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_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)
#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) #define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)
#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) #define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)
......
...@@ -294,25 +294,14 @@ SDL_WarpMouse((int)center.x*2-1,(int)center.y*2-1); ...@@ -294,25 +294,14 @@ SDL_WarpMouse((int)center.x*2-1,(int)center.y*2-1);
float x, y; float x, y;
x = y = 0; x = y = 0;
if (msg->FindFloat("be:wheel_delta_x", &x) == B_OK && msg->FindFloat("be:wheel_delta_y", &y) == B_OK) { if (msg->FindFloat("be:wheel_delta_x", &x) == B_OK && msg->FindFloat("be:wheel_delta_y", &y) == B_OK) {
if ( y ) { if (x < 0 || y < 0) {
if (y < 0) {
SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELDOWN, 0, 0); SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELDOWN, 0, 0);
SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_WHEELDOWN, 0, 0); SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_WHEELDOWN, 0, 0);
} else { } else if (x > 0 || y > 0) {
SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELUP, 0, 0); SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELUP, 0, 0);
SDL_PrivateMouseButton(SDL_RELEASED, 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);
}
}
}
break; break;
} }
......
...@@ -932,8 +932,7 @@ void QZ_PumpEvents (_THIS) ...@@ -932,8 +932,7 @@ void QZ_PumpEvents (_THIS)
Uint8 button; Uint8 button;
dy = [ event deltaY ]; dy = [ event deltaY ];
dx = [ event deltaX ]; dx = [ event deltaX ];
if ( dy ) { if ( dy > 0.0 || dx > 0.0 ) /* Scroll up */
if ( dy > 0.0 ) /* Scroll up */
button = SDL_BUTTON_WHEELUP; button = SDL_BUTTON_WHEELUP;
else /* Scroll down */ else /* Scroll down */
button = SDL_BUTTON_WHEELDOWN; button = SDL_BUTTON_WHEELDOWN;
...@@ -941,16 +940,6 @@ void QZ_PumpEvents (_THIS) ...@@ -941,16 +940,6 @@ void QZ_PumpEvents (_THIS)
SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0); SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);
SDL_PrivateMouseButton (SDL_RELEASED, 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);
}
}
break; break;
case NSKeyUp: case NSKeyUp:
QZ_DoKey (this, SDL_RELEASED, event); QZ_DoKey (this, SDL_RELEASED, event);
......
...@@ -520,12 +520,12 @@ LRESULT CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) ...@@ -520,12 +520,12 @@ LRESULT CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
break; break;
case WM_XBUTTONDOWN: case WM_XBUTTONDOWN:
xbuttonval = GET_XBUTTON_WPARAM(wParam); xbuttonval = GET_XBUTTON_WPARAM(wParam);
button = SDL_BUTTON_WHEELRIGHT + xbuttonval; button = SDL_BUTTON_WHEELDOWN + xbuttonval;
state = SDL_PRESSED; state = SDL_PRESSED;
break; break;
case WM_XBUTTONUP: case WM_XBUTTONUP:
xbuttonval = GET_XBUTTON_WPARAM(wParam); xbuttonval = GET_XBUTTON_WPARAM(wParam);
button = SDL_BUTTON_WHEELRIGHT + xbuttonval; button = SDL_BUTTON_WHEELDOWN + xbuttonval;
state = SDL_RELEASED; state = SDL_RELEASED;
break; break;
default: default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment