1
0
forked from Clones/Controlify

fix bugs:

fix reconnecting controllers are unidentified
fix some mod keybinds failing to register
fix crash with unmapped joysticks
This commit is contained in:
isXander
2023-05-02 12:30:34 +01:00
parent 4e076631a4
commit 681eabd90a
12 changed files with 57 additions and 10 deletions

View File

@ -105,6 +105,10 @@ public class ControllerHIDService {
}
}
public void unconsumeController(ControllerHIDInfo hid) {
hid.hidDevice.ifPresent(device -> attachedDevices.remove(device.getPath()));
}
private boolean isController(HidDevice device) {
boolean isControllerType = ControllerType.getTypeMap().containsKey(new HIDIdentifier(device.getVendorId(), device.getProductId()));
boolean isGenericDesktopControlOrGameControl = device.getUsagePage() == 0x1 || device.getUsagePage() == 0x5;