diff --git a/RELEASE.md b/RELEASE.md index b3ce4ed..7599276 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -25,3 +25,4 @@ It does help this project on being supported. - Allow to change scroll direction - Debounce controller changes from Steam - Allow to select between touch keyboard or CTRL+WIN+O +- Fix haptics not being fired both sides diff --git a/SteamController/Devices/SteamControllerHaptic.cs b/SteamController/Devices/SteamControllerHaptic.cs index 0030d86..19a0254 100644 --- a/SteamController/Devices/SteamControllerHaptic.cs +++ b/SteamController/Devices/SteamControllerHaptic.cs @@ -62,11 +62,11 @@ namespace SteamController.Devices public SDCHapticPacket2() { } } - private Task? hapticTask; + private Task?[] hapticTask = new Task?[byte.MaxValue]; public bool SendHaptic(byte position, sbyte intensity) { - if (hapticTask?.IsCompleted == false) + if (hapticTask[position]?.IsCompleted == false) return false; var ts = Random.Shared.Next(); @@ -87,7 +87,7 @@ namespace SteamController.Devices try { Marshal.StructureToPtr(haptic, handle.AddrOfPinnedObject(), false); - hapticTask = neptuneDevice.RequestFeatureReportAsync(bytes); + hapticTask[position] = neptuneDevice.RequestFeatureReportAsync(bytes); return true; } catch (Exception e)