1
0
forked from Clones/Controlify

compound binds, complete vanilla compat, better vmouse screen handling, controller uuid, beta notice screen, configurable movement keys, vmouse shift key, icon, optimize controller save/load

This commit is contained in:
isXander
2023-02-05 14:55:20 +00:00
parent 9c7972c971
commit 6c5108469c
62 changed files with 831 additions and 137 deletions

View File

@ -1,6 +1,7 @@
package dev.isxander.controlify.controller.hid;
import dev.isxander.controlify.Controlify;
import dev.isxander.controlify.controller.ControllerType;
import org.hid4java.*;
import org.hid4java.event.HidServicesEvent;
@ -35,7 +36,7 @@ public class ControllerHIDService implements HidServicesListener {
services.start();
}
public void awaitNextDevice(Consumer<HidDevice> consumer) {
public void awaitNextController(Consumer<HidDevice> consumer) {
deviceQueue.add(consumer);
}
@ -46,6 +47,8 @@ public class ControllerHIDService implements HidServicesListener {
if (isController(device)) {
if (deviceQueue.peek() != null) {
deviceQueue.poll().accept(event.getHidDevice());
} else {
Controlify.LOGGER.error("Unhandled controller: " + ControllerType.getTypeForHID(new HIDIdentifier(device.getVendorId(), device.getProductId())).friendlyName());
}
}
}