Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update GameControllerDirectInput.cs
fixes SharpDX error
  • Loading branch information
w0wca7a authored Jun 25, 2025
commit f8150d4441008649236ddfceeff2675f0e6fe95c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ public GameControllerDirectInput(InputSourceWindowsDirectInput source, DirectInp
Id = instance.InstanceGuid;
ProductId = instance.ProductGuid;
joystick = new DirectInputJoystick(directInput, instance.InstanceGuid);
joystick.SetCooperativeLevel(IntPtr.Zero, CooperativeLevel.NonExclusive | CooperativeLevel.Foreground);
var descriptor = RawInput.Win32.GetForegroundWindow();

if (descriptor != IntPtr.Zero)
joystick.SetCooperativeLevel(descriptor, CooperativeLevel.NonExclusive | CooperativeLevel.Background);
var objects = joystick.GetObjects();

int sliderCount = 0;
Expand Down