mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-02-09 05:03:25 +01:00
Only read one touch packet
This commit is contained in:
parent
633b0d224f
commit
272eba4432
@ -960,21 +960,20 @@ namespace DS4Windows
|
|||||||
bool inHotPlug = false;
|
bool inHotPlug = false;
|
||||||
protected override void WndProc(ref Message m)
|
protected override void WndProc(ref Message m)
|
||||||
{
|
{
|
||||||
if (runHotPlug)
|
try
|
||||||
{
|
{
|
||||||
try
|
if (m.Msg == ScpDevice.WM_DEVICECHANGE)
|
||||||
{
|
{
|
||||||
if (m.Msg == ScpDevice.WM_DEVICECHANGE)
|
if (runHotPlug)
|
||||||
{
|
{
|
||||||
Int32 Type = m.WParam.ToInt32();
|
Int32 Type = m.WParam.ToInt32();
|
||||||
|
|
||||||
InnerHotplug2();
|
InnerHotplug2();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch { }
|
|
||||||
if (m.Msg == WM_QUERYENDSESSION)
|
|
||||||
systemShutdown = true;
|
|
||||||
}
|
}
|
||||||
|
catch { }
|
||||||
|
if (m.Msg == WM_QUERYENDSESSION)
|
||||||
|
systemShutdown = true;
|
||||||
|
|
||||||
// If this is WM_QUERYENDSESSION, the closing event should be
|
// If this is WM_QUERYENDSESSION, the closing event should be
|
||||||
// raised in the base WndProc.
|
// raised in the base WndProc.
|
||||||
@ -997,7 +996,6 @@ namespace DS4Windows
|
|||||||
|
|
||||||
protected async void InnerHotplug2()
|
protected async void InnerHotplug2()
|
||||||
{
|
{
|
||||||
|
|
||||||
await System.Threading.Tasks.Task.Delay(50);
|
await System.Threading.Tasks.Task.Delay(50);
|
||||||
|
|
||||||
if (inHotPlug)
|
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.
|
// XXX DS4State mapping needs fixup, turn touches into an array[4] of structs. And include the touchpad details there instead.
|
||||||
try
|
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.TouchPacketCounter = inputReport[-1 + DS4Touchpad.TOUCHPAD_DATA_OFFSET + touchOffset];
|
||||||
cState.Touch1 = (inputReport[0 + DS4Touchpad.TOUCHPAD_DATA_OFFSET + touchOffset] >> 7) != 0 ? false : true; // >= 1 touch detected
|
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