https://bugs.winehq.org/show_bug.cgi?id=38314
Bug ID: 38314 Summary: Mouse Wheel doesn’t work for JA2 1.13 (it uses MOUSEHOOKSTRUCTEX) Product: Wine Version: 1.7.39 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: notifications+bugs.winehq.org@m0a.de Distribution: ---
The mouse wheel does not work at all in JA2 1.13 and by looking at the source code I think it may be one of several reasons:
1) MOUSEHOOKSTRUCTEX is not properly supported in wine 2) The wheel distance in mouseData does not equal WHEEL_DELTA (if it’s not exactly WHEEL_DELTA then this code will just drop the event) 3) There is a "bug" in the JA2 1.13 code, which actually works in Windows 3a) If I look at the code I see a comparison with WHEEL_DELTA, this will fail if the LOWORD of mouseData is not zero. Seems like on windows it’s always zero? Maybe in wine it’s not zero? Source: https://msdn.microsoft.com/en-us/library/windows/desktop/ms644969%28v=vs.85%...
The code:
LRESULT CALLBACK MouseHandler(int Code, WPARAM wParam, LPARAM lParam) { [...] p_mhs = (MOUSEHOOKSTRUCTEX*)lParam; [...] if(p_mhs->mouseData==(WHEEL_DELTA<<16)) //up MessageBeep(-1); QueueEvent(MOUSE_WHEEL_UP, 0, uiParam); if(p_mhs->mouseData==(-WHEEL_DELTA<<16)) //dn MessageBeep(0x00000040L); QueueEvent(MOUSE_WHEEL_DOWN, 0, uiParam);