diff options
author | Marcus Comstedt | 2013-08-08 14:08:30 +0200 |
---|---|---|
committer | Marcus Comstedt | 2013-08-08 14:08:30 +0200 |
commit | 1b69f8aedee240af79ea871c32a9caadc6a0dd98 (patch) | |
tree | 5eb2f2f79a8bb3bc559730b4d032064ebfa1e8e9 /backends/platform/android/org | |
parent | 9a888ed1c8b32a33a8dd91f0ff6c81ea7773e6ff (diff) | |
download | scummvm-rg350-1b69f8aedee240af79ea871c32a9caadc6a0dd98.tar.gz scummvm-rg350-1b69f8aedee240af79ea871c32a9caadc6a0dd98.tar.bz2 scummvm-rg350-1b69f8aedee240af79ea871c32a9caadc6a0dd98.zip |
ANDROID: Add gamepad button support
Diffstat (limited to 'backends/platform/android/org')
-rw-r--r-- | backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java index 5f51ffac6c..9278e7ff1c 100644 --- a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java +++ b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java @@ -31,6 +31,7 @@ public class ScummVMEvents implements public static final int JE_RMB_DOWN = 11; public static final int JE_RMB_UP = 12; public static final int JE_MOUSE_MOVE = 13; + public static final int JE_GAMEPAD = 14; public static final int JE_QUIT = 0x1000; final protected Context _context; @@ -177,6 +178,25 @@ public class ScummVMEvents implements (int)(e.getEventTime() - e.getDownTime()), e.getRepeatCount(), 0); return true; + case KeyEvent.KEYCODE_BUTTON_A: + case KeyEvent.KEYCODE_BUTTON_B: + case KeyEvent.KEYCODE_BUTTON_C: + case KeyEvent.KEYCODE_BUTTON_X: + case KeyEvent.KEYCODE_BUTTON_Y: + case KeyEvent.KEYCODE_BUTTON_Z: + case KeyEvent.KEYCODE_BUTTON_L1: + case KeyEvent.KEYCODE_BUTTON_R1: + case KeyEvent.KEYCODE_BUTTON_L2: + case KeyEvent.KEYCODE_BUTTON_R2: + case KeyEvent.KEYCODE_BUTTON_THUMBL: + case KeyEvent.KEYCODE_BUTTON_THUMBR: + case KeyEvent.KEYCODE_BUTTON_START: + case KeyEvent.KEYCODE_BUTTON_SELECT: + case KeyEvent.KEYCODE_BUTTON_MODE: + _scummvm.pushEvent(JE_GAMEPAD, action, keyCode, + (int)(e.getEventTime() - e.getDownTime()), + e.getRepeatCount(), 0); + return true; } _scummvm.pushEvent(JE_KEY, action, keyCode, |