mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-01-11 15:59:08 +01:00
Change main report routine to use custom delegate.
Remove the need to box and unbox data every gamepad poll. Seems to help with performance.
This commit is contained in:
parent
b94e5bbd76
commit
2497ced5d5
@ -404,7 +404,7 @@ namespace DS4Windows
|
||||
this.On_Report(sender, e, tempIdx);
|
||||
};
|
||||
|
||||
EventHandler<EventArgs> tempEvnt = (sender, args) =>
|
||||
DS4Device.ReportHandler<EventArgs> tempEvnt = (sender, args) =>
|
||||
{
|
||||
DualShockPadMeta padDetail = new DualShockPadMeta();
|
||||
GetPadDetailForIdx(tempIdx, ref padDetail);
|
||||
@ -620,7 +620,7 @@ namespace DS4Windows
|
||||
this.On_Report(sender, e, tempIdx);
|
||||
};
|
||||
|
||||
EventHandler<EventArgs> tempEvnt = (sender, args) =>
|
||||
DS4Device.ReportHandler<EventArgs> tempEvnt = (sender, args) =>
|
||||
{
|
||||
DualShockPadMeta padDetail = new DualShockPadMeta();
|
||||
GetPadDetailForIdx(tempIdx, ref padDetail);
|
||||
@ -1013,9 +1013,10 @@ namespace DS4Windows
|
||||
private string[] tempStrings = new string[4] { string.Empty, string.Empty, string.Empty, string.Empty };
|
||||
|
||||
// Called every time a new input report has arrived
|
||||
protected virtual void On_Report(object sender, EventArgs e, int ind)
|
||||
//protected virtual void On_Report(object sender, EventArgs e, int ind)
|
||||
protected virtual void On_Report(DS4Device device, EventArgs e, int ind)
|
||||
{
|
||||
DS4Device device = (DS4Device)sender;
|
||||
//DS4Device device = (DS4Device)sender;
|
||||
|
||||
if (ind != -1)
|
||||
{
|
||||
|
@ -184,11 +184,15 @@ namespace DS4Windows
|
||||
private bool exitInputThread = false;
|
||||
private object exitLocker = new object();
|
||||
|
||||
public event EventHandler<EventArgs> Report = null;
|
||||
public delegate void ReportHandler<TEventArgs>(DS4Device sender, TEventArgs args);
|
||||
|
||||
//public event EventHandler<EventArgs> Report = null;
|
||||
public event ReportHandler<EventArgs> Report = null;
|
||||
public event EventHandler<EventArgs> Removal = null;
|
||||
public event EventHandler<EventArgs> SyncChange = null;
|
||||
public event EventHandler<EventArgs> SerialChange = null;
|
||||
public EventHandler<EventArgs> MotionEvent = null;
|
||||
//public EventHandler<EventArgs> MotionEvent = null;
|
||||
public ReportHandler<EventArgs> MotionEvent = null;
|
||||
|
||||
public HidDevice HidDevice => hDevice;
|
||||
public bool IsExclusive => HidDevice.IsExclusive;
|
||||
|
Loading…
x
Reference in New Issue
Block a user