mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-02-02 18:12:32 +01:00
Only read one touch packet
This commit is contained in:
parent
633b0d224f
commit
272eba4432
@ -959,22 +959,21 @@ namespace DS4Windows
|
||||
bool skipHotplug = false;
|
||||
bool inHotPlug = false;
|
||||
protected override void WndProc(ref Message m)
|
||||
{
|
||||
if (runHotPlug)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (m.Msg == ScpDevice.WM_DEVICECHANGE)
|
||||
{
|
||||
if (runHotPlug)
|
||||
{
|
||||
Int32 Type = m.WParam.ToInt32();
|
||||
|
||||
InnerHotplug2();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
if (m.Msg == WM_QUERYENDSESSION)
|
||||
systemShutdown = true;
|
||||
}
|
||||
|
||||
// If this is WM_QUERYENDSESSION, the closing event should be
|
||||
// raised in the base WndProc.
|
||||
@ -997,7 +996,6 @@ namespace DS4Windows
|
||||
|
||||
protected async void InnerHotplug2()
|
||||
{
|
||||
|
||||
await System.Threading.Tasks.Task.Delay(50);
|
||||
|
||||
if (inHotPlug)
|
||||
|
@ -668,7 +668,10 @@ namespace DS4Windows
|
||||
// XXX DS4State mapping needs fixup, turn touches into an array[4] of structs. And include the touchpad details there instead.
|
||||
try
|
||||
{
|
||||
for (int touches = inputReport[-1 + DS4Touchpad.TOUCHPAD_DATA_OFFSET - 1], touchOffset = 0; touches > 0; touches--, touchOffset += 9)
|
||||
// Only care if one touch packet is detected. Other touch packets
|
||||
// don't seem to contain relevant data. ds4drv does not use them either.
|
||||
for (int touches = Math.Max((int)(inputReport[-1 + DS4Touchpad.TOUCHPAD_DATA_OFFSET - 1]), 1), touchOffset = 0; touches > 0; touches--, touchOffset += 9)
|
||||
//for (int touches = inputReport[-1 + DS4Touchpad.TOUCHPAD_DATA_OFFSET - 1], touchOffset = 0; touches > 0; touches--, touchOffset += 9)
|
||||
{
|
||||
cState.TouchPacketCounter = inputReport[-1 + DS4Touchpad.TOUCHPAD_DATA_OFFSET + touchOffset];
|
||||
cState.Touch1 = (inputReport[0 + DS4Touchpad.TOUCHPAD_DATA_OFFSET + touchOffset] >> 7) != 0 ? false : true; // >= 1 touch detected
|
||||
|
Loading…
x
Reference in New Issue
Block a user