summaryrefslogtreecommitdiff
path: root/src/touchactions.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-05 14:39:06 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-05 14:39:06 +0300
commiteb37dba283cab99816c5d227ad3744a8bb19d2c2 (patch)
treeb078c8be48ad37a0c64db5701ef3e551c0c7c3e5 /src/touchactions.cpp
parentc0ec0ae9ec97f89a7bfc45f9428dac61a5fef45c (diff)
downloadplus-eb37dba283cab99816c5d227ad3744a8bb19d2c2.tar.gz
plus-eb37dba283cab99816c5d227ad3744a8bb19d2c2.tar.bz2
plus-eb37dba283cab99816c5d227ad3744a8bb19d2c2.tar.xz
plus-eb37dba283cab99816c5d227ad3744a8bb19d2c2.zip
Simplify touch manager events.
Diffstat (limited to 'src/touchactions.cpp')
-rw-r--r--src/touchactions.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/touchactions.cpp b/src/touchactions.cpp
index b9d6b2fc9..df18fd366 100644
--- a/src/touchactions.cpp
+++ b/src/touchactions.cpp
@@ -35,16 +35,15 @@
bool padClicked(false);
-#ifdef ANDROID
-void showKeyboard(const MouseInput &mouseInput A_UNUSED)
+#define impHandler(name) void name(const MouseInput &mouseInput)
+#define impHandler0(name) void name(const MouseInput &mouseInput A_UNUSED)
+
+impHandler0(showKeyboard)
{
+#ifdef ANDROID
SDL_ANDROID_ToggleScreenKeyboardTextInput(nullptr);
-}
-#else
-void showKeyboard(const MouseInput &mouseInput A_UNUSED)
-{
-}
#endif
+}
static void moveChar(int x, int y)
{
@@ -112,13 +111,13 @@ static void moveChar(int x, int y)
}
}
-void padClick(const MouseInput &mouseInput)
+impHandler(padClick)
{
moveChar(mouseInput.getX(), mouseInput.getY());
padClicked = true;
}
-void padEvents(const MouseInput &mouseInput)
+impHandler(padEvents)
{
if (mouseInput.getType() == gcn::MouseInput::MOVED)
{
@@ -127,13 +126,13 @@ void padEvents(const MouseInput &mouseInput)
}
}
-void padOut(const MouseInput &mouseInput A_UNUSED)
+impHandler0(padOut)
{
padClicked = false;
moveChar(50, 50);
}
-void padUp(const MouseInput &mouseInput A_UNUSED)
+impHandler0(padUp)
{
padClicked = false;
moveChar(50, 50);