/// <summary> /// Tries to configure input based on productID & vendorID /// </summary> /// <param name="device">Device to check against</param> /// <param name="configurations">Configurations to test against device</param> /// <returns>Index of configuration</returns> public static int FindHardwareConfiguration(DeviceBase device, GamepadHardwareConfiguration[] configurations) { if (device == null || configurations == null) { return(-1); } for (int i = 0; i != configurations.Length; ++i) { if (configurations[i].productID == device.productID && (configurations[i].vendorID == 0 || configurations[i].vendorID == device.vendorID)) { return(i); } } return(-1); }
public Gamepad(DeviceBase device) { this.device = device; device.UpdateAbstractionCallback += Device_UpdateAbstractionCallback; }