mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 14:01:45 +00:00
- added m_swapbuttons CVAR for the Windows RawInput and DirectInput backends.
The problem I discovered is that these backends do not respect the GUI-side system setting for swapping the buttons, so this needs to be done in-application so that swapped buttons can behave the same in the menu and the game.
This commit is contained in:
parent
97de1f670b
commit
feb3520ee9
1 changed files with 9 additions and 0 deletions
|
@ -380,9 +380,18 @@ void FMouse::WheelMoved(int axis, int wheelmove)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
CVAR(Bool, m_swapbuttons, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||
|
||||
void FMouse::PostButtonEvent(int button, bool down)
|
||||
{
|
||||
event_t ev = { 0 };
|
||||
|
||||
// Neither RawInput nor DirectInput check the GUI setting for swapped mouse buttons so we have to do our own implementation...
|
||||
if (m_swapbuttons && button < 2)
|
||||
{
|
||||
button = 1 - button;
|
||||
}
|
||||
|
||||
int mask = 1 << button;
|
||||
|
||||
ev.data1 = KEY_MOUSE1 + button;
|
||||
|
|
Loading…
Reference in a new issue