diff options
author | dhewg | 2011-03-18 21:05:46 +0100 |
---|---|---|
committer | dhewg | 2011-03-18 21:53:25 +0100 |
commit | b7215472136c91841d44decd6955b4eb3e3e2ce1 (patch) | |
tree | a621b1e8ec1c6e91b8b363ed864d1ae16de1ab81 /backends/platform/android/events.cpp | |
parent | 004df22752b47e26f757100b6faac04dd7b707e0 (diff) | |
download | scummvm-rg350-b7215472136c91841d44decd6955b4eb3e3e2ce1.tar.gz scummvm-rg350-b7215472136c91841d44decd6955b4eb3e3e2ce1.tar.bz2 scummvm-rg350-b7215472136c91841d44decd6955b4eb3e3e2ce1.zip |
ANDROID: Implement trackball click
Diffstat (limited to 'backends/platform/android/events.cpp')
-rw-r--r-- | backends/platform/android/events.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/backends/platform/android/events.cpp b/backends/platform/android/events.cpp index cab09e04dd..da17b8ec32 100644 --- a/backends/platform/android/events.cpp +++ b/backends/platform/android/events.cpp @@ -569,15 +569,29 @@ void OSystem_Android::pushEvent(int type, int arg1, int arg2, int arg3, return; case JE_BALL: - e.type = Common::EVENT_MOUSEMOVE; - e.mouse = getEventManager()->getMousePos(); - // already multiplied by 100 - e.mouse.x += arg1 * _trackball_scale / _eventScaleX; - e.mouse.y += arg2 * _trackball_scale / _eventScaleY; + switch (arg1) { + case JACTION_DOWN: + e.type = Common::EVENT_LBUTTONDOWN; + break; + case JACTION_UP: + e.type = Common::EVENT_LBUTTONUP; + break; + case JACTION_MULTIPLE: + e.type = Common::EVENT_MOUSEMOVE; + + // already multiplied by 100 + e.mouse.x += arg2 * _trackball_scale / _eventScaleX; + e.mouse.y += arg3 * _trackball_scale / _eventScaleY; - clipMouse(e.mouse); + clipMouse(e.mouse); + + break; + default: + LOGE("unhandled jaction on system key: %d", arg1); + return; + } lockMutex(_event_queue_lock); _event_queue.push(e); |