diff options
author | David Robillard <d@drobilla.net> | 2021-12-17 11:13:53 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-12-17 11:18:04 -0500 |
commit | 7dd7d5d9dca9fdcedd9bc7c6568be864b5236c97 (patch) | |
tree | 9a35d47d03f6e271850a0db6a1925da3913cd198 | |
parent | 6ca68635e8cef8407e91bc9542edf196ef708210 (diff) | |
download | pugl-7dd7d5d9dca9fdcedd9bc7c6568be864b5236c97.tar.gz pugl-7dd7d5d9dca9fdcedd9bc7c6568be864b5236c97.tar.bz2 pugl-7dd7d5d9dca9fdcedd9bc7c6568be864b5236c97.zip |
Windows: Support extended mouse buttons
-rw-r--r-- | src/win.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -688,6 +688,13 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam) case WM_RBUTTONDOWN: initMouseEvent(&event, view, 1, true, lParam); break; + case WM_XBUTTONDOWN: + if (GET_XBUTTON_WPARAM(wParam) == XBUTTON1) { + initMouseEvent(&event, view, 3, true, lParam); + } else { + initMouseEvent(&event, view, 4, true, lParam); + } + break; case WM_LBUTTONUP: initMouseEvent(&event, view, 0, false, lParam); break; @@ -697,6 +704,13 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam) case WM_RBUTTONUP: initMouseEvent(&event, view, 1, false, lParam); break; + case WM_XBUTTONUP: + if (GET_XBUTTON_WPARAM(wParam) == XBUTTON1) { + initMouseEvent(&event, view, 3, false, lParam); + } else { + initMouseEvent(&event, view, 4, false, lParam); + } + break; case WM_MOUSEWHEEL: initScrollEvent(&event, view, lParam); event.scroll.dy = GET_WHEEL_DELTA_WPARAM(wParam) / (double)WHEEL_DELTA; |