summaryrefslogtreecommitdiff
path: root/Source/Android/app/src/main/java/org
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2017-12-19 09:55:57 +0100
committerGitHub <noreply@github.com>2017-12-19 09:55:57 +0100
commitf5477036604d5ee6a2b9a0d3e315c66cce07fc55 (patch)
tree0744447b739a3000fc0eea80ebc9a1fbaad40414 /Source/Android/app/src/main/java/org
parented13a8d7a7a43e4a6869fd4de6fcad641a1e66be (diff)
parent0067bf1b3ec07139854f15c113468abd1e582e39 (diff)
Merge pull request #6224 from hackbar/input-fix-moga
Android: Handle missing mappings for the Moga Pro 2 HID controller.
Diffstat (limited to 'Source/Android/app/src/main/java/org')
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ControllerMappingHelper.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ControllerMappingHelper.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ControllerMappingHelper.java
index 1cdc07604a..69edc7a448 100644
--- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ControllerMappingHelper.java
+++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ControllerMappingHelper.java
@@ -45,6 +45,14 @@ public class ControllerMappingHelper
return 0.0f;
}
}
+ else if (isMogaPro2Hid(inputDevice))
+ {
+ // This controller has a broken axis that reports a constant value. Ignore it.
+ if (axis == MotionEvent.AXIS_GENERIC_1)
+ {
+ return 0.0f;
+ }
+ }
return value;
}
@@ -59,4 +67,10 @@ public class ControllerMappingHelper
// Microsoft Xbox One controller
return inputDevice.getVendorId() == 0x45e && inputDevice.getProductId() == 0x2e0;
}
+
+ private boolean isMogaPro2Hid(InputDevice inputDevice)
+ {
+ // Moga Pro 2 HID
+ return inputDevice.getVendorId() == 0x20d6 && inputDevice.getProductId() == 0x6271;
+ }
}