mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-12-02 14:04:21 +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)
|
lock (Devices)
|
||||||
{
|
{
|
||||||
|
int[] vids = { 0x054C };
|
||||||
int[] pid = { 0xBA0, 0x5C4, 0x09CC };
|
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.
|
// 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); });
|
||||||
|
|
||||||
|
@ -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…
Reference in New Issue
Block a user