diff options
author | Eugene Sandulenko | 2016-05-23 08:22:34 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-05-23 08:22:34 +0200 |
commit | 5a4faf34f70138ed83269ae5904da9d457190fe9 (patch) | |
tree | d381bc712bcf779e9c535ad4852340e96f373845 /backends/platform | |
parent | f14c971313ce0eadb91123d55e01f8acf731ee18 (diff) | |
parent | 832d7bb289aef42f5eb48dc0495e1519f6bc5e71 (diff) | |
download | scummvm-rg350-5a4faf34f70138ed83269ae5904da9d457190fe9.tar.gz scummvm-rg350-5a4faf34f70138ed83269ae5904da9d457190fe9.tar.bz2 scummvm-rg350-5a4faf34f70138ed83269ae5904da9d457190fe9.zip |
Merge pull request #765 from mjg59/master
ANDROID: Add support for Leanback Launcher on Android TV
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/android/android.mk | 1 | ||||
-rw-r--r-- | backends/platform/android/events.cpp | 21 | ||||
-rw-r--r-- | backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java | 2 |
3 files changed, 23 insertions, 1 deletions
diff --git a/backends/platform/android/android.mk b/backends/platform/android/android.mk index e11ad0724e..68a2a34ae1 100644 --- a/backends/platform/android/android.mk +++ b/backends/platform/android/android.mk @@ -20,6 +20,7 @@ RESOURCES = \ $(PATH_BUILD_RES)/layout/main.xml \ $(PATH_BUILD_RES)/drawable/scummvm.png \ $(PATH_BUILD_RES)/drawable/scummvm_big.png \ + $(PATH_BUILD_RES)/drawable-xhdpi/leanback_icon.png \ $(PATH_BUILD_RES)/drawable-xhdpi/ouya_icon.png DIST_ANDROID_MK = $(PATH_DIST)/jni/Android.mk diff --git a/backends/platform/android/events.cpp b/backends/platform/android/events.cpp index 8039981a92..b146945a01 100644 --- a/backends/platform/android/events.cpp +++ b/backends/platform/android/events.cpp @@ -101,7 +101,9 @@ enum { JKEYCODE_MEDIA_NEXT = 87, JKEYCODE_MEDIA_PREVIOUS = 88, JKEYCODE_MEDIA_REWIND = 89, - JKEYCODE_MEDIA_FAST_FORWARD = 90 + JKEYCODE_MEDIA_FAST_FORWARD = 90, + JKEYCODE_MEDIA_PLAY = 126, + JKEYCODE_MEDIA_PAUSE = 127 }; // five-way navigation control @@ -380,6 +382,19 @@ void OSystem_Android::pushEvent(int type, int arg1, int arg2, int arg3, return; + case JKEYCODE_MEDIA_PAUSE: + case JKEYCODE_MEDIA_PLAY: + case JKEYCODE_MEDIA_PLAY_PAUSE: + if (arg1 == JACTION_DOWN) { + e.type = Common::EVENT_MAINMENU; + + lockMutex(_event_queue_lock); + _event_queue.push(e); + unlockMutex(_event_queue_lock); + } + + return; + case JKEYCODE_CAMERA: case JKEYCODE_SEARCH: if (arg1 == JACTION_DOWN) @@ -888,6 +903,10 @@ void OSystem_Android::pushEvent(int type, int arg1, int arg2, int arg3, e.kbd.ascii = Common::ASCII_ESCAPE; break; + case JKEYCODE_BUTTON_Y: + e.type = Common::EVENT_MAINMENU; + break; + default: LOGW("unmapped gamepad key: %d", arg2); return; diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java index 32c65d3395..e81000d8b1 100644 --- a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java +++ b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java @@ -119,6 +119,8 @@ public class ScummVMEvents implements case KeyEvent.KEYCODE_MENU: case KeyEvent.KEYCODE_CAMERA: case KeyEvent.KEYCODE_SEARCH: + case KeyEvent.KEYCODE_MEDIA_PLAY: + case KeyEvent.KEYCODE_MEDIA_PAUSE: break; default: |