From d8022a2ec9182a3a4efa361e8934e2116929779d Mon Sep 17 00:00:00 2001 From: Bob Helander Date: Thu, 10 Dec 2020 18:29:01 -0700 Subject: [PATCH] Added try/catch around autocenter --- ForceFeedbackSharpDx/MicrosoftSidewinder.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ForceFeedbackSharpDx/MicrosoftSidewinder.cs b/ForceFeedbackSharpDx/MicrosoftSidewinder.cs index 34c132f..a416256 100644 --- a/ForceFeedbackSharpDx/MicrosoftSidewinder.cs +++ b/ForceFeedbackSharpDx/MicrosoftSidewinder.cs @@ -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();