aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
Diffstat (limited to 'backends')
-rw-r--r--backends/events/gph/gph-events.cpp25
-rw-r--r--backends/events/openpandora/op-events.cpp11
2 files changed, 15 insertions, 21 deletions
diff --git a/backends/events/gph/gph-events.cpp b/backends/events/gph/gph-events.cpp
index a720ded0f2..18a4c6c32a 100644
--- a/backends/events/gph/gph-events.cpp
+++ b/backends/events/gph/gph-events.cpp
@@ -41,9 +41,6 @@
#define JOY_XAXIS 0
#define JOY_YAXIS 1
-/* Quick default button states for modifiers. */
-int BUTTON_STATE_L = false;
-
#if defined(CAANOO)
/* Caanoo: Main Joystick Button Mappings */
@@ -165,7 +162,7 @@ GPHEventSource::GPHEventSource()
bool GPHEventSource::handleMouseButtonDown(SDL_Event &ev, Common::Event &event) {
if (ev.button.button == SDL_BUTTON_LEFT) {
- if (BUTTON_STATE_L == true) /* BUTTON_STATE_L = Left Trigger Held, force Right Click */
+ if (_buttonStateL == true) /* _buttonStateL = Left Trigger Held, force Right Click */
event.type = Common::EVENT_RBUTTONDOWN;
else if (GPH::tapmodeLevel == TAPMODE_LEFT) /* TAPMODE_LEFT = Left Click Tap Mode */
event.type = Common::EVENT_LBUTTONDOWN;
@@ -200,7 +197,7 @@ 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 (BUTTON_STATE_L == true) /* BUTTON_STATE_L = Left Trigger Held, force Right Click */
+ if (_buttonStateL == true) /* _buttonStateL = Left Trigger Held, force Right Click */
event.type = Common::EVENT_RBUTTONUP;
else if (GPH::tapmodeLevel == TAPMODE_LEFT) /* TAPMODE_LEFT = Left Click Tap Mode */
event.type = Common::EVENT_LBUTTONUP;
@@ -348,11 +345,11 @@ bool GPHEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
processMouseEvent(event, _km.x / MULTIPLIER, _km.y / MULTIPLIER);
break;
case BUTTON_L:
- BUTTON_STATE_L = true;
+ _buttonStateL = true;
break;
case BUTTON_R:
event.type = Common::EVENT_KEYDOWN;
- if (BUTTON_STATE_L == true) {
+ if (_buttonStateL == true) {
#ifdef ENABLE_VKEYBD
event.type = Common::EVENT_VIRTUAL_KEYBOARD;
#else
@@ -367,7 +364,7 @@ bool GPHEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
case BUTTON_SELECT:
case BUTTON_HOME:
event.type = Common::EVENT_KEYDOWN;
- if (BUTTON_STATE_L == true) {
+ if (_buttonStateL == true) {
event.type = Common::EVENT_QUIT;
} else {
event.kbd.keycode = Common::KEYCODE_ESCAPE;
@@ -376,7 +373,7 @@ bool GPHEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
break;
case BUTTON_A:
event.type = Common::EVENT_KEYDOWN;
- if (BUTTON_STATE_L == true) {
+ if (_buttonStateL == true) {
event.type = Common::EVENT_PREDICTIVE_DIALOG;
} else {
event.kbd.keycode = Common::KEYCODE_PERIOD;
@@ -385,7 +382,7 @@ bool GPHEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
break;
case BUTTON_Y:
event.type = Common::EVENT_KEYDOWN;
- if (BUTTON_STATE_L == true) {
+ if (_buttonStateL == true) {
GPH::ToggleTapMode();
if (GPH::tapmodeLevel == TAPMODE_LEFT) {
g_system->displayMessageOnOSD(_("Touchscreen 'Tap Mode' - Left Click"));
@@ -402,7 +399,7 @@ bool GPHEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
case BUTTON_MENU:
case BUTTON_HELP:
event.type = Common::EVENT_KEYDOWN;
- if (BUTTON_STATE_L == true) {
+ if (_buttonStateL == true) {
event.type = Common::EVENT_MAINMENU;
} else {
event.kbd.keycode = Common::KEYCODE_F5;
@@ -472,7 +469,7 @@ bool GPHEventSource::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) {
processMouseEvent(event, _km.x / MULTIPLIER, _km.y / MULTIPLIER);
break;
case BUTTON_L:
- BUTTON_STATE_L = false;
+ _buttonStateL = false;
break;
case BUTTON_SELECT:
case BUTTON_HOME:
@@ -493,7 +490,7 @@ bool GPHEventSource::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) {
case BUTTON_MENU:
case BUTTON_HELP:
event.type = Common::EVENT_KEYUP;
- if (BUTTON_STATE_L == true) {
+ if (_buttonStateL == true) {
event.type = Common::EVENT_MAINMENU;
} else {
event.kbd.keycode = Common::KEYCODE_F5;
@@ -502,7 +499,7 @@ bool GPHEventSource::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) {
break;
case BUTTON_R:
event.type = Common::EVENT_KEYUP;
- if (BUTTON_STATE_L == true) {
+ if (_buttonStateL == true) {
#ifdef ENABLE_VKEYBD
event.kbd.keycode = Common::KEYCODE_F7;
event.kbd.ascii = mapKey(SDLK_F7, ev.key.keysym.mod, 0);
diff --git a/backends/events/openpandora/op-events.cpp b/backends/events/openpandora/op-events.cpp
index 80fff20bc2..fd5d2bc043 100644
--- a/backends/events/openpandora/op-events.cpp
+++ b/backends/events/openpandora/op-events.cpp
@@ -37,9 +37,6 @@
#include "common/util.h"
#include "common/events.h"
-/* Quick default button states for modifiers. */
-int BUTTON_STATE_L = false;
-
enum {
/* Touchscreen TapMode */
TAPMODE_LEFT = 0,
@@ -56,7 +53,7 @@ OPEventSource::OPEventSource()
bool OPEventSource::handleMouseButtonDown(SDL_Event &ev, Common::Event &event) {
if (ev.button.button == SDL_BUTTON_LEFT) {
- if (BUTTON_STATE_L == true) /* BUTTON_STATE_L = Left Trigger Held, force Right Click */
+ if (_buttonStateL == true) /* _buttonStateL = Left Trigger Held, force Right Click */
event.type = Common::EVENT_RBUTTONDOWN;
else if (OP::tapmodeLevel == TAPMODE_LEFT) /* TAPMODE_LEFT = Left Click Tap Mode */
event.type = Common::EVENT_LBUTTONDOWN;
@@ -93,7 +90,7 @@ 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 (BUTTON_STATE_L == true) /* BUTTON_STATE_L = Left Trigger Held, force Right Click */
+ if (_buttonStateL == true) /* _buttonStateL = Left Trigger Held, force Right Click */
event.type = Common::EVENT_RBUTTONUP;
else if (OP::tapmodeLevel == TAPMODE_LEFT) /* TAPMODE_LEFT = Left Click Tap Mode */
event.type = Common::EVENT_LBUTTONUP;
@@ -181,7 +178,7 @@ bool OPEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
}
break;
case SDLK_RSHIFT:
- BUTTON_STATE_L = true;
+ _buttonStateL = true;
break;
case SDLK_RCTRL:
break;
@@ -209,7 +206,7 @@ bool OPEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
case SDLK_PAGEUP:
break;
case SDLK_RSHIFT:
- BUTTON_STATE_L = false;
+ _buttonStateL = false;
break;
case SDLK_RCTRL:
break;