Fixed a bug described in #664 issue where gyro mouse doesn't get correct properties (for example toggle option) right after Startup or Hotplug LoadProfile calls. The mouse object was created after LoadProfile function even when LoadProfile function tries to set few properties of that mouse object.

This commit is contained in:
mika-n 2019-04-23 12:32:12 +03:00
parent 4f87d24ee3
commit 456145cf8e

View File

@ -403,6 +403,9 @@ namespace DS4Windows
device.SyncChange += this.On_SyncChange;
device.SyncChange += DS4Devices.UpdateSerial;
device.SerialChange += this.On_SerialChange;
touchPad[i] = new Mouse(i, device);
if (!useTempProfile[i])
{
if (device.isValidSerial() && containsLinkedProfile(device.getMacAddress()))
@ -417,7 +420,6 @@ namespace DS4Windows
LoadProfile(i, false, this, false, false);
}
touchPad[i] = new Mouse(i, device);
device.LightBarColor = getMainColor(i);
if (!getDInputOnly(i) && device.isSynced())
@ -641,6 +643,9 @@ namespace DS4Windows
device.SyncChange += this.On_SyncChange;
device.SyncChange += DS4Devices.UpdateSerial;
device.SerialChange += this.On_SerialChange;
touchPad[Index] = new Mouse(Index, device);
if (!useTempProfile[Index])
{
if (device.isValidSerial() && containsLinkedProfile(device.getMacAddress()))
@ -655,7 +660,6 @@ namespace DS4Windows
LoadProfile(Index, false, this, false, false);
}
touchPad[Index] = new Mouse(Index, device);
device.LightBarColor = getMainColor(Index);
int tempIdx = Index;