Home » MODDING HQ 1.13 » v1.13 Bug Reports » Mouse Wheel Detection seems to violate MS specification
Mouse Wheel Detection seems to violate MS specification[message #340314] Mon, 30 March 2015 01:42 Go to next message
Kira

 
Messages:18
Registered:January 2009
Location: Germany
Hello JA2 1.13 coders, since the mouse wheel doesn't work in wine I've researched a bit and found the following code in "Build/Standard Gaming Platform/input.cpp:192".

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);


If you look at the spec (see: https://msdn.microsoft.com/en-us/library/windows/desktop/ms644969%28v=vs.85%29.aspx ) it states that the LOWORD of mouseData is "undefined and reserved". But you actually do a full compare of mouseData and WHEEL_DELTA moved left by 16 bits. This comparison *only* works if the LOWORD of mouseData is zero. But since the spec states that the LOWORD is "undefined and reserved" it will break as soon as the LOWORD is not zero (and this may be the reason of the wine bug as well).

PS: The wine bug: https://bugs.winehq.org/show_bug.cgi?id=38314#c0


rgds~

[Updated on: Mon, 30 March 2015 01:44]

Re: Mouse Wheel Detection seems to violate MS specification[message #340315 is a reply to message #340314] Mon, 30 March 2015 02:20 Go to previous messageGo to next message
edmortimer

 
Messages:1200
Registered:January 2015
Location: Home Free
The mouse wheel works for me in v1.13 under WinE in XUbuntu 14.10. Just a FYI.




Arulco Vacations Blog

Arulco Vacations Bears Pit Forum


Re: Mouse Wheel Detection seems to violate MS specification[message #340316 is a reply to message #340314] Mon, 30 March 2015 02:32 Go to previous messageGo to next message
Kira

 
Messages:18
Registered:January 2009
Location: Germany
Maybe it's related to KDE then? I've tested using openSUSE 13.2 with default KDE (and wine 1.7.39)
Re: Mouse Wheel Detection seems to violate MS specification[message #340401 is a reply to message #340314] Sat, 04 April 2015 01:43 Go to previous messageGo to next message
Kira

 
Messages:18
Registered:January 2009
Location: Germany
@edmortimer have you used any special wine settings?
Re: Mouse Wheel Detection seems to violate MS specification[message #340418 is a reply to message #340401] Sat, 04 April 2015 17:12 Go to previous messageGo to next message
edmortimer

 
Messages:1200
Registered:January 2015
Location: Home Free
@Kira

Quote:
@edmortimer have you used any special wine settings?


No, Default Windows XP setting for WINE v1.6.2. Xubuntu 14.10. I am not a Linux expert so I only customize when I have a need. The game itself runs great. No problems. Never a crash unless I've messed something up in the XML files.

Note: I cannot run any JA2v1.13 Editor except the Map Editor. But I don't have a need for a GUI Editor in the other circumstances, preferring a text editor always.




Arulco Vacations Blog

Arulco Vacations Bears Pit Forum


Re: Mouse Wheel Detection seems to violate MS specification[message #343533 is a reply to message #340314] Mon, 21 December 2015 21:23 Go to previous messageGo to next message
Kira

 
Messages:18
Registered:January 2009
Location: Germany
@edmortimer One question: did you mean clicking on the mouse wheel and using it as a third button or actually scrolling the mouse wheel to increase aiming accuracy?
Re: Mouse Wheel Detection seems to violate MS specification[message #343535 is a reply to message #343533] Tue, 22 December 2015 00:18 Go to previous messageGo to next message
edmortimer

 
Messages:1200
Registered:January 2015
Location: Home Free
Quote:
@edmortimer One question: did you mean clicking on the mouse wheel and using it as a third button or actually scrolling the mouse wheel to increase aiming accuracy?


Simply scrolling without clicking.




Arulco Vacations Blog

Arulco Vacations Bears Pit Forum


Re: Mouse Wheel Detection seems to violate MS specification[message #344049 is a reply to message #340314] Mon, 08 February 2016 17:45 Go to previous message
Kira

 
Messages:18
Registered:January 2009
Location: Germany
This is amazing big grin Because I submitted a patch to wine and it should really never have worked before.

Anyway, for others interested: Mouse wheel is fixed starting with Wine 1.9.3
Previous Topic: 1.13 4870 no Loadscreen after new installation
Next Topic: Manually Turned Base Problem - Not Exactly a BUG (We Need an Important Limit)
Goto Forum:
  


Current Time: Sat Apr 20 19:30:25 EEST 2019

Total time taken to generate the page: 0.00787 seconds