mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-12-27 17:11:48 +01:00
Use array to specify compatible vids
This commit is contained in:
parent
212ae71d4e
commit
076b1d0839
@ -37,8 +37,9 @@ namespace DS4Windows
|
||||
{
|
||||
lock (Devices)
|
||||
{
|
||||
int[] vids = { 0x054C };
|
||||
int[] pid = { 0xBA0, 0x5C4, 0x09CC };
|
||||
IEnumerable<HidDevice> hDevices = HidDevices.Enumerate(0x054C, pid);
|
||||
IEnumerable<HidDevice> hDevices = HidDevices.Enumerate(vids, pid);
|
||||
// Sort Bluetooth first in case USB is also connected on the same controller.
|
||||
hDevices = hDevices.OrderBy<HidDevice, ConnectionType>((HidDevice d) => { return DS4Device.HidConnectionType(d); });
|
||||
|
||||
|
@ -36,6 +36,12 @@ namespace DS4Windows
|
||||
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)
|
||||
{
|
||||
return EnumerateDevices().Select(x => new HidDevice(x.Path, x.Description)).Where(x => x.Attributes.VendorId == vendorId);
|
||||
|
Loading…
Reference in New Issue
Block a user