mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-01-02 23:00:23 +01:00
Fix haptics not being fired both sides
This commit is contained in:
parent
0a52c57d59
commit
6173c80bdd
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue