summaryrefslogtreecommitdiff
path: root/src/gui/sdlinput.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-10-07 23:21:38 +0300
committerAndrei Karas <akaras@inbox.ru>2013-10-07 23:22:37 +0300
commitdfdd2555a2816af800c2e999bf45de9d8bd884a8 (patch)
tree553bfedc80e6fd0e10461e900e0de03948c4d06a /src/gui/sdlinput.cpp
parent4776e0efe9859d623939ffd48b95d9ca5fb8969a (diff)
downloadManaVerse-dfdd2555a2816af800c2e999bf45de9d8bd884a8.tar.gz
ManaVerse-dfdd2555a2816af800c2e999bf45de9d8bd884a8.tar.bz2
ManaVerse-dfdd2555a2816af800c2e999bf45de9d8bd884a8.tar.xz
ManaVerse-dfdd2555a2816af800c2e999bf45de9d8bd884a8.zip
emulate right click with SDL2 by multitouch two fingers click.
Diffstat (limited to 'src/gui/sdlinput.cpp')
-rw-r--r--src/gui/sdlinput.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gui/sdlinput.cpp b/src/gui/sdlinput.cpp
index c869cd99b..3dcbd4caa 100644
--- a/src/gui/sdlinput.cpp
+++ b/src/gui/sdlinput.cpp
@@ -529,3 +529,19 @@ int SDLInput::convertKeyCharacter(const SDL_Event &event)
}
return value;
}
+
+void SDLInput::simulateMouseClick(const int x, const int y,
+ const unsigned int button)
+{
+ MouseInput mouseInput;
+ mouseInput.setX(x);
+ mouseInput.setY(y);
+ mouseInput.setReal(x, y);
+ mouseInput.setButton(button);
+ mouseInput.setType(gcn::MouseInput::PRESSED);
+ mouseInput.setTimeStamp(SDL_GetTicks());
+ mMouseInputQueue.push(mouseInput);
+ mouseInput.setType(gcn::MouseInput::RELEASED);
+ mouseInput.setTimeStamp(SDL_GetTicks());
+ mMouseInputQueue.push(mouseInput);
+}