Skip to content

Commit 31aa2a6

Browse files
committed
More stability fixes
1 parent 55eac8a commit 31aa2a6

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

VKB/VKBConnectionHandler.cs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,15 @@ public void Startup(Object sender, EventArgs e)
1919
DeviceList.Local.Changed += DevicesChanged;
2020
foreach (HidDevice dev in DevList)
2121
{
22-
if (dev.GetReportDescriptor().FeatureReports.Count() > 0)
23-
Devices.Add(new VKBDevice(dev));
22+
try
23+
{
24+
if (dev.GetReportDescriptor().FeatureReports.Count() > 0)
25+
Devices.Add(new VKBDevice(dev));
26+
}
27+
catch(NotSupportedException)
28+
{
29+
// Ignore virtual controllers and the likes
30+
}
2431
}
2532
}
2633
public void DevicesChanged(Object sender, EventArgs e)
@@ -39,8 +46,15 @@ public void DevicesChanged(Object sender, EventArgs e)
3946
{
4047
if(Devices.Find(d => d.HidDev == dev) == null)
4148
{
42-
if (dev.GetReportDescriptor().FeatureReports.Count() > 0)
43-
Devices.Add(new VKBDevice(dev));
49+
try
50+
{
51+
if (dev.GetReportDescriptor().FeatureReports.Count() > 0)
52+
Devices.Add(new VKBDevice(dev));
53+
}
54+
catch (NotSupportedException)
55+
{
56+
// Ignore virtual controllers and the likes
57+
}
4458
}
4559
}
4660
}

0 commit comments

Comments
 (0)