Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Mouse wheel sends mouse button (4/5) events on Windows
- Loading branch information
Showing
with
43 additions
and
0 deletions.
-
+1
−0
docs.html
-
+28
−0
src/video/wincommon/SDL_sysevents.c
-
+14
−0
src/video/windx5/SDL_dx5events.c
|
@@ -16,6 +16,7 @@ <H2> |
|
|
Major changes since SDL 1.0.0: |
|
|
</H2> |
|
|
<UL> |
|
|
<LI> 1.2.1: Mouse wheel sends mouse button (4/5) events on Windows |
|
|
<LI> 1.2.1: Added MacOS X Project Builder projects (thanks Darrell!) |
|
|
<LI> 1.2.1: Added initial support for Quartz video (thanks Darrell!) |
|
|
<LI> 1.2.1: Disabled Linux /dev/event joystick interface by default |
|
|
|
@@ -321,6 +321,34 @@ static LONG CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara |
|
|
} |
|
|
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 |
|
|
|
@@ -379,6 +379,20 @@ static void handle_mouse(const int numevents, DIDEVICEOBJECTDATA *ptrbuf) |
|
|
case DIMOFS_Y: |
|
|
yrel += (Sint16)ptrbuf[i].dwData; |
|
|
break; |
|
|
case DIMOFS_Z: |
|
|
if ( xrel || yrel ) { |
|
|
posted = SDL_PrivateMouseMotion( |
|
|
0, 1, xrel, yrel); |
|
|
xrel = 0; |
|
|
yrel = 0; |
|
|
} |
|
|
if((int)ptrbuf[i].dwData > 0) |
|
|
posted = SDL_PrivateMouseButton( |
|
|
SDL_PRESSED, 4, 0, 0); |
|
|
else if((int)ptrbuf[i].dwData < 0) |
|
|
posted = SDL_PrivateMouseButton( |
|
|
SDL_PRESSED, 5, 0, 0); |
|
|
break; |
|
|
case DIMOFS_BUTTON0: |
|
|
case DIMOFS_BUTTON1: |
|
|
case DIMOFS_BUTTON2: |
|
|