From 53594ada666e32eff88d7a51917d3b40e06445f1 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 19 Nov 2014 23:27:10 -0800 Subject: [PATCH] Disable the Android TV controller hack for now --- .../binding/input/ControllerHandler.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/limelight/binding/input/ControllerHandler.java b/app/src/main/java/com/limelight/binding/input/ControllerHandler.java index 459fbf02..6dadce3b 100644 --- a/app/src/main/java/com/limelight/binding/input/ControllerHandler.java +++ b/app/src/main/java/com/limelight/binding/input/ControllerHandler.java @@ -171,16 +171,23 @@ public class ControllerHandler { mapping.rightStickDeadzoneRadius = (float) stickDeadzone; } + /* + FIXME: This is broken on SHIELD + // This path will make the back button function as start for Android TV controllers // that don't have a real start button. It's fine being KitKat and above because // ATV is a 5.0 platform if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) { - // Check if this controller has a start or menu button - boolean[] hasStartKey = dev.hasKeys(KeyEvent.KEYCODE_BUTTON_START, KeyEvent.KEYCODE_MENU, 0); - if (!hasStartKey[0] && !hasStartKey[1]) { - mapping.backIsStart = true; + // Make sure this is a gamepad and not some other device + if ((dev.getSources() & InputDevice.SOURCE_GAMEPAD) != 0) { + // Check if this controller has a start or menu button + boolean[] hasStartKey = dev.hasKeys(KeyEvent.KEYCODE_BUTTON_START, KeyEvent.KEYCODE_MENU, 0); + if (!hasStartKey[0] && !hasStartKey[1]) { + mapping.backIsStart = true; + } } } + */ return mapping; }