[Android] Verifiy motionEvent is from a joystick

Geoffrey Métais git at videolan.org
Wed Dec 17 12:18:45 CET 2014


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Dec 17 12:17:02 2014 +0100| [fff958ec74f02320d4e1b1a75f3275b2863e4253] | committer: Geoffrey Métais

Verifiy motionEvent is from a joystick

Fixes mouse clicks triggering seek calls

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

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

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 1872c6e..4cd07c4 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -752,6 +752,11 @@ public class VideoPlayerActivity extends ActionBarActivity implements IVideoPlay
 
     @TargetApi(12) //only active for Android 3.1+
     public boolean dispatchGenericMotionEvent(MotionEvent event){
+        //Check for a joystick event
+        if ((event.getSource() & InputDevice.SOURCE_JOYSTICK) !=
+                InputDevice.SOURCE_JOYSTICK ||
+                event.getAction() != MotionEvent.ACTION_MOVE)
+            return false;
 
 		InputDevice mInputDevice = event.getDevice();
 



More information about the Android mailing list