mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-23 01:39:17 +01:00
parent
ecb271cfb1
commit
3e4a5c0562
@ -231,6 +231,13 @@ namespace DS4Windows
|
||||
for (int i = 0, devlen = devices.Count(); i < devlen; i++)
|
||||
{
|
||||
DS4Device device = devices.ElementAt<DS4Device>(i);
|
||||
|
||||
if (QuickCharge && device?.getConnectionType() == ConnectionType.BT && (bool)device?.isCharging())
|
||||
{
|
||||
device.DisconnectBT();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (device.isDisconnectingStatus())
|
||||
continue;
|
||||
|
||||
@ -278,6 +285,7 @@ namespace DS4Windows
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1572,7 +1572,7 @@ namespace DS4Windows
|
||||
ConnectionType deviceConn = d.getConnectionType();
|
||||
if (deviceConn == ConnectionType.BT)
|
||||
{
|
||||
d.DisconnectBT();
|
||||
d.DisconnectBT(false);
|
||||
}
|
||||
|
||||
//foreach (DS4Controls dc in action.trigger)
|
||||
|
@ -877,11 +877,6 @@ namespace DS4Windows
|
||||
{
|
||||
Pads[Index].Text = Program.rootHub.getDS4MacAddress(Index);
|
||||
DS4Device d = Program.rootHub.DS4Controllers[Index];
|
||||
if (QuickCharge && d?.getConnectionType() == ConnectionType.BT && (bool)d?.isCharging())
|
||||
{
|
||||
d.DisconnectBT();
|
||||
return;
|
||||
}
|
||||
|
||||
switch (Program.rootHub.getDS4Status(Index))
|
||||
{
|
||||
|
@ -410,6 +410,7 @@ namespace DS4Windows
|
||||
Console.WriteLine(e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
StopOutputUpdate();
|
||||
}
|
||||
|
||||
@ -705,7 +706,7 @@ namespace DS4Windows
|
||||
{
|
||||
if (conType == ConnectionType.BT)
|
||||
{
|
||||
if (DisconnectBT())
|
||||
if (DisconnectBT(false))
|
||||
return; // all done
|
||||
}
|
||||
else if (conType == ConnectionType.SONYWA)
|
||||
@ -814,7 +815,7 @@ namespace DS4Windows
|
||||
}
|
||||
}
|
||||
|
||||
public bool DisconnectBT()
|
||||
public bool DisconnectBT(bool allThreadsQuit = true)
|
||||
{
|
||||
if (Mac != null)
|
||||
{
|
||||
@ -851,7 +852,15 @@ namespace DS4Windows
|
||||
if(success)
|
||||
{
|
||||
IsDisconnecting = true;
|
||||
if (allThreadsQuit)
|
||||
{
|
||||
StopUpdate();
|
||||
}
|
||||
else
|
||||
{
|
||||
StopOutputUpdate();
|
||||
}
|
||||
|
||||
if (Removal != null)
|
||||
Removal(this, EventArgs.Empty);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user