mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-01-11 15:59:08 +01:00
Only copy touchpad packet data when changed
This commit is contained in:
parent
2dc0950d63
commit
0410a27f51
@ -83,9 +83,9 @@ namespace DS4Windows
|
||||
bool changed = false;
|
||||
for (int i = 0, arLen = previousPacket.Length; !changed && i < arLen; i++)
|
||||
{
|
||||
byte oldValue = previousPacket[i];
|
||||
previousPacket[i] = data[i + TOUCHPAD_DATA_OFFSET + touchPacketOffset];
|
||||
if (previousPacket[i] != oldValue)
|
||||
//byte oldValue = previousPacket[i];
|
||||
//previousPacket[i] = data[i + TOUCHPAD_DATA_OFFSET + touchPacketOffset];
|
||||
if (previousPacket[i] != data[i + TOUCHPAD_DATA_OFFSET + touchPacketOffset])
|
||||
changed = true;
|
||||
}
|
||||
|
||||
@ -104,6 +104,7 @@ namespace DS4Windows
|
||||
return;
|
||||
}
|
||||
|
||||
Array.Copy(data, TOUCHPAD_DATA_OFFSET + touchPacketOffset, previousPacket, 0, 8);
|
||||
byte touchID1 = (byte)(data[0 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] & 0x7F);
|
||||
byte touchID2 = (byte)(data[4 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] & 0x7F);
|
||||
int currentX1 = ((data[2 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] & 0x0F) << 8) | data[1 + TOUCHPAD_DATA_OFFSET + touchPacketOffset];
|
||||
|
Loading…
x
Reference in New Issue
Block a user