Add special Start and Select mappings for the ROG Kunai

This commit is contained in:
Cameron Gutman
2020-04-15 23:47:09 -07:00
parent 11dde835d1
commit 7d03203d83
3 changed files with 46 additions and 6 deletions

View File

@@ -3,6 +3,8 @@ package com.limelight.binding.input.driver;
public abstract class AbstractController {
private final int deviceId;
private final int vendorId;
private final int productId;
private UsbDriverListener listener;
@@ -15,6 +17,14 @@ public abstract class AbstractController {
return deviceId;
}
public int getVendorId() {
return vendorId;
}
public int getProductId() {
return productId;
}
protected void setButtonFlag(int buttonFlag, int data) {
if (data != 0) {
buttonFlags |= buttonFlag;
@@ -32,9 +42,11 @@ public abstract class AbstractController {
public abstract boolean start();
public abstract void stop();
public AbstractController(int deviceId, UsbDriverListener listener) {
public AbstractController(int deviceId, UsbDriverListener listener, int vendorId, int productId) {
this.deviceId = deviceId;
this.listener = listener;
this.vendorId = vendorId;
this.productId = productId;
}
public abstract void rumble(short lowFreqMotor, short highFreqMotor);

View File

@@ -22,7 +22,7 @@ public abstract class AbstractXboxController extends AbstractController {
protected UsbEndpoint inEndpt, outEndpt;
public AbstractXboxController(UsbDevice device, UsbDeviceConnection connection, int deviceId, UsbDriverListener listener) {
super(deviceId, listener);
super(deviceId, listener, device.getVendorId(), device.getProductId());
this.device = device;
this.connection = connection;
}