mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-25 19:55:54 +01:00
fix Inverted Right and Middle button on certain case with SDL
This commit is contained in:
parent
fb73e85d74
commit
25d405c3a0
|
@ -314,8 +314,16 @@ static void sdl_event_handler(const SDL_Event *event)
|
||||||
|
|
||||||
case SDL_MOUSEBUTTONDOWN:
|
case SDL_MOUSEBUTTONDOWN:
|
||||||
case SDL_MOUSEBUTTONUP:
|
case SDL_MOUSEBUTTONUP:
|
||||||
if (event->button.button <= 5)
|
if (event->button.button <= 5) {
|
||||||
_abKeysPressed[KID_MOUSE1 + (event->button.button-1)] = (event->button.state == SDL_PRESSED) ? TRUE : FALSE;
|
int button = KID_MOUSE1;
|
||||||
|
switch(event->button.button) {
|
||||||
|
case SDL_BUTTON_RIGHT: button = KID_MOUSE2; break;
|
||||||
|
case SDL_BUTTON_MIDDLE: button = KID_MOUSE3; break;
|
||||||
|
case 4: button = KID_MOUSE4; break;
|
||||||
|
case 5: button = KID_MOUSE5; break;
|
||||||
|
}
|
||||||
|
_abKeysPressed[button] = (event->button.state == SDL_PRESSED) ? TRUE : FALSE;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_MOUSEWHEEL:
|
case SDL_MOUSEWHEEL:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user