Skip to content

Commit

Permalink
changing submitreport call order
Browse files Browse the repository at this point in the history
  • Loading branch information
Valkirie committed Jan 10, 2022
1 parent 316cf6b commit 4893b0f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ControllerService/ControllerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ private void UpdateVirtualController(HIDmode mode)
throw new InvalidOperationException();
}

VirtualTarget.Submited += OnTargetSubmited;
VirtualTarget.Updated += OnTargetSubmited;
VirtualTarget.Connected += OnTargetConnected;
// VirtualTarget.Disconnected += OnTargetDisconnected;

Expand Down
4 changes: 2 additions & 2 deletions ControllerService/Targets/DualShock4Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ public override unsafe void UpdateReport(object sender, ElapsedEventArgs e)

DS4OutDeviceExtras.CopyBytes(ref outDS4Report, rawOutReportEx);
virtualController.SubmitRawReport(rawOutReportEx);

base.SubmitReport();
}

base.SubmitReport();
}
}
}
5 changes: 3 additions & 2 deletions ControllerService/Targets/ViGEmTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void Girometer_ReadingChanged(XInputGirometer sender, Vector3 e)
protected short LeftThumbX, LeftThumbY, RightThumbX, RightThumbY;
public Timer UpdateTimer;

public event SubmitedEventHandler Submited;
public event SubmitedEventHandler Updated;
public delegate void SubmitedEventHandler(ViGEmTarget target);

public event ConnectedEventHandler Connected;
Expand Down Expand Up @@ -161,6 +161,8 @@ public virtual void Disconnect()

public virtual unsafe void UpdateReport(object sender, ElapsedEventArgs e)
{
Updated?.Invoke(this);

lock (updateLock)
{
// update timestamp
Expand Down Expand Up @@ -208,7 +210,6 @@ public virtual unsafe void UpdateReport(object sender, ElapsedEventArgs e)

internal void SubmitReport()
{
Submited?.Invoke(this);

// force null position to avoid drifting ?
AngularVelocity = new();
Expand Down
4 changes: 2 additions & 2 deletions ControllerService/Targets/Xbox360Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ public override unsafe void UpdateReport(object sender, ElapsedEventArgs e)
virtualController.SetSliderValue(Xbox360Slider.RightTrigger, Gamepad.RightTrigger);

virtualController.SubmitReport();

base.SubmitReport();
}

base.SubmitReport();
}
}
}

0 comments on commit 4893b0f

Please sign in to comment.