dosbox-pure icon indicating copy to clipboard operation
dosbox-pure copied to clipboard

fix: mouse buttons don't work after launching a Windows 98 OS

Open emawind84 opened this issue 1 year ago • 6 comments

fix: mouse buttons don't work after launching a Windows 98 OS in some scenarios. Going into core options and changing dbp_mouse_input or other relevant options fix the problem

Fixes #489

emawind84 avatar Mar 29 '24 08:03 emawind84

#489 this is the issue

emawind84 avatar Mar 29 '24 08:03 emawind84

The problem started from the following commit 5c3403dc4cf92341477d7e08ed8e5564a4b02a73

The RefreshInputBinds was present before your commit, I don't know if this was intended or just an oversight https://github.com/schellingb/dosbox-pure/commit/5c3403dc4cf92341477d7e08ed8e5564a4b02a73#diff-b64e80926bade6d32106d17933a67d887bebc353b32909dcd7dd308266a3419fL3357

emawind84 avatar Mar 29 '24 09:03 emawind84

The call to RefreshInputBinds(true); exists inside DBP_PadMapping::SetPortMode, so this change seems redundant? Maybe it isn't called in all cases where necessary?

schellingb avatar Mar 29 '24 09:03 schellingb

Even if exists inside that method is not getting executed, I see the condition is different so my guess is the condition in not exactly correct. Sure is changing the condition is the right way, so I will do some test but feel free to do the fix yourself and close the PR.

if (mode != MODE_DISABLED) RefreshInputBinds(true); My guess is the RefreshInputBinds should be executed whether the mode is disabled or not

emawind84 avatar Mar 30 '24 01:03 emawind84

Finally got time to look into this. Turns out the actual bug was in DBP_PadMapping::ClearBinds which was unintentionally removing the mouse button bindings when asked to clear binds of port 0. I fixed this now in 95d9648 and cleaned up the code a bit.

schellingb avatar Jun 01 '24 16:06 schellingb

Thanks appreciated

emawind84 avatar Jun 02 '24 23:06 emawind84