Change event check for newly opened devices

This commit is contained in:
Travis Nickles 2017-04-30 06:39:09 -07:00
parent 242843ab99
commit 1821658455

View File

@ -4,10 +4,10 @@ using System.Linq;
using System.Text; using System.Text;
using System.IO; using System.IO;
using System.Reflection;
using System.Media; using System.Media;
using System.Threading.Tasks; using System.Threading.Tasks;
using static DS4Windows.Global; using static DS4Windows.Global;
namespace DS4Windows namespace DS4Windows
{ {
public class ControlService public class ControlService
@ -587,17 +587,16 @@ namespace DS4Windows
device.getPreviousState(PreviousState[ind]); device.getPreviousState(PreviousState[ind]);
DS4State pState = PreviousState[ind]; DS4State pState = PreviousState[ind];
if (pState.Battery != cState.Battery)
{
OnBatteryStatusChange(this, ind, cState.Battery);
//ControllerStatusChanged(this);
}
if (!device.firstReport && device.IsAlive()) if (!device.firstReport && device.IsAlive())
{ {
device.firstReport = true; device.firstReport = true;
OnDeviceStatusChanged(this, ind); OnDeviceStatusChanged(this, ind);
} }
else if (pState.Battery != cState.Battery)
{
OnBatteryStatusChange(this, ind, cState.Battery);
//ControllerStatusChanged(this);
}
if (getEnableTouchToggle(ind)) if (getEnableTouchToggle(ind))
{ {