mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-01-25 22:41:16 +01:00
Nacon Revolution Pro support
This commit is contained in:
parent
81b58fd90a
commit
e3f1d9dc1d
@ -32,8 +32,9 @@ namespace DS4Windows
|
|||||||
{
|
{
|
||||||
lock (Devices)
|
lock (Devices)
|
||||||
{
|
{
|
||||||
int[] pid = { 0xBA0, 0x5C4, 0x09CC };
|
int[] vid = { 0x054C, 0x146B };
|
||||||
IEnumerable<HidDevice> hDevices = HidDevices.Enumerate(0x054C, pid);
|
int[] pid = { 0xBA0, 0x5C4, 0x09CC, 0x0D01 };
|
||||||
|
IEnumerable<HidDevice> hDevices = HidDevices.Enumerate(vid, pid);
|
||||||
// Sort Bluetooth first in case USB is also connected on the same controller.
|
// Sort Bluetooth first in case USB is also connected on the same controller.
|
||||||
hDevices = hDevices.OrderBy<HidDevice, ConnectionType>((HidDevice d) => { return DS4Device.HidConnectionType(d); });
|
hDevices = hDevices.OrderBy<HidDevice, ConnectionType>((HidDevice d) => { return DS4Device.HidConnectionType(d); });
|
||||||
|
|
||||||
@ -46,7 +47,9 @@ namespace DS4Windows
|
|||||||
//foreach (HidDevice hDevice in hDevices)
|
//foreach (HidDevice hDevice in hDevices)
|
||||||
{
|
{
|
||||||
HidDevice hDevice = tempList[i];
|
HidDevice hDevice = tempList[i];
|
||||||
if (DevicePaths.Contains(hDevice.DevicePath))
|
if (hDevice.Description == "HID-compliant vendor-defined device")
|
||||||
|
continue; // ignore the Nacon Revolution Pro programming interface
|
||||||
|
else if (DevicePaths.Contains(hDevice.DevicePath))
|
||||||
continue; // BT/USB endpoint already open once
|
continue; // BT/USB endpoint already open once
|
||||||
|
|
||||||
if (!hDevice.IsOpen)
|
if (!hDevice.IsOpen)
|
||||||
|
@ -36,6 +36,12 @@ namespace DS4Windows
|
|||||||
productIds.Contains(x.Attributes.ProductId));
|
productIds.Contains(x.Attributes.ProductId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IEnumerable<HidDevice> Enumerate(int[] vendorIds, params int[] productIds)
|
||||||
|
{
|
||||||
|
return EnumerateDevices().Select(x => new HidDevice(x.Path, x.Description)).Where(x => vendorIds.Contains(x.Attributes.VendorId) &&
|
||||||
|
productIds.Contains(x.Attributes.ProductId));
|
||||||
|
}
|
||||||
|
|
||||||
public static IEnumerable<HidDevice> Enumerate(int vendorId)
|
public static IEnumerable<HidDevice> Enumerate(int vendorId)
|
||||||
{
|
{
|
||||||
return EnumerateDevices().Select(x => new HidDevice(x.Path, x.Description)).Where(x => x.Attributes.VendorId == vendorId);
|
return EnumerateDevices().Select(x => new HidDevice(x.Path, x.Description)).Where(x => x.Attributes.VendorId == vendorId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user