Add horizonal mousewheel scrolling

This commit is contained in:
Jack Andersen 2016-01-14 20:46:15 -10:00
parent 6c5e8f5fe8
commit 056eef542b
2 changed files with 19 additions and 0 deletions

View File

@ -269,6 +269,7 @@ public:
case WM_MOUSEHOVER:
case WM_NCMOUSEHOVER:
case WM_MOUSEWHEEL:
case WM_MOUSEHWHEEL:
case WM_CHAR:
case WM_UNICHAR:
window->_incomingEvent(&HWNDEvent(uMsg, wParam, lParam));

View File

@ -1190,6 +1190,24 @@ public:
}
return;
}
case WM_MOUSEHWHEEL:
{
if (m_callback)
{
int x, y, w, h;
getWindowFrame(x, y, w, h);
SWindowCoord coord =
{
{ GET_X_LPARAM(e.lParam), h-GET_Y_LPARAM(e.lParam) },
{ GET_X_LPARAM(e.lParam), h-GET_Y_LPARAM(e.lParam) },
{ float(GET_X_LPARAM(e.lParam)) / float(w), float(h-GET_Y_LPARAM(e.lParam)) / float(h) }
};
SScrollDelta scroll = {};
scroll.delta[0] = GET_WHEEL_DELTA_WPARAM(e.wParam) / double(-WHEEL_DELTA);
m_callback->scroll(coord, scroll);
}
return;
}
case WM_CHAR:
case WM_UNICHAR:
{