Skip to content

Commit

Permalink
Added try/catch around autocenter
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Helander committed Dec 11, 2020
1 parent 374ba92 commit d8022a2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ForceFeedbackSharpDx/MicrosoftSidewinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,15 @@ public bool ForceFeedback2(string productGuid, string productName, bool AutoCent
return false;
}

// Autocenter on
joystick.Properties.AutoCenter = AutoCenter;
try
{
// Autocenter on
joystick.Properties.AutoCenter = AutoCenter;
}
catch (Exception _)
{
// Some devices do not support this setting.
}

// Acquire the joystick
joystick.Acquire();
Expand Down

0 comments on commit d8022a2

Please sign in to comment.