Added option to swap left and right mouse buttons

Changed the use of SDL buttons to Moonlight buttons definitions
This commit is contained in:
Anton
2020-08-23 16:05:00 +02:00
parent 5755afc4ea
commit 89319dc7aa
7 changed files with 37 additions and 0 deletions

View File

@@ -55,6 +55,14 @@ void SdlInputHandler::handleMouseButtonEvent(SDL_MouseButtonEvent* event)
return;
}
if (m_SwapMouseButtons) {
if (button == BUTTON_RIGHT)
button = BUTTON_LEFT;
else if (button == BUTTON_LEFT)
button = BUTTON_RIGHT;
}
LiSendMouseButtonEvent(event->state == SDL_PRESSED ?
BUTTON_ACTION_PRESS :
BUTTON_ACTION_RELEASE,