BACKENDS: Add events for additional mouse buttons

This commit is contained in:
Cameron Cawley 2020-02-11 21:09:56 +00:00 committed by Bastien Bouclet
parent 11b358691d
commit 1605b72ee8
10 changed files with 118 additions and 11 deletions

View file

@ -819,6 +819,14 @@ bool SdlEventSource::handleMouseButtonDown(SDL_Event &ev, Common::Event &event)
#if defined(SDL_BUTTON_MIDDLE)
else if (ev.button.button == SDL_BUTTON_MIDDLE)
event.type = Common::EVENT_MBUTTONDOWN;
#endif
#if defined(SDL_BUTTON_X1)
else if (ev.button.button == SDL_BUTTON_X1)
event.type = Common::EVENT_X1BUTTONDOWN;
#endif
#if defined(SDL_BUTTON_X2)
else if (ev.button.button == SDL_BUTTON_X2)
event.type = Common::EVENT_X2BUTTONDOWN;
#endif
else
return false;
@ -838,6 +846,14 @@ bool SdlEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &event) {
#if defined(SDL_BUTTON_MIDDLE)
else if (ev.button.button == SDL_BUTTON_MIDDLE)
event.type = Common::EVENT_MBUTTONUP;
#endif
#if defined(SDL_BUTTON_X1)
else if (ev.button.button == SDL_BUTTON_X1)
event.type = Common::EVENT_X1BUTTONUP;
#endif
#if defined(SDL_BUTTON_X2)
else if (ev.button.button == SDL_BUTTON_X2)
event.type = Common::EVENT_X2BUTTONUP;
#endif
else
return false;