Added Quick Charge back in

This commit is contained in:
Travis Nickles 2019-12-20 20:08:27 -06:00
parent 5f0557123c
commit c4cdade076

View File

@ -491,6 +491,7 @@ namespace DS4Windows
device.SyncChange += this.On_SyncChange; device.SyncChange += this.On_SyncChange;
device.SyncChange += DS4Devices.UpdateSerial; device.SyncChange += DS4Devices.UpdateSerial;
device.SerialChange += this.On_SerialChange; device.SerialChange += this.On_SerialChange;
device.ChargingChanged += CheckQuickCharge;
touchPad[i] = new Mouse(i, device); touchPad[i] = new Mouse(i, device);
@ -616,6 +617,16 @@ namespace DS4Windows
return true; return true;
} }
private void CheckQuickCharge(object sender, EventArgs e)
{
DS4Device device = sender as DS4Device;
if (device.ConnectionType == ConnectionType.BT && getQuickCharge() &&
device.Charging)
{
device.DisconnectBT();
}
}
public bool Stop(bool showlog = true) public bool Stop(bool showlog = true)
{ {
if (running) if (running)
@ -754,6 +765,7 @@ namespace DS4Windows
device.SyncChange += this.On_SyncChange; device.SyncChange += this.On_SyncChange;
device.SyncChange += DS4Devices.UpdateSerial; device.SyncChange += DS4Devices.UpdateSerial;
device.SerialChange += this.On_SerialChange; device.SerialChange += this.On_SerialChange;
device.ChargingChanged += CheckQuickCharge;
touchPad[Index] = new Mouse(Index, device); touchPad[Index] = new Mouse(Index, device);