diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2016-02-04 19:06:17 +0100 |
---|---|---|
committer | Rémi Verschelde <remi@verschelde.fr> | 2016-02-04 19:06:17 +0100 |
commit | 85d9f72b8ad92a3e58449af27679c306128d3cb6 (patch) | |
tree | 75b884fad9458ba36cbd0bf209f65537d20d472f /platform/windows/os_windows.cpp | |
parent | 6ea0863ed3e836127cfd38587a50679d40ca40bc (diff) | |
parent | df4faf8f334c5b1c71bfcec25fb64caf933b294b (diff) |
Merge pull request #3585 from Hinsbart/hscroll
support horizontal mouse wheel
Diffstat (limited to 'platform/windows/os_windows.cpp')
-rw-r--r-- | platform/windows/os_windows.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 20f417ccc6..8a291a298b 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -66,6 +66,10 @@ extern "C" { #endif } +#ifndef WM_MOUSEHWHEEL +#define WM_MOUSEHWHEEL 0x020e +#endif + //#define STDOUT_FILE extern HINSTANCE godot_hinstance; @@ -432,6 +436,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) { case WM_RBUTTONDOWN: case WM_RBUTTONUP: case WM_MOUSEWHEEL: + case WM_MOUSEHWHEEL: case WM_LBUTTONDBLCLK: case WM_RBUTTONDBLCLK: /*case WM_XBUTTONDOWN: @@ -502,12 +507,24 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) { if (motion>0) - mb.button_index=4; + mb.button_index= BUTTON_WHEEL_UP; else - mb.button_index=5; + mb.button_index= BUTTON_WHEEL_DOWN; } break; + case WM_MOUSEHWHEEL: { + + mb.pressed = true; + int motion = (short)HIWORD(wParam); + if (!motion) + return 0; + + if (motion<0) + mb.button_index = BUTTON_WHEEL_LEFT; + else + mb.button_index = BUTTON_WHEEL_RIGHT; + } break; /* case WM_XBUTTONDOWN: { mb.pressed=true; |