Add filtering for XInput devices

This commit is contained in:
Ash 2017-04-13 13:08:27 +10:00
parent 39e8459840
commit 61c7cb31a2
2 changed files with 5 additions and 1 deletions

View File

@ -167,6 +167,8 @@ public final class ControllerManager {
private static Map<String, ControllerType> detectXInputControllers() {
Map<String, ControllerType> result = new HashMap<String, ControllerType>();
if (!Settings.ControllerFiltering.getFilterState(Settings.ControllerFiltering.Type.XINPUT)) return result;
ControllerType type = ControllerType.XINPUT13;
// Try and catch missing C++ redist

View File

@ -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;
}
}
}