mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-29 20:44:20 +01:00
Make lastActive field matter for USB connections again. Related to issue #45.
This commit is contained in:
parent
9f554cf6c1
commit
19afe15937
@ -876,26 +876,32 @@ namespace DS4Windows
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ds4Idle = cState.FrameCounter == pState.FrameCounter;
|
bool ds4ActiveFrame = cState.FrameCounter == pState.FrameCounter;
|
||||||
if (!ds4Idle)
|
if (!ds4ActiveFrame)
|
||||||
{
|
{
|
||||||
isRemoved = false;
|
isRemoved = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conType == ConnectionType.USB)
|
if (conType == ConnectionType.USB)
|
||||||
|
{
|
||||||
|
if (idleTimeout == 0)
|
||||||
{
|
{
|
||||||
lastActive = utcNow;
|
lastActive = utcNow;
|
||||||
}
|
}
|
||||||
|
else if (!isDS4Idle())
|
||||||
|
{
|
||||||
|
lastActive = utcNow;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool shouldDisconnect = false;
|
bool shouldDisconnect = false;
|
||||||
int idleTime = idleTimeout;
|
if (!isRemoved && idleTimeout > 0)
|
||||||
if (!isRemoved && idleTime > 0)
|
|
||||||
{
|
{
|
||||||
bool idleInput = isDS4Idle();
|
bool idleInput = isDS4Idle();
|
||||||
if (idleInput)
|
if (idleInput)
|
||||||
{
|
{
|
||||||
DateTime timeout = lastActive + TimeSpan.FromSeconds(idleTime);
|
DateTime timeout = lastActive + TimeSpan.FromSeconds(idleTimeout);
|
||||||
if (!charging)
|
if (!charging)
|
||||||
shouldDisconnect = utcNow >= timeout;
|
shouldDisconnect = utcNow >= timeout;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user