diff options
author | Marcus Comstedt | 2013-08-08 15:16:06 +0200 |
---|---|---|
committer | Marcus Comstedt | 2013-08-08 15:16:06 +0200 |
commit | bb39cbcba4a3ca8d16b1589e2d07a4325076b01b (patch) | |
tree | f20ae1cd2573f77fb5f9c3a73a478271b626c30c /backends/platform/android/org | |
parent | a50ede203b0424d800d2a1d4460121f9f1de8e7a (diff) | |
download | scummvm-rg350-bb39cbcba4a3ca8d16b1589e2d07a4325076b01b.tar.gz scummvm-rg350-bb39cbcba4a3ca8d16b1589e2d07a4325076b01b.tar.bz2 scummvm-rg350-bb39cbcba4a3ca8d16b1589e2d07a4325076b01b.zip |
ANDROID: Enter main menu on middle mouse press
Diffstat (limited to 'backends/platform/android/org')
-rw-r--r-- | backends/platform/android/org/scummvm/scummvm/MouseHelper.java | 18 | ||||
-rw-r--r-- | backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/backends/platform/android/org/scummvm/scummvm/MouseHelper.java b/backends/platform/android/org/scummvm/scummvm/MouseHelper.java index 999815593f..8990515b84 100644 --- a/backends/platform/android/org/scummvm/scummvm/MouseHelper.java +++ b/backends/platform/android/org/scummvm/scummvm/MouseHelper.java @@ -14,6 +14,7 @@ public class MouseHelper { private long _rmbGuardTime; private boolean _rmbPressed; private boolean _lmbPressed; + private boolean _mmbPressed; /** * Class initialization fails when this throws an exception. @@ -114,6 +115,23 @@ public class MouseHelper { _rmbPressed = false; } + boolean mmbDown = (buttonState & MotionEvent.BUTTON_TERTIARY) == MotionEvent.BUTTON_TERTIARY; + if (mmbDown) { + if (!_mmbPressed) { + // middle mouse button was pressed just now + _scummvm.pushEvent(ScummVMEvents.JE_MMB_DOWN, (int)e.getX(), (int)e.getY(), e.getButtonState(), 0, 0); + } + + _mmbPressed = true; + } else { + if (_mmbPressed) { + // middle mouse button was released just now + _scummvm.pushEvent(ScummVMEvents.JE_MMB_UP, (int)e.getX(), (int)e.getY(), e.getButtonState(), 0, 0); + } + + _mmbPressed = false; + } + return true; } diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java index 21f177f0c7..702215341b 100644 --- a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java +++ b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java @@ -34,6 +34,8 @@ public class ScummVMEvents implements public static final int JE_MOUSE_MOVE = 13; public static final int JE_GAMEPAD = 14; public static final int JE_JOYSTICK = 15; + public static final int JE_MMB_DOWN = 16; + public static final int JE_MMB_UP = 17; public static final int JE_QUIT = 0x1000; final protected Context _context; |