[Android] Handle B gamepad button has cancel button

Geoffrey Métais git at videolan.org
Thu Apr 23 15:33:35 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Apr 23 15:30:25 2015 +0200| [3ac1e854c6a9529b5a4f28c2f2939acddc84fa85] | committer: Geoffrey Métais

Handle B gamepad button has cancel button

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=3ac1e854c6a9529b5a4f28c2f2939acddc84fa85
---

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java       |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 2f900ed..d546a78 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -944,8 +944,9 @@ public class VideoPlayerActivity extends ActionBarActivity implements IVideoPlay
 
     @Override
     public boolean onKeyDown(int keyCode, KeyEvent event) {
-        if (keyCode != KeyEvent.KEYCODE_BACK)
-            showOverlayTimeout(OVERLAY_TIMEOUT);
+        if (keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_BUTTON_B)
+            return super.onKeyDown(keyCode, event);
+        showOverlayTimeout(OVERLAY_TIMEOUT);
         switch (keyCode) {
         case KeyEvent.KEYCODE_F:
         case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD:



More information about the Android mailing list