Seeking help with OpenMW/SDL mouse button issue

Hi. I’m totally new to SDL so if I’m in the wrong place, please redirect me.

I’m looking into a long-standing issue with OpenMW which uses SDL. Briefly, I use the mouse with my left hand, and have primary and secondary buttons swapped via Windows control panel. In OpenMW, the mouse buttons behave improperly with this configuration. If you’d like details about the problem, you can see them here.

I don’t know what version of sdl2.dll ships with OpenMW, but the file is dated June 19, 2021. At the suggestion of an OpenMW developer, I replaced that file with the latest version downloaded from this site, and the mouse button behavior is improved but still not totally correct. Specifically, the primary button (physical right button for me) now behaves correctly but the secondary button (physical left button for me) must be clicked twice to take effect (that’s two single clicks, not a double-click).

I’ve been in touch with the OpenMW team about the issue. It’s unclear if the problem lies with SDL or OpenMW. Since both are open-source, I downloaded the source code for both and have been looking through all the code related to mouse button handling (I’ve been a professional software engineer for quite some time).

I don’t currently have the tools needed to build the systems and run under a debugger, so I’ve just been inspecting the code. I have a theory about the source of the problem, but need some help looking into it.

Rather than going into it further here, I’ll stop for now and wait to hear if I’m in the right place to discuss this issue, or if I should move this topic someplace else.

Thanks for any help you can offer.

Go ahead and report the issue here, along with any hypothesis and information you might have:
Issues · libsdl-org/SDL (

OK. Thanks. I’ll do that a bit later tonight.