[Android] Do not catch gamepad dpad events

Geoffrey Métais git at videolan.org
Thu Mar 26 16:13:16 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Mar 26 15:18:12 2015 +0100| [4ca0c7cce630a9d3b0020360418b55d3c4ee86a7] | committer: Geoffrey Métais

Do not catch gamepad dpad events

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

 .../org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java   |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/vlc-android/tv/src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java b/vlc-android/tv/src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java
index d11704a..6060f0e 100644
--- a/vlc-android/tv/src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java
+++ b/vlc-android/tv/src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java
@@ -218,7 +218,9 @@ public class AudioPlayerActivity extends Activity implements AudioServiceControl
 
         InputDevice inputDevice = event.getDevice();
 
-        if (inputDevice == null)
+        float dpadx = event.getAxisValue(MotionEvent.AXIS_HAT_X);
+        float dpady = event.getAxisValue(MotionEvent.AXIS_HAT_Y);
+        if (inputDevice == null || Math.abs(dpadx) == 1.0f || Math.abs(dpady) == 1.0f)
             return false;
 
         float x = AndroidDevices.getCenteredAxis(event, inputDevice,



More information about the Android mailing list