schellingb / dosbox-pure

DOSBox Pure is a new fork of DOSBox built for RetroArch/Libretro aiming for simplicity and ease of use.
GNU General Public License v2.0
731 stars 61 forks source link

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

Open emawind84 opened 3 months ago

emawind84 commented 3 months ago

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 commented 3 months ago

489 this is the issue

emawind84 commented 3 months ago

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

schellingb commented 3 months ago

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?

emawind84 commented 3 months ago

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

schellingb commented 1 month ago

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.

emawind84 commented 1 month ago

Thanks appreciated