From c4cdade0764633c11be9be8806d1fa36639b1ace Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Fri, 20 Dec 2019 20:08:27 -0600 Subject: [PATCH] Added Quick Charge back in --- DS4Windows/DS4Control/ControlService.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/DS4Windows/DS4Control/ControlService.cs b/DS4Windows/DS4Control/ControlService.cs index ac6eedf..d38f706 100644 --- a/DS4Windows/DS4Control/ControlService.cs +++ b/DS4Windows/DS4Control/ControlService.cs @@ -491,6 +491,7 @@ namespace DS4Windows device.SyncChange += this.On_SyncChange; device.SyncChange += DS4Devices.UpdateSerial; device.SerialChange += this.On_SerialChange; + device.ChargingChanged += CheckQuickCharge; touchPad[i] = new Mouse(i, device); @@ -616,6 +617,16 @@ namespace DS4Windows 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) { if (running) @@ -754,6 +765,7 @@ namespace DS4Windows device.SyncChange += this.On_SyncChange; device.SyncChange += DS4Devices.UpdateSerial; device.SerialChange += this.On_SerialChange; + device.ChargingChanged += CheckQuickCharge; touchPad[Index] = new Mouse(Index, device);