GPH/OPENPANDORA: Minor cleanup
This commit is contained in:
parent
c65f3e071c
commit
c8c120d839
2 changed files with 29 additions and 43 deletions
|
@ -231,7 +231,9 @@ bool GPHEventSource::handleMouseButtonDown(SDL_Event &ev, Common::Event &event)
|
|||
}
|
||||
|
||||
bool GPHEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &event) {
|
||||
if (ev.button.button == SDL_BUTTON_LEFT) {
|
||||
if (ev.button.button != SDL_BUTTON_LEFT)
|
||||
return SdlEventSource::handleMouseButtonUp(ev, event);
|
||||
|
||||
if (_buttonStateL == true) /* _buttonStateL = Left Trigger Held, force Right Click */
|
||||
event.type = Common::EVENT_RBUTTONUP;
|
||||
else if (_tapmodeLevel == TAPMODE_LEFT) /* TAPMODE_LEFT = Left Click Tap Mode */
|
||||
|
@ -242,21 +244,13 @@ bool GPHEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &event) {
|
|||
event.type = Common::EVENT_MOUSEMOVE;
|
||||
else
|
||||
event.type = Common::EVENT_LBUTTONUP; /* For normal mice etc. */
|
||||
} else if (ev.button.button == SDL_BUTTON_RIGHT)
|
||||
event.type = Common::EVENT_RBUTTONUP;
|
||||
#if defined(SDL_BUTTON_MIDDLE)
|
||||
else if (ev.button.button == SDL_BUTTON_MIDDLE)
|
||||
event.type = Common::EVENT_MBUTTONUP;
|
||||
#endif
|
||||
else
|
||||
return false;
|
||||
|
||||
processMouseEvent(event, ev.button.x, ev.button.y);
|
||||
|
||||
// update KbdMouse
|
||||
_km.x = ev.button.x * MULTIPLIER;
|
||||
_km.y = ev.button.y * MULTIPLIER;
|
||||
|
||||
return true;
|
||||
return processMouseEvent(event, ev.button.x, ev.button.y);
|
||||
}
|
||||
|
||||
/* Custom handleJoyButtonDown/handleJoyButtonUp to deal with the joystick buttons on GPH devices */
|
||||
|
|
|
@ -86,7 +86,9 @@ bool OPEventSource::handleMouseButtonDown(SDL_Event &ev, Common::Event &event) {
|
|||
}
|
||||
|
||||
bool OPEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &event) {
|
||||
if (ev.button.button == SDL_BUTTON_LEFT) {
|
||||
if (ev.button.button != SDL_BUTTON_LEFT)
|
||||
return SdlEventSource::handleMouseButtonDown(ev, event);
|
||||
|
||||
if (_buttonStateL == true) /* _buttonStateL = Left Trigger Held, force Right Click */
|
||||
event.type = Common::EVENT_RBUTTONUP;
|
||||
else if (_tapmodeLevel == TAPMODE_LEFT) /* TAPMODE_LEFT = Left Click Tap Mode */
|
||||
|
@ -99,18 +101,8 @@ bool OPEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &event) {
|
|||
event.type = Common::EVENT_MOUSEMOVE;
|
||||
else
|
||||
event.type = Common::EVENT_LBUTTONUP; /* For normal mice etc. */
|
||||
} else if (ev.button.button == SDL_BUTTON_RIGHT)
|
||||
event.type = Common::EVENT_RBUTTONUP;
|
||||
#if defined(SDL_BUTTON_MIDDLE)
|
||||
else if (ev.button.button == SDL_BUTTON_MIDDLE)
|
||||
event.type = Common::EVENT_MBUTTONUP;
|
||||
#endif
|
||||
else
|
||||
return false;
|
||||
|
||||
processMouseEvent(event, ev.button.x, ev.button.y);
|
||||
|
||||
return true;
|
||||
return processMouseEvent(event, ev.button.x, ev.button.y);
|
||||
}
|
||||
|
||||
/* On the OpenPandora by default the ABXY and L/R Trigger buttons are returned by SDL as
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue