From 61c7cb31a2dfebfb32e12a139fc7e0cdc8483536 Mon Sep 17 00:00:00 2001 From: Ash Date: Thu, 13 Apr 2017 13:08:27 +1000 Subject: [PATCH] Add filtering for XInput devices --- .../ash/HIDToVPADNetworkClient/manager/ControllerManager.java | 2 ++ src/net/ash/HIDToVPADNetworkClient/util/Settings.java | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/net/ash/HIDToVPADNetworkClient/manager/ControllerManager.java b/src/net/ash/HIDToVPADNetworkClient/manager/ControllerManager.java index f8dbb68..4c11e84 100644 --- a/src/net/ash/HIDToVPADNetworkClient/manager/ControllerManager.java +++ b/src/net/ash/HIDToVPADNetworkClient/manager/ControllerManager.java @@ -167,6 +167,8 @@ public final class ControllerManager { private static Map detectXInputControllers() { Map result = new HashMap(); + if (!Settings.ControllerFiltering.getFilterState(Settings.ControllerFiltering.Type.XINPUT)) return result; + ControllerType type = ControllerType.XINPUT13; // Try and catch missing C++ redist diff --git a/src/net/ash/HIDToVPADNetworkClient/util/Settings.java b/src/net/ash/HIDToVPADNetworkClient/util/Settings.java index 43129a6..a24dc9a 100644 --- a/src/net/ash/HIDToVPADNetworkClient/util/Settings.java +++ b/src/net/ash/HIDToVPADNetworkClient/util/Settings.java @@ -211,7 +211,8 @@ public final class Settings { HIDKEYBOARD (1, "HID Keyboards", Platform.LINUX.mask | Platform.MAC_OS_X.mask), HIDMOUSE (2, "HID Mice", Platform.LINUX.mask | Platform.MAC_OS_X.mask), HIDOTHER (3, "Other HIDs", Platform.LINUX.mask | Platform.WINDOWS.mask | Platform.MAC_OS_X.mask), - LINUX (4, "Linux controllers", Platform.LINUX.mask); + LINUX (4, "Linux controllers", Platform.LINUX.mask), + XINPUT (5, "XInput controllers", Platform.WINDOWS.mask); private int index; @Getter private String name; @@ -253,6 +254,7 @@ public final class Settings { filterStates[Type.HIDMOUSE.index] = false; filterStates[Type.HIDOTHER.index] = false; filterStates[Type.LINUX.index] = true; + filterStates[Type.XINPUT.index] = true; } } }