diff --git a/.gitignore b/.gitignore index 1bc915c..2f72fc4 100644 --- a/.gitignore +++ b/.gitignore @@ -97,7 +97,7 @@ publish/ # NuGet Packages Directory ## TODO: If you have NuGet Package Restore enabled, uncomment the next line -#packages/ +packages/ # Windows Azure Build Output csx diff --git a/DS4Windows.sln b/DS4Windows.sln index 916f340..454a045 100644 --- a/DS4Windows.sln +++ b/DS4Windows.sln @@ -15,12 +15,12 @@ Global GlobalSection(ProjectConfigurationPlatforms) = postSolution {7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Debug|x64.ActiveCfg = Debug|Any CPU - {7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Debug|x64.Build.0 = Debug|Any CPU + {7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Debug|x64.ActiveCfg = Debug|x64 + {7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Debug|x64.Build.0 = Debug|x64 {7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Release|Any CPU.ActiveCfg = Release|Any CPU {7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Release|Any CPU.Build.0 = Release|Any CPU - {7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Release|x64.ActiveCfg = Release|Any CPU - {7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Release|x64.Build.0 = Release|Any CPU + {7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Release|x64.ActiveCfg = Release|x64 + {7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/DS4Windows/DS4Control/ControlSerivce.cs b/DS4Windows/DS4Control/ControlSerivce.cs index 28759a7..64a0faa 100644 --- a/DS4Windows/DS4Control/ControlSerivce.cs +++ b/DS4Windows/DS4Control/ControlSerivce.cs @@ -1,48 +1,46 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.IO; -using System.Reflection; using System.Media; -using System.Threading.Tasks; using static DS4Windows.Global; + namespace DS4Windows { public class ControlService { public X360Device x360Bus; - public DS4Device[] DS4Controllers = new DS4Device[4]; - public Mouse[] touchPad = new Mouse[4]; + public const int DS4_CONTROLLER_COUNT = 4; + public DS4Device[] DS4Controllers = new DS4Device[DS4_CONTROLLER_COUNT]; + public Mouse[] touchPad = new Mouse[DS4_CONTROLLER_COUNT]; private bool running = false; - private DS4State[] MappedState = new DS4State[4]; - private DS4State[] CurrentState = new DS4State[4]; - private DS4State[] PreviousState = new DS4State[4]; - public DS4StateExposed[] ExposedState = new DS4StateExposed[4]; + private DS4State[] MappedState = new DS4State[DS4_CONTROLLER_COUNT]; + private DS4State[] CurrentState = new DS4State[DS4_CONTROLLER_COUNT]; + private DS4State[] PreviousState = new DS4State[DS4_CONTROLLER_COUNT]; + public DS4StateExposed[] ExposedState = new DS4StateExposed[DS4_CONTROLLER_COUNT]; public bool recordingMacro = false; public event EventHandler Debug = null; - public bool eastertime = false; - private int eCode = 0; bool[] buttonsdown = { false, false, false, false }; List dcs = new List(); - bool[] held = new bool[4]; - int[] oldmouse = new int[4] { -1, -1, -1, -1 }; - SoundPlayer sp = new SoundPlayer(); + bool[] held = new bool[DS4_CONTROLLER_COUNT]; + int[] oldmouse = new int[DS4_CONTROLLER_COUNT] { -1, -1, -1, -1 }; + //SoundPlayer sp = new SoundPlayer(); private class X360Data { public byte[] Report = new byte[28]; public byte[] Rumble = new byte[8]; } + private X360Data[] processingData = new X360Data[4]; public ControlService() { - sp.Stream = Properties.Resources.EE; + //sp.Stream = Properties.Resources.EE; x360Bus = new X360Device(); AddtoDS4List(); - for (int i = 0; i < DS4Controllers.Length; i++) + + for (int i = 0, arlength = DS4Controllers.Length; i < arlength; i++) { processingData[i] = new X360Data(); MappedState[i] = new DS4State(); @@ -54,7 +52,6 @@ namespace DS4Windows void AddtoDS4List() { - dcs.Add(DS4Controls.Cross); dcs.Add(DS4Controls.Cross); dcs.Add(DS4Controls.Circle); dcs.Add(DS4Controls.Square); @@ -88,63 +85,93 @@ namespace DS4Windows private async void WarnExclusiveModeFailure(DS4Device device) { - if (DS4Devices.isExclusiveMode && !device.IsExclusive) + if (DS4Devices.isExclusiveMode && !device.isExclusive()) { await System.Threading.Tasks.Task.Delay(5); - String message = Properties.Resources.CouldNotOpenDS4.Replace("*Mac address*", device.MacAddress) + " " + Properties.Resources.QuitOtherPrograms; + string message = Properties.Resources.CouldNotOpenDS4.Replace("*Mac address*", device.getMacAddress()) + " " + + Properties.Resources.QuitOtherPrograms; LogDebug(message, true); Log.LogToTray(message, true); } - } + } + public bool Start(bool showlog = true) { if (x360Bus.Open() && x360Bus.Start()) { if (showlog) - LogDebug(Properties.Resources.Starting); - DS4Devices.isExclusiveMode = UseExclusiveMode; + LogDebug(Properties.Resources.Starting); + + LogDebug("Connection to Scp Virtual Bus established"); + + DS4Devices.isExclusiveMode = getUseExclusiveMode(); if (showlog) { LogDebug(Properties.Resources.SearchingController); - LogDebug(DS4Devices.isExclusiveMode ? Properties.Resources.UsingExclusive: Properties.Resources.UsingShared); + LogDebug(DS4Devices.isExclusiveMode ? Properties.Resources.UsingExclusive : Properties.Resources.UsingShared); } + try { DS4Devices.findControllers(); IEnumerable devices = DS4Devices.getDS4Controllers(); - int ind = 0; - DS4LightBar.defualtLight = false; - foreach (DS4Device device in devices) + //int ind = 0; + DS4LightBar.defaultLight = false; + //foreach (DS4Device device in devices) + + for (int i = 0, devCount = devices.Count(); i < devCount; i++) { + DS4Device device = devices.ElementAt(i); if (showlog) - LogDebug(Properties.Resources.FoundController + device.MacAddress + " (" + device.ConnectionType + ")"); + LogDebug(Properties.Resources.FoundController + device.getMacAddress() + " (" + device.getConnectionType() + ")"); + WarnExclusiveModeFailure(device); - DS4Controllers[ind] = device; - device.Removal -= DS4Devices.On_Removal; + DS4Controllers[i] = device; + //device.Removal -= DS4Devices.On_Removal; device.Removal += this.On_DS4Removal; device.Removal += DS4Devices.On_Removal; - touchPad[ind] = new Mouse(ind, device); - device.LightBarColor = MainColor[ind]; - if (!DinputOnly[ind]) - x360Bus.Plugin(ind); - device.Report += this.On_Report; - TouchPadOn(ind, device); - //string filename = ProfilePath[ind]; - ind++; - if (showlog) - if (System.IO.File.Exists(appdatapath + "\\Profiles\\" + ProfilePath[ind-1] + ".xml")) + touchPad[i] = new Mouse(i, device); + device.LightBarColor = getMainColor(i); + + if (!getDInputOnly(i)) + { + int xinputIndex = x360Bus.FirstController + i; + LogDebug("Plugging in X360 Controller #" + xinputIndex); + bool xinputResult = x360Bus.Plugin(i); + if (xinputResult) { - string prolog = Properties.Resources.UsingProfile.Replace("*number*", ind.ToString()).Replace("*Profile name*", ProfilePath[ind-1]); + LogDebug("X360 Controller # " + xinputIndex + " connected"); + useDInputOnly[i] = false; + } + else + { + LogDebug("X360 Controller # " + xinputIndex + " failed. Using DInput only mode"); + useDInputOnly[i] = true; + } + } + + device.Report += this.On_Report; + TouchPadOn(i, device); + device.StartUpdate(); + //string filename = ProfilePath[ind]; + //ind++; + if (showlog) + { + if (System.IO.File.Exists(appdatapath + "\\Profiles\\" + ProfilePath[i] + ".xml")) + { + string prolog = Properties.Resources.UsingProfile.Replace("*number*", (i + 1).ToString()).Replace("*Profile name*", ProfilePath[i]); LogDebug(prolog); Log.LogToTray(prolog); } else { - string prolog = Properties.Resources.NotUsingProfile.Replace("*number*", (ind).ToString()); + string prolog = Properties.Resources.NotUsingProfile.Replace("*number*", (i + 1).ToString()); LogDebug(prolog); Log.LogToTray(prolog); } - if (ind >= 4) // out of Xinput devices! + } + + if (i >= 4) // out of Xinput devices! break; } } @@ -153,9 +180,19 @@ namespace DS4Windows LogDebug(e.Message); Log.LogToTray(e.Message); } - running = true; + running = true; } + else + { + string logMessage = "Could not connect to Scp Virtual Bus Driver. Please check the status of the System device in Device Manager"; + LogDebug(logMessage); + Log.LogToTray(logMessage); + } + + //ControllerStatusChanged(this); + runHotPlug = true; + return true; } @@ -164,41 +201,66 @@ namespace DS4Windows if (running) { running = false; + runHotPlug = false; + if (showlog) LogDebug(Properties.Resources.StoppingX360); + bool anyUnplugged = false; - for (int i = 0; i < DS4Controllers.Length; i++) + for (int i = 0, arlength = DS4Controllers.Length; i < arlength; i++) { - if (DS4Controllers[i] != null) + DS4Device tempDevice = DS4Controllers[i]; + if (tempDevice != null) { - if (DCBTatStop && !DS4Controllers[i].Charging && showlog) - DS4Controllers[i].DisconnectBT(); + if (DCBTatStop && !tempDevice.isCharging()) + { + if (tempDevice.getConnectionType() == ConnectionType.BT) + { + tempDevice.StopUpdate(); + tempDevice.DisconnectBT(true); + } + else if (tempDevice.getConnectionType() == ConnectionType.SONYWA) + { + tempDevice.StopUpdate(); + tempDevice.DisconnectDongle(true); + } + } else { DS4LightBar.forcelight[i] = false; DS4LightBar.forcedFlash[i] = 0; - DS4LightBar.defualtLight = true; + DS4LightBar.defaultLight = true; DS4LightBar.updateLightBar(DS4Controllers[i], i, CurrentState[i], ExposedState[i], touchPad[i]); + tempDevice.IsRemoved = true; System.Threading.Thread.Sleep(50); } + CurrentState[i].Battery = PreviousState[i].Battery = 0; // Reset for the next connection's initial status change. x360Bus.Unplug(i); + useDInputOnly[i] = false; anyUnplugged = true; DS4Controllers[i] = null; touchPad[i] = null; + lag[i] = false; + inWarnMonitor[i] = false; } } + if (anyUnplugged) System.Threading.Thread.Sleep(XINPUT_UNPLUG_SETTLE_TIME); + x360Bus.UnplugAll(); x360Bus.Stop(); + if (showlog) LogDebug(Properties.Resources.StoppingDS4); + DS4Devices.stopControllers(); if (showlog) LogDebug(Properties.Resources.StoppedDS4Windows); - ControllerStatusChanged(this); } + + runHotPlug = false; return true; } @@ -206,35 +268,87 @@ namespace DS4Windows { if (running) { + // Do first run check for Quick Charge checks. Needed so old device will + // be removed before performing another controller scan + if (getQuickCharge()) + { + for (int i = 0, devlen = DS4Controllers.Length; i < devlen; i++) + { + DS4Device device = DS4Controllers[i]; + if (device != null) + { + if (device.getConnectionType() == ConnectionType.BT && device.isCharging()) + { + device.StopUpdate(); + device.DisconnectBT(true); + /*Task temp = Task.Delay(50).ContinueWith((t) => { + while (!device.IsRemoved) { System.Threading.Thread.Sleep(10); } + }); + temp.Wait(100); + */ + } + } + } + } + DS4Devices.findControllers(); IEnumerable devices = DS4Devices.getDS4Controllers(); - foreach (DS4Device device in devices) + //foreach (DS4Device device in devices) + for (int i = 0, devlen = devices.Count(); i < devlen; i++) { - if (device.IsDisconnecting) + DS4Device device = devices.ElementAt(i); + + if (device.isDisconnectingStatus()) continue; + if (((Func)delegate { - for (Int32 Index = 0; Index < DS4Controllers.Length; Index++) - if (DS4Controllers[Index] != null && DS4Controllers[Index].MacAddress == device.MacAddress) + for (Int32 Index = 0, arlength = DS4Controllers.Length; Index < arlength; Index++) + { + if (DS4Controllers[Index] != null && + DS4Controllers[Index].getMacAddress() == device.getMacAddress()) return true; + } + return false; })()) + { continue; - for (Int32 Index = 0; Index < DS4Controllers.Length; Index++) + } + + for (Int32 Index = 0, arlength = DS4Controllers.Length; Index < arlength; Index++) + { if (DS4Controllers[Index] == null) { - LogDebug(Properties.Resources.FoundController + device.MacAddress + " (" + device.ConnectionType + ")"); + LogDebug(Properties.Resources.FoundController + device.getMacAddress() + " (" + device.getConnectionType() + ")"); WarnExclusiveModeFailure(device); DS4Controllers[Index] = device; - device.Removal -= DS4Devices.On_Removal; + //device.Removal -= DS4Devices.On_Removal; device.Removal += this.On_DS4Removal; device.Removal += DS4Devices.On_Removal; touchPad[Index] = new Mouse(Index, device); - device.LightBarColor = MainColor[Index]; + device.LightBarColor = getMainColor(Index); device.Report += this.On_Report; - if (!DinputOnly[Index]) - x360Bus.Plugin(Index); + if (!getDInputOnly(Index)) + { + int xinputIndex = x360Bus.FirstController + i; + LogDebug("Plugging in X360 Controller #" + xinputIndex); + bool xinputResult = x360Bus.Plugin(i); + if (xinputResult) + { + LogDebug("X360 Controller # " + xinputIndex + " connected"); + useDInputOnly[i] = false; + } + else + { + LogDebug("X360 Controller # " + xinputIndex + " failed. Using DInput only mode"); + useDInputOnly[i] = true; + } + } + TouchPadOn(Index, device); + device.StartUpdate(); + //string filename = Path.GetFileName(ProfilePath[Index]); if (System.IO.File.Exists(appdatapath + "\\Profiles\\" + ProfilePath[Index] + ".xml")) { @@ -248,11 +362,15 @@ namespace DS4Windows LogDebug(prolog); Log.LogToTray(prolog); } - + break; } + } } + + //ControllerStatusChanged(this); } + return true; } @@ -268,108 +386,77 @@ namespace DS4Windows device.SixAxis.SixAccelMoved += tPad.sixaxisMoved; //LogDebug("Touchpad mode for " + device.MacAddress + " is now " + tmode.ToString()); //Log.LogToTray("Touchpad mode for " + device.MacAddress + " is now " + tmode.ToString()); - ControllerStatusChanged(this); - } - - public void TimeoutConnection(DS4Device d) - { - try - { - System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch(); - sw.Start(); - while (!d.IsAlive()) - { - if (sw.ElapsedMilliseconds < 1000) - System.Threading.Thread.SpinWait(500); - //If weve been waiting less than 1 second let the thread keep its processing chunk - else - System.Threading.Thread.Sleep(500); - //If weve been waiting more than 1 second give up some resources - - if (sw.ElapsedMilliseconds > 5000) throw new TimeoutException(); //Weve waited long enough - } - sw.Reset(); - } - catch (TimeoutException) - { - Stop(false); - Start(false); - } + //ControllerStatusChanged(this); } public string getDS4ControllerInfo(int index) { - if (DS4Controllers[index] != null) + DS4Device d = DS4Controllers[index]; + if (d != null) { - DS4Device d = DS4Controllers[index]; if (!d.IsAlive()) - //return "Connecting..."; // awaiting the first battery charge indication { - var TimeoutThread = new System.Threading.Thread(() => TimeoutConnection(d)); - TimeoutThread.IsBackground = true; - TimeoutThread.Name = "TimeoutFor" + d.MacAddress.ToString(); - TimeoutThread.Start(); return Properties.Resources.Connecting; } - String battery; - if (d.Charging) + + string battery; + if (d.isCharging()) { - if (d.Battery >= 100) + if (d.getBattery() >= 100) battery = Properties.Resources.Charged; else - battery = Properties.Resources.Charging.Replace("*number*", d.Battery.ToString()); + battery = Properties.Resources.Charging.Replace("*number*", d.getBattery().ToString()); } else { - battery = Properties.Resources.Battery.Replace("*number*", d.Battery.ToString()); + battery = Properties.Resources.Battery.Replace("*number*", d.getBattery().ToString()); } - return d.MacAddress + " (" + d.ConnectionType + "), " + battery; + + return d.getMacAddress() + " (" + d.getConnectionType() + "), " + battery; //return d.MacAddress + " (" + d.ConnectionType + "), Battery is " + battery + ", Touchpad in " + modeSwitcher[index].ToString(); } else - return String.Empty; + return string.Empty; } public string getDS4MacAddress(int index) { - if (DS4Controllers[index] != null) + DS4Device d = DS4Controllers[index]; + if (d != null) { - DS4Device d = DS4Controllers[index]; if (!d.IsAlive()) - //return "Connecting..."; // awaiting the first battery charge indication { - var TimeoutThread = new System.Threading.Thread(() => TimeoutConnection(d)); - TimeoutThread.IsBackground = true; - TimeoutThread.Name = "TimeoutFor" + d.MacAddress.ToString(); - TimeoutThread.Start(); return Properties.Resources.Connecting; } - return d.MacAddress; + + return d.getMacAddress(); } else - return String.Empty; + return string.Empty; } public string getShortDS4ControllerInfo(int index) { - if (DS4Controllers[index] != null) + DS4Device d = DS4Controllers[index]; + if (d != null) { - DS4Device d = DS4Controllers[index]; - String battery; + string battery; if (!d.IsAlive()) battery = "..."; - if (d.Charging) + + if (d.isCharging()) { - if (d.Battery >= 100) + if (d.getBattery() >= 100) battery = Properties.Resources.Full; else - battery = d.Battery + "%+"; + battery = d.getBattery() + "%+"; } else { - battery = d.Battery + "%"; + battery = d.getBattery() + "%"; } - return (d.ConnectionType + " " + battery); + + return (d.getConnectionType() + " " + battery); } else return Properties.Resources.NoneText; @@ -377,23 +464,25 @@ namespace DS4Windows public string getDS4Battery(int index) { - if (DS4Controllers[index] != null) + DS4Device d = DS4Controllers[index]; + if (d != null) { - DS4Device d = DS4Controllers[index]; - String battery; + string battery; if (!d.IsAlive()) battery = "..."; - if (d.Charging) + + if (d.isCharging()) { - if (d.Battery >= 100) + if (d.getBattery() >= 100) battery = Properties.Resources.Full; else - battery = d.Battery + "%+"; + battery = d.getBattery() + "%+"; } else { - battery = d.Battery + "%"; + battery = d.getBattery() + "%"; } + return battery; } else @@ -402,112 +491,160 @@ namespace DS4Windows public string getDS4Status(int index) { - if (DS4Controllers[index] != null) + DS4Device d = DS4Controllers[index]; + if (d != null) { - DS4Device d = DS4Controllers[index]; - return d.ConnectionType+""; + return d.getConnectionType() + ""; } else return Properties.Resources.NoneText; } - - private int XINPUT_UNPLUG_SETTLE_TIME = 250; // Inhibit races that occur with the asynchronous teardown of ScpVBus -> X360 driver instance. //Called when DS4 is disconnected or timed out protected virtual void On_DS4Removal(object sender, EventArgs e) { DS4Device device = (DS4Device)sender; int ind = -1; - for (int i = 0; i < DS4Controllers.Length; i++) - if (DS4Controllers[i] != null && device.MacAddress == DS4Controllers[i].MacAddress) + for (int i = 0, arlength = DS4Controllers.Length; ind == -1 && i < arlength; i++) + { + if (DS4Controllers[i] != null && device.getMacAddress() == DS4Controllers[i].getMacAddress()) ind = i; + } + if (ind != -1) { - CurrentState[ind].Battery = PreviousState[ind].Battery = 0; // Reset for the next connection's initial status change. - x360Bus.Unplug(ind); - string removed = Properties.Resources.ControllerWasRemoved.Replace("*Mac address*", (ind +1).ToString()); - if (DS4Controllers[ind].Battery <= 20 && - DS4Controllers[ind].ConnectionType == ConnectionType.BT && !DS4Controllers[ind].Charging) - removed += ". " + Properties.Resources.ChargeController; - LogDebug(removed); - Log.LogToTray(removed); - System.Threading.Thread.Sleep(XINPUT_UNPLUG_SETTLE_TIME); - DS4Controllers[ind] = null; - touchPad[ind] = null; - ControllerStatusChanged(this); + bool removingStatus = false; + lock (device.removeLocker) + { + if (!device.IsRemoving) + { + removingStatus = true; + device.IsRemoving = true; + } + } + + if (removingStatus) + { + CurrentState[ind].Battery = PreviousState[ind].Battery = 0; // Reset for the next connection's initial status change. + x360Bus.Unplug(ind); + string removed = Properties.Resources.ControllerWasRemoved.Replace("*Mac address*", (ind + 1).ToString()); + if (device.getBattery() <= 20 && + device.getConnectionType() == ConnectionType.BT && !device.isCharging()) + { + removed += ". " + Properties.Resources.ChargeController; + } + + LogDebug(removed); + Log.LogToTray(removed); + System.Threading.Thread.Sleep(XINPUT_UNPLUG_SETTLE_TIME); + device.IsRemoved = true; + DS4Controllers[ind] = null; + touchPad[ind] = null; + lag[ind] = false; + inWarnMonitor[ind] = false; + useDInputOnly[ind] = false; + OnControllerRemoved(this, ind); + //ControllerStatusChanged(this); + } } } + public bool[] lag = { false, false, false, false }; + public bool[] inWarnMonitor = { false, false, false, false }; //Called every time the new input report has arrived protected virtual void On_Report(object sender, EventArgs e) { - DS4Device device = (DS4Device)sender; int ind = -1; - for (int i = 0; i < DS4Controllers.Length; i++) - if (device == DS4Controllers[i]) + for (int i = 0, arlength = DS4_CONTROLLER_COUNT; ind == -1 && i < arlength; i++) + { + DS4Device tempDev = DS4Controllers[i]; + if (tempDev != null && device == tempDev) ind = i; + } if (ind != -1) { - if (FlushHIDQueue[ind]) + if (getFlushHIDQueue(ind)) device.FlushHID(); + if (!string.IsNullOrEmpty(device.error)) { LogDebug(device.error); } - if (DateTime.UtcNow - device.firstActive > TimeSpan.FromSeconds(5)) + + if (inWarnMonitor[ind]) { - if (device.Latency >= FlashWhenLateAt && !lag[ind]) + int flashWhenLateAt = getFlashWhenLateAt(); + if (!lag[ind] && device.Latency >= flashWhenLateAt) LagFlashWarning(ind, true); - else if (device.Latency < FlashWhenLateAt && lag[ind]) + else if (lag[ind] && device.Latency < flashWhenLateAt) LagFlashWarning(ind, false); } + else + { + if (DateTime.UtcNow - device.firstActive > TimeSpan.FromSeconds(5)) + { + inWarnMonitor[ind] = true; + } + } + device.getExposedState(ExposedState[ind], CurrentState[ind]); DS4State cState = CurrentState[ind]; device.getPreviousState(PreviousState[ind]); DS4State pState = PreviousState[ind]; - if (pState.Battery != cState.Battery) - ControllerStatusChanged(this); - CheckForHotkeys(ind, cState, pState); - if (eastertime) - EasterTime(ind); - GetInputkeys(ind); - if (LSCurve[ind] != 0 || RSCurve[ind] != 0 || LSDeadzone[ind] != 0 || RSDeadzone[ind] != 0 || - L2Deadzone[ind] != 0 || R2Deadzone[ind] != 0 || LSSens[ind] != 0 || RSSens[ind] != 0 || - L2Sens[ind] != 0 || R2Sens[ind] != 0) //if a curve or deadzone is in place - cState = Mapping.SetCurveAndDeadzone(ind, cState); + + if (!device.firstReport && device.IsAlive()) + { + device.firstReport = true; + OnDeviceStatusChanged(this, ind); + } + else if (pState.Battery != cState.Battery) + { + OnBatteryStatusChange(this, ind, cState.Battery); + //ControllerStatusChanged(this); + } + + if (getEnableTouchToggle(ind)) + { + CheckForTouchToggle(ind, cState, pState); + } + + cState = Mapping.SetCurveAndDeadzone(ind, cState); + if (!recordingMacro && (!string.IsNullOrEmpty(tempprofilename[ind]) || - HasCustomAction(ind) || HasCustomExtras(ind) || ProfileActions[ind].Count > 0)) + containsCustomAction(ind) || containsCustomExtras(ind) || + getProfileActionCount(ind) > 0)) { Mapping.MapCustom(ind, cState, MappedState[ind], ExposedState[ind], touchPad[ind], this); cState = MappedState[ind]; } - //if (HasCustomExtras(ind)) - // DoExtras(ind); // Update the GUI/whatever. DS4LightBar.updateLightBar(device, ind, cState, ExposedState[ind], touchPad[ind]); - x360Bus.Parse(cState, processingData[ind].Report, ind); - // We push the translated Xinput state, and simultaneously we - // pull back any possible rumble data coming from Xinput consumers. - if (x360Bus.Report(processingData[ind].Report, processingData[ind].Rumble)) + if (!useDInputOnly[ind]) { - Byte Big = (Byte)(processingData[ind].Rumble[3]); - Byte Small = (Byte)(processingData[ind].Rumble[4]); - - if (processingData[ind].Rumble[1] == 0x08) + x360Bus.Parse(cState, processingData[ind].Report, ind); + // We push the translated Xinput state, and simultaneously we + // pull back any possible rumble data coming from Xinput consumers. + if (x360Bus.Report(processingData[ind].Report, processingData[ind].Rumble)) { - setRumble(Big, Small, ind); + Byte Big = (Byte)(processingData[ind].Rumble[3]); + Byte Small = (Byte)(processingData[ind].Rumble[4]); + + if (processingData[ind].Rumble[1] == 0x08) + { + setRumble(Big, Small, ind); + } } } // Output any synthetic events. Mapping.Commit(ind); // Pull settings updates. - device.IdleTimeout = IdleDisconnectTimeout[ind]; + device.setIdleTimeout(getIdleDisconnectTimeout(ind)); } } @@ -517,7 +654,7 @@ namespace DS4Windows { lag[ind] = true; LogDebug(Properties.Resources.LatencyOverTen.Replace("*number*", (ind + 1).ToString()), true); - if (FlashWhenLate) + if (getFlashWhenLate()) { DS4Color color = new DS4Color { red = 50, green = 0, blue = 0 }; DS4LightBar.forcedColor[ind] = color; @@ -533,254 +670,310 @@ namespace DS4Windows DS4LightBar.forcedFlash[ind] = 0; } } - - /* private void DoExtras(int ind) - { - DS4State cState = CurrentState[ind]; - DS4StateExposed eState = ExposedState[ind]; - Mouse tp = touchPad[ind]; - DS4Controls helddown = DS4Controls.None; - foreach (KeyValuePair p in getCustomExtras(ind)) - { - if (Mapping.getBoolMapping(ind, p.Key, cState, eState, tp)) - { - helddown = p.Key; - break; - } - } - if (helddown != DS4Controls.None) - { - string p = getCustomExtras(ind)[helddown]; - string[] extraS = p.Split(','); - int[] extras = new int[extraS.Length]; - for (int i = 0; i < extraS.Length; i++) - { - int b; - if (int.TryParse(extraS[i], out b)) - extras[i] = b; - } - held[ind] = true; - try - { - if (!(extras[0] == extras[1] && extras[1] == 0)) - setRumble((byte)extras[0], (byte)extras[1], ind); - if (extras[2] == 1) - { - DS4Color color = new DS4Color { red = (byte)extras[3], green = (byte)extras[4], blue = (byte)extras[5] }; - DS4LightBar.forcedColor[ind] = color; - DS4LightBar.forcedFlash[ind] = (byte)extras[6]; - DS4LightBar.forcelight[ind] = true; - } - if (extras[7] == 1) - { - if (oldmouse[ind] == -1) - oldmouse[ind] = ButtonMouseSensitivity[ind]; - ButtonMouseSensitivity[ind] = extras[8]; - } - } - catch { } - } - else if (held[ind]) - { - DS4LightBar.forcelight[ind] = false; - DS4LightBar.forcedFlash[ind] = 0; - ButtonMouseSensitivity[ind] = oldmouse[ind]; - oldmouse[ind] = -1; - setRumble(0, 0, ind); - held[ind] = false; - } - }*/ - - - - public void EasterTime(int ind) - { - DS4State cState = CurrentState[ind]; - DS4StateExposed eState = ExposedState[ind]; - Mouse tp = touchPad[ind]; - - bool pb = false; - foreach (DS4Controls dc in dcs) - { - if (Mapping.getBoolMapping(ind, dc, cState, eState, tp)) - { - pb = true; - break; - } - } - int temp = eCode; - //Looks like you found the easter egg code, since you're already cheating, - //I scrambled the code for you :) - if (pb && !buttonsdown[ind]) - { - if (cState.Cross && eCode == 9) - eCode++; - else if (!cState.Cross && eCode == 9) - eCode = 0; - else if (cState.DpadLeft && eCode == 6) - eCode++; - else if (!cState.DpadLeft && eCode == 6) - eCode = 0; - else if (cState.DpadRight && eCode == 7) - eCode++; - else if (!cState.DpadRight && eCode == 7) - eCode = 0; - else if (cState.DpadLeft && eCode == 4) - eCode++; - else if (!cState.DpadLeft && eCode == 4) - eCode = 0; - else if (cState.DpadDown && eCode == 2) - eCode++; - else if (!cState.DpadDown && eCode == 2) - eCode = 0; - else if (cState.DpadRight && eCode == 5) - eCode++; - else if (!cState.DpadRight && eCode == 5) - eCode = 0; - else if (cState.DpadUp && eCode == 1) - eCode++; - else if (!cState.DpadUp && eCode == 1) - eCode = 0; - else if (cState.DpadDown && eCode == 3) - eCode++; - else if (!cState.DpadDown && eCode == 3) - eCode = 0; - else if (cState.Circle && eCode == 8) - eCode++; - else if (!cState.Circle && eCode == 8) - eCode = 0; - - if (cState.DpadUp && eCode == 0) - eCode++; - - if (eCode == 10) - { - string message = "(!)"; - sp.Play(); - LogDebug(message, true); - eCode = 0; - } - - if (temp != eCode) - Console.WriteLine(eCode); - buttonsdown[ind] = true; - } - else if (!pb) - buttonsdown[ind] = false; - } public string GetInputkeys(int ind) { DS4State cState = CurrentState[ind]; DS4StateExposed eState = ExposedState[ind]; Mouse tp = touchPad[ind]; + string result = "nothing"; + if (DS4Controllers[ind] != null) - if (Mapping.getBoolMapping(ind, DS4Controls.Cross, cState, eState, tp)) return "Cross"; - else if (Mapping.getBoolMapping(ind, DS4Controls.Circle, cState, eState, tp)) return "Circle"; - else if (Mapping.getBoolMapping(ind, DS4Controls.Triangle, cState, eState, tp)) return "Triangle"; - else if (Mapping.getBoolMapping(ind, DS4Controls.Square, cState, eState, tp)) return "Square"; - else if (Mapping.getBoolMapping(ind, DS4Controls.L1, cState, eState, tp)) return "L1"; - else if (Mapping.getBoolMapping(ind, DS4Controls.R1, cState, eState, tp)) return "R1"; - else if (Mapping.getBoolMapping(ind, DS4Controls.L2, cState, eState, tp)) return "L2"; - else if (Mapping.getBoolMapping(ind, DS4Controls.R2, cState, eState, tp)) return "R2"; - else if (Mapping.getBoolMapping(ind, DS4Controls.L3, cState, eState, tp)) return "L3"; - else if (Mapping.getBoolMapping(ind, DS4Controls.R3, cState, eState, tp)) return "R3"; - else if (Mapping.getBoolMapping(ind, DS4Controls.DpadUp, cState, eState, tp)) return "Up"; - else if (Mapping.getBoolMapping(ind, DS4Controls.DpadDown, cState, eState, tp)) return "Down"; - else if (Mapping.getBoolMapping(ind, DS4Controls.DpadLeft, cState, eState, tp)) return "Left"; - else if (Mapping.getBoolMapping(ind, DS4Controls.DpadRight, cState, eState, tp)) return "Right"; - else if (Mapping.getBoolMapping(ind, DS4Controls.Share, cState, eState, tp)) return "Share"; - else if (Mapping.getBoolMapping(ind, DS4Controls.Options, cState, eState, tp)) return "Options"; - else if (Mapping.getBoolMapping(ind, DS4Controls.PS, cState, eState, tp)) return "PS"; - else if (Mapping.getBoolMapping(ind, DS4Controls.LXPos, cState, eState, tp)) return "LS Right"; - else if (Mapping.getBoolMapping(ind, DS4Controls.LXNeg, cState, eState, tp)) return "LS Left"; - else if (Mapping.getBoolMapping(ind, DS4Controls.LYPos, cState, eState, tp)) return "LS Down"; - else if (Mapping.getBoolMapping(ind, DS4Controls.LYNeg, cState, eState, tp)) return "LS Up"; - else if (Mapping.getBoolMapping(ind, DS4Controls.RXPos, cState, eState, tp)) return "RS Right"; - else if (Mapping.getBoolMapping(ind, DS4Controls.RXNeg, cState, eState, tp)) return "RS Left"; - else if (Mapping.getBoolMapping(ind, DS4Controls.RYPos, cState, eState, tp)) return "RS Down"; - else if (Mapping.getBoolMapping(ind, DS4Controls.RYNeg, cState, eState, tp)) return "RS Up"; - else if (Mapping.getBoolMapping(ind, DS4Controls.TouchLeft, cState, eState, tp)) return "Touch Left"; - else if (Mapping.getBoolMapping(ind, DS4Controls.TouchRight, cState, eState, tp)) return "Touch Right"; - else if (Mapping.getBoolMapping(ind, DS4Controls.TouchMulti, cState, eState, tp)) return "Touch Multi"; - else if (Mapping.getBoolMapping(ind, DS4Controls.TouchUpper, cState, eState, tp)) return "Touch Upper"; - return "nothing"; + { + if (Mapping.getBoolButtonMapping(cState.Cross)) + { + result = "Cross"; + } + else if (Mapping.getBoolButtonMapping(cState.Circle)) + { + result = "Circle"; + } + else if (Mapping.getBoolButtonMapping(cState.Triangle)) + { + result = "Triangle"; + } + else if (Mapping.getBoolButtonMapping(cState.Square)) + { + result = "Triangle"; + } + else if (Mapping.getBoolButtonMapping(cState.L1)) + { + result = "L1"; + } + else if (Mapping.getBoolTriggerMapping(cState.L2)) + { + result = "L2"; + } + else if (Mapping.getBoolButtonMapping(cState.L3)) + { + result = "L3"; + } + else if (Mapping.getBoolButtonMapping(cState.R1)) + { + result = "R1"; + } + else if (Mapping.getBoolTriggerMapping(cState.R2)) + { + result = "R2"; + } + else if (Mapping.getBoolButtonMapping(cState.R3)) + { + result = "R3"; + } + else if (Mapping.getBoolButtonMapping(cState.DpadUp)) + { + result = "Up"; + } + else if (Mapping.getBoolButtonMapping(cState.DpadDown)) + { + result = "Down"; + } + else if (Mapping.getBoolButtonMapping(cState.DpadLeft)) + { + result = "Left"; + } + else if (Mapping.getBoolButtonMapping(cState.DpadRight)) + { + result = "DpadRight"; + } + else if (Mapping.getBoolButtonMapping(cState.Share)) + { + result = "Share"; + } + else if (Mapping.getBoolButtonMapping(cState.Options)) + { + result = "Options"; + } + else if (Mapping.getBoolButtonMapping(cState.PS)) + { + result = "PS"; + } + else if (Mapping.getBoolAxisDirMapping(cState.LX, true)) + { + result = "LS Right"; + } + else if (Mapping.getBoolAxisDirMapping(cState.LX, false)) + { + result = "LS Left"; + } + else if (Mapping.getBoolAxisDirMapping(cState.LY, true)) + { + result = "LS Down"; + } + else if (Mapping.getBoolAxisDirMapping(cState.LY, false)) + { + result = "LS Up"; + } + else if (Mapping.getBoolAxisDirMapping(cState.RX, true)) + { + result = "RS Right"; + } + else if (Mapping.getBoolAxisDirMapping(cState.RX, false)) + { + result = "RS Left"; + } + else if (Mapping.getBoolAxisDirMapping(cState.RY, true)) + { + result = "RS Down"; + } + else if (Mapping.getBoolAxisDirMapping(cState.RY, false)) + { + result = "RS Up"; + } + else if (Mapping.getBoolTouchMapping(tp.leftDown)) + { + result = "Touch Left"; + } + else if (Mapping.getBoolTouchMapping(tp.rightDown)) + { + result = "Touch Right"; + } + else if (Mapping.getBoolTouchMapping(tp.multiDown)) + { + result = "Touch Multi"; + } + else if (Mapping.getBoolTouchMapping(tp.upperDown)) + { + result = "Touch Upper"; + } + } + + return result; } - public DS4Controls GetInputkeysDS4(int ind) + /* TODO: Not used. Possible candidate for removal. Currently keeping for reference. */ + /*public DS4Controls GetInputkeysDS4(int ind) { DS4State cState = CurrentState[ind]; DS4StateExposed eState = ExposedState[ind]; Mouse tp = touchPad[ind]; + DS4Controls result = DS4Controls.None; + if (DS4Controllers[ind] != null) - if (Mapping.getBoolMapping(ind, DS4Controls.Cross, cState, eState, tp)) return DS4Controls.Cross; - else if (Mapping.getBoolMapping(ind, DS4Controls.Circle, cState, eState, tp)) return DS4Controls.Circle; - else if (Mapping.getBoolMapping(ind, DS4Controls.Triangle, cState, eState, tp)) return DS4Controls.Triangle; - else if (Mapping.getBoolMapping(ind, DS4Controls.Square, cState, eState, tp)) return DS4Controls.Square; - else if (Mapping.getBoolMapping(ind, DS4Controls.L1, cState, eState, tp)) return DS4Controls.L1; - else if (Mapping.getBoolMapping(ind, DS4Controls.R1, cState, eState, tp)) return DS4Controls.R1; - else if (Mapping.getBoolMapping(ind, DS4Controls.L2, cState, eState, tp)) return DS4Controls.L2; - else if (Mapping.getBoolMapping(ind, DS4Controls.R2, cState, eState, tp)) return DS4Controls.R2; - else if (Mapping.getBoolMapping(ind, DS4Controls.L3, cState, eState, tp)) return DS4Controls.L3; - else if (Mapping.getBoolMapping(ind, DS4Controls.R3, cState, eState, tp)) return DS4Controls.R3; - else if (Mapping.getBoolMapping(ind, DS4Controls.DpadUp, cState, eState, tp)) return DS4Controls.DpadUp; - else if (Mapping.getBoolMapping(ind, DS4Controls.DpadDown, cState, eState, tp)) return DS4Controls.DpadDown; - else if (Mapping.getBoolMapping(ind, DS4Controls.DpadLeft, cState, eState, tp)) return DS4Controls.DpadLeft; - else if (Mapping.getBoolMapping(ind, DS4Controls.DpadRight, cState, eState, tp)) return DS4Controls.DpadRight; - else if (Mapping.getBoolMapping(ind, DS4Controls.Share, cState, eState, tp)) return DS4Controls.Share; - else if (Mapping.getBoolMapping(ind, DS4Controls.Options, cState, eState, tp)) return DS4Controls.Options; - else if (Mapping.getBoolMapping(ind, DS4Controls.PS, cState, eState, tp)) return DS4Controls.PS; - else if (Mapping.getBoolMapping(ind, DS4Controls.LXPos, cState, eState, tp)) return DS4Controls.LXPos; - else if (Mapping.getBoolMapping(ind, DS4Controls.LXNeg, cState, eState, tp)) return DS4Controls.LXNeg; - else if (Mapping.getBoolMapping(ind, DS4Controls.LYPos, cState, eState, tp)) return DS4Controls.LYPos; - else if (Mapping.getBoolMapping(ind, DS4Controls.LYNeg, cState, eState, tp)) return DS4Controls.LYNeg; - else if (Mapping.getBoolMapping(ind, DS4Controls.RXPos, cState, eState, tp)) return DS4Controls.RXPos; - else if (Mapping.getBoolMapping(ind, DS4Controls.RXNeg, cState, eState, tp)) return DS4Controls.RXNeg; - else if (Mapping.getBoolMapping(ind, DS4Controls.RYPos, cState, eState, tp)) return DS4Controls.RYPos; - else if (Mapping.getBoolMapping(ind, DS4Controls.RYNeg, cState, eState, tp)) return DS4Controls.RYNeg; - else if (Mapping.getBoolMapping(ind, DS4Controls.TouchLeft, cState, eState, tp)) return DS4Controls.TouchLeft; - else if (Mapping.getBoolMapping(ind, DS4Controls.TouchRight, cState, eState, tp)) return DS4Controls.TouchRight; - else if (Mapping.getBoolMapping(ind, DS4Controls.TouchMulti, cState, eState, tp)) return DS4Controls.TouchMulti; - else if (Mapping.getBoolMapping(ind, DS4Controls.TouchUpper, cState, eState, tp)) return DS4Controls.TouchUpper; - return DS4Controls.None; + { + if (Mapping.getBoolButtonMapping(cState.Cross)) + { + result = DS4Controls.Cross; + } + else if (Mapping.getBoolButtonMapping(cState.Circle)) + { + result = DS4Controls.Circle; + } + else if (Mapping.getBoolButtonMapping(cState.Triangle)) + { + result = DS4Controls.Triangle; + } + else if (Mapping.getBoolButtonMapping(cState.Square)) + { + result = DS4Controls.Square; + } + else if (Mapping.getBoolButtonMapping(cState.L1)) + { + result = DS4Controls.L1; + } + else if (Mapping.getBoolTriggerMapping(cState.L2)) + { + result = DS4Controls.L2; + } + else if (Mapping.getBoolButtonMapping(cState.L3)) + { + result = DS4Controls.L3; + } + else if (Mapping.getBoolButtonMapping(cState.R1)) + { + result = DS4Controls.R1; + } + else if (Mapping.getBoolTriggerMapping(cState.R2)) + { + result = DS4Controls.R2; + } + else if (Mapping.getBoolButtonMapping(cState.R3)) + { + result = DS4Controls.R3; + } + else if (Mapping.getBoolButtonMapping(cState.DpadUp)) + { + result = DS4Controls.DpadUp; + } + else if (Mapping.getBoolButtonMapping(cState.DpadDown)) + { + result = DS4Controls.DpadDown; + } + else if (Mapping.getBoolButtonMapping(cState.DpadLeft)) + { + result = DS4Controls.DpadLeft; + } + else if (Mapping.getBoolButtonMapping(cState.DpadRight)) + { + result = DS4Controls.DpadRight; + } + else if (Mapping.getBoolButtonMapping(cState.Share)) + { + result = DS4Controls.Share; + } + else if (Mapping.getBoolButtonMapping(cState.Options)) + { + result = DS4Controls.Options; + } + else if (Mapping.getBoolButtonMapping(cState.PS)) + { + result = DS4Controls.PS; + } + else if (Mapping.getBoolAxisDirMapping(cState.LX, true)) + { + result = DS4Controls.LXPos; + } + else if (Mapping.getBoolAxisDirMapping(cState.LX, false)) + { + result = DS4Controls.LXNeg; + } + else if (Mapping.getBoolAxisDirMapping(cState.LY, true)) + { + result = DS4Controls.LYPos; + } + else if (Mapping.getBoolAxisDirMapping(cState.LY, false)) + { + result = DS4Controls.LYNeg; + } + else if (Mapping.getBoolAxisDirMapping(cState.RX, true)) + { + result = DS4Controls.RXPos; + } + else if (Mapping.getBoolAxisDirMapping(cState.RX, false)) + { + result = DS4Controls.RXNeg; + } + else if (Mapping.getBoolAxisDirMapping(cState.RY, true)) + { + result = DS4Controls.RYPos; + } + else if (Mapping.getBoolAxisDirMapping(cState.RY, false)) + { + result = DS4Controls.RYNeg; + } + else if (Mapping.getBoolTouchMapping(tp.leftDown)) + { + result = DS4Controls.TouchLeft; + } + else if (Mapping.getBoolTouchMapping(tp.rightDown)) + { + result = DS4Controls.TouchRight; + } + else if (Mapping.getBoolTouchMapping(tp.multiDown)) + { + result = DS4Controls.TouchMulti; + } + else if (Mapping.getBoolTouchMapping(tp.upperDown)) + { + result = DS4Controls.TouchUpper; + } + } + + return result; } + */ public bool[] touchreleased = { true, true, true, true }, touchslid = { false, false, false, false }; public byte[] oldtouchvalue = { 0, 0, 0, 0 }; public int[] oldscrollvalue = { 0, 0, 0, 0 }; - protected virtual void CheckForHotkeys(int deviceID, DS4State cState, DS4State pState) + + protected virtual void CheckForTouchToggle(int deviceID, DS4State cState, DS4State pState) { - if (!UseTPforControls[deviceID] && cState.Touch1 && pState.PS) + if (!getUseTPforControls(deviceID) && cState.Touch1 && pState.PS) { - if (TouchSensitivity[deviceID] > 0 && touchreleased[deviceID]) + if (getTouchSensitivity(deviceID) > 0 && touchreleased[deviceID]) { - oldtouchvalue[deviceID] = TouchSensitivity[deviceID]; - oldscrollvalue[deviceID] = ScrollSensitivity[deviceID]; - TouchSensitivity[deviceID] = 0; - ScrollSensitivity[deviceID] = 0; - LogDebug(TouchSensitivity[deviceID] > 0 ? Properties.Resources.TouchpadMovementOn : Properties.Resources.TouchpadMovementOff); - Log.LogToTray(TouchSensitivity[deviceID] > 0 ? Properties.Resources.TouchpadMovementOn : Properties.Resources.TouchpadMovementOff); + oldtouchvalue[deviceID] = getTouchSensitivity(deviceID); + oldscrollvalue[deviceID] = getScrollSensitivity(deviceID); + getTouchSensitivity()[deviceID] = 0; + getScrollSensitivity()[deviceID] = 0; + LogDebug(getTouchSensitivity(deviceID) > 0 ? Properties.Resources.TouchpadMovementOn : + Properties.Resources.TouchpadMovementOff); + Log.LogToTray(getTouchSensitivity(deviceID) > 0 ? Properties.Resources.TouchpadMovementOn : + Properties.Resources.TouchpadMovementOff); touchreleased[deviceID] = false; } else if (touchreleased[deviceID]) { - TouchSensitivity[deviceID] = oldtouchvalue[deviceID]; - ScrollSensitivity[deviceID] = oldscrollvalue[deviceID]; - LogDebug(TouchSensitivity[deviceID] > 0 ? Properties.Resources.TouchpadMovementOn : Properties.Resources.TouchpadMovementOff); - Log.LogToTray(TouchSensitivity[deviceID] > 0 ? Properties.Resources.TouchpadMovementOn : Properties.Resources.TouchpadMovementOff); + getTouchSensitivity()[deviceID] = oldtouchvalue[deviceID]; + getScrollSensitivity()[deviceID] = oldscrollvalue[deviceID]; + LogDebug(getTouchSensitivity(deviceID) > 0 ? Properties.Resources.TouchpadMovementOn : + Properties.Resources.TouchpadMovementOff); + Log.LogToTray(getTouchSensitivity(deviceID) > 0 ? Properties.Resources.TouchpadMovementOn : + Properties.Resources.TouchpadMovementOff); touchreleased[deviceID] = false; } } else - touchreleased[deviceID] = true; + touchreleased[deviceID] = true; } public virtual void StartTPOff(int deviceID) { if (deviceID < 4) { - oldtouchvalue[deviceID] = TouchSensitivity[deviceID]; - oldscrollvalue[deviceID] = ScrollSensitivity[deviceID]; + oldtouchvalue[deviceID] = getTouchSensitivity(deviceID); + oldscrollvalue[deviceID] = getScrollSensitivity(deviceID); TouchSensitivity[deviceID] = 0; ScrollSensitivity[deviceID] = 0; } @@ -790,7 +983,9 @@ namespace DS4Windows { DS4State cState = CurrentState[ind]; string slidedir = "none"; - if (DS4Controllers[ind] != null && cState.Touch2 && !(touchPad[ind].dragging || touchPad[ind].dragging2)) + if (DS4Controllers[ind] != null && cState.Touch2 && + !(touchPad[ind].dragging || touchPad[ind].dragging2)) + { if (touchPad[ind].slideright && !touchslid[ind]) { slidedir = "right"; @@ -806,11 +1001,14 @@ namespace DS4Windows slidedir = ""; touchslid[ind] = false; } + } + return slidedir; } + public virtual void LogDebug(String Data, bool warning = false) { - Console.WriteLine(System.DateTime.Now.ToString("G") + "> " + Data); + //Console.WriteLine(System.DateTime.Now.ToString("G") + "> " + Data); if (Debug != null) { DebugEventArgs args = new DebugEventArgs(Data, warning); @@ -827,22 +1025,27 @@ namespace DS4Windows //sets the rumble adjusted with rumble boost public virtual void setRumble(byte heavyMotor, byte lightMotor, int deviceNum) { - byte boost = RumbleBoost[deviceNum]; + byte boost = getRumbleBoost(deviceNum); uint lightBoosted = ((uint)lightMotor * (uint)boost) / 100; if (lightBoosted > 255) lightBoosted = 255; uint heavyBoosted = ((uint)heavyMotor * (uint)boost) / 100; if (heavyBoosted > 255) heavyBoosted = 255; + if (deviceNum < 4) - if (DS4Controllers[deviceNum] != null) - DS4Controllers[deviceNum].setRumble((byte)lightBoosted, (byte)heavyBoosted); + { + DS4Device device = DS4Controllers[deviceNum]; + if (device != null) + device.setRumble((byte)lightBoosted, (byte)heavyBoosted); + } } public DS4State getDS4State(int ind) { return CurrentState[ind]; } + public DS4State getDS4StateMapped(int ind) { return MappedState[ind]; diff --git a/DS4Windows/DS4Control/DS4LightBar.cs b/DS4Windows/DS4Control/DS4LightBar.cs index 98483a3..74db736 100644 --- a/DS4Windows/DS4Control/DS4LightBar.cs +++ b/DS4Windows/DS4Control/DS4LightBar.cs @@ -5,6 +5,8 @@ using System.Text; using System.Drawing; using static System.Math; using static DS4Windows.Global; +using System.Diagnostics; + namespace DS4Windows { public class DS4LightBar @@ -23,124 +25,210 @@ namespace DS4Windows { 252, 28 } // on 90% of the time at 90 }; static double[] counters = new double[4] { 0, 0, 0, 0 }; - public static double[] fadetimer = new double[4] { 0, 0, 0, 0 }; + public static Stopwatch[] fadewatches = { new Stopwatch(), new Stopwatch(), new Stopwatch(), new Stopwatch() }; static bool[] fadedirection = new bool[4] { false, false, false, false }; - static DateTime oldnow = DateTime.UtcNow; + static DateTime[] oldnow = { DateTime.UtcNow, DateTime.UtcNow, DateTime.UtcNow, DateTime.UtcNow }; public static bool[] forcelight = new bool[4] { false, false, false, false }; public static DS4Color[] forcedColor = new DS4Color[4]; public static byte[] forcedFlash = new byte[4]; - public static void updateLightBar(DS4Device device, int deviceNum, DS4State cState, DS4StateExposed eState, Mouse tp) - { - DS4Color color; - if (!defualtLight && !forcelight[deviceNum]) - { - if (UseCustomLed[deviceNum]) - { - if (LedAsBatteryIndicator[deviceNum]) - { - DS4Color fullColor = CustomColor[deviceNum]; - DS4Color lowColor = LowColor[deviceNum]; + internal const int PULSE_FLASH_DURATION = 2000; + internal const int PULSE_CHARGING_DURATION = 4000; - color = getTransitionedColor(lowColor, fullColor, device.Battery); + public static void updateLightBar(DS4Device device, int deviceNum, DS4State cState, + DS4StateExposed eState, Mouse tp) + { + /* + * TODO: Remove more property usage and use explicit getter methods instead. + * Testing in proper optimized release builds shows that it is + * still necessary to reduce lag. + */ + DS4Color color; + if (!defaultLight && !forcelight[deviceNum]) + { + if (getUseCustomLed(deviceNum)) + { + if (getLedAsBatteryIndicator(deviceNum)) + { + DS4Color fullColor = getCustomColor(deviceNum); + DS4Color lowColor = getLowColor(deviceNum); + color = getTransitionedColor(lowColor, fullColor, device.Battery); } else - color = CustomColor[deviceNum]; + color = getCustomColor(deviceNum); } else { - if (Rainbow[deviceNum] > 0) - {// Display rainbow + double rainbow = getRainbow(deviceNum); + if (rainbow > 0) + { + // Display rainbow DateTime now = DateTime.UtcNow; - if (now >= oldnow + TimeSpan.FromMilliseconds(10)) //update by the millisecond that way it's a smooth transtion + if (now >= oldnow[deviceNum] + TimeSpan.FromMilliseconds(10)) //update by the millisecond that way it's a smooth transtion { - oldnow = now; - if (device.Charging) - counters[deviceNum] -= 1.5 * 3 / Rainbow[deviceNum]; + oldnow[deviceNum] = now; + if (device.isCharging()) + counters[deviceNum] -= 1.5 * 3 / rainbow; else - counters[deviceNum] += 1.5 * 3 / Rainbow[deviceNum]; + counters[deviceNum] += 1.5 * 3 / rainbow; } + if (counters[deviceNum] < 0) counters[deviceNum] = 180000; - if (counters[deviceNum] > 180000) + else if (counters[deviceNum] > 180000) counters[deviceNum] = 0; - if (LedAsBatteryIndicator[deviceNum]) - color = HuetoRGB((float)counters[deviceNum] % 360, (byte)(2.55 * device.Battery)); + + if (getLedAsBatteryIndicator(deviceNum)) + color = HuetoRGB((float)counters[deviceNum] % 360, (byte)(2.55 * device.getBattery())); else color = HuetoRGB((float)counters[deviceNum] % 360, 255); } - else if (LedAsBatteryIndicator[deviceNum]) + else if (getLedAsBatteryIndicator(deviceNum)) { //if (device.Charging == false || device.Battery >= 100) // when charged, don't show the charging animation { - DS4Color fullColor = MainColor[deviceNum]; - DS4Color lowColor = LowColor[deviceNum]; + DS4Color fullColor = getMainColor(deviceNum); + DS4Color lowColor = getLowColor(deviceNum); - color = getTransitionedColor(lowColor, fullColor, (uint)device.Battery); + color = getTransitionedColor(lowColor, fullColor, (uint)device.getBattery()); } } else { - color = MainColor[deviceNum]; + color = getMainColor(deviceNum); } - } - if (device.Battery <= FlashAt[deviceNum] && !defualtLight && !device.Charging) + if (device.getBattery() <= getFlashAt(deviceNum) && !defaultLight && !device.isCharging()) { - if (!(FlashColor[deviceNum].red == 0 && - FlashColor[deviceNum].green == 0 && - FlashColor[deviceNum].blue == 0)) - color = FlashColor[deviceNum]; - if (FlashType[deviceNum] == 1) + DS4Color flashColor = getFlashColor(deviceNum); + if (!(flashColor.red == 0 && + flashColor.green == 0 && + flashColor.blue == 0)) + color = flashColor; + + if (getFlashType(deviceNum) == 1) { - if (fadetimer[deviceNum] <= 0) - fadedirection[deviceNum] = true; - else if (fadetimer[deviceNum] >= 100) - fadedirection[deviceNum] = false; - if (fadedirection[deviceNum]) - fadetimer[deviceNum] += 1; + double ratio = 0.0; + + if (!fadewatches[deviceNum].IsRunning) + { + bool temp = fadedirection[deviceNum]; + fadedirection[deviceNum] = !temp; + fadewatches[deviceNum].Restart(); + ratio = temp ? 100.0 : 0.0; + } else - fadetimer[deviceNum] -= 1; - color = getTransitionedColor(color, new DS4Color(0, 0, 0), fadetimer[deviceNum]); + { + long elapsed = fadewatches[deviceNum].ElapsedMilliseconds; + + if (fadedirection[deviceNum]) + { + if (elapsed < PULSE_FLASH_DURATION) + { + ratio = 100.0 * (elapsed / (double)PULSE_FLASH_DURATION); + } + else + { + ratio = 100.0; + fadewatches[deviceNum].Stop(); + } + } + else + { + if (elapsed < PULSE_FLASH_DURATION) + { + ratio = (0 - 100.0) * (elapsed / (double)PULSE_FLASH_DURATION) + 100.0; + } + else + { + ratio = 0.0; + fadewatches[deviceNum].Stop(); + } + } + } + + color = getTransitionedColor(color, new DS4Color(0, 0, 0), ratio); } } - if (IdleDisconnectTimeout[deviceNum] > 0 && LedAsBatteryIndicator[deviceNum] && (!device.Charging || device.Battery >= 100)) - {//Fade lightbar by idle time + int idleDisconnectTimeout = getIdleDisconnectTimeout(deviceNum); + if (idleDisconnectTimeout > 0 && getLedAsBatteryIndicator(deviceNum) && + (!device.isCharging() || device.getBattery() >= 100)) + { + //Fade lightbar by idle time TimeSpan timeratio = new TimeSpan(DateTime.UtcNow.Ticks - device.lastActive.Ticks); double botratio = timeratio.TotalMilliseconds; - double topratio = TimeSpan.FromSeconds(IdleDisconnectTimeout[deviceNum]).TotalMilliseconds; - double ratio = ((botratio / topratio) * 100); - if (ratio >= 50 && ratio <= 100) + double topratio = TimeSpan.FromSeconds(idleDisconnectTimeout).TotalMilliseconds; + double ratio = 100.0 * (botratio / topratio); + if (ratio >= 50.0 && ratio <= 100.0) color = getTransitionedColor(color, new DS4Color(0, 0, 0), (uint)((ratio - 50) * 2)); - else if (ratio >= 100) - color = getTransitionedColor(color, new DS4Color(0, 0, 0), 100); + else if (ratio >= 100.0) + color = getTransitionedColor(color, new DS4Color(0, 0, 0), 100.0); } - if (device.Charging && device.Battery < 100) - switch (ChargingType[deviceNum]) + + if (device.isCharging() && device.getBattery() < 100) + { + switch (getChargingType(deviceNum)) { case 1: - if (fadetimer[deviceNum] <= 0) - fadedirection[deviceNum] = true; - else if (fadetimer[deviceNum] >= 105) - fadedirection[deviceNum] = false; - if (fadedirection[deviceNum]) - fadetimer[deviceNum] += .1; + { + double ratio = 0.0; + + if (!fadewatches[deviceNum].IsRunning) + { + bool temp = fadedirection[deviceNum]; + fadedirection[deviceNum] = !temp; + fadewatches[deviceNum].Restart(); + ratio = temp ? 100.0 : 0.0; + } else - fadetimer[deviceNum] -= .1; - color = getTransitionedColor(color, new DS4Color(0, 0, 0), fadetimer[deviceNum]); + { + long elapsed = fadewatches[deviceNum].ElapsedMilliseconds; + + if (fadedirection[deviceNum]) + { + if (elapsed < PULSE_CHARGING_DURATION) + { + ratio = 100.0 * (elapsed / (double)PULSE_CHARGING_DURATION); + } + else + { + ratio = 100.0; + fadewatches[deviceNum].Stop(); + } + } + else + { + if (elapsed < PULSE_CHARGING_DURATION) + { + ratio = (0 - 100.0) * (elapsed / (double)PULSE_CHARGING_DURATION) + 100.0; + } + else + { + ratio = 0.0; + fadewatches[deviceNum].Stop(); + } + } + } + + color = getTransitionedColor(color, new DS4Color(0, 0, 0), ratio); break; + } case 2: - counters[deviceNum] += .167; + { + counters[deviceNum] += 0.167; color = HuetoRGB((float)counters[deviceNum] % 360, 255); break; + } case 3: - color = ChargingColor[deviceNum]; - break; - default: + { + color = getChargingColor(deviceNum); break; + } + default: break; } + } } else if (forcelight[deviceNum]) { @@ -150,25 +238,30 @@ namespace DS4Windows color = new DS4Color(0, 0, 0); else { - if (device.ConnectionType == ConnectionType.BT) + if (device.getConnectionType() == ConnectionType.BT) color = new DS4Color(32, 64, 64); else color = new DS4Color(0, 0, 0); } - bool distanceprofile = (ProfilePath[deviceNum].ToLower().Contains("distance") || tempprofilename[deviceNum].ToLower().Contains("distance")); - if (distanceprofile && !defualtLight) - { //Thing I did for Distance - float rumble = device.LeftHeavySlowRumble / 2.55f; + + bool distanceprofile = DistanceProfiles[deviceNum] || tempprofileDistance[deviceNum]; + //distanceprofile = (ProfilePath[deviceNum].ToLower().Contains("distance") || tempprofilename[deviceNum].ToLower().Contains("distance")); + if (distanceprofile && !defaultLight) + { + // Thing I did for Distance + float rumble = device.getLeftHeavySlowRumble() / 2.55f; byte max = Max(color.red, Max(color.green, color.blue)); - if (device.LeftHeavySlowRumble > 100) + if (device.getLeftHeavySlowRumble() > 100) color = getTransitionedColor(new DS4Color(max, max, 0), new DS4Color(255, 0, 0), rumble); else - color = getTransitionedColor(color, getTransitionedColor(new DS4Color(max, max, 0), new DS4Color(255, 0, 0), 39.6078f), device.LeftHeavySlowRumble); + color = getTransitionedColor(color, getTransitionedColor(new DS4Color(max, max, 0), new DS4Color(255, 0, 0), 39.6078f), device.getLeftHeavySlowRumble()); } + DS4HapticState haptics = new DS4HapticState { LightBarColor = color }; + if (haptics.IsLightBarSet()) { if (forcelight[deviceNum] && forcedFlash[deviceNum] > 0) @@ -176,17 +269,18 @@ namespace DS4Windows haptics.LightBarFlashDurationOff = haptics.LightBarFlashDurationOn = (byte)(25 - forcedFlash[deviceNum]); haptics.LightBarExplicitlyOff = true; } - else if (device.Battery <= FlashAt[deviceNum] && FlashType[deviceNum] == 0 && !defualtLight && !device.Charging) + else if (device.getBattery() <= getFlashAt(deviceNum) && getFlashType(deviceNum) == 0 && !defaultLight && !device.isCharging()) { - int level = device.Battery / 10; - //if (level >= 10) - //level = 0; // all values of ~0% or >~100% are rendered the same + int level = device.getBattery() / 10; + if (level >= 10) + level = 0; // all values of ~0% or >~100% are rendered the same + haptics.LightBarFlashDurationOn = BatteryIndicatorDurations[level, 0]; haptics.LightBarFlashDurationOff = BatteryIndicatorDurations[level, 1]; } - else if (distanceprofile && device.LeftHeavySlowRumble > 155) //also part of Distance + else if (distanceprofile && device.getLeftHeavySlowRumble() > 155) //also part of Distance { - haptics.LightBarFlashDurationOff = haptics.LightBarFlashDurationOn = (byte)((-device.LeftHeavySlowRumble + 265)); + haptics.LightBarFlashDurationOff = haptics.LightBarFlashDurationOn = (byte)((-device.getLeftHeavySlowRumble() + 265)); haptics.LightBarExplicitlyOff = true; } else @@ -200,14 +294,19 @@ namespace DS4Windows { haptics.LightBarExplicitlyOff = true; } - if (device.LightBarOnDuration != haptics.LightBarFlashDurationOn && device.LightBarOnDuration != 1 && haptics.LightBarFlashDurationOn == 0) + + byte tempLightBarOnDuration = device.getLightBarOnDuration(); + if (tempLightBarOnDuration != haptics.LightBarFlashDurationOn && tempLightBarOnDuration != 1 && haptics.LightBarFlashDurationOn == 0) haptics.LightBarFlashDurationOff = haptics.LightBarFlashDurationOn = 1; - if (device.LightBarOnDuration == 1) //helps better reset the color - System.Threading.Thread.Sleep(5); + + // Comment out code for now. This condition gets hit too often and bogs down the GUI + //if (device.LightBarOnDuration == 1) //helps better reset the color + // System.Threading.Thread.Sleep(5); + device.pushHapticState(haptics); } - public static bool defualtLight = false, shuttingdown = false; + public static bool defaultLight = false, shuttingdown = false; public static DS4Color HuetoRGB(float hue, byte sat) { diff --git a/DS4Windows/DS4Control/DS4StateFieldMapping.cs b/DS4Windows/DS4Control/DS4StateFieldMapping.cs new file mode 100644 index 0000000..62b464f --- /dev/null +++ b/DS4Windows/DS4Control/DS4StateFieldMapping.cs @@ -0,0 +1,146 @@ + +namespace DS4Windows +{ + public class DS4StateFieldMapping + { + public enum ControlType { Unknown = 0, Button, AxisDir, Trigger, Touch, GyroDir, SwipeDir } + + public bool[] buttons = new bool[(int)DS4Controls.SwipeDown + 1]; + public byte[] axisdirs = new byte[(int)DS4Controls.SwipeDown + 1]; + public byte[] triggers = new byte[(int)DS4Controls.SwipeDown + 1]; + public int[] gryodirs = new int[(int)DS4Controls.SwipeDown + 1]; + public byte[] swipedirs = new byte[(int)DS4Controls.SwipeDown + 1]; + public bool[] swipedirbools = new bool[(int)DS4Controls.SwipeDown + 1]; + + public static ControlType[] mappedType = { ControlType.Unknown, // DS4Controls.None + ControlType.AxisDir, // DS4Controls.LXNeg + ControlType.AxisDir, // DS4Controls.LXPos + ControlType.AxisDir, // DS4Controls.LYNeg + ControlType.AxisDir, // DS4Controls.LYPos + ControlType.AxisDir, // DS4Controls.RXNeg + ControlType.AxisDir, // DS4Controls.RXPos + ControlType.AxisDir, // DS4Controls.RYNeg + ControlType.AxisDir, // DS4Controls.RYPos + ControlType.Button, // DS4Controls.L1 + ControlType.Trigger, // DS4Controls.L2 + ControlType.Button, // DS4Controls.L3 + ControlType.Button, // DS4Controls.R1 + ControlType.Trigger, // DS4Controls.R2 + ControlType.Button, // DS4Controls.R3 + ControlType.Button, // DS4Controls.Square + ControlType.Button, // DS4Controls.Triangle + ControlType.Button, // DS4Controls.Circle + ControlType.Button, // DS4Controls.Cross + ControlType.Button, // DS4Controls.DpadUp + ControlType.Button, // DS4Controls.DpadRight + ControlType.Button, // DS4Controls.DpadDown + ControlType.Button, // DS4Controls.DpadLeft + ControlType.Button, // DS4Controls.PS + ControlType.Touch, // DS4Controls.TouchLeft + ControlType.Touch, // DS4Controls.TouchUpper + ControlType.Touch, // DS4Controls.TouchMulti + ControlType.Touch, // DS4Controls.TouchRight + ControlType.Button, // DS4Controls.Share + ControlType.Button, // DS4Controls.Options + ControlType.GyroDir, // DS4Controls.GyroXPos + ControlType.GyroDir, // DS4Controls.GyroXNeg + ControlType.GyroDir, // DS4Controls.GyroZPos + ControlType.GyroDir, // DS4Controls.GyroZNeg + ControlType.SwipeDir, // DS4Controls.SwipeLeft + ControlType.SwipeDir, // DS4Controls.SwipeRight + ControlType.SwipeDir, // DS4Controls.SwipeUp + ControlType.SwipeDir, // DS4Controls.SwipeDown + }; + + public DS4StateFieldMapping(DS4State cState, DS4StateExposed exposeState, Mouse tp) + { + axisdirs[(int)DS4Controls.LXNeg] = cState.LX; + axisdirs[(int)DS4Controls.LXPos] = cState.LX; + axisdirs[(int)DS4Controls.LYNeg] = cState.LY; + axisdirs[(int)DS4Controls.LYPos] = cState.LY; + + axisdirs[(int)DS4Controls.RXNeg] = cState.RX; + axisdirs[(int)DS4Controls.RXPos] = cState.RX; + axisdirs[(int)DS4Controls.RYNeg] = cState.RY; + axisdirs[(int)DS4Controls.RYPos] = cState.RY; + + triggers[(int)DS4Controls.L2] = cState.L2; + triggers[(int)DS4Controls.R2] = cState.R2; + + buttons[(int)DS4Controls.L1] = cState.L1; + buttons[(int)DS4Controls.L3] = cState.L3; + buttons[(int)DS4Controls.R1] = cState.R1; + buttons[(int)DS4Controls.R3] = cState.R3; + + buttons[(int)DS4Controls.Cross] = cState.Cross; + buttons[(int)DS4Controls.Triangle] = cState.Triangle; + buttons[(int)DS4Controls.Circle] = cState.Circle; + buttons[(int)DS4Controls.Square] = cState.Square; + buttons[(int)DS4Controls.PS] = cState.PS; + buttons[(int)DS4Controls.Options] = cState.Options; + buttons[(int)DS4Controls.Share] = cState.Share; + + buttons[(int)DS4Controls.DpadUp] = cState.DpadUp; + buttons[(int)DS4Controls.DpadRight] = cState.DpadRight; + buttons[(int)DS4Controls.DpadDown] = cState.DpadDown; + buttons[(int)DS4Controls.DpadLeft] = cState.DpadLeft; + + buttons[(int)DS4Controls.TouchLeft] = tp != null ? tp.leftDown : false; + buttons[(int)DS4Controls.TouchRight] = tp != null ? tp.rightDown : false; + buttons[(int)DS4Controls.TouchUpper] = tp != null ? tp.upperDown : false; + buttons[(int)DS4Controls.TouchMulti] = tp != null ? tp.multiDown : false; + + int gyroX = exposeState.getGyroX(); + gryodirs[(int)DS4Controls.GyroXPos] = gyroX > 0 ? gyroX : 0; + gryodirs[(int)DS4Controls.GyroXNeg] = gyroX < 0 ? gyroX : 0; + + int gyroZ = exposeState.getGyroZ(); + gryodirs[(int)DS4Controls.GyroZPos] = gyroZ > 0 ? gyroZ : 0; + gryodirs[(int)DS4Controls.GyroZNeg] = gyroZ < 0 ? gyroZ : 0; + + swipedirs[(int)DS4Controls.SwipeLeft] = tp != null ? tp.swipeLeftB : (byte)0; + swipedirs[(int)DS4Controls.SwipeRight] = tp != null ? tp.swipeRightB : (byte)0; + swipedirs[(int)DS4Controls.SwipeUp] = tp != null ? tp.swipeUpB : (byte)0; + swipedirs[(int)DS4Controls.SwipeDown] = tp != null ? tp.swipeDownB : (byte)0; + + swipedirbools[(int)DS4Controls.SwipeLeft] = tp != null ? tp.swipeLeft : false; + swipedirbools[(int)DS4Controls.SwipeRight] = tp != null ? tp.swipeRight : false; + swipedirbools[(int)DS4Controls.SwipeUp] = tp != null ? tp.swipeUp : false; + swipedirbools[(int)DS4Controls.SwipeDown] = tp != null ? tp.swipeDown : false; + } + + public void populateState(DS4State state) + { + state.LX = axisdirs[(int)DS4Controls.LXNeg]; + state.LX = axisdirs[(int)DS4Controls.LXPos]; + state.LY = axisdirs[(int)DS4Controls.LYNeg]; + state.LY = axisdirs[(int)DS4Controls.LYPos]; + + state.RX = axisdirs[(int)DS4Controls.RXNeg]; + state.RX = axisdirs[(int)DS4Controls.RXPos]; + state.RY = axisdirs[(int)DS4Controls.RYNeg]; + state.RY = axisdirs[(int)DS4Controls.RYPos]; + + state.L2 = triggers[(int)DS4Controls.L2]; + state.R2 = triggers[(int)DS4Controls.R2]; + + state.L1 = buttons[(int)DS4Controls.L1]; + state.L3 = buttons[(int)DS4Controls.L3]; + state.R1 = buttons[(int)DS4Controls.R1]; + state.R3 = buttons[(int)DS4Controls.R3]; + + state.Cross = buttons[(int)DS4Controls.Cross]; + state.Triangle = buttons[(int)DS4Controls.Triangle]; + state.Circle = buttons[(int)DS4Controls.Circle]; + state.Square = buttons[(int)DS4Controls.Square]; + state.PS = buttons[(int)DS4Controls.PS]; + state.Options = buttons[(int)DS4Controls.Options]; + state.Share = buttons[(int)DS4Controls.Share]; + + state.DpadUp = buttons[(int)DS4Controls.DpadUp]; + state.DpadRight = buttons[(int)DS4Controls.DpadRight]; + state.DpadDown = buttons[(int)DS4Controls.DpadDown]; + state.DpadLeft = buttons[(int)DS4Controls.DpadLeft]; + } + } +} diff --git a/DS4Windows/DS4Control/InputMethods.cs b/DS4Windows/DS4Control/InputMethods.cs index 278f86e..91c4f08 100644 --- a/DS4Windows/DS4Control/InputMethods.cs +++ b/DS4Windows/DS4Control/InputMethods.cs @@ -1,14 +1,13 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Runtime.InteropServices; + namespace DS4Windows { class InputMethods { private static INPUT[] sendInputs = new INPUT[2]; // will allow for keyboard + mouse/tablet input within one SendInput call, or two mouse events private static object lockob = new object(); + public static void MoveCursorBy(int x, int y) { lock (lockob) @@ -43,6 +42,7 @@ namespace DS4Windows sendInputs[inputs].Data.Mouse.Y = 0; inputs++; } + if (horizontal != 0) { sendInputs[inputs].Type = INPUT_MOUSE; @@ -54,6 +54,7 @@ namespace DS4Windows sendInputs[inputs].Data.Mouse.Y = 0; inputs++; } + SendInput(inputs, sendInputs, (int)inputs * Marshal.SizeOf(sendInputs[0])); } } @@ -88,69 +89,6 @@ namespace DS4Windows } } - public static void performLeftClick() - { - lock (lockob) - { - sendInputs[0].Type = INPUT_MOUSE; - sendInputs[0].Data.Mouse.ExtraInfo = IntPtr.Zero; - sendInputs[0].Data.Mouse.Flags = 0; - sendInputs[0].Data.Mouse.Flags |= MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP; - sendInputs[0].Data.Mouse.MouseData = 0; - sendInputs[0].Data.Mouse.Time = 0; - sendInputs[0].Data.Mouse.X = 0; - sendInputs[0].Data.Mouse.Y = 0; - uint result = SendInput(1, sendInputs, Marshal.SizeOf(sendInputs[0])); - } - } - - public static void performRightClick() - { - lock (lockob) - { - sendInputs[0].Type = INPUT_MOUSE; - sendInputs[0].Data.Mouse.ExtraInfo = IntPtr.Zero; - sendInputs[0].Data.Mouse.Flags = 0; - sendInputs[0].Data.Mouse.Flags |= MOUSEEVENTF_RIGHTDOWN | MOUSEEVENTF_RIGHTUP; - sendInputs[0].Data.Mouse.MouseData = 0; - sendInputs[0].Data.Mouse.Time = 0; - sendInputs[0].Data.Mouse.X = 0; - sendInputs[0].Data.Mouse.Y = 0; - uint result = SendInput(1, sendInputs, Marshal.SizeOf(sendInputs[0])); - } - } - - public static void performMiddleClick() - { - lock (lockob) - { - sendInputs[0].Type = INPUT_MOUSE; - sendInputs[0].Data.Mouse.ExtraInfo = IntPtr.Zero; - sendInputs[0].Data.Mouse.Flags = 0; - sendInputs[0].Data.Mouse.Flags |= MOUSEEVENTF_MIDDLEDOWN | MOUSEEVENTF_MIDDLEUP; - sendInputs[0].Data.Mouse.MouseData = 0; - sendInputs[0].Data.Mouse.Time = 0; - sendInputs[0].Data.Mouse.X = 0; - sendInputs[0].Data.Mouse.Y = 0; - uint result = SendInput(1, sendInputs, Marshal.SizeOf(sendInputs[0])); - } - } - - public static void performFourthClick() - { - lock (lockob) - { - sendInputs[0].Type = INPUT_MOUSE; - sendInputs[0].Data.Mouse.ExtraInfo = IntPtr.Zero; - sendInputs[0].Data.Mouse.Flags = 0; - sendInputs[0].Data.Mouse.Flags |= MOUSEEVENTF_XBUTTONDOWN | MOUSEEVENTF_XBUTTONUP; - sendInputs[0].Data.Mouse.MouseData = 1; - sendInputs[0].Data.Mouse.Time = 0; - sendInputs[0].Data.Mouse.X = 0; - sendInputs[0].Data.Mouse.Y = 0; - uint result = SendInput(1, sendInputs, Marshal.SizeOf(sendInputs[0])); - } - } public static void performSCKeyPress(ushort key) { lock (lockob) @@ -169,10 +107,16 @@ namespace DS4Windows { lock (lockob) { + ushort scancode = scancodeFromVK(key); + bool extended = (scancode & 0x100) != 0; + uint curflags = extended ? KEYEVENTF_EXTENDEDKEY : 0; + sendInputs[0].Type = INPUT_KEYBOARD; sendInputs[0].Data.Keyboard.ExtraInfo = IntPtr.Zero; - sendInputs[0].Data.Keyboard.Flags = 1; - sendInputs[0].Data.Keyboard.Scan = 0; + sendInputs[0].Data.Keyboard.Flags = curflags; + sendInputs[0].Data.Keyboard.Scan = scancode; + //sendInputs[0].Data.Keyboard.Flags = 1; + //sendInputs[0].Data.Keyboard.Scan = 0; sendInputs[0].Data.Keyboard.Time = 0; sendInputs[0].Data.Keyboard.Vk = key; uint result = SendInput(1, sendInputs, Marshal.SizeOf(sendInputs[0])); @@ -197,16 +141,60 @@ namespace DS4Windows { lock (lockob) { + ushort scancode = scancodeFromVK(key); + bool extended = (scancode & 0x100) != 0; + uint curflags = extended ? KEYEVENTF_EXTENDEDKEY : 0; + sendInputs[0].Type = INPUT_KEYBOARD; sendInputs[0].Data.Keyboard.ExtraInfo = IntPtr.Zero; - sendInputs[0].Data.Keyboard.Flags = KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP; - sendInputs[0].Data.Keyboard.Scan = 0; + sendInputs[0].Data.Keyboard.Flags = curflags | KEYEVENTF_KEYUP; + sendInputs[0].Data.Keyboard.Scan = scancode; + //sendInputs[0].Data.Keyboard.Flags = KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP; + //sendInputs[0].Data.Keyboard.Scan = 0; sendInputs[0].Data.Keyboard.Time = 0; sendInputs[0].Data.Keyboard.Vk = key; uint result = SendInput(1, sendInputs, Marshal.SizeOf(sendInputs[0])); } } + private static ushort scancodeFromVK(uint vkey) + { + ushort scancode = 0; + if (vkey == VK_PAUSE) + { + // MapVirtualKey does not work with VK_PAUSE + scancode = 0x45; + } + else + { + scancode = MapVirtualKey(vkey, MAPVK_VK_TO_VSC); + } + + switch (vkey) + { + case VK_LEFT: + case VK_UP: + case VK_RIGHT: + case VK_DOWN: + case VK_PRIOR: + case VK_NEXT: + case VK_END: + case VK_HOME: + case VK_INSERT: + case VK_DELETE: + case VK_DIVIDE: + case VK_NUMLOCK: + case VK_RCONTROL: + case VK_RMENU: + { + scancode |= (ushort)EXTENDED_FLAG; // set extended bit + break; + } + } + + return scancode; + } + /// /// http://msdn.microsoft.com/en-us/library/windows/desktop/ms646270(v=vs.85).aspx /// @@ -277,7 +265,11 @@ namespace DS4Windows MOUSEEVENTF_XBUTTONDOWN = 128, MOUSEEVENTF_XBUTTONUP = 256, KEYEVENTF_EXTENDEDKEY = 1, KEYEVENTF_KEYUP = 2, MOUSEEVENTF_WHEEL = 0x0800, MOUSEEVENTF_HWHEEL = 0x1000, MOUSEEVENTF_MIDDLEWDOWN = 0x0020, MOUSEEVENTF_MIDDLEWUP = 0x0040, - KEYEVENTF_SCANCODE = 0x0008, MAPVK_VK_TO_VSC = 0, KEYEVENTF_UNICODE = 0x0004; + KEYEVENTF_SCANCODE = 0x0008, MAPVK_VK_TO_VSC = 0, KEYEVENTF_UNICODE = 0x0004, EXTENDED_FLAG = 0x100; + + internal const uint VK_PAUSE = 0x13, VK_LEFT = 0x25, VK_UP = 0x26, VK_RIGHT = 0x27, VK_DOWN = 0x28, + VK_PRIOR = 0x21, VK_NEXT = 0x22, VK_END = 0x23, VK_HOME = 0x24, VK_INSERT = 0x2D, VK_DELETE = 0x2E, + VK_DIVIDE = 0x6F, VK_NUMLOCK = 0x90, VK_RCONTROL = 0xAE, VK_RMENU = 0xA5; [DllImport("user32.dll", SetLastError = true)] private static extern uint SendInput(uint numberOfInputs, INPUT[] inputs, int sizeOfInputs); @@ -285,6 +277,7 @@ namespace DS4Windows private static extern ushort MapVirtualKey(uint uCode, uint uMapType); [DllImport("user32.dll", SetLastError = true)] static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo); + //Not used, just here public static void DownKeys(ushort key) { @@ -301,5 +294,5 @@ namespace DS4Windows keybd_event((byte)key, 0, (int)KEYEVENTF_KEYUP, 0); } } - } + diff --git a/DS4Windows/DS4Control/Log.cs b/DS4Windows/DS4Control/Log.cs index f581f77..1eef330 100644 --- a/DS4Windows/DS4Control/Log.cs +++ b/DS4Windows/DS4Control/Log.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; namespace DS4Windows { diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs index 24b06ed..3c2db73 100644 --- a/DS4Windows/DS4Control/Mapping.cs +++ b/DS4Windows/DS4Control/Mapping.cs @@ -1,12 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; -using System.Windows.Forms; using System.Diagnostics; using static DS4Windows.Global; + namespace DS4Windows { public class Mapping @@ -38,8 +37,12 @@ namespace DS4Windows previousClicks = currentClicks; if (performClear) currentClicks.leftCount = currentClicks.middleCount = currentClicks.rightCount = currentClicks.fourthCount = currentClicks.fifthCount = currentClicks.wUpCount = currentClicks.wDownCount = currentClicks.toggleCount = 0; - foreach (KeyPresses kp in keyPresses.Values) + + //foreach (KeyPresses kp in keyPresses.Values) + Dictionary.ValueCollection keyValues = keyPresses.Values; + for (int i = 0, kpCount = keyValues.Count; i < kpCount; i++) { + KeyPresses kp = keyValues.ElementAt(i); kp.previous = kp.current; if (performClear) { @@ -81,6 +84,47 @@ namespace DS4Windows public static DateTime[] oldnowKeyAct = { DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue }; private static bool tappedOnce = false, firstTouch = false, secondtouchbegin = false; private static DateTime pastTime, firstTap, TimeofEnd; + private static DS4Controls[] shiftTriggerMapping = { DS4Controls.None, DS4Controls.Cross, DS4Controls.Circle, DS4Controls.Square, + DS4Controls.Triangle, DS4Controls.Options, DS4Controls.Share, DS4Controls.DpadUp, DS4Controls.DpadDown, + DS4Controls.DpadLeft, DS4Controls.DpadRight, DS4Controls.PS, DS4Controls.L1, DS4Controls.R1, DS4Controls.L2, + DS4Controls.R2, DS4Controls.L3, DS4Controls.R3, DS4Controls.TouchLeft, DS4Controls.TouchUpper, DS4Controls.TouchMulti, + DS4Controls.TouchRight, DS4Controls.GyroZNeg, DS4Controls.GyroZPos, DS4Controls.GyroXPos, DS4Controls.GyroXNeg + }; + private static int[] ds4ControlMapping = { 0, // DS4Control.None + 16, // DS4Controls.LXNeg + 20, // DS4Controls.LXPos + 17, // DS4Controls.LYNeg + 21, // DS4Controls.LYPos + 18, // DS4Controls.RXNeg + 22, // DS4Controls.RXPos + 19, // DS4Controls.RYNeg + 23, // DS4Controls.RYPos + 3, // DS4Controls.L1 + 24, // DS4Controls.L2 + 5, // DS4Controls.L3 + 4, // DS4Controls.R1 + 25, // DS4Controls.R2 + 6, // DS4Controls.R3 + 13, // DS4Controls.Square + 14, // DS4Controls.Triangle + 15, // DS4Controls.Circle + 12, // DS4Controls.Cross + 7, // DS4Controls.DpadUp + 10, // DS4Controls.DpadRight + 8, // DS4Controls.DpadDown + 9, // DS4Controls.DpadLeft + 11, // DS4Controls.PS + 27, // DS4Controls.TouchLeft + 29, // DS4Controls.TouchUpper + 26, // DS4Controls.TouchMulti + 28, // DS4Controls.TouchRight + 1, // DS4Controls.Share + 2, // DS4Controls.Options + 31, // DS4Controls.GyroXPos + 30, // DS4Controls.GyroXNeg + 33, // DS4Controls.GyroZPos + 32 // DS4Controls.GyroZNeg + }; //special macros static bool altTabDone = true; @@ -193,58 +237,63 @@ namespace DS4Windows // Merge and synthesize all key presses/releases that are present in this device's mapping. // TODO what about the rest? e.g. repeat keys really ought to be on some set schedule - foreach (KeyValuePair kvp in state.keyPresses) + Dictionary.KeyCollection kvpKeys = state.keyPresses.Keys; + //foreach (KeyValuePair kvp in state.keyPresses) + for (int i = 0, keyCount = kvpKeys.Count; i < keyCount; i++) { + UInt16 kvpKey = kvpKeys.ElementAt(i); + SyntheticState.KeyPresses kvpValue = state.keyPresses[kvpKey]; + SyntheticState.KeyPresses gkp; - if (globalState.keyPresses.TryGetValue(kvp.Key, out gkp)) + if (globalState.keyPresses.TryGetValue(kvpKey, out gkp)) { - gkp.current.vkCount += kvp.Value.current.vkCount - kvp.Value.previous.vkCount; - gkp.current.scanCodeCount += kvp.Value.current.scanCodeCount - kvp.Value.previous.scanCodeCount; - gkp.current.repeatCount += kvp.Value.current.repeatCount - kvp.Value.previous.repeatCount; - gkp.current.toggle = kvp.Value.current.toggle; - gkp.current.toggleCount += kvp.Value.current.toggleCount - kvp.Value.previous.toggleCount; + gkp.current.vkCount += kvpValue.current.vkCount - kvpValue.previous.vkCount; + gkp.current.scanCodeCount += kvpValue.current.scanCodeCount - kvpValue.previous.scanCodeCount; + gkp.current.repeatCount += kvpValue.current.repeatCount - kvpValue.previous.repeatCount; + gkp.current.toggle = kvpValue.current.toggle; + gkp.current.toggleCount += kvpValue.current.toggleCount - kvpValue.previous.toggleCount; } else { gkp = new SyntheticState.KeyPresses(); - gkp.current = kvp.Value.current; - globalState.keyPresses[kvp.Key] = gkp; + gkp.current = kvpValue.current; + globalState.keyPresses[kvpKey] = gkp; } if (gkp.current.toggleCount != 0 && gkp.previous.toggleCount == 0 && gkp.current.toggle) { if (gkp.current.scanCodeCount != 0) - InputMethods.performSCKeyPress(kvp.Key); + InputMethods.performSCKeyPress(kvpKey); else - InputMethods.performKeyPress(kvp.Key); + InputMethods.performKeyPress(kvpKey); } else if (gkp.current.toggleCount != 0 && gkp.previous.toggleCount == 0 && !gkp.current.toggle) { if (gkp.previous.scanCodeCount != 0) // use the last type of VK/SC - InputMethods.performSCKeyRelease(kvp.Key); + InputMethods.performSCKeyRelease(kvpKey); else - InputMethods.performKeyRelease(kvp.Key); + InputMethods.performKeyRelease(kvpKey); } else if (gkp.current.vkCount + gkp.current.scanCodeCount != 0 && gkp.previous.vkCount + gkp.previous.scanCodeCount == 0) { if (gkp.current.scanCodeCount != 0) { oldnow = DateTime.UtcNow; - InputMethods.performSCKeyPress(kvp.Key); + InputMethods.performSCKeyPress(kvpKey); pressagain = false; - keyshelddown = kvp.Key; + keyshelddown = kvpKey; } else { oldnow = DateTime.UtcNow; - InputMethods.performKeyPress(kvp.Key); + InputMethods.performKeyPress(kvpKey); pressagain = false; - keyshelddown = kvp.Key; + keyshelddown = kvpKey; } } else if (gkp.current.toggleCount != 0 || gkp.previous.toggleCount != 0 || gkp.current.repeatCount != 0 || // repeat or SC/VK transition ((gkp.previous.scanCodeCount == 0) != (gkp.current.scanCodeCount == 0))) //repeat keystroke after 500ms { - if (keyshelddown == kvp.Key) + if (keyshelddown == kvpKey) { DateTime now = DateTime.UtcNow; if (now >= oldnow + TimeSpan.FromMilliseconds(500) && !pressagain) @@ -258,7 +307,7 @@ namespace DS4Windows if (now >= oldnow + TimeSpan.FromMilliseconds(25) && pressagain) { oldnow = now; - InputMethods.performSCKeyPress(kvp.Key); + InputMethods.performSCKeyPress(kvpKey); } } else if (pressagain) @@ -267,7 +316,7 @@ namespace DS4Windows if (now >= oldnow + TimeSpan.FromMilliseconds(25) && pressagain) { oldnow = now; - InputMethods.performKeyPress(kvp.Key); + InputMethods.performKeyPress(kvpKey); } } } @@ -276,12 +325,12 @@ namespace DS4Windows { if (gkp.previous.scanCodeCount != 0) // use the last type of VK/SC { - InputMethods.performSCKeyRelease(kvp.Key); + InputMethods.performSCKeyRelease(kvpKey); pressagain = false; } else { - InputMethods.performKeyRelease(kvp.Key); + InputMethods.performKeyRelease(kvpKey); pressagain = false; } } @@ -316,48 +365,19 @@ namespace DS4Windows case Click.WDOWN: deviceState[device].currentClicks.wDownCount++; break; + default: break; } } public static int DS4ControltoInt(DS4Controls ctrl) { - switch (ctrl) + int result = 0; + if (ctrl >= DS4Controls.None && ctrl <= DS4Controls.GyroZNeg) { - case DS4Controls.Share: return 1; - case DS4Controls.Options: return 2; - case DS4Controls.L1: return 3; - case DS4Controls.R1: return 4; - case DS4Controls.L3: return 5; - case DS4Controls.R3: return 6; - case DS4Controls.DpadUp: return 7; - case DS4Controls.DpadDown: return 8; - case DS4Controls.DpadLeft: return 9; - case DS4Controls.DpadRight: return 10; - case DS4Controls.PS: return 11; - case DS4Controls.Cross: return 12; - case DS4Controls.Square: return 13; - case DS4Controls.Triangle: return 14; - case DS4Controls.Circle: return 15; - case DS4Controls.LXNeg: return 16; - case DS4Controls.LYNeg: return 17; - case DS4Controls.RXNeg: return 18; - case DS4Controls.RYNeg: return 19; - case DS4Controls.LXPos: return 20; - case DS4Controls.LYPos: return 21; - case DS4Controls.RXPos: return 22; - case DS4Controls.RYPos: return 23; - case DS4Controls.L2: return 24; - case DS4Controls.R2: return 25; - case DS4Controls.TouchMulti: return 26; - case DS4Controls.TouchLeft: return 27; - case DS4Controls.TouchRight: return 28; - case DS4Controls.TouchUpper: return 29; - case DS4Controls.GyroXNeg: return 30; - case DS4Controls.GyroXPos: return 31; - case DS4Controls.GyroZNeg: return 32; - case DS4Controls.GyroZPos: return 33; + result = ds4ControlMapping[(int)ctrl]; } - return 0; + + return result; } static double TValue(double value1, double value2, double percent) @@ -365,6 +385,7 @@ namespace DS4Windows percent /= 100f; return value1 * percent + value2 * (1 - percent); } + static double Clamp(double min, double value, double max) { if (value > max) @@ -375,20 +396,28 @@ namespace DS4Windows return value; } + private static int ClampInt(int min, int value, int max) + { + return (value < min) ? min : (value > max) ? max : value; + } + public static DS4State SetCurveAndDeadzone(int device, DS4State cState) { DS4State dState = new DS4State(cState); int x; int y; int curve; - if (LSCurve[device] > 0) + + /* TODO: Look into curve options and make sure maximum axes values are being respected */ + int lsCurve = getLSCurve(device); + if (lsCurve > 0) { x = cState.LX; y = cState.LY; float max = x + y; double curvex; double curvey; - curve = LSCurve[device]; + curve = lsCurve; double multimax = TValue(382.5, max, curve); double multimin = TValue(127.5, max, curve); if ((x > 127.5f && y > 127.5f) || (x < 127.5f && y < 127.5f)) @@ -410,17 +439,21 @@ namespace DS4Windows curvey = Math.Min(y, (y / max) * multimax); } } + dState.LX = (byte)Math.Round(curvex, 0); dState.LY = (byte)Math.Round(curvey, 0); } - if (RSCurve[device] > 0) + + /* TODO: Look into curve options and make sure maximum axes values are being respected */ + int rsCurve = getRSCurve(device); + if (rsCurve > 0) { x = cState.RX; y = cState.RY; float max = x + y; double curvex; double curvey; - curve = RSCurve[device]; + curve = rsCurve; double multimax = TValue(382.5, max, curve); double multimin = TValue(127.5, max, curve); if ((x > 127.5f && y > 127.5f) || (x < 127.5f && y < 127.5f)) @@ -441,89 +474,305 @@ namespace DS4Windows curvey = Math.Min(y, (y / max) * multimax); } } + dState.RX = (byte)Math.Round(curvex, 0); dState.RY = (byte)Math.Round(curvey, 0); } - double ls = Math.Sqrt(Math.Pow(cState.LX - 127.5f, 2) + Math.Pow(cState.LY - 127.5f, 2)); - //deadzones - if (LSDeadzone[device] > 0 && ls < LSDeadzone[device]) + + int lsDeadzone = getLSDeadzone(device); + int lsAntiDead = getLSAntiDeadzone(device); + int lsMaxZone = getLSMaxzone(device); + if (lsDeadzone > 0 || lsAntiDead > 0 || lsMaxZone != 100) { - dState.LX = 127; - dState.LY = 127; + double lsSquared = Math.Pow(cState.LX - 127.5f, 2) + Math.Pow(cState.LY - 127.5f, 2); + double lsDeadzoneSquared = Math.Pow(lsDeadzone, 2); + if (lsDeadzone > 0 && lsSquared <= lsDeadzoneSquared) + { + dState.LX = 127; + dState.LY = 127; + } + else if ((lsDeadzone > 0 && lsSquared > lsDeadzoneSquared) || lsAntiDead > 0 || lsMaxZone != 100) + { + double r = Math.Atan2(-(dState.LY - 127.5f), (dState.LX - 127.5f)); + double maxXValue = dState.LX >= 127.5 ? 127.5 : -127.5; + double maxYValue = dState.LY >= 127.5 ? 127.5 : -127.5; + double ratio = lsMaxZone / 100.0; + + double maxZoneXNegValue = (ratio * -127.5f) + 127.5f; + double maxZoneXPosValue = (ratio * 127.5f) + 127.5f; + double maxZoneYNegValue = maxZoneXNegValue; + double maxZoneYPosValue = maxZoneXPosValue; + double maxZoneX = dState.LX >= 127.5 ? (maxZoneXPosValue - 127.5f) : (maxZoneXNegValue - 127.5f); + double maxZoneY = dState.LY >= 127.5 ? (maxZoneYPosValue - 127.5f) : (maxZoneYNegValue - 127.5f); + + double tempLsXDead = 0.0, tempLsYDead = 0.0; + double tempOutputX = 0.0, tempOutputY = 0.0; + if (lsDeadzone > 0) + { + tempLsXDead = Math.Abs(Math.Cos(r)) * (lsDeadzone / 127.0) * maxXValue; + tempLsYDead = Math.Abs(Math.Sin(r)) * (lsDeadzone / 127.0) * maxYValue; + + if (lsSquared > lsDeadzoneSquared) + { + double currentX = Clamp(maxZoneXNegValue, dState.LX, maxZoneXPosValue); + double currentY = Clamp(maxZoneYNegValue, dState.LY, maxZoneYPosValue); + //currentX = (byte)((dState.LX >= 127.5f) ? Math.Min(dState.LX, maxZoneX) : Math.Max(dState.LX, maxZoneX)); + //currentY = (byte)((dState.LY >= 127.5f) ? Math.Min(dState.LY, maxZoneY) : Math.Max(dState.LY, maxZoneY)); + tempOutputX = ((currentX - 127.5f - tempLsXDead) / (double)(maxZoneX - tempLsXDead)); + tempOutputY = ((currentY - 127.5f - tempLsYDead) / (double)(maxZoneY - tempLsYDead)); + } + } + else + { + double currentX = Clamp(maxZoneXNegValue, dState.LX, maxZoneXPosValue); + double currentY = Clamp(maxZoneYNegValue, dState.LY, maxZoneYPosValue); + tempOutputX = (currentX - 127.5f) / (double)(maxZoneX); + tempOutputY = (currentY - 127.5f) / (double)(maxZoneY); + } + + double tempLsXAntiDeadPercent = 0.0, tempLsYAntiDeadPercent = 0.0; + if (lsAntiDead > 0) + { + tempLsXAntiDeadPercent = (lsAntiDead * 0.01) * Math.Abs(Math.Cos(r)); + tempLsYAntiDeadPercent = (lsAntiDead * 0.01) * Math.Abs(Math.Sin(r)); + } + + if (tempOutputX > 0.0) + { + dState.LX = (byte)((((1.0 - tempLsXAntiDeadPercent) * tempOutputX + tempLsXAntiDeadPercent)) * maxXValue + 127.5f); + } + else + { + dState.LX = 127; + } + + if (tempOutputY > 0.0) + { + dState.LY = (byte)((((1.0 - tempLsYAntiDeadPercent) * tempOutputY + tempLsYAntiDeadPercent)) * maxYValue + 127.5f); + } + else + { + dState.LY = 127; + } + } } - else if (LSDeadzone[device] < 0 && ls > 127.5f + LSDeadzone[device]) + + int rsDeadzone = getRSDeadzone(device); + int rsAntiDead = getRSAntiDeadzone(device); + int rsMaxZone = getRSMaxzone(device); + if (rsDeadzone > 0 || rsAntiDead > 0 || rsMaxZone != 100) { - double r = Math.Atan2((dState.LY - 127.5f), (dState.LX - 127.5f)); - dState.LX = (byte)(Math.Cos(r) * (127.5f + LSDeadzone[device]) + 127.5f); - dState.LY = (byte)(Math.Sin(r) * (127.5f + LSDeadzone[device]) + 127.5f); + double rsSquared = Math.Pow(cState.RX - 127.5f, 2) + Math.Pow(cState.RY - 127.5f, 2); + double rsDeadzoneSquared = Math.Pow(rsDeadzone, 2); + if (rsDeadzone > 0 && rsSquared <= rsDeadzoneSquared) + { + dState.RX = 127; + dState.RY = 127; + } + else if ((rsDeadzone > 0 && rsSquared > rsDeadzoneSquared) || rsAntiDead > 0 || rsMaxZone != 100) + { + double r = Math.Atan2(-(dState.RY - 127.5f), (dState.RX - 127.5f)); + double maxXValue = dState.RX >= 127.5 ? 127.5 : -127.5; + double maxYValue = dState.RY >= 127.5 ? 127.5 : -127.5; + double ratio = rsMaxZone / 100.0; + + double maxZoneXNegValue = (ratio * -127.5f) + 127.5f; + double maxZoneXPosValue = (ratio * 127.5f) + 127.5f; + double maxZoneYNegValue = maxZoneXNegValue; + double maxZoneYPosValue = maxZoneXPosValue; + double maxZoneX = dState.RX >= 127.5 ? (maxZoneXPosValue - 127.5f) : (maxZoneXNegValue - 127.5f); + double maxZoneY = dState.RY >= 127.5 ? (maxZoneYPosValue - 127.5f) : (maxZoneYNegValue - 127.5f); + + double tempRsXDead = 0.0, tempRsYDead = 0.0; + double tempOutputX = 0.0, tempOutputY = 0.0; + if (rsDeadzone > 0) + { + tempRsXDead = Math.Abs(Math.Cos(r)) * (rsDeadzone / 127.0) * maxXValue; + tempRsYDead = Math.Abs(Math.Sin(r)) * (rsDeadzone / 127.0) * maxYValue; + + if (rsSquared > rsDeadzoneSquared) + { + double currentX = Clamp(maxZoneXNegValue, dState.RX, maxZoneXPosValue); + double currentY = Clamp(maxZoneYNegValue, dState.RY, maxZoneYPosValue); + + tempOutputX = ((currentX - 127.5f - tempRsXDead) / (double)(maxZoneX - tempRsXDead)); + tempOutputY = ((currentY - 127.5f - tempRsYDead) / (double)(maxZoneY - tempRsYDead)); + //tempOutputX = ((dState.RX - 127.5f - tempRsXDead) / (double)(maxXValue - tempRsXDead)); + //tempOutputY = ((dState.RY - 127.5f - tempRsYDead) / (double)(maxYValue - tempRsYDead)); + } + } + else + { + double currentX = Clamp(maxZoneXNegValue, dState.RX, maxZoneXPosValue); + double currentY = Clamp(maxZoneYNegValue, dState.RY, maxZoneYPosValue); + + tempOutputX = (currentX - 127.5f) / (double)(maxZoneX); + tempOutputY = (currentY - 127.5f) / (double)(maxZoneY); + //tempOutputX = ((dState.RX - 127.5f) / (double)(maxXValue)); + //tempOutputY = ((dState.RY - 127.5f) / (double)(maxYValue)); + } + + double tempRsXAntiDeadPercent = 0.0, tempRsYAntiDeadPercent = 0.0; + if (rsAntiDead > 0) + { + tempRsXAntiDeadPercent = (rsAntiDead * 0.01) * Math.Abs(Math.Cos(r)); + tempRsYAntiDeadPercent = (rsAntiDead * 0.01) * Math.Abs(Math.Sin(r)); + } + + if (tempOutputX > 0.0) + { + dState.RX = (byte)((((1.0 - tempRsXAntiDeadPercent) * tempOutputX + tempRsXAntiDeadPercent)) * maxXValue + 127.5f); + } + else + { + dState.RX = 127; + } + + if (tempOutputY > 0.0) + { + dState.RY = (byte)((((1.0 - tempRsYAntiDeadPercent) * tempOutputY + tempRsYAntiDeadPercent)) * maxYValue + 127.5f); + } + else + { + dState.RY = 127; + } + } } - //Console.WriteLine - double rs = Math.Sqrt(Math.Pow(cState.RX - 127.5f, 2) + Math.Pow(cState.RY - 127.5f, 2)); - if (RSDeadzone[device] > 0 && rs < LSDeadzone[device]) + + byte l2Deadzone = getL2Deadzone(device); + int l2AntiDeadzone = getL2AntiDeadzone(device); + int l2Maxzone = getL2Maxzone(device); + if (l2Deadzone > 0 || l2AntiDeadzone > 0 || l2Maxzone != 100) { - dState.RX = 127; - dState.RY = 127; + double tempL2Output = (cState.L2 / 255.0); + double tempL2AntiDead = 0.0; + double ratio = (l2Maxzone / 100.0); + double maxValue = 255 * ratio; + + if (l2Deadzone > 0) + { + if (cState.L2 > l2Deadzone) + { + double current = Clamp(0, dState.L2, maxValue); + tempL2Output = ((current - l2Deadzone) / (double)(maxValue - l2Deadzone)); + } + else + { + tempL2Output = 0.0; + } + } + + if (l2AntiDeadzone > 0) + { + tempL2AntiDead = l2AntiDeadzone * 0.01; + } + + if (tempL2Output > 0.0) + { + dState.L2 = (byte)(((1.0 - tempL2AntiDead) * tempL2Output + tempL2AntiDead) * 255); + } + else + { + dState.L2 = 0; + } } - else if (RSDeadzone[device] < 0 && rs > 127.5f + RSDeadzone[device]) + + byte r2Deadzone = getR2Deadzone(device); + int r2AntiDeadzone = getR2AntiDeadzone(device); + int r2Maxzone = getR2Maxzone(device); + if (r2Deadzone > 0 || r2AntiDeadzone > 0 || r2Maxzone != 100) { - double r = Math.Atan2((dState.RY - 127.5f), (dState.RX - 127.5f)); - dState.RX = (byte)(Math.Cos(r) * (127.5f + RSDeadzone[device]) + 127.5f); - dState.RY = (byte)(Math.Sin(r) * (127.5f + RSDeadzone[device]) + 127.5f); + double tempR2Output = (cState.R2 / 255.0); + double tempR2AntiDead = 0.0; + double ratio = (r2Maxzone / 100.0); + double maxValue = 255 * ratio; + + if (r2Deadzone > 0) + { + if (cState.R2 > r2Deadzone) + { + double current = Clamp(0, dState.R2, maxValue); + tempR2Output = ((current - r2Deadzone) / (double)(maxValue - r2Deadzone)); + } + else + { + tempR2Output = 0.0; + } + } + + if (r2AntiDeadzone > 0) + { + tempR2AntiDead = r2AntiDeadzone * 0.01; + } + + if (tempR2Output > 0.0) + { + dState.R2 = (byte)(((1.0 - tempR2AntiDead) * tempR2Output + tempR2AntiDead) * 255); + } + else + { + dState.R2 = 0; + } } - if (L2Deadzone[device] > 0 && cState.L2 < L2Deadzone[device]) - dState.L2 = 0; - if (R2Deadzone[device] > 0 && cState.R2 < R2Deadzone[device]) - dState.R2 = 0; - if (LSSens[device] != 1) + + double lsSens = getLSSens(device); + if (lsSens != 1.0) { - dState.LX = (byte)Clamp(0, LSSens[device] * (dState.LX - 127) + 127, 255); - dState.LY = (byte)Clamp(0, LSSens[device] * (dState.LY - 127) + 127, 255); + dState.LX = (byte)Clamp(0, lsSens * (dState.LX - 127.5f) + 127.5f, 255); + dState.LY = (byte)Clamp(0, lsSens * (dState.LY - 127.5f) + 127.5f, 255); } - if (RSSens[device] != 1) + + double rsSens = getRSSens(device); + if (rsSens != 1.0) { - dState.RX = (byte)Clamp(0, RSSens[device] * (dState.RX - 127) + 127, 255); - dState.RY = (byte)Clamp(0, RSSens[device] * (dState.RY - 127) + 127, 255); + dState.RX = (byte)Clamp(0, rsSens * (dState.RX - 127.5f) + 127.5f, 255); + dState.RY = (byte)Clamp(0, rsSens * (dState.RY - 127.5f) + 127.5f, 255); } - if (L2Sens[device] != 1) - dState.L2 = (byte)Clamp(0, L2Sens[device] * dState.L2, 255); - if (R2Sens[device] != 1) - dState.R2 = (byte)Clamp(0, R2Sens[device] * dState.R2, 255); + + double l2Sens = getL2Sens(device); + if (l2Sens != 1.0) + dState.L2 = (byte)Clamp(0, l2Sens * dState.L2, 255); + + double r2Sens = getR2Sens(device); + if (r2Sens != 1.0) + dState.R2 = (byte)Clamp(0, r2Sens * dState.R2, 255); + return dState; } + /* TODO: Possibly remove usage of this version of the method */ private static bool ShiftTrigger(int trigger, int device, DS4State cState, DS4StateExposed eState, Mouse tp) { - switch (trigger) + bool result = false; + if (trigger == 0) { - case 1: return getBoolMapping(device, DS4Controls.Cross, cState, eState, tp); - case 2: return getBoolMapping(device, DS4Controls.Circle, cState, eState, tp); - case 3: return getBoolMapping(device, DS4Controls.Square, cState, eState, tp); - case 4: return getBoolMapping(device, DS4Controls.Triangle, cState, eState, tp); - case 5: return getBoolMapping(device, DS4Controls.Options, cState, eState, tp); - case 6: return getBoolMapping(device, DS4Controls.Share, cState, eState, tp); - case 7: return getBoolMapping(device, DS4Controls.DpadUp, cState, eState, tp); - case 8: return getBoolMapping(device, DS4Controls.DpadDown, cState, eState, tp); - case 9: return getBoolMapping(device, DS4Controls.DpadLeft, cState, eState, tp); - case 10: return getBoolMapping(device, DS4Controls.DpadRight, cState, eState, tp); - case 11: return getBoolMapping(device, DS4Controls.PS, cState, eState, tp); - case 12: return getBoolMapping(device, DS4Controls.L1, cState, eState, tp); - case 13: return getBoolMapping(device, DS4Controls.R1, cState, eState, tp); - case 14: return getBoolMapping(device, DS4Controls.L2, cState, eState, tp); - case 15: return getBoolMapping(device, DS4Controls.R2, cState, eState, tp); - case 16: return getBoolMapping(device, DS4Controls.L3, cState, eState, tp); - case 17: return getBoolMapping(device, DS4Controls.R3, cState, eState, tp); - case 18: return getBoolMapping(device, DS4Controls.TouchLeft, cState, eState, tp); - case 19: return getBoolMapping(device, DS4Controls.TouchUpper, cState, eState, tp); - case 20: return getBoolMapping(device, DS4Controls.TouchMulti, cState, eState, tp); - case 21: return getBoolMapping(device, DS4Controls.TouchRight, cState, eState, tp); - case 22: return getBoolMapping(device, DS4Controls.GyroZNeg, cState, eState, tp); - case 23: return getBoolMapping(device, DS4Controls.GyroZPos, cState, eState, tp); - case 24: return getBoolMapping(device, DS4Controls.GyroXPos, cState, eState, tp); - case 25: return getBoolMapping(device, DS4Controls.GyroXNeg, cState, eState, tp); - case 26: return cState.Touch1; - default: return false; + result = false; } + else + { + DS4Controls ds = shiftTriggerMapping[trigger]; + result = getBoolMapping(device, ds, cState, eState, tp); + } + + return result; } + + private static bool ShiftTrigger2(int trigger, int device, DS4State cState, DS4StateExposed eState, Mouse tp, DS4StateFieldMapping fieldMapping) + { + bool result = false; + if (trigger == 0) + { + result = false; + } + else + { + DS4Controls ds = shiftTriggerMapping[trigger]; + result = getBoolMapping2(device, ds, cState, eState, tp, fieldMapping); + } + + return result; + } + private static X360Controls getX360ControlsByName(string key) { X360Controls x3c; @@ -582,55 +831,42 @@ namespace DS4Windows /// static bool[] held = new bool[4]; static int[] oldmouse = new int[4] { -1, -1, -1, -1 }; - public static void MapCustom(int device, DS4State cState, DS4State MappedState, DS4StateExposed eState, Mouse tp, ControlService ctrl) + public static void MapCustom(int device, DS4State cState, DS4State MappedState, DS4StateExposed eState, + Mouse tp, ControlService ctrl) { - + /* TODO: This method is slow sauce. Find ways to speed up action execution */ MappedState.LX = 127; MappedState.LY = 127; MappedState.RX = 127; MappedState.RY = 127; - int MouseDeltaX = 0; - int MouseDeltaY = 0; - + double tempMouseDeltaX = 0.0; + double tempMouseDeltaY = 0.0; + int mouseDeltaX = 0; + int mouseDeltaY = 0; + + cState.calculateStickAngles(); + DS4StateFieldMapping fieldMapping = new DS4StateFieldMapping(cState, eState, tp); + DS4StateFieldMapping outputfieldMapping = new DS4StateFieldMapping(cState, eState, tp); + SyntheticState deviceState = Mapping.deviceState[device]; - if (GetActions().Count > 0 && (ProfileActions[device].Count > 0 || !string.IsNullOrEmpty(tempprofilename[device]))) - MapCustomAction(device, cState, MappedState, eState, tp, ctrl); + if (getProfileActionCount(device) > 0 || !string.IsNullOrEmpty(tempprofilename[device])) + MapCustomAction(device, cState, MappedState, eState, tp, ctrl, fieldMapping, outputfieldMapping); if (ctrl.DS4Controllers[device] == null) return; cState.CopyTo(MappedState); - List Cross = new List(); - List Circle = new List(); - List Square = new List(); - List Triangle = new List(); - List Options = new List(); - List Share = new List(); - List DpadUp = new List(); - List DpadDown = new List(); - List DpadLeft = new List(); - List DpadRight = new List(); - List PS = new List(); - List L1 = new List(); - List R1 = new List(); - List L2 = new List(); - List R2 = new List(); - List L3 = new List(); - List R3 = new List(); - List LXN = new List(); - List LXP = new List(); - List LYN = new List(); - List LYP = new List(); - List RXN = new List(); - List RXP = new List(); - List RYN = new List(); - List RYP = new List(); + Dictionary tempControlDict = new Dictionary(); + //MultiValueDict tempControlDict = new MultiValueDict(); DS4Controls usingExtra = DS4Controls.None; - foreach (DS4ControlSettings dcs in getDS4CSettings(device)) + List tempSettingsList = getDS4CSettings(device); + //foreach (DS4ControlSettings dcs in getDS4CSettings(device)) + for (int settingIndex = 0, arlen = tempSettingsList.Count; settingIndex < arlen; settingIndex++) { + DS4ControlSettings dcs = tempSettingsList[settingIndex]; object action = null; DS4ControlSettings.ActionType actionType = 0; DS4KeyType keyType = DS4KeyType.None; - if (dcs.shiftAction != null && ShiftTrigger(dcs.shiftTrigger, device, cState, eState, tp)) + if (dcs.shiftAction != null && ShiftTrigger2(dcs.shiftTrigger, device, cState, eState, tp, fieldMapping)) { action = dcs.shiftAction; actionType = dcs.shiftActionType; @@ -642,33 +878,38 @@ namespace DS4Windows actionType = dcs.actionType; keyType = dcs.keyType; } + if (action != null) { if (actionType == DS4ControlSettings.ActionType.Macro) { - if (getBoolMapping(device, dcs.control, cState, eState, tp)) + bool active = getBoolMapping2(device, dcs.control, cState, eState, tp, fieldMapping); + if (active) { - resetToDefaultValue(dcs.control, MappedState); + resetToDefaultValue2(dcs.control, MappedState, outputfieldMapping); PlayMacro(device, macroControl, string.Join("/", (int[])action), dcs.control, keyType); } - else if (!getBoolMapping(device, dcs.control, cState, eState, tp)) + else { EndMacro(device, macroControl, string.Join("/", (int[])action), dcs.control); } } else if (actionType == DS4ControlSettings.ActionType.Key) { - ushort value = ushort.Parse(action.ToString()); - if (getBoolMapping(device, dcs.control, cState, eState, tp)) + //ushort value = ushort.Parse(action.ToString()); + ushort value = Convert.ToUInt16(action); + if (getBoolActionMapping2(device, dcs.control, cState, eState, tp, fieldMapping)) { - resetToDefaultValue(dcs.control, MappedState); + resetToDefaultValue2(dcs.control, MappedState, outputfieldMapping); SyntheticState.KeyPresses kp; if (!deviceState.keyPresses.TryGetValue(value, out kp)) deviceState.keyPresses[value] = kp = new SyntheticState.KeyPresses(); + if (keyType.HasFlag(DS4KeyType.ScanCode)) kp.current.scanCodeCount++; else kp.current.vkCount++; + if (keyType.HasFlag(DS4KeyType.Toggle)) { if (!pressedonce[value]) @@ -686,113 +927,162 @@ namespace DS4Windows else if (actionType == DS4ControlSettings.ActionType.Button) { int keyvalue = 0; - bool isAnalog = dcs.control.ToString().Contains("LX") || - dcs.control.ToString().Contains("RX") || - dcs.control.ToString().Contains("LY") || - dcs.control.ToString().Contains("LY") || - dcs.control.ToString().Contains("R2") || - dcs.control.ToString().Contains("L2") || - dcs.control.ToString().Contains("Gyro"); - switch (getX360ControlsByName(action.ToString())) + bool isAnalog = false; + + if (dcs.control >= DS4Controls.LXNeg && dcs.control <= DS4Controls.RYPos) { - case X360Controls.A: Cross.Add(dcs.control); break; - case X360Controls.B: Circle.Add(dcs.control); break; - case X360Controls.X: Square.Add(dcs.control); break; - case X360Controls.Y: Triangle.Add(dcs.control); break; - case X360Controls.LB: L1.Add(dcs.control); break; - case X360Controls.LS: L3.Add(dcs.control); break; - case X360Controls.RB: R1.Add(dcs.control); break; - case X360Controls.RS: R3.Add(dcs.control); break; - case X360Controls.DpadUp: DpadUp.Add(dcs.control); break; - case X360Controls.DpadDown: DpadDown.Add(dcs.control); break; - case X360Controls.DpadLeft: DpadLeft.Add(dcs.control); break; - case X360Controls.DpadRight: DpadRight.Add(dcs.control); break; - case X360Controls.Start: Options.Add(dcs.control); break; - case X360Controls.Guide: PS.Add(dcs.control); break; - case X360Controls.Back: Share.Add(dcs.control); break; - case X360Controls.LXNeg: LXN.Add(dcs.control); break; - case X360Controls.LYNeg: LYN.Add(dcs.control); break; - case X360Controls.RXNeg: RXN.Add(dcs.control); break; - case X360Controls.RYNeg: RYN.Add(dcs.control); break; - case X360Controls.LXPos: LXP.Add(dcs.control); break; - case X360Controls.LYPos: LYP.Add(dcs.control); break; - case X360Controls.RXPos: RXP.Add(dcs.control); break; - case X360Controls.RYPos: RYP.Add(dcs.control); break; - case X360Controls.LT: L2.Add(dcs.control); break; - case X360Controls.RT: R2.Add(dcs.control); break; - case X360Controls.LeftMouse: - keyvalue = 256; - if (getBoolMapping(device, dcs.control, cState, eState, tp)) - deviceState.currentClicks.leftCount++; - break; - case X360Controls.RightMouse: - keyvalue = 257; - if (getBoolMapping(device, dcs.control, cState, eState, tp)) - deviceState.currentClicks.rightCount++; - break; - case X360Controls.MiddleMouse: - keyvalue = 258; - if (getBoolMapping(device, dcs.control, cState, eState, tp)) - deviceState.currentClicks.middleCount++; - break; - case X360Controls.FourthMouse: - keyvalue = 259; - if (getBoolMapping(device, dcs.control, cState, eState, tp)) - deviceState.currentClicks.fourthCount++; - break; - case X360Controls.FifthMouse: - keyvalue = 260; - if (getBoolMapping(device, dcs.control, cState, eState, tp)) - deviceState.currentClicks.fifthCount++; - break; - case X360Controls.WUP: - if (getBoolMapping(device, dcs.control, cState, eState, tp)) - if (isAnalog) - getMouseWheelMapping(device, dcs.control, cState, eState, tp, false); - else - deviceState.currentClicks.wUpCount++; - break; - case X360Controls.WDOWN: - if (getBoolMapping(device, dcs.control, cState, eState, tp)) - if (isAnalog) - getMouseWheelMapping(device, dcs.control, cState, eState, tp, true); - else - deviceState.currentClicks.wDownCount++; - break; - case X360Controls.MouseUp: - if (MouseDeltaY == 0) - { - MouseDeltaY = getMouseMapping(device, dcs.control, cState, eState, 0); - MouseDeltaY = -Math.Abs((MouseDeltaY == -2147483648 ? 0 : MouseDeltaY)); - } - break; - case X360Controls.MouseDown: - if (MouseDeltaY == 0) - { - MouseDeltaY = getMouseMapping(device, dcs.control, cState, eState, 1); - MouseDeltaY = Math.Abs((MouseDeltaY == -2147483648 ? 0 : MouseDeltaY)); - } - break; - case X360Controls.MouseLeft: - if (MouseDeltaX == 0) - { - MouseDeltaX = getMouseMapping(device, dcs.control, cState, eState, 2); - MouseDeltaX = -Math.Abs((MouseDeltaX == -2147483648 ? 0 : MouseDeltaX)); - } - break; - case X360Controls.MouseRight: - if (MouseDeltaX == 0) - { - MouseDeltaX = getMouseMapping(device, dcs.control, cState, eState, 3); - MouseDeltaX = Math.Abs((MouseDeltaX == -2147483648 ? 0 : MouseDeltaX)); - } - break; + isAnalog = true; } + else if (dcs.control == DS4Controls.L2 || dcs.control == DS4Controls.R2) + { + isAnalog = true; + } + else if (dcs.control >= DS4Controls.GyroXPos && dcs.control <= DS4Controls.GyroZNeg) + { + isAnalog = true; + } + + X360Controls xboxControl = X360Controls.None; + if (action is X360Controls) + { + xboxControl = (X360Controls)action; + } + else if (action is string) + { + xboxControl = getX360ControlsByName(action.ToString()); + } + + if (xboxControl >= X360Controls.LXNeg && xboxControl <= X360Controls.Start) + { + DS4Controls tempDS4Control = reverseX360ButtonMapping[(int)xboxControl]; + tempControlDict.Add(dcs.control, tempDS4Control); + } + else if (xboxControl >= X360Controls.LeftMouse && xboxControl <= X360Controls.WDOWN) + { + switch (xboxControl) + { + case X360Controls.LeftMouse: + { + keyvalue = 256; + if (getBoolActionMapping2(device, dcs.control, cState, eState, tp, fieldMapping)) + deviceState.currentClicks.leftCount++; + + break; + } + case X360Controls.RightMouse: + { + keyvalue = 257; + if (getBoolActionMapping2(device, dcs.control, cState, eState, tp, fieldMapping)) + deviceState.currentClicks.rightCount++; + + break; + } + case X360Controls.MiddleMouse: + { + keyvalue = 258; + if (getBoolActionMapping2(device, dcs.control, cState, eState, tp, fieldMapping)) + deviceState.currentClicks.middleCount++; + + break; + } + case X360Controls.FourthMouse: + { + keyvalue = 259; + if (getBoolActionMapping2(device, dcs.control, cState, eState, tp, fieldMapping)) + deviceState.currentClicks.fourthCount++; + + break; + } + case X360Controls.FifthMouse: + { + keyvalue = 260; + if (getBoolActionMapping2(device, dcs.control, cState, eState, tp, fieldMapping)) + deviceState.currentClicks.fifthCount++; + + break; + } + case X360Controls.WUP: + { + if (getBoolActionMapping2(device, dcs.control, cState, eState, tp, fieldMapping)) + { + if (isAnalog) + getMouseWheelMapping(device, dcs.control, cState, eState, tp, false); + else + deviceState.currentClicks.wUpCount++; + } + + break; + } + case X360Controls.WDOWN: + { + if (getBoolActionMapping2(device, dcs.control, cState, eState, tp, fieldMapping)) + { + if (isAnalog) + getMouseWheelMapping(device, dcs.control, cState, eState, tp, true); + else + deviceState.currentClicks.wDownCount++; + } + + break; + } + + default: break; + } + } + else if (xboxControl >= X360Controls.MouseUp && xboxControl <= X360Controls.MouseRight) + { + switch (xboxControl) + { + case X360Controls.MouseUp: + { + if (tempMouseDeltaY == 0) + { + tempMouseDeltaY = getMouseMapping(device, dcs.control, cState, eState, fieldMapping, 0); + tempMouseDeltaY = -Math.Abs((tempMouseDeltaY == -2147483648 ? 0 : tempMouseDeltaY)); + } + + break; + } + case X360Controls.MouseDown: + { + if (tempMouseDeltaY == 0) + { + tempMouseDeltaY = getMouseMapping(device, dcs.control, cState, eState, fieldMapping, 1); + tempMouseDeltaY = Math.Abs((tempMouseDeltaY == -2147483648 ? 0 : tempMouseDeltaY)); + } + + break; + } + case X360Controls.MouseLeft: + { + if (tempMouseDeltaX == 0) + { + tempMouseDeltaX = getMouseMapping(device, dcs.control, cState, eState, fieldMapping, 2); + tempMouseDeltaX = -Math.Abs((tempMouseDeltaX == -2147483648 ? 0 : tempMouseDeltaX)); + } + + break; + } + case X360Controls.MouseRight: + { + if (tempMouseDeltaX == 0) + { + tempMouseDeltaX = getMouseMapping(device, dcs.control, cState, eState, fieldMapping, 3); + tempMouseDeltaX = Math.Abs((tempMouseDeltaX == -2147483648 ? 0 : tempMouseDeltaX)); + } + + break; + } + + default: break; + } + } + if (keyType.HasFlag(DS4KeyType.Toggle)) { - if (getBoolMapping(device, dcs.control, cState, eState, tp)) + if (getBoolActionMapping2(device, dcs.control, cState, eState, tp, fieldMapping)) { - resetToDefaultValue(dcs.control, MappedState); + resetToDefaultValue2(dcs.control, MappedState, outputfieldMapping); if (!pressedonce[keyvalue]) { deviceState.currentClicks.toggle = !deviceState.currentClicks.toggle; @@ -805,15 +1095,16 @@ namespace DS4Windows pressedonce[keyvalue] = false; } } - resetToDefaultValue(dcs.control, MappedState); // erase default mappings for things that are remapped + + resetToDefaultValue2(dcs.control, MappedState, outputfieldMapping); // erase default mappings for things that are remapped } } if (usingExtra == DS4Controls.None || usingExtra == dcs.control) { - bool shiftE = dcs.shiftExtras != "0,0,0,0,0,0,0,0" && dcs.shiftExtras != "" && ShiftTrigger(dcs.shiftTrigger, device, cState, eState, tp); - bool regE = dcs.extras != "0,0,0,0,0,0,0,0" && dcs.extras != ""; - if ((regE || shiftE) && getBoolMapping(device, dcs.control, cState, eState, tp)) + bool shiftE = !string.IsNullOrEmpty(dcs.shiftExtras) && dcs.shiftExtras != "0,0,0,0,0,0,0,0" && ShiftTrigger2(dcs.shiftTrigger, device, cState, eState, tp, fieldMapping); + bool regE = !string.IsNullOrEmpty(dcs.extras) && dcs.extras != "0,0,0,0,0,0,0,0"; + if ((regE || shiftE) && getBoolActionMapping2(device, dcs.control, cState, eState, tp, fieldMapping)) { usingExtra = dcs.control; string p; @@ -821,19 +1112,23 @@ namespace DS4Windows p = dcs.shiftExtras; else p = dcs.extras; + string[] extraS = p.Split(','); - int[] extras = new int[extraS.Length]; - for (int i = 0; i < extraS.Length; i++) + int extrasSLen = extraS.Length; + int[] extras = new int[extrasSLen]; + for (int i = 0; i < extrasSLen; i++) { int b; if (int.TryParse(extraS[i], out b)) extras[i] = b; } + held[device] = true; try { if (!(extras[0] == extras[1] && extras[1] == 0)) ctrl.setRumble((byte)extras[0], (byte)extras[1], device); + if (extras[2] == 1) { DS4Color color = new DS4Color { red = (byte)extras[3], green = (byte)extras[4], blue = (byte)extras[5] }; @@ -841,6 +1136,7 @@ namespace DS4Windows DS4LightBar.forcedFlash[device] = (byte)extras[6]; DS4LightBar.forcelight[device] = true; } + if (extras[7] == 1) { if (oldmouse[device] == -1) @@ -861,7 +1157,9 @@ namespace DS4Windows usingExtra = DS4Controls.None; } } - } + } + + outputfieldMapping.populateState(MappedState); if (macroControl[00]) MappedState.Cross = true; if (macroControl[01]) MappedState.Circle = true; @@ -888,163 +1186,237 @@ namespace DS4Windows if (macroControl[22]) MappedState.RX = 0; if (macroControl[23]) MappedState.RY = 255; if (macroControl[24]) MappedState.RY = 0; - foreach (DS4Controls dc in Cross) - if (getBoolMapping(device, dc, cState, eState, tp)) - MappedState.Cross = true; - foreach (DS4Controls dc in Circle) - if (getBoolMapping(device, dc, cState, eState, tp)) - MappedState.Circle = true; - foreach (DS4Controls dc in Square) - if (getBoolMapping(device, dc, cState, eState, tp)) - MappedState.Square = true; - foreach (DS4Controls dc in Triangle) - if (getBoolMapping(device, dc, cState, eState, tp)) - MappedState.Triangle = true; - foreach (DS4Controls dc in L1) - if (getBoolMapping(device, dc, cState, eState, tp)) - MappedState.L1 = true; - foreach (DS4Controls dc in L2) - if (getByteMapping(device, dc, cState, eState, tp) > 5) - MappedState.L2 = getByteMapping(device, dc, cState, eState, tp); - foreach (DS4Controls dc in L3) - if (getBoolMapping(device, dc, cState, eState, tp)) - MappedState.L3 = true; - foreach (DS4Controls dc in R1) - if (getBoolMapping(device, dc, cState, eState, tp)) - MappedState.R1 = true; - foreach (DS4Controls dc in R2) - if (getByteMapping(device, dc, cState, eState, tp) > 5) - MappedState.R2 = getByteMapping(device, dc, cState, eState, tp); - foreach (DS4Controls dc in R3) - if (getBoolMapping(device, dc, cState, eState, tp)) - MappedState.R3 = true; - foreach (DS4Controls dc in DpadUp) - if (getBoolMapping(device, dc, cState, eState, tp)) - MappedState.DpadUp = true; - foreach (DS4Controls dc in DpadRight) - if (getBoolMapping(device, dc, cState, eState, tp)) - MappedState.DpadRight = true; - foreach (DS4Controls dc in DpadLeft) - if (getBoolMapping(device, dc, cState, eState, tp)) - MappedState.DpadLeft = true; - foreach (DS4Controls dc in DpadDown) - if (getBoolMapping(device, dc, cState, eState, tp)) - MappedState.DpadDown = true; - foreach (DS4Controls dc in Options) - if (getBoolMapping(device, dc, cState, eState, tp)) - MappedState.Options = true; - foreach (DS4Controls dc in Share) - if (getBoolMapping(device, dc, cState, eState, tp)) - MappedState.Share = true; - foreach (DS4Controls dc in PS) - if (getBoolMapping(device, dc, cState, eState, tp)) - MappedState.PS = true; - if (IfAxisIsNotModified(device, ShiftTrigger(GetDS4STrigger(device, DS4Controls.LXNeg.ToString()), device, cState, eState, tp), DS4Controls.LXNeg)) - LXN.Add(DS4Controls.LXNeg); - if (IfAxisIsNotModified(device, ShiftTrigger(GetDS4STrigger(device, DS4Controls.LXPos.ToString()), device, cState, eState, tp), DS4Controls.LXPos)) - LXP.Add(DS4Controls.LXPos); + if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.LXNeg), device, cState, eState, tp, fieldMapping), DS4Controls.LXNeg)) + tempControlDict.Add(DS4Controls.LXNeg, DS4Controls.LXNeg); - if (IfAxisIsNotModified(device, ShiftTrigger(GetDS4STrigger(device, DS4Controls.LYNeg.ToString()), device, cState, eState, tp), DS4Controls.LYNeg)) - LYN.Add(DS4Controls.LYNeg); + if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.LXPos), device, cState, eState, tp, fieldMapping), DS4Controls.LXPos)) + tempControlDict.Add(DS4Controls.LXPos, DS4Controls.LXPos); - if (IfAxisIsNotModified(device, ShiftTrigger(GetDS4STrigger(device, DS4Controls.LYPos.ToString()), device, cState, eState, tp), DS4Controls.LYPos)) - LYP.Add(DS4Controls.LYPos); + if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.LYNeg), device, cState, eState, tp, fieldMapping), DS4Controls.LYNeg)) + tempControlDict.Add(DS4Controls.LYNeg, DS4Controls.LYNeg); - if (IfAxisIsNotModified(device, ShiftTrigger(GetDS4STrigger(device, DS4Controls.RXNeg.ToString()), device, cState, eState, tp), DS4Controls.RXNeg)) - RXN.Add(DS4Controls.RXNeg); + if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.LYPos), device, cState, eState, tp, fieldMapping), DS4Controls.LYPos)) + tempControlDict.Add(DS4Controls.LYPos, DS4Controls.LYPos); - if (IfAxisIsNotModified(device, ShiftTrigger(GetDS4STrigger(device, DS4Controls.RXPos.ToString()), device, cState, eState, tp), DS4Controls.RXPos)) - RXP.Add(DS4Controls.RXPos); + if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.RXNeg), device, cState, eState, tp, fieldMapping), DS4Controls.RXNeg)) + tempControlDict.Add(DS4Controls.RXNeg, DS4Controls.RXNeg); - if (IfAxisIsNotModified(device, ShiftTrigger(GetDS4STrigger(device, DS4Controls.RYNeg.ToString()), device, cState, eState, tp), DS4Controls.RYNeg)) - RYN.Add(DS4Controls.RYNeg); + if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.RXPos), device, cState, eState, tp, fieldMapping), DS4Controls.RXPos)) + tempControlDict.Add(DS4Controls.RXPos, DS4Controls.RXPos); - if (IfAxisIsNotModified(device, ShiftTrigger(GetDS4STrigger(device, DS4Controls.RYPos.ToString()), device, cState, eState, tp), DS4Controls.RYPos)) - RYP.Add(DS4Controls.RYPos); + if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.RYNeg), device, cState, eState, tp, fieldMapping), DS4Controls.RYNeg)) + tempControlDict.Add(DS4Controls.RYNeg, DS4Controls.RYNeg); - if (Math.Abs(MappedState.LX - 127) < 10) - if (LXN.Count > 0 || LXP.Count > 0) + if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.RYPos), device, cState, eState, tp, fieldMapping), DS4Controls.RYPos)) + tempControlDict.Add(DS4Controls.RYPos, DS4Controls.RYPos); + + Dictionary.KeyCollection controlKeys = tempControlDict.Keys; + //Dictionary>.KeyCollection controlKeys = tempControlDict.Keys; + + //foreach (KeyValuePair entry in tempControlDict) + for (int i = 0, keyCount = controlKeys.Count; i < keyCount; i++) + { + DS4Controls key = controlKeys.ElementAt(i); + DS4Controls dc = tempControlDict[key]; + //DS4Controls key = entry.Key; + //DS4Controls dc = entry.Value; + + if (getBoolActionMapping2(device, key, cState, eState, tp, fieldMapping, true)) { - foreach (DS4Controls dc in LXP) - if (Math.Abs(127 - getXYAxisMapping(device, dc, cState, eState, tp, true)) > 5) - MappedState.LX = getXYAxisMapping(device, dc, cState, eState, tp, true); - foreach (DS4Controls dc in LXN) - if (Math.Abs(127 - getXYAxisMapping(device, dc, cState, eState, tp)) > 5) - MappedState.LX = getXYAxisMapping(device, dc, cState, eState, tp); + if (dc >= DS4Controls.Square && dc <= DS4Controls.Cross) + { + switch (dc) + { + case DS4Controls.Cross: MappedState.Cross = true; break; + case DS4Controls.Circle: MappedState.Circle = true; break; + case DS4Controls.Square: MappedState.Square = true; break; + case DS4Controls.Triangle: MappedState.Triangle = true; break; + default: break; + } + } + else if (dc >= DS4Controls.L1 && dc <= DS4Controls.R3) + { + switch (dc) + { + case DS4Controls.L1: MappedState.L1 = true; break; + case DS4Controls.L2: MappedState.L2 = getByteMapping2(device, key, cState, eState, tp, fieldMapping); break; + case DS4Controls.L3: MappedState.L3 = true; break; + case DS4Controls.R1: MappedState.R1 = true; break; + case DS4Controls.R2: MappedState.R2 = getByteMapping2(device, key, cState, eState, tp, fieldMapping); break; + case DS4Controls.R3: MappedState.R3 = true; break; + default: break; + } + } + else if (dc >= DS4Controls.DpadUp && dc <= DS4Controls.DpadLeft) + { + switch (dc) + { + case DS4Controls.DpadUp: MappedState.DpadUp = true; break; + case DS4Controls.DpadRight: MappedState.DpadRight = true; break; + case DS4Controls.DpadLeft: MappedState.DpadLeft = true; break; + case DS4Controls.DpadDown: MappedState.DpadDown = true; break; + default: break; + } + } + else if (dc >= DS4Controls.LXNeg && dc <= DS4Controls.RYPos) + { + switch (dc) + { + case DS4Controls.LXNeg: + case DS4Controls.LXPos: + { + if (MappedState.LX == 127) + { + if (dc == DS4Controls.LXNeg) + { + byte axisMapping = getXYAxisMapping2(device, key, cState, eState, tp, fieldMapping); + MappedState.LX = axisMapping; + } + else + { + byte axisMapping = getXYAxisMapping2(device, key, cState, eState, tp, fieldMapping, true); + MappedState.LX = axisMapping; + } + } + + break; + } + case DS4Controls.LYNeg: + case DS4Controls.LYPos: + { + if (MappedState.LY == 127) + { + if (dc == DS4Controls.LYNeg) + { + byte axisMapping = getXYAxisMapping2(device, key, cState, eState, tp, fieldMapping); + MappedState.LY = axisMapping; + } + else + { + byte axisMapping = getXYAxisMapping2(device, key, cState, eState, tp, fieldMapping, true); + MappedState.LY = axisMapping; + } + } + + break; + } + case DS4Controls.RXNeg: + case DS4Controls.RXPos: + { + if (MappedState.RX == 127) + { + if (dc == DS4Controls.RXNeg) + { + byte axisMapping = getXYAxisMapping2(device, key, cState, eState, tp, fieldMapping); + MappedState.RX = axisMapping; + } + else + { + byte axisMapping = getXYAxisMapping2(device, key, cState, eState, tp, fieldMapping, true); + MappedState.RX = axisMapping; + } + } + + break; + } + case DS4Controls.RYNeg: + case DS4Controls.RYPos: + { + if (MappedState.RY == 127) + { + if (dc == DS4Controls.RYNeg) + { + byte axisMapping = getXYAxisMapping2(device, key, cState, eState, tp, fieldMapping); + MappedState.RY = axisMapping; + } + else + { + byte axisMapping = getXYAxisMapping2(device, key, cState, eState, tp, fieldMapping, true); + MappedState.RY = axisMapping; + } + } + + break; + } + default: break; + } + } + else + { + switch (dc) + { + case DS4Controls.Options: MappedState.Options = true; break; + case DS4Controls.Share: MappedState.Share = true; break; + case DS4Controls.PS: MappedState.PS = true; break; + default: break; + } + } } - //else - //MappedState.LX = cState.LX; - if (Math.Abs(MappedState.LY - 127) < 10) - if (LYN.Count > 0 || LYP.Count > 0) - { - foreach (DS4Controls dc in LYN) - if (Math.Abs(127 - getXYAxisMapping(device, dc, cState, eState, tp)) > 5) - MappedState.LY = getXYAxisMapping(device, dc, cState, eState, tp); - foreach (DS4Controls dc in LYP) - if (Math.Abs(127 - getXYAxisMapping(device, dc, cState, eState, tp, true)) > 5) - MappedState.LY = getXYAxisMapping(device, dc, cState, eState, tp, true); - } - //else - //MappedState.LY = cState.LY; - if (Math.Abs(MappedState.RX - 127) < 10) - if (RXN.Count > 0 || RXP.Count > 0) - { - foreach (DS4Controls dc in RXN) - if (Math.Abs(127 - getXYAxisMapping(device, dc, cState, eState, tp)) > 5) - MappedState.RX = getXYAxisMapping(device, dc, cState, eState, tp); - foreach (DS4Controls dc in RXP) - if (Math.Abs(127 - getXYAxisMapping(device, dc, cState, eState, tp, true)) > 5) - MappedState.RX = getXYAxisMapping(device, dc, cState, eState, tp, true); - } - //else - // MappedState.RX = cState.RX; - if (Math.Abs(MappedState.RY - 127) < 10) - if (RYN.Count > 0 || RYP.Count > 0) - { - foreach (DS4Controls dc in RYN) - if (Math.Abs(127 - getXYAxisMapping(device, dc, cState, eState, tp)) > 5) - MappedState.RY = getXYAxisMapping(device, dc, cState, eState, tp); - foreach (DS4Controls dc in RYP) - if (Math.Abs(127 - getXYAxisMapping(device, dc, cState, eState, tp, true)) > 5) - MappedState.RY = getXYAxisMapping(device, dc, cState, eState, tp, true); - } - // else - // MappedState.RY = cState.RY; - InputMethods.MoveCursorBy(MouseDeltaX, MouseDeltaY); + } + + calculateFinalMouseMovement(ref tempMouseDeltaX, ref tempMouseDeltaY, + out mouseDeltaX, out mouseDeltaY); + if (mouseDeltaX != 0 || mouseDeltaY != 0) + { + InputMethods.MoveCursorBy(mouseDeltaX, mouseDeltaY); + } } private static bool IfAxisIsNotModified(int device, bool shift, DS4Controls dc) { - return shift ? false : GetDS4Action(device, dc.ToString(), false) == null; + return shift ? false : GetDS4Action(device, dc, false) == null; } - public static async void MapCustomAction(int device, DS4State cState, DS4State MappedState, DS4StateExposed eState, Mouse tp, ControlService ctrl) + + private static async void MapCustomAction(int device, DS4State cState, DS4State MappedState, + DS4StateExposed eState, Mouse tp, ControlService ctrl, DS4StateFieldMapping fieldMapping, DS4StateFieldMapping outputfieldMapping) { - try { - foreach (string actionname in ProfileActions[device]) + /* TODO: This method is slow sauce. Find ways to speed up action execution */ + try + { + int actionDoneCount = actionDone.Count; + int totalActionCount = GetActions().Count; + DS4StateFieldMapping previousFieldMapping = null; + List profileActions = getProfileActions(device); + //foreach (string actionname in profileActions) + for (int actionIndex = 0, profileListLen = profileActions.Count; + actionIndex < profileListLen; actionIndex++) { //DS4KeyType keyType = getShiftCustomKeyType(device, customKey.Key); - SpecialAction action = GetAction(actionname); - int index = GetActionIndexOf(actionname); - if (actionDone.Count < index + 1) + //SpecialAction action = GetAction(actionname); + //int index = GetActionIndexOf(actionname); + string actionname = profileActions[actionIndex]; + SpecialAction action = GetProfileAction(device, actionname); + int index = GetProfileActionIndexOf(device, actionname); + + if (actionDoneCount < index + 1) + { actionDone.Add(new ActionState()); - else if (actionDone.Count > GetActions().Count()) - actionDone.RemoveAt(actionDone.Count - 1); - double time; + actionDoneCount++; + } + else if (actionDoneCount > totalActionCount) + { + actionDone.RemoveAt(actionDoneCount - 1); + actionDoneCount--; + } + + double time = 0.0; //If a key or button is assigned to the trigger, a key special action is used like //a quick tap to use and hold to use the regular custom button/key - bool triggerToBeTapped = action.type == "Key" && action.trigger.Count == 1 && - GetDS4Action(device, action.trigger[0].ToString(), false) == null; - if (!(action.name == "null" || index < 0)) + bool triggerToBeTapped = action.typeID == SpecialAction.ActionTypeId.None && action.trigger.Count == 1 && + GetDS4Action(device, action.trigger[0], false) == null; + if (!(action.typeID == SpecialAction.ActionTypeId.None || index < 0)) { bool triggeractivated = true; - if (action.delayTime > 0) + if (action.delayTime > 0.0) { triggeractivated = false; bool subtriggeractivated = true; - foreach (DS4Controls dc in action.trigger) + //foreach (DS4Controls dc in action.trigger) + for (int i = 0, arlen = action.trigger.Count; i < arlen; i++) { - if (!getBoolMapping(device, dc, cState, eState, tp)) + DS4Controls dc = action.trigger[i]; + if (!getBoolMapping2(device, dc, cState, eState, tp, fieldMapping)) { subtriggeractivated = false; break; @@ -1064,9 +1436,11 @@ namespace DS4Windows { triggeractivated = false; bool subtriggeractivated = true; - foreach (DS4Controls dc in action.trigger) + //foreach (DS4Controls dc in action.trigger) + for (int i = 0, arlen = action.trigger.Count; i < arlen; i++) { - if (!getBoolMapping(device, dc, cState, eState, tp)) + DS4Controls dc = action.trigger[i]; + if (!getBoolMapping2(device, dc, cState, eState, tp, fieldMapping)) { subtriggeractivated = false; break; @@ -1081,9 +1455,11 @@ namespace DS4Windows { triggeractivated = false; bool subtriggeractivated = true; - foreach (DS4Controls dc in action.trigger) + //foreach (DS4Controls dc in action.trigger) + for (int i = 0, arlen = action.trigger.Count; i < arlen; i++) { - if (!getBoolMapping(device, dc, cState, eState, tp)) + DS4Controls dc = action.trigger[i]; + if (!getBoolMapping2(device, dc, cState, eState, tp, fieldMapping)) { subtriggeractivated = false; break; @@ -1100,21 +1476,28 @@ namespace DS4Windows oldnowKeyAct[device] = DateTime.MinValue; } else - foreach (DS4Controls dc in action.trigger) + { + //foreach (DS4Controls dc in action.trigger) + for (int i = 0, arlen = action.trigger.Count; i < arlen; i++) { - if (!getBoolMapping(device, dc, cState, eState, tp)) + DS4Controls dc = action.trigger[i]; + if (!getBoolMapping2(device, dc, cState, eState, tp, fieldMapping)) { triggeractivated = false; break; } } + } bool utriggeractivated = true; - if (action.type == "Key" && action.uTrigger.Count > 0) + int uTriggerCount = action.uTrigger.Count; + if (action.typeID == SpecialAction.ActionTypeId.Key && uTriggerCount > 0) { - foreach (DS4Controls dc in action.uTrigger) + //foreach (DS4Controls dc in action.uTrigger) + for (int i = 0, arlen = action.uTrigger.Count; i < arlen; i++) { - if (!getBoolMapping(device, dc, cState, eState, tp)) + DS4Controls dc = action.uTrigger[i]; + if (!getBoolMapping2(device, dc, cState, eState, tp, fieldMapping)) { utriggeractivated = false; break; @@ -1123,274 +1506,339 @@ namespace DS4Windows if (action.pressRelease) utriggeractivated = !utriggeractivated; } - if (triggeractivated && action.type == "Program") + bool actionFound = false; + if (triggeractivated) { - if (!actionDone[index].dev[device]) + if (action.typeID == SpecialAction.ActionTypeId.Program) { - actionDone[index].dev[device] = true; - if (!string.IsNullOrEmpty(action.extra)) - Process.Start(action.details, action.extra); - else - Process.Start(action.details); - } - } - else if (triggeractivated && action.type == "Profile") - { - if (!actionDone[index].dev[device] && string.IsNullOrEmpty(tempprofilename[device])) - { - actionDone[index].dev[device] = true; - untriggeraction[device] = action; - untriggerindex[device] = index; - foreach (DS4Controls dc in action.trigger) - { - DS4ControlSettings dcs = getDS4CSetting(device, dc.ToString()); - if (dcs.action != null) - { - if (dcs.actionType == DS4ControlSettings.ActionType.Key) - InputMethods.performKeyRelease(ushort.Parse(action.ToString())); - else if (dcs.actionType == DS4ControlSettings.ActionType.Macro) - { - int[] keys = (int[])dcs.action; - for (int i = 0; i < keys.Length; i++) - InputMethods.performKeyRelease((ushort)keys[i]); - } - } - } - LoadTempProfile(device, action.details, true, ctrl); - return; - } - } - else if (triggeractivated && action.type == "Macro") - { - if (!actionDone[index].dev[device]) - { - DS4KeyType keyType = action.keyType; - actionDone[index].dev[device] = true; - foreach (DS4Controls dc in action.trigger) - resetToDefaultValue(dc, MappedState); - PlayMacro(device, macroControl, String.Join("/", action.macro), DS4Controls.None, keyType); - } - else - EndMacro(device, macroControl, String.Join("/", action.macro), DS4Controls.None); - } - else if (triggeractivated && action.type == "Key") - { - if (action.uTrigger.Count == 0 || (action.uTrigger.Count > 0 && untriggerindex[device] == -1 && !actionDone[index].dev[device])) - { - actionDone[index].dev[device] = true; - untriggerindex[device] = index; - ushort key; - ushort.TryParse(action.details, out key); - if (action.uTrigger.Count == 0) - { - SyntheticState.KeyPresses kp; - if (!deviceState[device].keyPresses.TryGetValue(key, out kp)) - deviceState[device].keyPresses[key] = kp = new SyntheticState.KeyPresses(); - if (action.keyType.HasFlag(DS4KeyType.ScanCode)) - kp.current.scanCodeCount++; - else - kp.current.vkCount++; - kp.current.repeatCount++; - } - else if (action.keyType.HasFlag(DS4KeyType.ScanCode)) - InputMethods.performSCKeyPress(key); - else - InputMethods.performKeyPress(key); - } - } - else if (action.uTrigger.Count > 0 && utriggeractivated && action.type == "Key") - { - if (untriggerindex[device] > -1 && !actionDone[index].dev[device]) - { - actionDone[index].dev[device] = true; - untriggerindex[device] = -1; - ushort key; - ushort.TryParse(action.details, out key); - if (action.keyType.HasFlag(DS4KeyType.ScanCode)) - InputMethods.performSCKeyRelease(key); - else - InputMethods.performKeyRelease(key); - } - } - else if (triggeractivated && action.type == "DisconnectBT") - { - DS4Device d = ctrl.DS4Controllers[device]; - if (!d.Charging) - { - d.DisconnectBT(); - foreach (DS4Controls dc in action.trigger) - { - DS4ControlSettings dcs = getDS4CSetting(device, dc.ToString()); - if (dcs.action != null) - { - if (dcs.actionType == DS4ControlSettings.ActionType.Key) - InputMethods.performKeyRelease((ushort)dcs.action); - else if (dcs.actionType == DS4ControlSettings.ActionType.Macro) - { - int[] keys = (int[])dcs.action; - for (int i = 0; i < keys.Length; i++) - InputMethods.performKeyRelease((ushort)keys[i]); - } - } - } - return; - } - } - else if (triggeractivated && action.type == "BatteryCheck") - { - string[] dets = action.details.Split('|'); - if (dets.Length == 1) - dets = action.details.Split(','); - if (bool.Parse(dets[1]) && !actionDone[index].dev[device]) - { - Log.LogToTray("Controller " + (device + 1) + ": " + - ctrl.getDS4Battery(device), true); - } - if (bool.Parse(dets[2])) - { - DS4Device d = ctrl.DS4Controllers[device]; + actionFound = true; + if (!actionDone[index].dev[device]) { - lastColor[device] = d.LightBarColor; - DS4LightBar.forcelight[device] = true; + actionDone[index].dev[device] = true; + if (!string.IsNullOrEmpty(action.extra)) + Process.Start(action.details, action.extra); + else + Process.Start(action.details); } - DS4Color empty = new DS4Color(byte.Parse(dets[3]), byte.Parse(dets[4]), byte.Parse(dets[5])); - DS4Color full = new DS4Color(byte.Parse(dets[6]), byte.Parse(dets[7]), byte.Parse(dets[8])); - DS4Color trans = getTransitionedColor(empty, full, d.Battery); - if (fadetimer[device] < 100) - DS4LightBar.forcedColor[device] = getTransitionedColor(lastColor[device], trans, fadetimer[device] += 2); } - actionDone[index].dev[device] = true; - } - else if (!triggeractivated && action.type == "BatteryCheck") - { - if (actionDone[index].dev[device]) + else if (action.typeID == SpecialAction.ActionTypeId.Profile) { - fadetimer[device] = 0; - /*if (prevFadetimer[device] == fadetimer[device]) - { - prevFadetimer[device] = 0; - fadetimer[device] = 0; - } - else - prevFadetimer[device] = fadetimer[device];*/ - DS4LightBar.forcelight[device] = false; - actionDone[index].dev[device] = false; - } - } - else if (action.type == "XboxGameDVR" || action.type == "MultiAction") - { - /*if (getCustomButton(device, action.trigger[0]) != X360Controls.Unbound) - getCustomButtons(device)[action.trigger[0]] = X360Controls.Unbound; - if (getCustomMacro(device, action.trigger[0]) != "0") - getCustomMacros(device).Remove(action.trigger[0]); - if (getCustomKey(device, action.trigger[0]) != 0) - getCustomMacros(device).Remove(action.trigger[0]);*/ - string[] dets = action.details.Split(','); - DS4Device d = ctrl.DS4Controllers[device]; - //cus - if (getBoolMapping(device, action.trigger[0], cState, eState, tp) && !getBoolMapping(device, action.trigger[0], d.getPreviousState(), eState, tp)) - {//pressed down - pastTime = DateTime.UtcNow; - if (DateTime.UtcNow <= (firstTap + TimeSpan.FromMilliseconds(150))) - { - tappedOnce = false; - secondtouchbegin = true; - } - else - firstTouch = true; - } - else if (!getBoolMapping(device, action.trigger[0], cState, eState, tp) && getBoolMapping(device, action.trigger[0], d.getPreviousState(), eState, tp)) - {//released - if (secondtouchbegin) - { - firstTouch = false; - secondtouchbegin = false; - } - else if (firstTouch) - { - firstTouch = false; - if (DateTime.UtcNow <= (pastTime + TimeSpan.FromMilliseconds(200)) && !tappedOnce) - { - tappedOnce = true; - firstTap = DateTime.UtcNow; - TimeofEnd = DateTime.UtcNow; - } - } - } + actionFound = true; - int type = 0; - string macro = ""; - if (tappedOnce) //single tap - { - if (action.type == "MultiAction") + if (!actionDone[index].dev[device] && string.IsNullOrEmpty(tempprofilename[device])) { - macro = dets[0]; - } - else if (int.TryParse(dets[0], out type)) - { - switch (type) + actionDone[index].dev[device] = true; + untriggeraction[device] = action; + untriggerindex[device] = index; + //foreach (DS4Controls dc in action.trigger) + for (int i = 0, arlen = action.trigger.Count; i < arlen; i++) { - case 0: macro = "91/71/71/91"; break; - case 1: macro = "91/164/82/82/164/91"; break; - case 2: macro = "91/164/44/44/164/91"; break; - case 3: macro = dets[3] + "/" + dets[3]; break; - case 4: macro = "91/164/71/71/164/91"; break; + DS4Controls dc = action.trigger[i]; + DS4ControlSettings dcs = getDS4CSetting(device, dc); + if (dcs.action != null) + { + if (dcs.actionType == DS4ControlSettings.ActionType.Key) + InputMethods.performKeyRelease(ushort.Parse(dcs.action.ToString())); + else if (dcs.actionType == DS4ControlSettings.ActionType.Macro) + { + int[] keys = (int[])dcs.action; + for (int j = 0, keysLen = keys.Length; j < keysLen; j++) + InputMethods.performKeyRelease((ushort)keys[j]); + } + } } + LoadTempProfile(device, action.details, true, ctrl); + return; } - if ((DateTime.UtcNow - TimeofEnd) > TimeSpan.FromMilliseconds(150)) - { - if (macro != "") - PlayMacro(device, macroControl, macro, DS4Controls.None, DS4KeyType.None); - tappedOnce = false; - } - //if it fails the method resets, and tries again with a new tester value (gives tap a delay so tap and hold can work) } - else if (firstTouch && (DateTime.UtcNow - pastTime) > TimeSpan.FromMilliseconds(1000)) //helddown + else if (action.typeID == SpecialAction.ActionTypeId.Macro) { - if (action.type == "MultiAction") + actionFound = true; + + if (!actionDone[index].dev[device]) { - macro = dets[1]; - } - else if (int.TryParse(dets[1], out type)) - { - switch (type) + DS4KeyType keyType = action.keyType; + actionDone[index].dev[device] = true; + //foreach (DS4Controls dc in action.trigger) + for (int i = 0, arlen = action.trigger.Count; i < arlen; i++) { - case 0: macro = "91/71/71/91"; break; - case 1: macro = "91/164/82/82/164/91"; break; - case 2: macro = "91/164/44/44/164/91"; break; - case 3: macro = dets[3] + "/" + dets[3]; break; - case 4: macro = "91/164/71/71/164/91"; break; + DS4Controls dc = action.trigger[i]; + resetToDefaultValue2(dc, MappedState, outputfieldMapping); } + + PlayMacro(device, macroControl, String.Join("/", action.macro), DS4Controls.None, keyType); } - if (macro != "") - PlayMacro(device, macroControl, macro, DS4Controls.None, DS4KeyType.None); - firstTouch = false; + else + EndMacro(device, macroControl, String.Join("/", action.macro), DS4Controls.None); } - else if (secondtouchbegin) //if double tap + else if (action.typeID == SpecialAction.ActionTypeId.Key) { - if (action.type == "MultiAction") + actionFound = true; + + if (uTriggerCount == 0 || (uTriggerCount > 0 && untriggerindex[device] == -1 && !actionDone[index].dev[device])) { - macro = dets[2]; - } - else if (int.TryParse(dets[2], out type)) - { - switch (type) + actionDone[index].dev[device] = true; + untriggerindex[device] = index; + ushort key; + ushort.TryParse(action.details, out key); + if (uTriggerCount == 0) { - case 0: macro = "91/71/71/91"; break; - case 1: macro = "91/164/82/82/164/91"; break; - case 2: macro = "91/164/44/44/164/91"; break; - case 3: macro = dets[3] + "/" + dets[3]; break; - case 4: macro = "91/164/71/71/164/91"; break; + SyntheticState.KeyPresses kp; + if (!deviceState[device].keyPresses.TryGetValue(key, out kp)) + deviceState[device].keyPresses[key] = kp = new SyntheticState.KeyPresses(); + if (action.keyType.HasFlag(DS4KeyType.ScanCode)) + kp.current.scanCodeCount++; + else + kp.current.vkCount++; + kp.current.repeatCount++; } + else if (action.keyType.HasFlag(DS4KeyType.ScanCode)) + InputMethods.performSCKeyPress(key); + else + InputMethods.performKeyPress(key); } - if (macro != "") - PlayMacro(device, macroControl, macro, DS4Controls.None, DS4KeyType.None); - secondtouchbegin = false; + } + else if (action.typeID == SpecialAction.ActionTypeId.DisconnectBT) + { + actionFound = true; + + DS4Device d = ctrl.DS4Controllers[device]; + if (!d.isCharging()) + { + ConnectionType deviceConn = d.getConnectionType(); + if (deviceConn == ConnectionType.BT) + { + d.DisconnectBT(); + } + + //foreach (DS4Controls dc in action.trigger) + for (int i = 0, arlen = action.trigger.Count; i < arlen; i++) + { + DS4Controls dc = action.trigger[i]; + DS4ControlSettings dcs = getDS4CSetting(device, dc); + if (dcs.action != null) + { + if (dcs.actionType == DS4ControlSettings.ActionType.Key) + InputMethods.performKeyRelease((ushort)dcs.action); + else if (dcs.actionType == DS4ControlSettings.ActionType.Macro) + { + int[] keys = (int[])dcs.action; + for (int j = 0, keysLen = keys.Length; j < keysLen; j++) + InputMethods.performKeyRelease((ushort)keys[j]); + } + } + } + return; + } + } + else if (action.typeID == SpecialAction.ActionTypeId.BatteryCheck) + { + actionFound = true; + + string[] dets = action.details.Split('|'); + if (dets.Length == 1) + dets = action.details.Split(','); + if (bool.Parse(dets[1]) && !actionDone[index].dev[device]) + { + Log.LogToTray("Controller " + (device + 1) + ": " + + ctrl.getDS4Battery(device), true); + } + if (bool.Parse(dets[2])) + { + DS4Device d = ctrl.DS4Controllers[device]; + if (!actionDone[index].dev[device]) + { + lastColor[device] = d.LightBarColor; + DS4LightBar.forcelight[device] = true; + } + DS4Color empty = new DS4Color(byte.Parse(dets[3]), byte.Parse(dets[4]), byte.Parse(dets[5])); + DS4Color full = new DS4Color(byte.Parse(dets[6]), byte.Parse(dets[7]), byte.Parse(dets[8])); + DS4Color trans = getTransitionedColor(empty, full, d.Battery); + if (fadetimer[device] < 100) + DS4LightBar.forcedColor[device] = getTransitionedColor(lastColor[device], trans, fadetimer[device] += 2); + } + actionDone[index].dev[device] = true; } } else - actionDone[index].dev[device] = false; + { + if (action.typeID == SpecialAction.ActionTypeId.BatteryCheck) + { + actionFound = true; + if (actionDone[index].dev[device]) + { + fadetimer[device] = 0; + /*if (prevFadetimer[device] == fadetimer[device]) + { + prevFadetimer[device] = 0; + fadetimer[device] = 0; + } + else + prevFadetimer[device] = fadetimer[device];*/ + DS4LightBar.forcelight[device] = false; + actionDone[index].dev[device] = false; + } + } + else if (action.typeID != SpecialAction.ActionTypeId.Key && + action.typeID != SpecialAction.ActionTypeId.XboxGameDVR && + action.typeID != SpecialAction.ActionTypeId.MultiAction) + { + // Ignore + actionFound = true; + actionDone[index].dev[device] = false; + } + } + + if (!actionFound) + { + if (uTriggerCount > 0 && utriggeractivated && action.typeID == SpecialAction.ActionTypeId.Key) + { + actionFound = true; + + if (untriggerindex[device] > -1 && !actionDone[index].dev[device]) + { + actionDone[index].dev[device] = true; + untriggerindex[device] = -1; + ushort key; + ushort.TryParse(action.details, out key); + if (action.keyType.HasFlag(DS4KeyType.ScanCode)) + InputMethods.performSCKeyRelease(key); + else + InputMethods.performKeyRelease(key); + } + } + else if (action.typeID == SpecialAction.ActionTypeId.XboxGameDVR || action.typeID == SpecialAction.ActionTypeId.MultiAction) + { + actionFound = true; + + /*if (getCustomButton(device, action.trigger[0]) != X360Controls.Unbound) + getCustomButtons(device)[action.trigger[0]] = X360Controls.Unbound; + if (getCustomMacro(device, action.trigger[0]) != "0") + getCustomMacros(device).Remove(action.trigger[0]); + if (getCustomKey(device, action.trigger[0]) != 0) + getCustomMacros(device).Remove(action.trigger[0]);*/ + string[] dets = action.details.Split(','); + DS4Device d = ctrl.DS4Controllers[device]; + //cus + + DS4State tempPrevState = d.getPreviousState(); + // Only create one instance of previous DS4StateFieldMapping in case more than one multi-action + // button is assigned + if (previousFieldMapping == null) + { + previousFieldMapping = new DS4StateFieldMapping(tempPrevState, eState, tp); + } + + bool activeCur = getBoolMapping2(device, action.trigger[0], cState, eState, tp, fieldMapping); + bool activePrev = getBoolMapping2(device, action.trigger[0], tempPrevState, eState, tp, previousFieldMapping); + if (activeCur && !activePrev) + { + // pressed down + pastTime = DateTime.UtcNow; + if (pastTime <= (firstTap + TimeSpan.FromMilliseconds(150))) + { + tappedOnce = false; + secondtouchbegin = true; + } + else + firstTouch = true; + } + else if (!activeCur && activePrev) + { + // released + if (secondtouchbegin) + { + firstTouch = false; + secondtouchbegin = false; + } + else if (firstTouch) + { + firstTouch = false; + if (DateTime.UtcNow <= (pastTime + TimeSpan.FromMilliseconds(200)) && !tappedOnce) + { + tappedOnce = true; + firstTap = DateTime.UtcNow; + TimeofEnd = DateTime.UtcNow; + } + } + } + + int type = 0; + string macro = ""; + if (tappedOnce) //single tap + { + if (action.typeID == SpecialAction.ActionTypeId.MultiAction) + { + macro = dets[0]; + } + else if (int.TryParse(dets[0], out type)) + { + switch (type) + { + case 0: macro = "91/71/71/91"; break; + case 1: macro = "91/164/82/82/164/91"; break; + case 2: macro = "91/164/44/44/164/91"; break; + case 3: macro = dets[3] + "/" + dets[3]; break; + case 4: macro = "91/164/71/71/164/91"; break; + } + } + if ((DateTime.UtcNow - TimeofEnd) > TimeSpan.FromMilliseconds(150)) + { + if (macro != "") + PlayMacro(device, macroControl, macro, DS4Controls.None, DS4KeyType.None); + tappedOnce = false; + } + //if it fails the method resets, and tries again with a new tester value (gives tap a delay so tap and hold can work) + } + else if (firstTouch && (DateTime.UtcNow - pastTime) > TimeSpan.FromMilliseconds(1000)) //helddown + { + if (action.typeID == SpecialAction.ActionTypeId.MultiAction) + { + macro = dets[1]; + } + else if (int.TryParse(dets[1], out type)) + { + switch (type) + { + case 0: macro = "91/71/71/91"; break; + case 1: macro = "91/164/82/82/164/91"; break; + case 2: macro = "91/164/44/44/164/91"; break; + case 3: macro = dets[3] + "/" + dets[3]; break; + case 4: macro = "91/164/71/71/164/91"; break; + } + } + if (macro != "") + PlayMacro(device, macroControl, macro, DS4Controls.None, DS4KeyType.None); + firstTouch = false; + } + else if (secondtouchbegin) //if double tap + { + if (action.typeID == SpecialAction.ActionTypeId.MultiAction) + { + macro = dets[2]; + } + else if (int.TryParse(dets[2], out type)) + { + switch (type) + { + case 0: macro = "91/71/71/91"; break; + case 1: macro = "91/164/82/82/164/91"; break; + case 2: macro = "91/164/44/44/164/91"; break; + case 3: macro = dets[3] + "/" + dets[3]; break; + case 4: macro = "91/164/71/71/164/91"; break; + } + } + if (macro != "") + PlayMacro(device, macroControl, macro, DS4Controls.None, DS4KeyType.None); + secondtouchbegin = false; + } + } + else + { + actionDone[index].dev[device] = false; + } + } } } } @@ -1401,25 +1849,30 @@ namespace DS4Windows SpecialAction action = untriggeraction[device]; int index = untriggerindex[device]; bool utriggeractivated = true; - foreach (DS4Controls dc in action.uTrigger) + //foreach (DS4Controls dc in action.uTrigger) + for (int i = 0, uTrigLen = action.uTrigger.Count; i < uTrigLen; i++) { - if (!getBoolMapping(device, dc, cState, eState, tp)) + DS4Controls dc = action.uTrigger[i]; + if (!getBoolMapping2(device, dc, cState, eState, tp, fieldMapping)) { utriggeractivated = false; break; } } - if (utriggeractivated && action.type == "Profile") + if (utriggeractivated && action.typeID == SpecialAction.ActionTypeId.Profile) { if ((action.controls == action.ucontrols && !actionDone[index].dev[device]) || //if trigger and end trigger are the same action.controls != action.ucontrols) + { if (!string.IsNullOrEmpty(tempprofilename[device])) { - foreach (DS4Controls dc in action.uTrigger) + //foreach (DS4Controls dc in action.uTrigger) + for (int i = 0, arlen = action.uTrigger.Count; i < arlen; i++) { + DS4Controls dc = action.uTrigger[i]; actionDone[index].dev[device] = true; - DS4ControlSettings dcs = getDS4CSetting(device, dc.ToString()); + DS4ControlSettings dcs = getDS4CSetting(device, dc); if (dcs.action != null) { if (dcs.actionType == DS4ControlSettings.ActionType.Key) @@ -1427,17 +1880,20 @@ namespace DS4Windows else if (dcs.actionType == DS4ControlSettings.ActionType.Macro) { int[] keys = (int[])dcs.action; - for (int i = 0; i < keys.Length; i++) - InputMethods.performKeyRelease((ushort)keys[i]); + for (int j = 0, keysLen = keys.Length; j < keysLen; j++) + InputMethods.performKeyRelease((ushort)keys[j]); } } } untriggeraction[device] = null; LoadProfile(device, false, ctrl); } + } } else + { actionDone[index].dev[device] = false; + } } } @@ -1586,9 +2042,10 @@ namespace DS4Windows keydown[i] = false; } } - for (ushort i = 0; i < keydown.Length; i++) + for (int i = 0, arlength = keydown.Length; i < arlength; i++) { if (keydown[i]) + { if (i == 256) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_LEFTUP); //anything above 255 is not a keyvalue else if (i == 257) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_RIGHTUP); else if (i == 258) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_MIDDLEUP); @@ -1620,10 +2077,12 @@ namespace DS4Windows else if (i == 284) macroControl[23] = false; else if (i == 285) macroControl[24] = false; else if (keyType.HasFlag(DS4KeyType.ScanCode)) - InputMethods.performSCKeyRelease(i); + InputMethods.performSCKeyRelease((ushort)i); else - InputMethods.performKeyRelease(i); + InputMethods.performKeyRelease((ushort)i); + } } + DS4LightBar.forcedFlash[device] = 0; DS4LightBar.forcelight[device] = false; Program.rootHub.DS4Controllers[device].setRumble(0, 0); @@ -1641,9 +2100,11 @@ namespace DS4Windows { if ((macro.StartsWith("164/9/9/164") || macro.StartsWith("18/9/9/18")) && !altTabDone) AltTabSwappingRelease(); + if (control != DS4Controls.None) macrodone[DS4ControltoInt(control)] = false; } + private static void AltTabSwapping(int wait, int device) { if (altTabDone) @@ -1675,7 +2136,8 @@ namespace DS4Windows } } - private static void getMouseWheelMapping(int device, DS4Controls control, DS4State cState, DS4StateExposed eState, Mouse tp, bool down) + private static void getMouseWheelMapping(int device, DS4Controls control, DS4State cState, + DS4StateExposed eState, Mouse tp, bool down) { DateTime now = DateTime.UtcNow; if (now >= oldnow + TimeSpan.FromMilliseconds(10) && !pressagain) @@ -1685,342 +2147,1268 @@ namespace DS4Windows } } - private static int getMouseMapping(int device, DS4Controls control, DS4State cState, DS4StateExposed eState, int mnum) + private static double getMouseMapping(int device, DS4Controls control, DS4State cState, DS4StateExposed eState, + DS4StateFieldMapping fieldMapping, int mnum) { int controlnum = DS4ControltoInt(control); - double SXD = SXDeadzone[device]; - double SZD = SZDeadzone[device]; + int deadzoneL = 3; int deadzoneR = 3; - if (LSDeadzone[device] >= 3) + if (getLSDeadzone(device) >= 3) deadzoneL = 0; - if (RSDeadzone[device] >= 3) + if (getRSDeadzone(device) >= 3) deadzoneR = 0; - double value = 0; + + double value = 0.0; int speed = ButtonMouseSensitivity[device] + 15; double root = 1.002; double divide = 10000d; //DateTime now = mousenow[mnum]; - switch (control) + + int controlNum = (int)control; + DS4StateFieldMapping.ControlType controlType = DS4StateFieldMapping.mappedType[controlNum]; + + if (controlType == DS4StateFieldMapping.ControlType.Button) { - case DS4Controls.LXNeg: - if (cState.LX - 127.5f < -deadzoneL) - value = -(cState.LX - 127.5f) / 2550d * speed; - break; - case DS4Controls.LXPos: - if (cState.LX - 127.5f > deadzoneL) - value = (cState.LX - 127.5f) / 2550d * speed; - break; - case DS4Controls.RXNeg: - if (cState.RX - 127.5f < -deadzoneR) - value = -(cState.RX - 127.5f) / 2550d * speed; - break; - case DS4Controls.RXPos: - if (cState.RX - 127.5f > deadzoneR) - value = (cState.RX - 127.5f) / 2550d * speed; - break; - case DS4Controls.LYNeg: - if (cState.LY - 127.5f < -deadzoneL) - value = -(cState.LY - 127.5f) / 2550d * speed; - break; - case DS4Controls.LYPos: - if (cState.LY - 127.5f > deadzoneL) - value = (cState.LY - 127.5f) / 2550d * speed; - break; - case DS4Controls.RYNeg: - if (cState.RY - 127.5f < -deadzoneR) - value = -(cState.RY - 127.5f) / 2550d * speed; - break; - case DS4Controls.RYPos: - if (cState.RY - 127.5f > deadzoneR) - value = (cState.RY - 127.5f) / 2550d * speed; - break; - case DS4Controls.Share: value = (cState.Share ? Math.Pow(root + speed / divide, 100) - 1 : 0); break; - case DS4Controls.Options: value = (cState.Options ? Math.Pow(root + speed / divide, 100) - 1 : 0); break; - case DS4Controls.L1: value = (cState.L1 ? Math.Pow(root + speed / divide, 100) - 1 : 0); break; - case DS4Controls.R1: value = (cState.R1 ? Math.Pow(root + speed / divide, 100) - 1 : 0); break; - case DS4Controls.L3: value = (cState.L3 ? Math.Pow(root + speed / divide, 100) - 1 : 0); break; - case DS4Controls.R3: value = (cState.R3 ? Math.Pow(root + speed / divide, 100) - 1 : 0); break; - case DS4Controls.DpadUp: value = (cState.DpadUp ? Math.Pow(root + speed / divide, 100) - 1 : 0); break; - case DS4Controls.DpadDown: value = (cState.DpadDown ? Math.Pow(root + speed / divide, 100) - 1 : 0); break; - case DS4Controls.DpadLeft: value = (cState.DpadLeft ? Math.Pow(root + speed / divide, 100) - 1 : 0); break; - case DS4Controls.DpadRight: value = (cState.DpadRight ? Math.Pow(root + speed / divide, 100) - 1 : 0); break; - case DS4Controls.PS: value = (cState.PS ? Math.Pow(root + speed / divide, 100) - 1 : 0); break; - case DS4Controls.Cross: value = (cState.Cross ? Math.Pow(root + speed / divide, 100) - 1 : 0); break; - case DS4Controls.Square: value = (cState.Square ? Math.Pow(root + speed / divide, 100) - 1 : 0); break; - case DS4Controls.Triangle: value = (cState.Triangle ? Math.Pow(root + speed / divide, 100) - 1 : 0); break; - case DS4Controls.Circle: value = (cState.Circle ? Math.Pow(root + speed / divide, 100) - 1 : 0); break; - case DS4Controls.L2: value = Math.Pow(root + speed / divide, cState.L2 / 2d) - 1; break; - case DS4Controls.R2: value = Math.Pow(root + speed / divide, cState.R2 / 2d) - 1; break; - case DS4Controls.GyroXPos: return (byte)(eState.GyroX > SXD * 10 ? - Math.Pow(root + speed / divide, eState.GyroX) : 0); - case DS4Controls.GyroXNeg: return (byte)(eState.GyroX < -SXD * 10 ? - Math.Pow(root + speed / divide, -eState.GyroX) : 0); - case DS4Controls.GyroZPos: return (byte)(eState.GyroZ > SZD * 10 ? - Math.Pow(root + speed / divide, eState.GyroZ) : 0); - case DS4Controls.GyroZNeg: return (byte)(eState.GyroZ < -SZD * 10 ? - Math.Pow(root + speed / divide, -eState.GyroZ) : 0); + bool active = fieldMapping.buttons[controlNum]; + value = (active ? Math.Pow(root + speed / divide, 100) - 1 : 0); } - bool LXChanged = (Math.Abs(127 - cState.LX) < deadzoneL); - bool LYChanged = (Math.Abs(127 - cState.LY) < deadzoneL); - bool RXChanged = (Math.Abs(127 - cState.RX) < deadzoneR); - bool RYChanged = (Math.Abs(127 - cState.RY) < deadzoneR); - bool contains = (control.ToString().Contains("LX") || - control.ToString().Contains("LY") || - control.ToString().Contains("RX") || - control.ToString().Contains("RY")); - if (MouseAccel[device]) + else if (controlType == DS4StateFieldMapping.ControlType.AxisDir) + { + switch (control) + { + case DS4Controls.LXNeg: + if (cState.LX < 127 - deadzoneL) + value = -(cState.LX - 127 - deadzoneL) / 2550d * speed; + break; + case DS4Controls.LXPos: + if (cState.LX > 127 + deadzoneL) + value = (cState.LX - 127 + deadzoneL) / 2550d * speed; + break; + case DS4Controls.RXNeg: + if (cState.RX < 127 - deadzoneR) + value = -(cState.RX - 127 - deadzoneR) / 2550d * speed; + break; + case DS4Controls.RXPos: + if (cState.RX > 127 + deadzoneR) + value = (cState.RX - 127 + deadzoneR) / 2550d * speed; + break; + case DS4Controls.LYNeg: + if (cState.LY < 127 - deadzoneL) + value = -(cState.LY - 127 - deadzoneL) / 2550d * speed; + break; + case DS4Controls.LYPos: + if (cState.LY > 127 + deadzoneL) + value = (cState.LY - 127 + deadzoneL) / 2550d * speed; + break; + case DS4Controls.RYNeg: + if (cState.RY < 127 - deadzoneR) + value = -(cState.RY - 127 - deadzoneR) / 2550d * speed; + break; + case DS4Controls.RYPos: + if (cState.RY > 127 + deadzoneR) + value = (cState.RY - 127 + deadzoneR) / 2550d * speed; + break; + default: break; + } + } + else if (controlType == DS4StateFieldMapping.ControlType.Trigger) + { + byte trigger = fieldMapping.triggers[controlNum]; + value = Math.Pow(root + speed / divide, trigger / 2d) - 1; + } + else if (controlType == DS4StateFieldMapping.ControlType.GyroDir) + { + double SXD = getSXDeadzone(device); + double SZD = getSZDeadzone(device); + + switch (control) + { + case DS4Controls.GyroXPos: + { + int gyroX = fieldMapping.gryodirs[controlNum]; + value = (byte)(gyroX > SXD * 10 ? Math.Pow(root + speed / divide, gyroX) : 0); + break; + } + case DS4Controls.GyroXNeg: + { + int gyroX = fieldMapping.gryodirs[controlNum]; + value = (byte)(gyroX < -SXD * 10 ? Math.Pow(root + speed / divide, -gyroX) : 0); + break; + } + case DS4Controls.GyroZPos: + { + int gyroZ = fieldMapping.gryodirs[controlNum]; + value = (byte)(gyroZ > SZD * 10 ? Math.Pow(root + speed / divide, gyroZ) : 0); + break; + } + case DS4Controls.GyroZNeg: + { + int gyroZ = fieldMapping.gryodirs[controlNum]; + value = (byte)(gyroZ < -SZD * 10 ? Math.Pow(root + speed / divide, -gyroZ) : 0); + break; + } + default: break; + } + } + + if (getMouseAccel(device)) { if (value > 0) { mcounter = 34; mouseaccel++; } + if (mouseaccel == prevmouseaccel) { mcounter--; } + if (mcounter <= 0) { mouseaccel = 0; mcounter = 34; } + value *= 1 + (double)Math.Min(20000, (mouseaccel)) / 10000d; prevmouseaccel = mouseaccel; } - int intValue; - if (mnum > 1) + + return value; + } + + private static void calculateFinalMouseMovement(ref double rawMouseX, ref double rawMouseY, + out int mouseX, out int mouseY) + { + if ((rawMouseX > 0.0 && horizontalRemainder > 0.0) || (rawMouseX < 0.0 && horizontalRemainder < 0.0)) { - if ((value > 0.0 && horizontalRemainder > 0.0) || (value < 0.0 && horizontalRemainder < 0.0)) - value += horizontalRemainder; - intValue = (int)value; - horizontalRemainder = value - intValue; + rawMouseX += horizontalRemainder; } else { - if ((value > 0.0 && verticalRemainder > 0.0) || (value < 0.0 && verticalRemainder < 0.0)) - value += verticalRemainder; - intValue = (int)value; - verticalRemainder = value - intValue; + horizontalRemainder = 0.0; } - return intValue; + + mouseX = (int)rawMouseX; + horizontalRemainder = rawMouseX - mouseX; + + if ((rawMouseY > 0.0 && verticalRemainder > 0.0) || (rawMouseY < 0.0 && verticalRemainder < 0.0)) + { + rawMouseY += verticalRemainder; + } + else + { + verticalRemainder = 0.0; + } + + mouseY = (int)rawMouseY; + verticalRemainder = rawMouseY - mouseY; } public static bool compare(byte b1, byte b2) { + bool result = true; if (Math.Abs(b1 - b2) > 10) { - return false; + result = false; } - return true; + + return result; + } + + private static byte getByteMapping2(int device, DS4Controls control, DS4State cState, DS4StateExposed eState, Mouse tp, + DS4StateFieldMapping fieldMap) + { + byte result = 0; + + int controlNum = (int)control; + DS4StateFieldMapping.ControlType controlType = DS4StateFieldMapping.mappedType[controlNum]; + if (controlType == DS4StateFieldMapping.ControlType.Button) + { + result = (byte)(fieldMap.buttons[controlNum] ? 255 : 0); + } + else if (controlType == DS4StateFieldMapping.ControlType.AxisDir) + { + byte axisValue = fieldMap.axisdirs[controlNum]; + + switch (control) + { + case DS4Controls.LXNeg: result = (byte)(axisValue - 127.5f > 0 ? 0 : -(axisValue - 127.5f) * 2); break; + case DS4Controls.LYNeg: result = (byte)(axisValue - 127.5f > 0 ? 0 : -(axisValue - 127.5f) * 2); break; + case DS4Controls.RXNeg: result = (byte)(axisValue - 127.5f > 0 ? 0 : -(axisValue - 127.5f) * 2); break; + case DS4Controls.RYNeg: result = (byte)(axisValue - 127.5f > 0 ? 0 : -(axisValue - 127.5f) * 2); break; + default: result = (byte)(axisValue - 127.5f < 0 ? 0 : (axisValue - 127.5f) * 2); break; + } + } + else if (controlType == DS4StateFieldMapping.ControlType.Trigger) + { + result = fieldMap.triggers[controlNum]; + } + else if (controlType == DS4StateFieldMapping.ControlType.Touch) + { + result = (byte)(tp != null && fieldMap.buttons[controlNum] ? 255 : 0); + } + else if (controlType == DS4StateFieldMapping.ControlType.SwipeDir) + { + result = (byte)(tp != null ? fieldMap.swipedirs[controlNum] : 0); + } + else if (controlType == DS4StateFieldMapping.ControlType.GyroDir) + { + double SXD = getSXDeadzone(device); + double SZD = getSZDeadzone(device); + bool sOff = isUsingSAforMouse(device); + double sxsens = getSXSens(device); + double szsens = getSZSens(device); + + switch (control) + { + case DS4Controls.GyroXPos: + { + int gyroX = fieldMap.gryodirs[controlNum]; + result = (byte)(!sOff && sxsens * gyroX > SXD * 10 ? Math.Min(255, sxsens * gyroX * 2) : 0); + break; + } + case DS4Controls.GyroXNeg: + { + int gyroX = fieldMap.gryodirs[controlNum]; + result = (byte)(!sOff && sxsens * gyroX < -SXD * 10 ? Math.Min(255, sxsens * -gyroX * 2) : 0); + break; + } + case DS4Controls.GyroZPos: + { + int gyroZ = fieldMap.gryodirs[controlNum]; + result = (byte)(!sOff && szsens * gyroZ > SZD * 10 ? Math.Min(255, szsens * gyroZ * 2) : 0); + break; + } + case DS4Controls.GyroZNeg: + { + int gyroZ = fieldMap.gryodirs[controlNum]; + result = (byte)(!sOff && szsens * gyroZ < -SZD * 10 ? Math.Min(255, szsens * -gyroZ * 2) : 0); + break; + } + default: break; + } + } + + return result; } public static byte getByteMapping(int device, DS4Controls control, DS4State cState, DS4StateExposed eState, Mouse tp) { - double SXD = SXDeadzone[device]; - double SZD = SZDeadzone[device]; - bool sOff = UseSAforMouse[device]; - switch (control) - { - case DS4Controls.Share: return (byte)(cState.Share ? 255 : 0); - case DS4Controls.Options: return (byte)(cState.Options ? 255 : 0); - case DS4Controls.L1: return (byte)(cState.L1 ? 255 : 0); - case DS4Controls.R1: return (byte)(cState.R1 ? 255 : 0); - case DS4Controls.L3: return (byte)(cState.L3 ? 255 : 0); - case DS4Controls.R3: return (byte)(cState.R3 ? 255 : 0); - case DS4Controls.DpadUp: return (byte)(cState.DpadUp ? 255 : 0); - case DS4Controls.DpadDown: return (byte)(cState.DpadDown ? 255 : 0); - case DS4Controls.DpadLeft: return (byte)(cState.DpadLeft ? 255 : 0); - case DS4Controls.DpadRight: return (byte)(cState.DpadRight ? 255 : 0); - case DS4Controls.PS: return (byte)(cState.PS ? 255 : 0); - case DS4Controls.Cross: return (byte)(cState.Cross ? 255 : 0); - case DS4Controls.Square: return (byte)(cState.Square ? 255 : 0); - case DS4Controls.Triangle: return (byte)(cState.Triangle ? 255 : 0); - case DS4Controls.Circle: return (byte)(cState.Circle ? 255 : 0); - case DS4Controls.TouchLeft: return (byte)(tp != null && tp.leftDown ? 255 : 0); - case DS4Controls.TouchRight: return (byte)(tp != null && tp.rightDown ? 255 : 0); - case DS4Controls.TouchMulti: return (byte)(tp != null && tp.multiDown ? 255 : 0); - case DS4Controls.TouchUpper: return (byte)(tp != null && tp.upperDown ? 255 : 0); - case DS4Controls.LXNeg: return (byte)(cState.LX - 127.5f > 0 ? 0 : -(cState.LX - 127.5f) * 2); - case DS4Controls.LYNeg: return (byte)(cState.LY - 127.5f > 0 ? 0 : -(cState.LY - 127.5f) * 2); - case DS4Controls.RXNeg: return (byte)(cState.RX - 127.5f > 0 ? 0 : -(cState.RX - 127.5f) * 2); - case DS4Controls.RYNeg: return (byte)(cState.RY - 127.5f > 0 ? 0 : -(cState.RY - 127.5f) * 2); - case DS4Controls.LXPos: return (byte)(cState.LX - 127.5f < 0 ? 0 : (cState.LX - 127.5f) * 2); - case DS4Controls.LYPos: return (byte)(cState.LY - 127.5f < 0 ? 0 : (cState.LY - 127.5f) * 2); - case DS4Controls.RXPos: return (byte)(cState.RX - 127.5f < 0 ? 0 : (cState.RX - 127.5f) * 2); - case DS4Controls.RYPos: return (byte)(cState.RY - 127.5f < 0 ? 0 : (cState.RY - 127.5f) * 2); - case DS4Controls.L2: return cState.L2; - case DS4Controls.R2: return cState.R2; - case DS4Controls.GyroXPos: return (byte)(!sOff && SXSens[device] * eState.GyroX > SXD * 10 ? Math.Min(255, SXSens[device] * eState.GyroX * 2) : 0); - case DS4Controls.GyroXNeg: return (byte)(!sOff && SXSens[device] * eState.GyroX < -SXD * 10 ? Math.Min(255, SXSens[device] * -eState.GyroX * 2) : 0); - case DS4Controls.GyroZPos: return (byte)(!sOff && SZSens[device] * eState.GyroZ > SZD * 10 ? Math.Min(255, SZSens[device] * eState.GyroZ * 2) : 0); - case DS4Controls.GyroZNeg: return (byte)(!sOff && SZSens[device] * eState.GyroZ < -SZD * 10 ? Math.Min(255, SZSens[device] * -eState.GyroZ * 2) : 0); - case DS4Controls.SwipeUp: return (byte)(tp != null ? tp.swipeUpB : 0); - case DS4Controls.SwipeDown: return (byte)(tp != null ? tp.swipeDownB: 0); - case DS4Controls.SwipeLeft: return (byte)(tp != null ? tp.swipeLeftB: 0); - case DS4Controls.SwipeRight: return (byte)(tp != null ? tp.swipeRightB : 0); - } - return 0; - } + byte result = 0; - public static bool getBoolMapping(int device, DS4Controls control, DS4State cState, DS4StateExposed eState, Mouse tp) - { - bool sOff = UseSAforMouse[device]; - switch (control) - { - case DS4Controls.Share: return cState.Share; - case DS4Controls.Options: return cState.Options; - case DS4Controls.L1: return cState.L1; - case DS4Controls.R1: return cState.R1; - case DS4Controls.L3: return cState.L3; - case DS4Controls.R3: return cState.R3; - case DS4Controls.DpadUp: return cState.DpadUp; - case DS4Controls.DpadDown: return cState.DpadDown; - case DS4Controls.DpadLeft: return cState.DpadLeft; - case DS4Controls.DpadRight: return cState.DpadRight; - case DS4Controls.PS: return cState.PS; - case DS4Controls.Cross: return cState.Cross; - case DS4Controls.Square: return cState.Square; - case DS4Controls.Triangle: return cState.Triangle; - case DS4Controls.Circle: return cState.Circle; - case DS4Controls.TouchLeft: return (tp != null ? tp.leftDown : false); - case DS4Controls.TouchRight: return (tp != null ? tp.rightDown : false); - case DS4Controls.TouchMulti: return (tp != null ? tp.multiDown : false); - case DS4Controls.TouchUpper: return (tp != null ? tp.upperDown : false); - case DS4Controls.LXNeg: return cState.LX < 127 - 55; - case DS4Controls.LYNeg: return cState.LY < 127 - 55; - case DS4Controls.RXNeg: return cState.RX < 127 - 55; - case DS4Controls.RYNeg: return cState.RY < 127 - 55; - case DS4Controls.LXPos: return cState.LX > 127 + 55; - case DS4Controls.LYPos: return cState.LY > 127 + 55; - case DS4Controls.RXPos: return cState.RX > 127 + 55; - case DS4Controls.RYPos: return cState.RY > 127 + 55; - case DS4Controls.L2: return cState.L2 > 100; - case DS4Controls.R2: return cState.R2 > 100; - case DS4Controls.GyroXPos: return !sOff ? SXSens[device] * eState.GyroX > 67 : false; - case DS4Controls.GyroXNeg: return !sOff ? SXSens[device] * eState.GyroX < -67 : false; - case DS4Controls.GyroZPos: return !sOff ? SZSens[device] * eState.GyroZ > 67 : false; - case DS4Controls.GyroZNeg: return !sOff ? SZSens[device] * eState.GyroZ < -67 : false; - case DS4Controls.SwipeUp: return (tp != null && tp.swipeUp); - case DS4Controls.SwipeDown: return (tp != null && tp.swipeDown); - case DS4Controls.SwipeLeft: return (tp != null && tp.swipeLeft); - case DS4Controls.SwipeRight: return (tp != null && tp.swipeRight); - } - return false; - } - - public static byte getXYAxisMapping(int device, DS4Controls control, DS4State cState, DS4StateExposed eState, Mouse tp, bool alt = false) - { - byte trueVal = 0; - byte falseVal = 127; - double SXD = SXDeadzone[device]; - double SZD = SZDeadzone[device]; - bool sOff = UseSAforMouse[device]; - if (alt) - trueVal = 255; - switch (control) - { - case DS4Controls.Share: return (byte)(cState.Share ? trueVal : falseVal); - case DS4Controls.Options: return (byte)(cState.Options ? trueVal : falseVal); - case DS4Controls.L1: return (byte)(cState.L1 ? trueVal : falseVal); - case DS4Controls.R1: return (byte)(cState.R1 ? trueVal : falseVal); - case DS4Controls.L3: return (byte)(cState.L3 ? trueVal : falseVal); - case DS4Controls.R3: return (byte)(cState.R3 ? trueVal : falseVal); - case DS4Controls.DpadUp: return (byte)(cState.DpadUp ? trueVal : falseVal); - case DS4Controls.DpadDown: return (byte)(cState.DpadDown ? trueVal : falseVal); - case DS4Controls.DpadLeft: return (byte)(cState.DpadLeft ? trueVal : falseVal); - case DS4Controls.DpadRight: return (byte)(cState.DpadRight ? trueVal : falseVal); - case DS4Controls.PS: return (byte)(cState.PS ? trueVal : falseVal); - case DS4Controls.Cross: return (byte)(cState.Cross ? trueVal : falseVal); - case DS4Controls.Square: return (byte)(cState.Square ? trueVal : falseVal); - case DS4Controls.Triangle: return (byte)(cState.Triangle ? trueVal : falseVal); - case DS4Controls.Circle: return (byte)(cState.Circle ? trueVal : falseVal); - case DS4Controls.TouchLeft: return (byte)(tp != null && tp.leftDown ? trueVal : falseVal); - case DS4Controls.TouchRight: return (byte)(tp != null && tp.rightDown ? trueVal : falseVal); - case DS4Controls.TouchMulti: return (byte)(tp != null && tp.multiDown ? trueVal : falseVal); - case DS4Controls.TouchUpper: return (byte)(tp != null && tp.upperDown ? trueVal : falseVal); - case DS4Controls.L2: if (alt) return (byte)(127.5f + cState.L2 / 2f); else return (byte)(127.5f - cState.L2 / 2f); - case DS4Controls.R2: if (alt) return (byte)(127.5f + cState.R2 / 2f); else return (byte)(127.5f - cState.R2 / 2f); - case DS4Controls.SwipeUp: if (alt) return (byte)(tp != null ? 127.5f + tp.swipeUpB / 2f : 0); else return (byte)(tp != null ? 127.5f - tp.swipeUpB / 2f : 0); - case DS4Controls.SwipeDown: if (alt) return (byte)(tp != null ? 127.5f + tp.swipeDownB / 2f : 0); else return (byte)(tp != null ? 127.5f - tp.swipeDownB / 2f : 0); - case DS4Controls.SwipeLeft: if (alt) return (byte)(tp != null ? 127.5f + tp.swipeLeftB / 2f : 0); else return (byte)(tp != null ? 127.5f - tp.swipeLeftB / 2f : 0); - case DS4Controls.SwipeRight: if (alt) return (byte)(tp != null ? 127.5f + tp.swipeRightB / 2f : 0); else return (byte)(tp != null ? 127.5f - tp.swipeRightB / 2f : 0); - case DS4Controls.GyroXPos: if (!sOff && eState.GyroX > SXD * 10) - if (alt) return (byte)Math.Min(255, 127 + SXSens[device] * eState.GyroX); else return (byte)Math.Max(0, 127 - SXSens[device] * eState.GyroX); - else return falseVal; - case DS4Controls.GyroXNeg: if (!sOff && eState.GyroX < -SXD * 10) - if (alt) return (byte)Math.Min(255, 127 + SXSens[device] * -eState.GyroX); else return (byte)Math.Max(0, 127 - SXSens[device] * -eState.GyroX); - else return falseVal; - case DS4Controls.GyroZPos: if (!sOff && eState.GyroZ > SZD * 10) - if (alt) return (byte)Math.Min(255, 127 + SZSens[device] * eState.GyroZ); else return (byte)Math.Max(0, 127 - SZSens[device] * eState.GyroZ); - else return falseVal; - case DS4Controls.GyroZNeg: if (!sOff && eState.GyroZ < -SZD * 10) - if (alt) return (byte)Math.Min(255, 127 + SZSens[device] * -eState.GyroZ); else return (byte)Math.Max(0, 127 - SZSens[device] * -eState.GyroZ); - else return falseVal; - } - if (!alt) + if (control >= DS4Controls.Square && control <= DS4Controls.Cross) { switch (control) { - case DS4Controls.LXNeg: return cState.LX; - case DS4Controls.LYNeg: return cState.LY; - case DS4Controls.RXNeg: return cState.RX; - case DS4Controls.RYNeg: return cState.RY; - case DS4Controls.LXPos: return (byte)(255 - cState.LX); - case DS4Controls.LYPos: return (byte)(255 - cState.LY); - case DS4Controls.RXPos: return (byte)(255 - cState.RX); - case DS4Controls.RYPos: return (byte)(255 - cState.RY); + case DS4Controls.Cross: result = (byte)(cState.Cross ? 255 : 0); break; + case DS4Controls.Square: result = (byte)(cState.Square ? 255 : 0); break; + case DS4Controls.Triangle: result = (byte)(cState.Triangle ? 255 : 0); break; + case DS4Controls.Circle: result = (byte)(cState.Circle ? 255 : 0); break; + default: break; + } + } + else if (control >= DS4Controls.L1 && control <= DS4Controls.R3) + { + switch (control) + { + case DS4Controls.L1: result = (byte)(cState.L1 ? 255 : 0); break; + case DS4Controls.L2: result = cState.L2; break; + case DS4Controls.L3: result = (byte)(cState.L3 ? 255 : 0); break; + case DS4Controls.R1: result = (byte)(cState.R1 ? 255 : 0); break; + case DS4Controls.R2: result = cState.R2; break; + case DS4Controls.R3: result = (byte)(cState.R3 ? 255 : 0); break; + default: break; + } + } + else if (control >= DS4Controls.DpadUp && control <= DS4Controls.DpadLeft) + { + switch (control) + { + case DS4Controls.DpadUp: result = (byte)(cState.DpadUp ? 255 : 0); break; + case DS4Controls.DpadDown: result = (byte)(cState.DpadDown ? 255 : 0); break; + case DS4Controls.DpadLeft: result = (byte)(cState.DpadLeft ? 255 : 0); break; + case DS4Controls.DpadRight: result = (byte)(cState.DpadRight ? 255 : 0); break; + default: break; + } + } + else if (control >= DS4Controls.LXNeg && control <= DS4Controls.RYPos) + { + switch (control) + { + case DS4Controls.LXNeg: result = (byte)(cState.LX - 127.5f > 0 ? 0 : -(cState.LX - 127.5f) * 2); break; + case DS4Controls.LYNeg: result = (byte)(cState.LY - 127.5f > 0 ? 0 : -(cState.LY - 127.5f) * 2); break; + case DS4Controls.RXNeg: result = (byte)(cState.RX - 127.5f > 0 ? 0 : -(cState.RX - 127.5f) * 2); break; + case DS4Controls.RYNeg: result = (byte)(cState.RY - 127.5f > 0 ? 0 : -(cState.RY - 127.5f) * 2); break; + case DS4Controls.LXPos: result = (byte)(cState.LX - 127.5f < 0 ? 0 : (cState.LX - 127.5f) * 2); break; + case DS4Controls.LYPos: result = (byte)(cState.LY - 127.5f < 0 ? 0 : (cState.LY - 127.5f) * 2); break; + case DS4Controls.RXPos: result = (byte)(cState.RX - 127.5f < 0 ? 0 : (cState.RX - 127.5f) * 2); break; + case DS4Controls.RYPos: result = (byte)(cState.RY - 127.5f < 0 ? 0 : (cState.RY - 127.5f) * 2); break; + default: break; + } + } + else if (control >= DS4Controls.TouchLeft && control <= DS4Controls.TouchRight) + { + switch (control) + { + case DS4Controls.TouchLeft: result = (byte)(tp != null && tp.leftDown ? 255 : 0); break; + case DS4Controls.TouchRight: result = (byte)(tp != null && tp.rightDown ? 255 : 0); break; + case DS4Controls.TouchMulti: result = (byte)(tp != null && tp.multiDown ? 255 : 0); break; + case DS4Controls.TouchUpper: result = (byte)(tp != null && tp.upperDown ? 255 : 0); break; + default: break; + } + } + else if (control >= DS4Controls.SwipeLeft && control <= DS4Controls.SwipeDown) + { + switch (control) + { + case DS4Controls.SwipeUp: result = (byte)(tp != null ? tp.swipeUpB : 0); break; + case DS4Controls.SwipeDown: result = (byte)(tp != null ? tp.swipeDownB : 0); break; + case DS4Controls.SwipeLeft: result = (byte)(tp != null ? tp.swipeLeftB : 0); break; + case DS4Controls.SwipeRight: result = (byte)(tp != null ? tp.swipeRightB : 0); break; + default: break; + } + } + else if (control >= DS4Controls.GyroXPos && control <= DS4Controls.GyroZNeg) + { + double SXD = getSXDeadzone(device); + double SZD = getSZDeadzone(device); + bool sOff = isUsingSAforMouse(device); + double sxsens = getSXSens(device); + double szsens = getSZSens(device); + + switch (control) + { + case DS4Controls.GyroXPos: + { + int gyroX = eState.GyroX; + result = (byte)(!sOff && sxsens * gyroX > SXD * 10 ? Math.Min(255, sxsens * gyroX * 2) : 0); + break; + } + case DS4Controls.GyroXNeg: + { + int gyroX = eState.GyroX; + result = (byte)(!sOff && sxsens * gyroX < -SXD * 10 ? Math.Min(255, sxsens * -gyroX * 2) : 0); + break; + } + case DS4Controls.GyroZPos: + { + int gyroZ = eState.GyroZ; + result = (byte)(!sOff && szsens * gyroZ > SZD * 10 ? Math.Min(255, szsens * gyroZ * 2) : 0); + break; + } + case DS4Controls.GyroZNeg: + { + int gyroZ = eState.GyroZ; + result = (byte)(!sOff && szsens * gyroZ < -SZD * 10 ? Math.Min(255, szsens * -gyroZ * 2) : 0); + break; + } + default: break; } } else { switch (control) { - case DS4Controls.LXNeg: return (byte)(255 - cState.LX); - case DS4Controls.LYNeg: return (byte)(255 - cState.LY); - case DS4Controls.RXNeg: return (byte)(255 - cState.RX); - case DS4Controls.RYNeg: return (byte)(255 - cState.RY); - case DS4Controls.LXPos: return cState.LX; - case DS4Controls.LYPos: return cState.LY; - case DS4Controls.RXPos: return cState.RX; - case DS4Controls.RYPos: return cState.RY; + case DS4Controls.Share: result = (byte)(cState.Share ? 255 : 0); break; + case DS4Controls.Options: result = (byte)(cState.Options ? 255 : 0); break; + case DS4Controls.PS: result = (byte)(cState.PS ? 255 : 0); break; + default: break; } } - return 0; + + return result; } + /* TODO: Possibly remove usage of this version of the method */ + public static bool getBoolMapping(int device, DS4Controls control, DS4State cState, DS4StateExposed eState, Mouse tp) + { + bool result = false; + + if (control >= DS4Controls.Square && control <= DS4Controls.Cross) + { + switch (control) + { + case DS4Controls.Cross: result = cState.Cross; break; + case DS4Controls.Square: result = cState.Square; break; + case DS4Controls.Triangle: result = cState.Triangle; break; + case DS4Controls.Circle: result = cState.Circle; break; + default: break; + } + } + else if (control >= DS4Controls.L1 && control <= DS4Controls.R3) + { + switch (control) + { + case DS4Controls.L1: result = cState.L1; break; + case DS4Controls.R1: result = cState.R1; break; + case DS4Controls.L2: result = cState.L2 > 100; break; + case DS4Controls.R2: result = cState.R2 > 100; break; + case DS4Controls.L3: result = cState.L3; break; + case DS4Controls.R3: result = cState.R3; break; + default: break; + } + } + else if (control >= DS4Controls.DpadUp && control <= DS4Controls.DpadLeft) + { + switch (control) + { + case DS4Controls.DpadUp: result = cState.DpadUp; break; + case DS4Controls.DpadDown: result = cState.DpadDown; break; + case DS4Controls.DpadLeft: result = cState.DpadLeft; break; + case DS4Controls.DpadRight: result = cState.DpadRight; break; + default: break; + } + } + else if (control >= DS4Controls.LXNeg && control <= DS4Controls.RYPos) + { + switch (control) + { + case DS4Controls.LXNeg: result = cState.LX < 127 - 55; break; + case DS4Controls.LYNeg: result = cState.LY < 127 - 55; break; + case DS4Controls.RXNeg: result = cState.RX < 127 - 55; break; + case DS4Controls.RYNeg: result = cState.RY < 127 - 55; break; + case DS4Controls.LXPos: result = cState.LX > 127 + 55; break; + case DS4Controls.LYPos: result = cState.LY > 127 + 55; break; + case DS4Controls.RXPos: result = cState.RX > 127 + 55; break; + case DS4Controls.RYPos: result = cState.RY > 127 + 55; break; + default: break; + } + } + else if (control >= DS4Controls.TouchLeft && control <= DS4Controls.TouchRight) + { + switch (control) + { + case DS4Controls.TouchLeft: result = (tp != null ? tp.leftDown : false); break; + case DS4Controls.TouchRight: result = (tp != null ? tp.rightDown : false); break; + case DS4Controls.TouchMulti: result = (tp != null ? tp.multiDown : false); break; + case DS4Controls.TouchUpper: result = (tp != null ? tp.upperDown : false); break; + default: break; + } + } + else if (control >= DS4Controls.SwipeLeft && control <= DS4Controls.SwipeDown) + { + switch (control) + { + case DS4Controls.SwipeUp: result = (tp != null && tp.swipeUp); break; + case DS4Controls.SwipeDown: result = (tp != null && tp.swipeDown); break; + case DS4Controls.SwipeLeft: result = (tp != null && tp.swipeLeft); break; + case DS4Controls.SwipeRight: result = (tp != null && tp.swipeRight); break; + default: break; + } + } + else if (control >= DS4Controls.GyroXPos && control <= DS4Controls.GyroZNeg) + { + bool sOff = isUsingSAforMouse(device); + + switch (control) + { + case DS4Controls.GyroXPos: result = !sOff ? SXSens[device] * eState.GyroX > 67 : false; break; + case DS4Controls.GyroXNeg: result = !sOff ? SXSens[device] * eState.GyroX < -67 : false; break; + case DS4Controls.GyroZPos: result = !sOff ? SZSens[device] * eState.GyroZ > 67 : false; break; + case DS4Controls.GyroZNeg: result = !sOff ? SZSens[device] * eState.GyroZ < -67 : false; break; + default: break; + } + } + else + { + switch (control) + { + case DS4Controls.PS: result = cState.PS; break; + case DS4Controls.Share: result = cState.Share; break; + case DS4Controls.Options: result = cState.Options; break; + default: break; + } + } + + return result; + } + + private static bool getBoolMapping2(int device, DS4Controls control, + DS4State cState, DS4StateExposed eState, Mouse tp, DS4StateFieldMapping fieldMap) + { + bool result = false; + + int controlNum = (int)control; + DS4StateFieldMapping.ControlType controlType = DS4StateFieldMapping.mappedType[controlNum]; + if (controlType == DS4StateFieldMapping.ControlType.Button) + { + result = fieldMap.buttons[controlNum]; + } + else if (controlType == DS4StateFieldMapping.ControlType.AxisDir) + { + byte axisValue = fieldMap.axisdirs[controlNum]; + + switch (control) + { + case DS4Controls.LXNeg: result = cState.LX < 127 - 55; break; + case DS4Controls.LYNeg: result = cState.LY < 127 - 55; break; + case DS4Controls.RXNeg: result = cState.RX < 127 - 55; break; + case DS4Controls.RYNeg: result = cState.RY < 127 - 55; break; + default: result = axisValue > 127 + 55; break; + } + } + else if (controlType == DS4StateFieldMapping.ControlType.Trigger) + { + result = fieldMap.triggers[controlNum] > 100; + } + else if (controlType == DS4StateFieldMapping.ControlType.Touch) + { + result = fieldMap.buttons[controlNum]; + } + else if (controlType == DS4StateFieldMapping.ControlType.SwipeDir) + { + result = fieldMap.swipedirbools[controlNum]; + } + else if (controlType == DS4StateFieldMapping.ControlType.GyroDir) + { + bool sOff = isUsingSAforMouse(device); + bool safeTest = false; + + switch (control) + { + case DS4Controls.GyroXPos: safeTest = SXSens[device] * fieldMap.gryodirs[controlNum] > 67; break; + case DS4Controls.GyroXNeg: safeTest = SXSens[device] * fieldMap.gryodirs[controlNum] < -67; break; + case DS4Controls.GyroZPos: safeTest = SZSens[device] * fieldMap.gryodirs[controlNum] > 67; break; + case DS4Controls.GyroZNeg: safeTest = SZSens[device] * fieldMap.gryodirs[controlNum] < -67; break; + default: break; + } + + result = !sOff ? safeTest : false; + } + + return result; + } + + private static bool getBoolActionMapping2(int device, DS4Controls control, + DS4State cState, DS4StateExposed eState, Mouse tp, DS4StateFieldMapping fieldMap, bool analog = false) + { + bool result = false; + + int controlNum = (int)control; + DS4StateFieldMapping.ControlType controlType = DS4StateFieldMapping.mappedType[controlNum]; + if (controlType == DS4StateFieldMapping.ControlType.Button) + { + result = fieldMap.buttons[controlNum]; + } + else if (controlType == DS4StateFieldMapping.ControlType.AxisDir) + { + switch (control) + { + case DS4Controls.LXNeg: + { + if (!analog) + { + double angle = cState.LSAngle; + result = cState.LX < 127 && (angle >= 210 && angle <= 330); + } + else + { + result = cState.LX < 127; + } + + break; + } + case DS4Controls.LYNeg: + { + if (!analog) + { + double angle = cState.LSAngle; + result = cState.LY < 127 && (angle >= 300 || angle <= 60); + } + else + { + result = cState.LY < 127; + } + + break; + } + case DS4Controls.RXNeg: + { + if (!analog) + { + double angle = cState.RSAngle; + result = cState.RX < 127 && (angle >= 210 && angle <= 330); + } + else + { + result = cState.RX < 127; + } + + break; + } + case DS4Controls.RYNeg: + { + if (!analog) + { + double angle = cState.RSAngle; + result = cState.RY < 127 && (angle >= 300 || angle <= 60); + } + else + { + result = cState.RY < 127; + } + + break; + } + case DS4Controls.LXPos: + { + if (!analog) + { + double angle = cState.LSAngle; + result = cState.LX > 127 && (angle >= 30 && angle <= 150); + } + else + { + result = cState.LX > 127; + } + + break; + } + case DS4Controls.LYPos: + { + if (!analog) + { + double angle = cState.LSAngle; + result = cState.LY > 127 && (angle >= 120 && angle <= 240); + } + else + { + result = cState.LY > 127; + } + + break; + } + case DS4Controls.RXPos: + { + if (!analog) + { + double angle = cState.RSAngle; + result = cState.RX > 127 && (angle >= 30 && angle <= 150); + } + else + { + result = cState.RX > 127; + } + + break; + } + case DS4Controls.RYPos: + { + if (!analog) + { + double angle = cState.RSAngle; + result = cState.RY > 127 && (angle >= 120 && angle <= 240); + } + else + { + result = cState.RY > 127; + } + + break; + } + default: break; + } + } + else if (controlType == DS4StateFieldMapping.ControlType.Trigger) + { + result = fieldMap.triggers[controlNum] > 0; + } + else if (controlType == DS4StateFieldMapping.ControlType.Touch) + { + result = fieldMap.buttons[controlNum]; + } + else if (controlType == DS4StateFieldMapping.ControlType.SwipeDir) + { + result = fieldMap.swipedirbools[controlNum]; + } + else if (controlType == DS4StateFieldMapping.ControlType.GyroDir) + { + bool sOff = isUsingSAforMouse(device); + bool safeTest = false; + + switch (control) + { + case DS4Controls.GyroXPos: safeTest = SXSens[device] * fieldMap.gryodirs[controlNum] > 67; break; + case DS4Controls.GyroXNeg: safeTest = SXSens[device] * fieldMap.gryodirs[controlNum] < -67; break; + case DS4Controls.GyroZPos: safeTest = SZSens[device] * fieldMap.gryodirs[controlNum] > 67; break; + case DS4Controls.GyroZNeg: safeTest = SZSens[device] * fieldMap.gryodirs[controlNum] < -67; break; + default: break; + } + + result = !sOff ? safeTest : false; + } + + return result; + } + + /* TODO: Possibly remove usage of this version of the method */ + public static bool getBoolActionMapping(int device, DS4Controls control, + DS4State cState, DS4StateExposed eState, Mouse tp, bool analog=false) + { + bool result = false; + + if (control >= DS4Controls.Square && control <= DS4Controls.Cross) + { + switch (control) + { + case DS4Controls.Cross: result = cState.Cross; break; + case DS4Controls.Square: result = cState.Square; break; + case DS4Controls.Triangle: result = cState.Triangle; break; + case DS4Controls.Circle: result = cState.Circle; break; + default: break; + } + } + else if (control >= DS4Controls.L1 && control <= DS4Controls.R3) + { + switch (control) + { + case DS4Controls.L1: result = cState.L1; break; + case DS4Controls.R1: result = cState.R1; break; + case DS4Controls.L2: result = cState.L2 > 0; break; + case DS4Controls.R2: result = cState.R2 > 0; break; + case DS4Controls.L3: result = cState.L3; break; + case DS4Controls.R3: result = cState.R3; break; + default: break; + } + } + else if (control >= DS4Controls.DpadUp && control <= DS4Controls.DpadLeft) + { + switch (control) + { + case DS4Controls.DpadUp: result = cState.DpadUp; break; + case DS4Controls.DpadDown: result = cState.DpadDown; break; + case DS4Controls.DpadLeft: result = cState.DpadLeft; break; + case DS4Controls.DpadRight: result = cState.DpadRight; break; + default: break; + } + } + else if (control >= DS4Controls.LXNeg && control <= DS4Controls.RYPos) + { + switch (control) + { + case DS4Controls.LXNeg: + { + if (!analog) + { + double angle = cState.LSAngle; + result = cState.LX < 127 && (angle >= 210 && angle <= 330); + } + else + { + result = cState.LX < 127; + } + + break; + } + case DS4Controls.LYNeg: + { + if (!analog) + { + double angle = cState.LSAngle; + result = cState.LY < 127 && (angle >= 300 || angle <= 60); + } + else + { + result = cState.LY < 127; + } + + break; + } + case DS4Controls.RXNeg: + { + if (!analog) + { + double angle = cState.RSAngle; + result = cState.RX < 127 && (angle >= 210 && angle <= 330); + } + else + { + result = cState.RX < 127; + } + + break; + } + case DS4Controls.RYNeg: + { + if (!analog) + { + double angle = cState.RSAngle; + result = cState.RY < 127 && (angle >= 300 || angle <= 60); + } + else + { + result = cState.RY < 127; + } + + break; + } + case DS4Controls.LXPos: + { + if (!analog) + { + double angle = cState.LSAngle; + result = cState.LX > 127 && (angle >= 30 && angle <= 150); + } + else + { + result = cState.LX > 127; + } + + break; + } + case DS4Controls.LYPos: + { + if (!analog) + { + double angle = cState.LSAngle; + result = cState.LY > 127 && (angle >= 120 && angle <= 240); + } + else + { + result = cState.LY > 127; + } + + break; + } + case DS4Controls.RXPos: + { + if (!analog) + { + double angle = cState.RSAngle; + result = cState.RX > 127 && (angle >= 30 && angle <= 150); + } + else + { + result = cState.RX > 127; + } + + break; + } + case DS4Controls.RYPos: + { + if (!analog) + { + double angle = cState.RSAngle; + result = cState.RY > 127 && (angle >= 120 && angle <= 240); + } + else + { + result = cState.RY > 127; + } + + break; + } + default: break; + } + } + else if (control >= DS4Controls.TouchLeft && control <= DS4Controls.TouchRight) + { + switch (control) + { + case DS4Controls.TouchLeft: result = (tp != null ? tp.leftDown : false); break; + case DS4Controls.TouchRight: result = (tp != null ? tp.rightDown : false); break; + case DS4Controls.TouchMulti: result = (tp != null ? tp.multiDown : false); break; + case DS4Controls.TouchUpper: result = (tp != null ? tp.upperDown : false); break; + default: break; + } + } + else if (control >= DS4Controls.SwipeLeft && control <= DS4Controls.SwipeDown) + { + switch (control) + { + case DS4Controls.SwipeUp: result = (tp != null && tp.swipeUp); break; + case DS4Controls.SwipeDown: result = (tp != null && tp.swipeDown); break; + case DS4Controls.SwipeLeft: result = (tp != null && tp.swipeLeft); break; + case DS4Controls.SwipeRight: result = (tp != null && tp.swipeRight); break; + default: break; + } + } + else if (control >= DS4Controls.GyroXPos && control <= DS4Controls.GyroZNeg) + { + bool sOff = isUsingSAforMouse(device); + + switch (control) + { + case DS4Controls.GyroXPos: result = !sOff ? SXSens[device] * eState.GyroX > 67 : false; break; + case DS4Controls.GyroXNeg: result = !sOff ? SXSens[device] * eState.GyroX < -67 : false; break; + case DS4Controls.GyroZPos: result = !sOff ? SZSens[device] * eState.GyroZ > 67 : false; break; + case DS4Controls.GyroZNeg: result = !sOff ? SZSens[device] * eState.GyroZ < -67 : false; break; + default: break; + } + } + else + { + switch (control) + { + case DS4Controls.PS: result = cState.PS; break; + case DS4Controls.Share: result = cState.Share; break; + case DS4Controls.Options: result = cState.Options; break; + default: break; + } + } + + return result; + } + + public static bool getBoolButtonMapping(bool stateButton) + { + return stateButton; + } + + public static bool getBoolAxisDirMapping(byte stateAxis, bool positive) + { + return positive ? stateAxis > 127 + 55 : stateAxis < 127 - 55; + } + + public static bool getBoolTriggerMapping(byte stateAxis) + { + return stateAxis > 100; + } + + public static bool getBoolTouchMapping(bool touchButton) + { + return touchButton; + } + + private static byte getXYAxisMapping2(int device, DS4Controls control, DS4State cState, + DS4StateExposed eState, Mouse tp, DS4StateFieldMapping fieldMap, bool alt = false) + { + byte result = 0; + byte trueVal = 0; + byte falseVal = 127; + + if (alt) + trueVal = 255; + + int controlNum = (int)control; + DS4StateFieldMapping.ControlType controlType = DS4StateFieldMapping.mappedType[controlNum]; + + if (controlType == DS4StateFieldMapping.ControlType.Button) + { + result = (byte)(fieldMap.buttons[controlNum] ? trueVal : falseVal); + } + else if (controlType == DS4StateFieldMapping.ControlType.AxisDir) + { + byte axisValue = fieldMap.axisdirs[controlNum]; + + switch (control) + { + case DS4Controls.LXNeg: if (!alt) result = cState.LX; else result = (byte)(255 - cState.LX); break; + case DS4Controls.LYNeg: if (!alt) result = cState.LY; else result = (byte)(255 - cState.LY); break; + case DS4Controls.RXNeg: if (!alt) result = cState.RX; else result = (byte)(255 - cState.RX); break; + case DS4Controls.RYNeg: if (!alt) result = cState.RY; else result = (byte)(255 - cState.RY); break; + default: if (!alt) result = (byte)(255 - axisValue); else result = axisValue; break; + } + } + else if (controlType == DS4StateFieldMapping.ControlType.Trigger) + { + if (alt) + { + result = (byte)(127.5f + fieldMap.triggers[controlNum] / 2f); + } + else + { + result = (byte)(127.5f - fieldMap.triggers[controlNum] / 2f); + } + } + else if (controlType == DS4StateFieldMapping.ControlType.Touch) + { + result = (byte)(fieldMap.buttons[controlNum] ? trueVal : falseVal); + } + else if (controlType == DS4StateFieldMapping.ControlType.SwipeDir) + { + if (alt) + { + result = (byte)(tp != null ? 127.5f + fieldMap.swipedirs[controlNum] / 2f : 0); + } + else + { + result = (byte)(tp != null ? 127.5f - fieldMap.swipedirs[controlNum] / 2f : 0); + } + } + else if (controlType == DS4StateFieldMapping.ControlType.GyroDir) + { + double SXD = getSXDeadzone(device); + double SZD = getSZDeadzone(device); + bool sOff = isUsingSAforMouse(device); + + switch (control) + { + case DS4Controls.GyroXPos: + { + if (!sOff && fieldMap.gryodirs[controlNum] > SXD * 10) + { + if (alt) result = (byte)Math.Min(255, 127 + SXSens[device] * fieldMap.gryodirs[controlNum]); else result = (byte)Math.Max(0, 127 - SXSens[device] * fieldMap.gryodirs[controlNum]); + } + else result = falseVal; + break; + } + case DS4Controls.GyroXNeg: + { + if (!sOff && fieldMap.gryodirs[controlNum] < -SXD * 10) + { + if (alt) result = (byte)Math.Min(255, 127 + SXSens[device] * -fieldMap.gryodirs[controlNum]); else result = (byte)Math.Max(0, 127 - SXSens[device] * -fieldMap.gryodirs[controlNum]); + } + else result = falseVal; + break; + } + case DS4Controls.GyroZPos: + { + if (!sOff && fieldMap.gryodirs[controlNum] > SZD * 10) + { + if (alt) result = (byte)Math.Min(255, 127 + SZSens[device] * fieldMap.gryodirs[controlNum]); else result = (byte)Math.Max(0, 127 - SZSens[device] * fieldMap.gryodirs[controlNum]); + } + else return falseVal; + break; + } + case DS4Controls.GyroZNeg: + { + if (!sOff && fieldMap.gryodirs[controlNum] < -SZD * 10) + { + if (alt) result = (byte)Math.Min(255, 127 + SZSens[device] * -fieldMap.gryodirs[controlNum]); else result = (byte)Math.Max(0, 127 - SZSens[device] * -fieldMap.gryodirs[controlNum]); + } + else result = falseVal; + break; + } + default: break; + } + } + + return result; + } + + public static byte getXYAxisMapping(int device, DS4Controls control, DS4State cState, DS4StateExposed eState, Mouse tp, bool alt = false) + { + byte result = 0; + byte trueVal = 0; + byte falseVal = 127; + + if (alt) + trueVal = 255; + + if (control >= DS4Controls.Square && control <= DS4Controls.Cross) + { + switch (control) + { + case DS4Controls.Cross: result = (byte)(cState.Cross ? trueVal : falseVal); break; + case DS4Controls.Square: result = (byte)(cState.Square ? trueVal : falseVal); break; + case DS4Controls.Triangle: result = (byte)(cState.Triangle ? trueVal : falseVal); break; + case DS4Controls.Circle: result = (byte)(cState.Circle ? trueVal : falseVal); break; + default: break; + } + } + else if (control >= DS4Controls.L1 && control <= DS4Controls.R3) + { + switch (control) + { + case DS4Controls.L1: result = (byte)(cState.L1 ? trueVal : falseVal); break; + case DS4Controls.L2: if (alt) result = (byte)(127.5f + cState.L2 / 2f); else result = (byte)(127.5f - cState.L2 / 2f); break; + case DS4Controls.L3: result = (byte)(cState.L3 ? trueVal : falseVal); break; + case DS4Controls.R1: result = (byte)(cState.R1 ? trueVal : falseVal); break; + case DS4Controls.R2: if (alt) result = (byte)(127.5f + cState.R2 / 2f); else result = (byte)(127.5f - cState.R2 / 2f); break; + case DS4Controls.R3: result = (byte)(cState.R3 ? trueVal : falseVal); break; + default: break; + } + } + else if (control >= DS4Controls.DpadUp && control <= DS4Controls.DpadLeft) + { + switch (control) + { + case DS4Controls.DpadUp: result = (byte)(cState.DpadUp ? trueVal : falseVal); break; + case DS4Controls.DpadDown: result = (byte)(cState.DpadDown ? trueVal : falseVal); break; + case DS4Controls.DpadLeft: result = (byte)(cState.DpadLeft ? trueVal : falseVal); break; + case DS4Controls.DpadRight: result = (byte)(cState.DpadRight ? trueVal : falseVal); break; + default: break; + } + } + else if (control >= DS4Controls.LXNeg && control <= DS4Controls.RYPos) + { + switch (control) + { + case DS4Controls.LXNeg: if (!alt) result = cState.LX; else result = (byte)(255 - cState.LX); break; + case DS4Controls.LYNeg: if (!alt) result = cState.LY; else result = (byte)(255 - cState.LY); break; + case DS4Controls.RXNeg: if (!alt) result = cState.RX; else result = (byte)(255 - cState.RX); break; + case DS4Controls.RYNeg: if (!alt) result = cState.RY; else result = (byte)(255 - cState.RY); break; + case DS4Controls.LXPos: if (!alt) result = (byte)(255 - cState.LX); else result = cState.LX; break; + case DS4Controls.LYPos: if (!alt) result = (byte)(255 - cState.LY); else result = cState.LY; break; + case DS4Controls.RXPos: if (!alt) result = (byte)(255 - cState.RX); else result = cState.RX; break; + case DS4Controls.RYPos: if (!alt) result = (byte)(255 - cState.RY); else result = cState.RY; break; + default: break; + } + } + else if (control >= DS4Controls.TouchLeft && control <= DS4Controls.TouchRight) + { + switch (control) + { + case DS4Controls.TouchLeft: result = (byte)(tp != null && tp.leftDown ? trueVal : falseVal); break; + case DS4Controls.TouchRight: result = (byte)(tp != null && tp.rightDown ? trueVal : falseVal); break; + case DS4Controls.TouchMulti: result = (byte)(tp != null && tp.multiDown ? trueVal : falseVal); break; + case DS4Controls.TouchUpper: result = (byte)(tp != null && tp.upperDown ? trueVal : falseVal); break; + default: break; + } + } + else if (control >= DS4Controls.SwipeLeft && control <= DS4Controls.SwipeDown) + { + switch (control) + { + case DS4Controls.SwipeUp: if (alt) result = (byte)(tp != null ? 127.5f + tp.swipeUpB / 2f : 0); else result = (byte)(tp != null ? 127.5f - tp.swipeUpB / 2f : 0); break; + case DS4Controls.SwipeDown: if (alt) result = (byte)(tp != null ? 127.5f + tp.swipeDownB / 2f : 0); else result = (byte)(tp != null ? 127.5f - tp.swipeDownB / 2f : 0); break; + case DS4Controls.SwipeLeft: if (alt) result = (byte)(tp != null ? 127.5f + tp.swipeLeftB / 2f : 0); else result = (byte)(tp != null ? 127.5f - tp.swipeLeftB / 2f : 0); break; + case DS4Controls.SwipeRight: if (alt) result = (byte)(tp != null ? 127.5f + tp.swipeRightB / 2f : 0); else result = (byte)(tp != null ? 127.5f - tp.swipeRightB / 2f : 0); break; + default: break; + } + } + else if (control >= DS4Controls.GyroXPos && control <= DS4Controls.GyroZNeg) + { + double SXD = getSXDeadzone(device); + double SZD = getSZDeadzone(device); + bool sOff = isUsingSAforMouse(device); + + switch (control) + { + case DS4Controls.GyroXPos: + { + if (!sOff && eState.GyroX > SXD * 10) + { + if (alt) result = (byte)Math.Min(255, 127 + SXSens[device] * eState.GyroX); else result = (byte)Math.Max(0, 127 - SXSens[device] * eState.GyroX); + } + else result = falseVal; + break; + } + case DS4Controls.GyroXNeg: + { + if (!sOff && eState.GyroX < -SXD * 10) + { + if (alt) result = (byte)Math.Min(255, 127 + SXSens[device] * -eState.GyroX); else result = (byte)Math.Max(0, 127 - SXSens[device] * -eState.GyroX); + } + else result = falseVal; + break; + } + case DS4Controls.GyroZPos: + { + if (!sOff && eState.GyroZ > SZD * 10) + { + if (alt) result = (byte)Math.Min(255, 127 + SZSens[device] * eState.GyroZ); else result = (byte)Math.Max(0, 127 - SZSens[device] * eState.GyroZ); + } + else return falseVal; + break; + } + case DS4Controls.GyroZNeg: + { + if (!sOff && eState.GyroZ < -SZD * 10) + { + if (alt) result = (byte)Math.Min(255, 127 + SZSens[device] * -eState.GyroZ); else result = (byte)Math.Max(0, 127 - SZSens[device] * -eState.GyroZ); + } + else result = falseVal; + break; + } + default: break; + } + } + else + { + switch (control) + { + case DS4Controls.Share: result = (byte)(cState.Share ? trueVal : falseVal); break; + case DS4Controls.Options: result = (byte)(cState.Options ? trueVal : falseVal); break; + case DS4Controls.PS: result = (byte)(cState.PS ? trueVal : falseVal); break; + default: break; + } + } + + return result; + } + + /* TODO: Possibly remove usage of this version of the method */ //Returns false for any bool, //if control is one of the xy axis returns 127 //if its a trigger returns 0 public static void resetToDefaultValue(DS4Controls control, DS4State cState) { - switch (control) + if (control >= DS4Controls.Square && control <= DS4Controls.Cross) { - case DS4Controls.Share: cState.Share = false; break; - case DS4Controls.Options: cState.Options = false; break; - case DS4Controls.L1: cState.L1 = false; break; - case DS4Controls.R1: cState.R1 = false; break; - case DS4Controls.L3: cState.L3 = false; break; - case DS4Controls.R3: cState.R3 = false; break; - case DS4Controls.DpadUp: cState.DpadUp = false; break; - case DS4Controls.DpadDown: cState.DpadDown = false; break; - case DS4Controls.DpadLeft: cState.DpadLeft = false; break; - case DS4Controls.DpadRight: cState.DpadRight = false; break; - case DS4Controls.PS: cState.PS = false; break; - case DS4Controls.Cross: cState.Cross = false; break; - case DS4Controls.Square: cState.Square = false; break; - case DS4Controls.Triangle: cState.Triangle = false; break; - case DS4Controls.Circle: cState.Circle = false; break; - case DS4Controls.LXNeg: cState.LX = 127; break; - case DS4Controls.LYNeg: cState.LY = 127; break; - case DS4Controls.RXNeg: cState.RX = 127; break; - case DS4Controls.RYNeg: cState.RY = 127; break; - case DS4Controls.LXPos: cState.LX = 127; break; - case DS4Controls.LYPos: cState.LY = 127; break; - case DS4Controls.RXPos: cState.RX = 127; break; - case DS4Controls.RYPos: cState.RY = 127; break; - case DS4Controls.L2: cState.L2 = 0; break; - case DS4Controls.R2: cState.R2 = 0; break; + switch (control) + { + case DS4Controls.Cross: cState.Cross = false; break; + case DS4Controls.Square: cState.Square = false; break; + case DS4Controls.Triangle: cState.Triangle = false; break; + case DS4Controls.Circle: cState.Circle = false; break; + default: break; + } + } + else if (control >= DS4Controls.L1 && control <= DS4Controls.R3) + { + switch (control) + { + case DS4Controls.L1: cState.L1 = false; break; + case DS4Controls.L2: cState.L2 = 0; break; + case DS4Controls.L3: cState.L3 = false; break; + case DS4Controls.R1: cState.R1 = false; break; + case DS4Controls.R2: cState.R2 = 0; break; + case DS4Controls.R3: cState.R3 = false; break; + default: break; + } + } + else if (control >= DS4Controls.DpadUp && control <= DS4Controls.DpadLeft) + { + switch (control) + { + case DS4Controls.DpadUp: cState.DpadUp = false; break; + case DS4Controls.DpadDown: cState.DpadDown = false; break; + case DS4Controls.DpadLeft: cState.DpadLeft = false; break; + case DS4Controls.DpadRight: cState.DpadRight = false; break; + default: break; + } + } + else if (control >= DS4Controls.LXNeg && control <= DS4Controls.RYPos) + { + switch (control) + { + case DS4Controls.LXNeg: cState.LX = 127; break; + case DS4Controls.LYNeg: cState.LY = 127; break; + case DS4Controls.RXNeg: cState.RX = 127; break; + case DS4Controls.RYNeg: cState.RY = 127; break; + case DS4Controls.LXPos: cState.LX = 127; break; + case DS4Controls.LYPos: cState.LY = 127; break; + case DS4Controls.RXPos: cState.RX = 127; break; + case DS4Controls.RYPos: cState.RY = 127; break; + default: break; + } + } + else + { + switch (control) + { + case DS4Controls.Share: cState.Share = false; break; + case DS4Controls.Options: cState.Options = false; break; + case DS4Controls.PS: cState.PS = false; break; + default: break; + } + } + } + + private static void resetToDefaultValue2(DS4Controls control, DS4State cState, + DS4StateFieldMapping fieldMap) + { + int controlNum = (int)control; + DS4StateFieldMapping.ControlType controlType = DS4StateFieldMapping.mappedType[controlNum]; + if (controlType == DS4StateFieldMapping.ControlType.Button) + { + fieldMap.buttons[controlNum] = false; + } + else if (controlType == DS4StateFieldMapping.ControlType.AxisDir) + { + fieldMap.axisdirs[controlNum] = 127; + } + else if (controlType == DS4StateFieldMapping.ControlType.Trigger) + { + fieldMap.triggers[controlNum] = 0; + } + else if (controlType == DS4StateFieldMapping.ControlType.Touch) + { + fieldMap.buttons[controlNum] = false; } } } diff --git a/DS4Windows/DS4Control/Mouse.cs b/DS4Windows/DS4Control/Mouse.cs index bd90856..4221210 100644 --- a/DS4Windows/DS4Control/Mouse.cs +++ b/DS4Windows/DS4Control/Mouse.cs @@ -73,7 +73,9 @@ namespace DS4Windows case 16: return s.Options; case 17: return s.Share; case 18: return s.PS; + default: break; } + return false; } @@ -98,11 +100,13 @@ namespace DS4Windows swipeLeftB = (byte)Math.Min(255, Math.Max(0, firstTouch.hwX - arg.touches[0].hwX)); swipeRightB = (byte)Math.Min(255, Math.Max(0, arg.touches[0].hwX - firstTouch.hwX)); } + if (Math.Abs(firstTouch.hwY - arg.touches[0].hwY) < 50 && arg.touches.Length == 2) if (arg.touches[0].hwX - firstTouch.hwX > 200 && !slideleft) slideright = true; else if (firstTouch.hwX - arg.touches[0].hwX > 200 && !slideright) slideleft = true; + dev.getCurrentState(s); synthesizeMouseButtons(); } @@ -113,14 +117,17 @@ namespace DS4Windows cursor.touchesBegan(arg); wheel.touchesBegan(arg); } + pastTime = arg.timeStamp; firstTouch = arg.touches[0]; + if (Global.DoubleTap[deviceNum]) { DateTime test = arg.timeStamp; if (test <= (firstTap + TimeSpan.FromMilliseconds((double)Global.TapSensitivity[deviceNum] * 1.5)) && !arg.touchButtonPressed) secondtouchbegin = true; } + dev.getCurrentState(s); synthesizeMouseButtons(); } @@ -129,16 +136,17 @@ namespace DS4Windows slideright = slideleft = false; swipeUp = swipeDown = swipeLeft = swipeRight = false; swipeUpB = swipeDownB = swipeLeftB = swipeRightB = 0; - if (Global.TapSensitivity[deviceNum] != 0 && !Global.UseTPforControls[deviceNum]) + byte tapSensitivity = Global.TapSensitivity[deviceNum]; + if (tapSensitivity != 0 && !Global.UseTPforControls[deviceNum]) { - if (secondtouchbegin) { tappedOnce = false; secondtouchbegin = false; } + DateTime test = arg.timeStamp; - if (test <= (pastTime + TimeSpan.FromMilliseconds((double)Global.TapSensitivity[deviceNum] * 2)) && !arg.touchButtonPressed && !tappedOnce) + if (test <= (pastTime + TimeSpan.FromMilliseconds((double)tapSensitivity * 2)) && !arg.touchButtonPressed && !tappedOnce) if (Math.Abs(firstTouch.hwX - arg.touches[0].hwX) < 10 && Math.Abs(firstTouch.hwY - arg.touches[0].hwY) < 10) if (Global.DoubleTap[deviceNum]) { @@ -149,6 +157,7 @@ namespace DS4Windows else Mapping.MapClick(deviceNum, Mapping.Click.Left); //this way no delay if disabled } + dev.getCurrentState(s); synthesizeMouseButtons(); } @@ -174,19 +183,23 @@ namespace DS4Windows public bool dragging, dragging2; private void synthesizeMouseButtons() { - if (Global.GetDS4Action(deviceNum, DS4Controls.TouchLeft.ToString(), false) == null && leftDown) + if (Global.GetDS4Action(deviceNum, DS4Controls.TouchLeft, false) == null && leftDown) { Mapping.MapClick(deviceNum, Mapping.Click.Left); dragging2 = true; } else + { dragging2 = false; - if (Global.GetDS4Action(deviceNum, DS4Controls.TouchUpper.ToString(), false) == null && upperDown) + } + + if (Global.GetDS4Action(deviceNum, DS4Controls.TouchUpper, false) == null && upperDown) Mapping.MapClick(deviceNum, Mapping.Click.Middle); - if (Global.GetDS4Action(deviceNum, DS4Controls.TouchRight.ToString(), false) == null && rightDown) + if (Global.GetDS4Action(deviceNum, DS4Controls.TouchRight, false) == null && rightDown) Mapping.MapClick(deviceNum, Mapping.Click.Left); - if (Global.GetDS4Action(deviceNum, DS4Controls.TouchMulti.ToString(), false) == null && multiDown) + if (Global.GetDS4Action(deviceNum, DS4Controls.TouchMulti, false) == null && multiDown) Mapping.MapClick(deviceNum, Mapping.Click.Right); + if (!Global.UseTPforControls[deviceNum]) { if (tappedOnce) @@ -205,8 +218,11 @@ namespace DS4Windows dragging = true; } else + { dragging = false; + } } + s = remapped; //remapped.CopyTo(s); } @@ -231,11 +247,13 @@ namespace DS4Windows { if ((Global.LowerRCOn[deviceNum] && arg.touches[0].hwX > (1920 * 3) / 4 && arg.touches[0].hwY > (960 * 3) / 4)) Mapping.MapClick(deviceNum, Mapping.Click.Right); + if (isLeft(arg.touches[0])) leftDown = true; else if (isRight(arg.touches[0])) rightDown = true; } + dev.getCurrentState(s); synthesizeMouseButtons(); } diff --git a/DS4Windows/DS4Control/MouseCursor.cs b/DS4Windows/DS4Control/MouseCursor.cs index 0a5870d..bb4010b 100644 --- a/DS4Windows/DS4Control/MouseCursor.cs +++ b/DS4Windows/DS4Control/MouseCursor.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - - + namespace DS4Windows { class MouseCursor @@ -42,10 +37,14 @@ namespace DS4Windows int yAction = (int)yMotion; vRemainder += yMotion - yAction; vRemainder -= (int)vRemainder; - if (Global.GyroInvert[deviceNumber] == 2 || Global.GyroInvert[deviceNumber] == 3) + + int gyroInvert = Global.GyroInvert[deviceNumber]; + if (gyroInvert == 2 || gyroInvert == 3) xAction *= -1; - if (Global.GyroInvert[deviceNumber] == 1 || Global.GyroInvert[deviceNumber] == 3) + + if (gyroInvert == 1 || gyroInvert == 3) yAction *= -1; + if (yAction != 0 || xAction != 0) InputMethods.MoveCursorBy(xAction, yAction); @@ -65,8 +64,10 @@ namespace DS4Windows private byte lastTouchID; public void touchesMoved(TouchpadEventArgs arg, bool dragging) { - if ((!dragging && arg.touches.Length != 1) || (dragging && arg.touches.Length < 1)) + int touchesLen = arg.touches.Length; + if ((!dragging && touchesLen != 1) || (dragging && touchesLen < 1)) return; + int deltaX, deltaY; if (arg.touches[0].touchID != lastTouchID) { @@ -78,8 +79,7 @@ namespace DS4Windows else if (Global.TouchpadJitterCompensation[deviceNumber]) { // Often the DS4's internal jitter compensation kicks in and starts hiding changes, ironically creating jitter... - - if (dragging && arg.touches.Length > 1) + if (dragging && touchesLen > 1) { deltaX = arg.touches[1].deltaX; deltaY = arg.touches[1].deltaY; @@ -89,6 +89,7 @@ namespace DS4Windows deltaX = arg.touches[0].deltaX; deltaY = arg.touches[0].deltaY; } + // allow only very fine, slow motions, when changing direction, even from neutral // TODO maybe just consume it completely? if (deltaX <= -1) @@ -127,7 +128,7 @@ namespace DS4Windows } else { - if (dragging && arg.touches.Length > 1) + if (dragging && touchesLen > 1) { deltaX = arg.touches[1].deltaX; deltaY = arg.touches[1].deltaY; diff --git a/DS4Windows/DS4Control/MouseWheel.cs b/DS4Windows/DS4Control/MouseWheel.cs index d237731..5529337 100644 --- a/DS4Windows/DS4Control/MouseWheel.cs +++ b/DS4Windows/DS4Control/MouseWheel.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using System.Text; - namespace DS4Windows { class MouseWheel @@ -27,6 +26,7 @@ namespace DS4Windows { if (arg.touches.Length != 2 || dragging) return; + Touch lastT0 = arg.touches[0].previousTouch; Touch lastT1 = arg.touches[1].previousTouch; Touch T0 = arg.touches[0]; diff --git a/DS4Windows/DS4Control/ScpDevice.cs b/DS4Windows/DS4Control/ScpDevice.cs index ae27617..8055616 100644 --- a/DS4Windows/DS4Control/ScpDevice.cs +++ b/DS4Windows/DS4Control/ScpDevice.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.ComponentModel; -using System.Windows.Forms; using System.Runtime.InteropServices; using Microsoft.Win32.SafeHandles; @@ -522,7 +521,7 @@ namespace DS4Windows protected virtual Boolean GetDeviceHandle(String Path) { - m_FileHandle = CreateFile(Path, (GENERIC_WRITE | GENERIC_READ), FILE_SHARE_READ | FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, 0); + m_FileHandle = CreateFile(Path, (GENERIC_WRITE | GENERIC_READ), FILE_SHARE_READ | FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED | 0x20000000 | 0x80000000, 0); return !m_FileHandle.IsInvalid; } diff --git a/DS4Windows/DS4Control/ScpUtil.cs b/DS4Windows/DS4Control/ScpUtil.cs index 2b23fcb..1c9acfe 100644 --- a/DS4Windows/DS4Control/ScpUtil.cs +++ b/DS4Windows/DS4Control/ScpUtil.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Text; using System.IO; using System.Reflection; @@ -8,6 +7,8 @@ using System.Xml; using System.Drawing; using System.Security.Principal; +using System.Threading.Tasks; + namespace DS4Windows { [Flags] @@ -19,7 +20,8 @@ namespace DS4Windows public class DS4ControlSettings { public DS4Controls control; - public string extras = "0,0,0,0,0,0,0,0"; + //public string extras = "0,0,0,0,0,0,0,0"; + public string extras = null; public DS4KeyType keyType = DS4KeyType.None; public enum ActionType : byte { Default, Key, Button, Macro }; public ActionType actionType = ActionType.Default; @@ -27,7 +29,8 @@ namespace DS4Windows public ActionType shiftActionType = ActionType.Default; public object shiftAction = null; public int shiftTrigger = 0; - public string shiftExtras = "0,0,0,0,0,0,0,0"; + //public string shiftExtras = "0,0,0,0,0,0,0,0"; + public string shiftExtras = null; public DS4KeyType shiftKeyType = DS4KeyType.None; public DS4ControlSettings(DS4Controls ctrl) @@ -37,17 +40,19 @@ namespace DS4Windows public void Reset() { - extras = "0,0,0,0,0,0,0,0"; + //extras = "0,0,0,0,0,0,0,0"; + extras = null; keyType = DS4KeyType.None; actionType = ActionType.Default; action = null; shiftActionType = ActionType.Default; shiftAction = null; shiftTrigger = 0; - shiftExtras = "0,0,0,0,0,0,0,0"; + //shiftExtras = "0,0,0,0,0,0,0,0"; + shiftExtras = null; shiftKeyType = DS4KeyType.None; } - + internal void UpdateSettings(bool shift, object act, string exts, DS4KeyType kt, int trigger = 0) { if (!shift) @@ -60,6 +65,7 @@ namespace DS4Windows actionType = ActionType.Macro; else actionType = ActionType.Default; + action = act; extras = exts; keyType = kt; @@ -74,6 +80,7 @@ namespace DS4Windows shiftActionType = ActionType.Macro; else shiftActionType = ActionType.Default; + shiftAction = act; shiftExtras = exts; shiftKeyType = kt; @@ -136,13 +143,108 @@ namespace DS4Windows } } + public class BatteryReportArgs : EventArgs + { + private int index; + private int level; + + public BatteryReportArgs(int index, int level) + { + this.index = index; + this.level = level; + } + + public int getIndex() + { + return this.index; + } + + public int getLevel() + { + return this.level; + } + } + + public class ControllerRemovedArgs : EventArgs + { + private int index; + + public ControllerRemovedArgs(int index) + { + this.index = index; + } + + public int getIndex() + { + return this.index; + } + } + + public class DeviceStatusChangeEventArgs : EventArgs + { + private int index; + + public DeviceStatusChangeEventArgs(int index) + { + this.index = index; + } + + public int getIndex() + { + return index; + } + } + + public class MultiValueDict : Dictionary> + { + public void Add(Key key, Value val) + { + List values = null; + if (!this.TryGetValue(key, out values)) + { + values = new List(); + this.Add(key, values); + } + + values.Add(val); + } + } + public class Global { protected static BackingStore m_Config = new BackingStore(); protected static Int32 m_IdleTimeout = 600000; static string exepath = Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName; public static string appdatapath; + public static bool runHotPlug = false; + public const int XINPUT_UNPLUG_SETTLE_TIME = 250; // Inhibit races that occur with the asynchronous teardown of ScpVBus -> X360 driver instance. public static string[] tempprofilename = new string[5] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty }; + public static bool[] tempprofileDistance = new bool[5] { false, false, false, false, false }; + public static bool[] useDInputOnly = new bool[5] { false, false, false, false, false }; + + public static X360Controls[] defaultButtonMapping = { X360Controls.None, X360Controls.LXNeg, X360Controls.LXPos, + X360Controls.LYNeg, X360Controls.LYPos, X360Controls.RXNeg, X360Controls.RXPos, X360Controls.RYNeg, X360Controls.RYPos, + X360Controls.LB, X360Controls.LT, X360Controls.LS, X360Controls.RB, X360Controls.RT, X360Controls.RS, X360Controls.X, + X360Controls.Y, X360Controls.B, X360Controls.A, X360Controls.DpadUp, X360Controls.DpadRight, X360Controls.DpadDown, + X360Controls.DpadLeft, X360Controls.Guide, X360Controls.None, X360Controls.None, X360Controls.None, X360Controls.None, + X360Controls.Back, X360Controls.Start, X360Controls.None, X360Controls.None, X360Controls.None, X360Controls.None, + X360Controls.None, X360Controls.None, X360Controls.None, X360Controls.None + }; + + public static DS4Controls[] reverseX360ButtonMapping = new Func(() => + { + DS4Controls[] temp = new DS4Controls[defaultButtonMapping.Length]; + for (int i = 0, arlen = defaultButtonMapping.Length; i < arlen; i++) + { + X360Controls mapping = defaultButtonMapping[i]; + if (mapping != X360Controls.None) + { + temp[(int)mapping] = (DS4Controls)i; + } + } + + return temp; + })(); public static void SaveWhere(string path) { @@ -182,12 +284,46 @@ namespace DS4Windows ControllerStatusChange(sender, EventArgs.Empty); } - //general values + public static event EventHandler BatteryStatusChange; + public static void OnBatteryStatusChange(object sender, int index, int level) + { + if (BatteryStatusChange != null) + { + BatteryReportArgs args = new BatteryReportArgs(index, level); + BatteryStatusChange(sender, args); + } + } + + public static event EventHandler ControllerRemoved; + public static void OnControllerRemoved(object sender, int index) + { + if (ControllerRemoved != null) + { + ControllerRemovedArgs args = new ControllerRemovedArgs(index); + ControllerRemoved(sender, args); + } + } + + public static event EventHandler DeviceStatusChange; + public static void OnDeviceStatusChanged(object sender, int index) + { + if (DeviceStatusChange != null) + { + DeviceStatusChangeEventArgs args = new DeviceStatusChangeEventArgs(index); + DeviceStatusChange(sender, args); + } + } + + // general values public static bool UseExclusiveMode { set { m_Config.useExclusiveMode = value; } get { return m_Config.useExclusiveMode; } } + public static bool getUseExclusiveMode() + { + return m_Config.useExclusiveMode; + } public static DateTime LastChecked { @@ -225,6 +361,10 @@ namespace DS4Windows set { m_Config.quickCharge = value; } get { return m_Config.quickCharge; } } + public static bool getQuickCharge() + { + return m_Config.quickCharge; + } public static int FirstXinputPort { set { m_Config.firstXinputPort = value; } @@ -260,84 +400,313 @@ namespace DS4Windows set { m_Config.flashWhenLate = value; } get { return m_Config.flashWhenLate; } } + public static bool getFlashWhenLate() + { + return m_Config.flashWhenLate; + } public static int FlashWhenLateAt { set { m_Config.flashWhenLateAt = value; } get { return m_Config.flashWhenLateAt; } } + public static int getFlashWhenLateAt() + { + return m_Config.flashWhenLateAt; + } public static bool UseWhiteIcon { set { m_Config.useWhiteIcon = value; } get { return m_Config.useWhiteIcon; } } - //controller/profile specfic values + // controller/profile specfic values public static int[] ButtonMouseSensitivity => m_Config.buttonMouseSensitivity; - public static byte[] RumbleBoost => m_Config.rumble; + public static byte[] RumbleBoost => m_Config.rumble; + public static byte getRumbleBoost(int index) + { + return m_Config.rumble[index]; + } public static double[] Rainbow => m_Config.rainbow; + public static double getRainbow(int index) + { + return m_Config.rainbow[index]; + } public static bool[] FlushHIDQueue => m_Config.flushHIDQueue; - public static int[] IdleDisconnectTimeout => m_Config.idleDisconnectTimeout; + public static bool getFlushHIDQueue(int index) + { + return m_Config.flushHIDQueue[index]; + } + public static bool[] EnableTouchToggle => m_Config.enableTouchToggle; + public static bool getEnableTouchToggle(int index) + { + return m_Config.enableTouchToggle[index]; + } + public static int[] IdleDisconnectTimeout => m_Config.idleDisconnectTimeout; + public static int getIdleDisconnectTimeout(int index) + { + return m_Config.idleDisconnectTimeout[index]; + } public static byte[] TouchSensitivity => m_Config.touchSensitivity; + public static byte[] getTouchSensitivity() + { + return m_Config.touchSensitivity; + } + public static byte getTouchSensitivity(int index) + { + return m_Config.touchSensitivity[index]; + } public static byte[] FlashType => m_Config.flashType; + public static byte getFlashType(int index) + { + return m_Config.flashType[index]; + } + public static int[] FlashAt => m_Config.flashAt; + public static int getFlashAt(int index) + { + return m_Config.flashAt[index]; + } + public static bool[] LedAsBatteryIndicator => m_Config.ledAsBattery; + public static bool getLedAsBatteryIndicator(int index) + { + return m_Config.ledAsBattery[index]; + } public static int[] ChargingType => m_Config.chargingType; + public static int getChargingType(int index) + { + return m_Config.chargingType[index]; + } public static bool[] DinputOnly => m_Config.dinputOnly; + public static bool getDInputOnly(int index) + { + return m_Config.dinputOnly[index]; + } + public static bool[] StartTouchpadOff => m_Config.startTouchpadOff; public static bool[] UseTPforControls => m_Config.useTPforControls; + public static bool getUseTPforControls(int index) + { + return m_Config.useTPforControls[index]; + } public static bool[] UseSAforMouse => m_Config.useSAforMouse; + public static bool isUsingSAforMouse(int index) + { + return m_Config.useSAforMouse[index]; + } public static string[] SATriggers => m_Config.sATriggers; public static int[] GyroSensitivity => m_Config.gyroSensitivity; public static int[] GyroInvert => m_Config.gyroInvert; - public static DS4Color[] MainColor => m_Config.m_Leds; + public static DS4Color[] MainColor => m_Config.m_Leds; + public static DS4Color getMainColor(int index) + { + return m_Config.m_Leds[index]; + } public static DS4Color[] LowColor => m_Config.m_LowLeds; + public static DS4Color getLowColor(int index) + { + return m_Config.m_LowLeds[index]; + } public static DS4Color[] ChargingColor => m_Config.m_ChargingLeds; + public static DS4Color getChargingColor(int index) + { + return m_Config.m_ChargingLeds[index]; + } public static DS4Color[] CustomColor => m_Config.m_CustomLeds; + public static DS4Color getCustomColor(int index) + { + return m_Config.m_CustomLeds[index]; + } public static bool[] UseCustomLed => m_Config.useCustomLeds; + public static bool getUseCustomLed(int index) + { + return m_Config.useCustomLeds[index]; + } - public static DS4Color[] FlashColor => m_Config.m_FlashLeds; + public static DS4Color[] FlashColor => m_Config.m_FlashLeds; + public static DS4Color getFlashColor(int index) + { + return m_Config.m_FlashLeds[index]; + } public static byte[] TapSensitivity => m_Config.tapSensitivity; public static bool[] DoubleTap => m_Config.doubleTap; public static int[] ScrollSensitivity => m_Config.scrollSensitivity; + public static int[] getScrollSensitivity() + { + return m_Config.scrollSensitivity; + } + public static int getScrollSensitivity(int index) + { + return m_Config.scrollSensitivity[index]; + } + public static bool[] LowerRCOn => m_Config.lowerRCOn; public static bool[] TouchpadJitterCompensation => m_Config.touchpadJitterCompensation; - public static byte[] L2Deadzone => m_Config.l2Deadzone; + public static byte[] L2Deadzone => m_Config.l2Deadzone; + public static byte getL2Deadzone(int index) + { + return m_Config.l2Deadzone[index]; + } public static byte[] R2Deadzone => m_Config.r2Deadzone; + public static byte getR2Deadzone(int index) + { + return m_Config.r2Deadzone[index]; + } public static double[] SXDeadzone => m_Config.SXDeadzone; + public static double getSXDeadzone(int index) + { + return m_Config.SXDeadzone[index]; + } public static double[] SZDeadzone => m_Config.SZDeadzone; + public static double getSZDeadzone(int index) + { + return m_Config.SZDeadzone[index]; + } public static int[] LSDeadzone => m_Config.LSDeadzone; + public static int getLSDeadzone(int index) + { + return m_Config.LSDeadzone[index]; + } public static int[] RSDeadzone => m_Config.RSDeadzone; + public static int getRSDeadzone(int index) + { + return m_Config.RSDeadzone[index]; + } + public static int[] LSAntiDeadzone => m_Config.LSAntiDeadzone; + public static int getLSAntiDeadzone(int index) + { + return m_Config.LSAntiDeadzone[index]; + } + public static int[] RSAntiDeadzone => m_Config.RSAntiDeadzone; + public static int getRSAntiDeadzone(int index) + { + return m_Config.RSAntiDeadzone[index]; + } + public static int[] LSMaxzone => m_Config.LSMaxzone; + public static int getLSMaxzone(int index) + { + return m_Config.LSMaxzone[index]; + } + public static int[] RSMaxzone => m_Config.RSMaxzone; + public static int getRSMaxzone(int index) + { + return m_Config.RSMaxzone[index]; + } + public static int[] L2AntiDeadzone => m_Config.l2AntiDeadzone; + public static int getL2AntiDeadzone(int index) + { + return m_Config.l2AntiDeadzone[index]; + } + public static int[] R2AntiDeadzone => m_Config.r2AntiDeadzone; + public static int getR2AntiDeadzone(int index) + { + return m_Config.r2AntiDeadzone[index]; + } + public static int[] L2Maxzone => m_Config.l2Maxzone; + public static int getL2Maxzone(int index) + { + return m_Config.l2Maxzone[index]; + } + public static int[] R2Maxzone => m_Config.r2Maxzone; + public static int getR2Maxzone(int index) + { + return m_Config.r2Maxzone[index]; + } public static int[] LSCurve => m_Config.lsCurve; + public static int getLSCurve(int index) + { + return m_Config.lsCurve[index]; + } public static int[] RSCurve => m_Config.rsCurve; + public static int getRSCurve(int index) + { + return m_Config.rsCurve[index]; + } public static double[] L2Sens => m_Config.l2Sens; + public static double getL2Sens(int index) + { + return m_Config.l2Sens[index]; + } public static double[] R2Sens => m_Config.r2Sens; + public static double getR2Sens(int index) + { + return m_Config.r2Sens[index]; + } public static double[] SXSens => m_Config.SXSens; + public static double getSXSens(int index) + { + return m_Config.SXSens[index]; + } public static double[] SZSens => m_Config.SZSens; + public static double getSZSens(int index) + { + return m_Config.SZSens[index]; + } public static double[] LSSens => m_Config.LSSens; + public static double getLSSens(int index) + { + return m_Config.LSSens[index]; + } public static double[] RSSens => m_Config.RSSens; + public static double getRSSens(int index) + { + return m_Config.RSSens[index]; + } public static bool[] MouseAccel => m_Config.mouseAccel; + public static bool getMouseAccel(int device) + { + return m_Config.mouseAccel[device]; + } public static string[] LaunchProgram => m_Config.launchProgram; public static string[] ProfilePath => m_Config.profilePath; + public static bool[] DistanceProfiles = m_Config.distanceProfiles; public static List[] ProfileActions => m_Config.profileActions; + public static int getProfileActionCount(int index) + { + return m_Config.profileActionCount[index]; + } + public static void calculateProfileActionCount(int index) + { + m_Config.profileActionCount[index] = m_Config.profileActions[index].Count; + } + public static List getProfileActions(int index) + { + return m_Config.profileActions[index]; + } public static void UpdateDS4CSetting (int deviceNum, string buttonName, bool shift, object action, string exts, DS4KeyType kt, int trigger = 0) { m_Config.UpdateDS4CSetting(deviceNum, buttonName, shift, action, exts, kt, trigger); + m_Config.containsCustomAction[deviceNum] = m_Config.HasCustomActions(deviceNum); + m_Config.containsCustomExtras[deviceNum] = m_Config.HasCustomExtras(deviceNum); } public static void UpdateDS4Extra(int deviceNum, string buttonName, bool shift, string exts) { m_Config.UpdateDS4CExtra(deviceNum, buttonName, shift, exts); + m_Config.containsCustomAction[deviceNum] = m_Config.HasCustomActions(deviceNum); + m_Config.containsCustomExtras[deviceNum] = m_Config.HasCustomExtras(deviceNum); } - public static object GetDS4Action(int deviceNum, string buttonName, bool shift) => m_Config.GetDS4Action(deviceNum, buttonName, shift); + public static object GetDS4Action(int deviceNum, string buttonName, bool shift) => m_Config.GetDS4Action(deviceNum, buttonName, shift); + public static object GetDS4Action(int deviceNum, DS4Controls control, bool shift) => m_Config.GetDS4Action(deviceNum, control, shift); public static DS4KeyType GetDS4KeyType(int deviceNum, string buttonName, bool shift) => m_Config.GetDS4KeyType(deviceNum, buttonName, shift); public static string GetDS4Extra(int deviceNum, string buttonName, bool shift) => m_Config.GetDS4Extra(deviceNum, buttonName, shift); public static int GetDS4STrigger(int deviceNum, string buttonName) => m_Config.GetDS4STrigger(deviceNum, buttonName); + public static int GetDS4STrigger(int deviceNum, DS4Controls control) => m_Config.GetDS4STrigger(deviceNum, control); public static List getDS4CSettings(int device) => m_Config.ds4settings[device]; public static DS4ControlSettings getDS4CSetting(int deviceNum, string control) => m_Config.getDS4CSetting(deviceNum, control); - public static bool HasCustomAction(int deviceNum) => m_Config.HasCustomActions(deviceNum); + public static DS4ControlSettings getDS4CSetting(int deviceNum, DS4Controls control) => m_Config.getDS4CSetting(deviceNum, control); + public static bool HasCustomActions(int deviceNum) => m_Config.HasCustomActions(deviceNum); public static bool HasCustomExtras(int deviceNum) => m_Config.HasCustomExtras(deviceNum); + public static bool containsCustomAction(int deviceNum) + { + return m_Config.containsCustomAction[deviceNum]; + } + public static bool containsCustomExtras(int deviceNum) + { + return m_Config.containsCustomExtras[deviceNum]; + } public static void SaveAction(string name, string controls, int mode, string details, bool edit, string extras = "") { @@ -356,12 +725,22 @@ namespace DS4Windows public static int GetActionIndexOf(string name) { - for (int i = 0; i < m_Config.actions.Count; i++) + for (int i = 0, actionCount = m_Config.actions.Count; i < actionCount; i++) + { if (m_Config.actions[i].name == name) return i; + } + return -1; } + public static int GetProfileActionIndexOf(int device, string name) + { + int index = -1; + m_Config.profileActionIndexDict[device].TryGetValue(name, out index); + return index; + } + public static SpecialAction GetAction(string name) { foreach (SpecialAction sA in m_Config.actions) @@ -370,6 +749,50 @@ namespace DS4Windows return new SpecialAction("null", "null", "null", "null"); } + public static SpecialAction GetProfileAction(int device, string name) + { + SpecialAction sA = null; + m_Config.profileActionDict[device].TryGetValue(name, out sA); + return sA; + } + + public static void calculateProfileActionDicts(int device) + { + m_Config.profileActionDict[device].Clear(); + m_Config.profileActionIndexDict[device].Clear(); + + foreach (string actionname in m_Config.profileActions[device]) + { + m_Config.profileActionDict[device].Add(actionname, Global.GetAction(actionname)); + m_Config.profileActionIndexDict[device].Add(actionname, Global.GetActionIndexOf(actionname)); + } + } + + public static void cacheProfileCustomsFlags(int device) + { + m_Config.containsCustomAction[device] = HasCustomActions(device); + m_Config.containsCustomExtras[device] = HasCustomExtras(device); + } + + public static X360Controls getX360ControlsByName(string key) + { + return m_Config.getX360ControlsByName(key); + } + + public static string getX360ControlString(X360Controls key) + { + return m_Config.getX360ControlString(key); + } + + public static DS4Controls getDS4ControlsByName(string key) + { + return m_Config.getDS4ControlsByName(key); + } + + public static X360Controls getDefaultX360ControlBinding(DS4Controls dc) + { + return defaultButtonMapping[(int)dc]; + } /*public static X360Controls getCustomButton(int device, DS4Controls controlName) => m_Config.GetCustomButton(device, controlName); @@ -403,19 +826,22 @@ namespace DS4Windows public static Dictionary getShiftCustomKeys(int device) => m_Config.shiftCustomMapKeys[device]; public static Dictionary getShiftCustomMacros(int device) => m_Config.shiftCustomMapMacros[device]; public static Dictionary getShiftCustomExtras(int device) => m_Config.shiftCustomMapExtras[device]; - public static Dictionary getShiftCustomKeyTypes(int device) => m_Config.shiftCustomMapKeyTypes[device]; */ + public static Dictionary getShiftCustomKeyTypes(int device) => m_Config.shiftCustomMapKeyTypes[device]; */ public static bool Load() => m_Config.Load(); - public static void LoadProfile(int device, bool launchprogram, ControlService control) + public static void LoadProfile(int device, bool launchprogram, ControlService control, bool xinputChange = true) { - m_Config.LoadProfile(device, launchprogram, control); + m_Config.LoadProfile(device, launchprogram, control, "", xinputChange); tempprofilename[device] = string.Empty; + tempprofileDistance[device] = false; } - public static void LoadTempProfile(int device, string name, bool launchprogram, ControlService control) + public static void LoadTempProfile(int device, string name, bool launchprogram, + ControlService control, bool xinputChange = true) { m_Config.LoadProfile(device, launchprogram, control, appdatapath + @"\Profiles\" + name + ".xml"); tempprofilename[device] = name; + tempprofileDistance[device] = name.ToLower().Contains("distance"); } public static bool Save() @@ -430,15 +856,17 @@ namespace DS4Windows private static byte applyRatio(byte b1, byte b2, double r) { - if (r > 100) - r = 100; - else if (r < 0) - r = 0; - r /= 100f; - return (byte)Math.Round((b1 * (1 - r) + b2 *r),0); + if (r > 100.0) + r = 100.0; + else if (r < 0.0) + r = 0.0; + + r /= 100.0; + return (byte)Math.Round((b1 * (1 - r) + b2 * r), 0); } + public static DS4Color getTransitionedColor(DS4Color c1, DS4Color c2, double ratio) - {//; + { //Color cs = Color.FromArgb(c1.red, c1.green, c1.blue); c1.red = applyRatio(c1.red, c2.red, ratio); c1.green = applyRatio(c1.green, c2.green, ratio); @@ -463,6 +891,7 @@ namespace DS4Windows csR = HuetoRGB(hue2,sat2,bri2 - br*ratio); else csR = HuetoRGB(hue2 - hr * ratio, sat2 - sr * ratio, bri2 - br * ratio); + return csR; } @@ -473,28 +902,41 @@ namespace DS4Windows float m = bri - C / 2; float R, G, B; if (0 <= hue && hue < 60) - { R = C; G = X; B = 0;} + { + R = C; G = X; B = 0; + } else if (60 <= hue && hue < 120) - {R = X; G = C; B = 0; } + { + R = X; G = C; B = 0; + } else if (120 <= hue && hue < 180) - { R = 0; G = C; B = X; } + { + R = 0; G = C; B = X; + } else if (180 <= hue && hue < 240) - { R = 0; G = X; B = C; } + { + R = 0; G = X; B = C; + } else if (240 <= hue && hue < 300) - { R = X; G = 0; B = C; } + { + R = X; G = 0; B = C; + } else if (300 <= hue && hue < 360) - { R = C; G = 0; B = X; } + { + R = C; G = 0; B = X; + } else - { R = 255; G = 0; B = 0; } + { + R = 255; G = 0; B = 0; + } + R += m; G += m; B += m; - R *= 255; G *= 255; B *= 255; + R *= 255.0f; G *= 255.0f; B *= 255.0f; return Color.FromArgb((int)R, (int)G, (int)B); } - } - public class BackingStore { //public String m_Profile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\DS4Tool" + "\\Profiles.xml"; @@ -505,17 +947,24 @@ namespace DS4Windows //fifth value used to for options, not fifth controller public int[] buttonMouseSensitivity = { 25, 25, 25, 25, 25 }; - public bool[] flushHIDQueue = { true, true, true, true, true }; + public bool[] flushHIDQueue = { false, false, false, false, false }; + public bool[] enableTouchToggle = { true, true, true, true, true }; public int[] idleDisconnectTimeout = { 0, 0, 0, 0, 0 }; public Boolean[] touchpadJitterCompensation = { true, true, true, true, true }; public Boolean[] lowerRCOn = { false, false, false, false, false }; public Boolean[] ledAsBattery = { false, false, false, false, false }; public Byte[] flashType = { 0, 0, 0, 0, 0 }; public String[] profilePath = { String.Empty, String.Empty, String.Empty, String.Empty, String.Empty }; + // Cache properties instead of performing a string comparison every frame + public bool[] distanceProfiles = { false, false, false, false, false }; public Byte[] rumble = { 100, 100, 100, 100, 100 }; public Byte[] touchSensitivity = { 100, 100, 100, 100, 100 }; public Byte[] l2Deadzone = { 0, 0, 0, 0, 0 }, r2Deadzone = { 0, 0, 0, 0, 0 }; public int[] LSDeadzone = { 0, 0, 0, 0, 0 }, RSDeadzone = { 0, 0, 0, 0, 0 }; + public int[] LSAntiDeadzone = { 0, 0, 0, 0, 0 }, RSAntiDeadzone = { 0, 0, 0, 0, 0 }; + public int[] LSMaxzone = { 100, 100, 100, 100, 100 }, RSMaxzone = { 100, 100, 100, 100, 100 }; + public int[] l2AntiDeadzone = { 0, 0, 0, 0, 0 }, r2AntiDeadzone = { 0, 0, 0, 0, 0 }; + public int[] l2Maxzone = { 100, 100, 100, 100, 100 }, r2Maxzone = { 100, 100, 100, 100, 100 }; public double[] SXDeadzone = { 0.25, 0.25, 0.25, 0.25, 0.25 }, SZDeadzone = { 0.25, 0.25, 0.25, 0.25, 0.25 }; public double[] l2Sens = { 1, 1, 1, 1, 1 }, r2Sens = { 1, 1, 1, 1, 1 }; public double[] LSSens = { 1, 1, 1, 1, 1 }, RSSens = { 1, 1, 1, 1, 1 }; @@ -528,7 +977,7 @@ namespace DS4Windows public bool[] mouseAccel = { true, true, true, true, true }; public DS4Color[] m_LowLeds = new DS4Color[] { - new DS4Color(Color.Black), + new DS4Color(Color.Black), new DS4Color(Color.Black), new DS4Color(Color.Black), new DS4Color(Color.Black), @@ -544,7 +993,7 @@ namespace DS4Windows }; public DS4Color[] m_ChargingLeds = new DS4Color[] { - new DS4Color(Color.Black), + new DS4Color(Color.Black), new DS4Color(Color.Black), new DS4Color(Color.Black), new DS4Color(Color.Black), @@ -552,7 +1001,7 @@ namespace DS4Windows }; public DS4Color[] m_FlashLeds = new DS4Color[] { - new DS4Color(Color.Black), + new DS4Color(Color.Black), new DS4Color(Color.Black), new DS4Color(Color.Black), new DS4Color(Color.Black), @@ -561,7 +1010,7 @@ namespace DS4Windows public bool[] useCustomLeds = new bool[] { false, false, false, false }; public DS4Color[] m_CustomLeds = new DS4Color[] { - new DS4Color(Color.Black), + new DS4Color(Color.Black), new DS4Color(Color.Black), new DS4Color(Color.Black), new DS4Color(Color.Black) @@ -602,10 +1051,17 @@ namespace DS4Windows public Dictionary[] shiftCustomMapButtons = { null, null, null, null, null }; public Dictionary[] shiftCustomMapExtras = { null, null, null, null, null };*/ public List[] profileActions = { null, null, null, null, null }; + public int[] profileActionCount = { 0, 0, 0, 0, 0 }; + public Dictionary[] profileActionDict = { new Dictionary(), new Dictionary(), new Dictionary(), new Dictionary(), new Dictionary() }; + public Dictionary[] profileActionIndexDict = { new Dictionary(), new Dictionary(), new Dictionary(), new Dictionary(), new Dictionary() }; public bool downloadLang = true; public bool useWhiteIcon; public bool flashWhenLate = true; - public int flashWhenLateAt = 10; + public int flashWhenLateAt = 20; + // Cache whether profile has custom action + public bool[] containsCustomAction = { false, false, false, false, false }; + // Cache whether profile has custom extras + public bool[] containsCustomExtras = { false, false, false, false, false }; public int[] gyroSensitivity = { 100, 100, 100, 100, 100 }; public int[] gyroInvert = { 0, 0, 0, 0, 0 }; @@ -614,8 +1070,11 @@ namespace DS4Windows for (int i = 0; i < 5; i++) { foreach (DS4Controls dc in Enum.GetValues(typeof(DS4Controls))) + { if (dc != DS4Controls.None) ds4settings[i].Add(new DS4ControlSettings(dc)); + } + /*customMapKeyTypes[i] = new Dictionary(); customMapKeys[i] = new Dictionary(); customMapMacros[i] = new Dictionary(); @@ -627,8 +1086,10 @@ namespace DS4Windows shiftCustomMapMacros[i] = new Dictionary(); shiftCustomMapButtons[i] = new Dictionary(); shiftCustomMapExtras[i] = new Dictionary();*/ + profileActions[i] = new List(); profileActions[i].Add("Disconnect Controller"); + profileActionCount[i] = profileActions[i].Count; } } @@ -725,6 +1186,7 @@ namespace DS4Windows Node = m_Xdoc.CreateNode(XmlNodeType.Element, "DS4Windows", null); XmlNode xmlFlushHIDQueue = m_Xdoc.CreateNode(XmlNodeType.Element, "flushHIDQueue", null); xmlFlushHIDQueue.InnerText = flushHIDQueue[device].ToString(); Node.AppendChild(xmlFlushHIDQueue); + XmlNode xmlTouchToggle = m_Xdoc.CreateNode(XmlNodeType.Element, "touchToggle", null); xmlTouchToggle.InnerText = enableTouchToggle[device].ToString(); Node.AppendChild(xmlTouchToggle); XmlNode xmlIdleDisconnectTimeout = m_Xdoc.CreateNode(XmlNodeType.Element, "idleDisconnectTimeout", null); xmlIdleDisconnectTimeout.InnerText = idleDisconnectTimeout[device].ToString(); Node.AppendChild(xmlIdleDisconnectTimeout); XmlNode xmlColor = m_Xdoc.CreateNode(XmlNodeType.Element, "Color", null); xmlColor.InnerText = m_Leds[device].red.ToString() + "," + m_Leds[device].green.ToString() + "," + m_Leds[device].blue.ToString(); @@ -750,10 +1212,18 @@ namespace DS4Windows XmlNode xmlScrollSensitivity = m_Xdoc.CreateNode(XmlNodeType.Element, "scrollSensitivity", null); xmlScrollSensitivity.InnerText = scrollSensitivity[device].ToString(); Node.AppendChild(xmlScrollSensitivity); XmlNode xmlLeftTriggerMiddle = m_Xdoc.CreateNode(XmlNodeType.Element, "LeftTriggerMiddle", null); xmlLeftTriggerMiddle.InnerText = l2Deadzone[device].ToString(); Node.AppendChild(xmlLeftTriggerMiddle); XmlNode xmlRightTriggerMiddle = m_Xdoc.CreateNode(XmlNodeType.Element, "RightTriggerMiddle", null); xmlRightTriggerMiddle.InnerText = r2Deadzone[device].ToString(); Node.AppendChild(xmlRightTriggerMiddle); + XmlNode xmlL2AD = m_Xdoc.CreateNode(XmlNodeType.Element, "L2AntiDeadZone", null); xmlL2AD.InnerText = l2AntiDeadzone[device].ToString(); Node.AppendChild(xmlL2AD); + XmlNode xmlR2AD = m_Xdoc.CreateNode(XmlNodeType.Element, "R2AntiDeadZone", null); xmlR2AD.InnerText = r2AntiDeadzone[device].ToString(); Node.AppendChild(xmlR2AD); + XmlNode xmlL2Maxzone = m_Xdoc.CreateNode(XmlNodeType.Element, "L2MaxZone", null); xmlL2Maxzone.InnerText = l2Maxzone[device].ToString(); Node.AppendChild(xmlL2Maxzone); + XmlNode xmlR2Maxzone = m_Xdoc.CreateNode(XmlNodeType.Element, "R2MaxZone", null); xmlR2Maxzone.InnerText = r2Maxzone[device].ToString(); Node.AppendChild(xmlR2Maxzone); XmlNode xmlButtonMouseSensitivity = m_Xdoc.CreateNode(XmlNodeType.Element, "ButtonMouseSensitivity", null); xmlButtonMouseSensitivity.InnerText = buttonMouseSensitivity[device].ToString(); Node.AppendChild(xmlButtonMouseSensitivity); XmlNode xmlRainbow = m_Xdoc.CreateNode(XmlNodeType.Element, "Rainbow", null); xmlRainbow.InnerText = rainbow[device].ToString(); Node.AppendChild(xmlRainbow); XmlNode xmlLSD = m_Xdoc.CreateNode(XmlNodeType.Element, "LSDeadZone", null); xmlLSD.InnerText = LSDeadzone[device].ToString(); Node.AppendChild(xmlLSD); XmlNode xmlRSD = m_Xdoc.CreateNode(XmlNodeType.Element, "RSDeadZone", null); xmlRSD.InnerText = RSDeadzone[device].ToString(); Node.AppendChild(xmlRSD); + XmlNode xmlLSAD = m_Xdoc.CreateNode(XmlNodeType.Element, "LSAntiDeadZone", null); xmlLSAD.InnerText = LSAntiDeadzone[device].ToString(); Node.AppendChild(xmlLSAD); + XmlNode xmlRSAD = m_Xdoc.CreateNode(XmlNodeType.Element, "RSAntiDeadZone", null); xmlRSAD.InnerText = RSAntiDeadzone[device].ToString(); Node.AppendChild(xmlRSAD); + XmlNode xmlLSMaxZone = m_Xdoc.CreateNode(XmlNodeType.Element, "LSMaxZone", null); xmlLSMaxZone.InnerText = LSMaxzone[device].ToString(); Node.AppendChild(xmlLSMaxZone); + XmlNode xmlRSMaxZone = m_Xdoc.CreateNode(XmlNodeType.Element, "RSMaxZone", null); xmlRSMaxZone.InnerText = RSMaxzone[device].ToString(); Node.AppendChild(xmlRSMaxZone); XmlNode xmlSXD = m_Xdoc.CreateNode(XmlNodeType.Element, "SXDeadZone", null); xmlSXD.InnerText = SXDeadzone[device].ToString(); Node.AppendChild(xmlSXD); XmlNode xmlSZD = m_Xdoc.CreateNode(XmlNodeType.Element, "SZDeadZone", null); xmlSZD.InnerText = SZDeadzone[device].ToString(); Node.AppendChild(xmlSZD); @@ -803,7 +1273,7 @@ namespace DS4Windows keyType += DS4KeyType.Unbound; if (dcs.keyType.HasFlag(DS4KeyType.HoldMacro)) keyType += DS4KeyType.HoldMacro; - if (dcs.keyType.HasFlag(DS4KeyType.Macro)) + else if (dcs.keyType.HasFlag(DS4KeyType.Macro)) keyType += DS4KeyType.Macro; if (dcs.keyType.HasFlag(DS4KeyType.Toggle)) keyType += DS4KeyType.Toggle; @@ -828,11 +1298,16 @@ namespace DS4Windows buttonNode.InnerText = dcs.action.ToString(); Key.AppendChild(buttonNode); } - else if (dcs.action is string || dcs.action is X360Controls) + else if (dcs.action is string) { buttonNode.InnerText = dcs.action.ToString(); Button.AppendChild(buttonNode); } + else if (dcs.action is X360Controls) + { + buttonNode.InnerText = getX360ControlString((X360Controls)dcs.action); + Button.AppendChild(buttonNode); + } } bool hasvalue = false; @@ -1037,7 +1512,7 @@ namespace DS4Windows return Saved; } - private DS4Controls getDS4ControlsByName(string key) + public DS4Controls getDS4ControlsByName(string key) { if (!key.StartsWith("bn")) @@ -1173,7 +1648,7 @@ namespace DS4Windows return 0; } - private X360Controls getX360ControlsByName(string key) + public X360Controls getX360ControlsByName(string key) { X360Controls x3c; if (Enum.TryParse(key, true, out x3c)) @@ -1226,7 +1701,57 @@ namespace DS4Windows return X360Controls.Unbound; } - public Boolean LoadProfile(int device, bool launchprogram, ControlService control, string propath = "") + public string getX360ControlString(X360Controls key) + { + switch (key) + { + case X360Controls.Back: return "Back"; + case X360Controls.LS: return "Left Stick"; + case X360Controls.RS: return "Right Stick"; + case X360Controls.Start: return "Start"; + case X360Controls.DpadUp: return "Up Button"; + case X360Controls.DpadRight: return "Right Button"; + case X360Controls.DpadDown: return "Down Button"; + case X360Controls.DpadLeft: return "Left Button"; + + case X360Controls.LB: return "Left Bumper"; + case X360Controls.RB: return "Right Bumper"; + case X360Controls.Y: return "Y Button"; + case X360Controls.B: return "B Button"; + case X360Controls.A: return "A Button"; + case X360Controls.X: return "X Button"; + + case X360Controls.Guide: return "Guide"; + case X360Controls.LXNeg: return "Left X-Axis-"; + case X360Controls.LYNeg: return "Left Y-Axis-"; + case X360Controls.RXNeg: return "Right X-Axis-"; + case X360Controls.RYNeg: return "Right Y-Axis-"; + + case X360Controls.LXPos: return "Left X-Axis+"; + case X360Controls.LYPos: return "Left Y-Axis+"; + case X360Controls.RXPos: return "Right X-Axis+"; + case X360Controls.RYPos: return "Right Y-Axis+"; + case X360Controls.LT: return "Left Trigger"; + case X360Controls.RT: return "Right Trigger"; + + case X360Controls.LeftMouse: return "Left Mouse Button"; + case X360Controls.RightMouse: return "Right Mouse Button"; + case X360Controls.MiddleMouse: return "Middle Mouse Button"; + case X360Controls.FourthMouse: return "4th Mouse Button"; + case X360Controls.FifthMouse: return "5th Mouse Button"; + case X360Controls.WUP: return "Mouse Wheel Up"; + case X360Controls.WDOWN: return "Mouse Wheel Down"; + case X360Controls.MouseUp: return "Mouse Up"; + case X360Controls.MouseDown: return "Mouse Down"; + case X360Controls.MouseLeft: return "Mouse Left"; + case X360Controls.MouseRight: return "Mouse Right"; + case X360Controls.Unbound: return "Unbound"; + } + + return "Unbound"; + } + + public Boolean LoadProfile(int device, bool launchprogram, ControlService control, string propath = "", bool xinputChange = true) { Boolean Loaded = true; Dictionary customMapKeyTypes = new Dictionary(); @@ -1246,6 +1771,7 @@ namespace DS4Windows profilepath = Global.appdatapath + @"\Profiles\" + profilePath[device] + ".xml"; else profilepath = propath; + if (File.Exists(profilepath)) { XmlNode Item; @@ -1264,6 +1790,9 @@ namespace DS4Windows try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/flushHIDQueue"); Boolean.TryParse(Item.InnerText, out flushHIDQueue[device]); } catch { missingSetting = true; }//rootname = } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/touchToggle"); Boolean.TryParse(Item.InnerText, out enableTouchToggle[device]); } + catch { missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/idleDisconnectTimeout"); Int32.TryParse(Item.InnerText, out idleDisconnectTimeout[device]); } catch { missingSetting = true; } //New method for saving color @@ -1380,6 +1909,22 @@ namespace DS4Windows catch { missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/RightTriggerMiddle"); byte.TryParse(Item.InnerText, out r2Deadzone[device]); } catch { missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/L2AntiDeadZone"); int.TryParse(Item.InnerText, out l2AntiDeadzone[device]); } + catch { missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/R2AntiDeadZone"); int.TryParse(Item.InnerText, out r2AntiDeadzone[device]); } + catch { missingSetting = true; } + try { + Item = m_Xdoc.SelectSingleNode("/" + rootname + "/L2MaxZone"); int temp = 100; + int.TryParse(Item.InnerText, out temp); + l2Maxzone[device] = Math.Min(Math.Max(temp, 0), 100); + } + catch { missingSetting = true; } + try { + Item = m_Xdoc.SelectSingleNode("/" + rootname + "/R2MaxZone"); int temp = 100; + int.TryParse(Item.InnerText, out temp); + r2Maxzone[device] = Math.Min(Math.Max(temp, 0), 100); + } + catch { missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/ButtonMouseSensitivity"); int.TryParse(Item.InnerText, out buttonMouseSensitivity[device]); } catch { missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/Rainbow"); double.TryParse(Item.InnerText, out rainbow[device]); } @@ -1388,6 +1933,22 @@ namespace DS4Windows catch { missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/RSDeadZone"); int.TryParse(Item.InnerText, out RSDeadzone[device]); } catch { missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LSAntiDeadZone"); int.TryParse(Item.InnerText, out LSAntiDeadzone[device]); } + catch { missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/RSAntiDeadZone"); int.TryParse(Item.InnerText, out RSAntiDeadzone[device]); } + catch { missingSetting = true; } + try { + Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LSMaxZone"); int temp = 100; + int.TryParse(Item.InnerText, out temp); + LSMaxzone[device] = Math.Min(Math.Max(temp, 0), 100); + } + catch { missingSetting = true; } + try { + Item = m_Xdoc.SelectSingleNode("/" + rootname + "/RSMaxZone"); int temp = 100; + int.TryParse(Item.InnerText, out temp); + RSMaxzone[device] = Math.Min(Math.Max(temp, 0), 100); + } + catch { missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SXDeadZone"); double.TryParse(Item.InnerText, out SXDeadzone[device]); } catch { missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SZDeadZone"); double.TryParse(Item.InnerText, out SZDeadzone[device]); } @@ -1402,9 +1963,9 @@ namespace DS4Windows LSSens[device] = 1; if (!double.TryParse(s[1], out RSSens[device]) || RSSens[device] < .5f) RSSens[device] = 1; - if (!double.TryParse(s[2], out l2Sens[device]) || l2Sens[device] < .5f) + if (!double.TryParse(s[2], out l2Sens[device]) || l2Sens[device] < .1f) l2Sens[device] = 1; - if (!double.TryParse(s[3], out r2Sens[device]) || r2Sens[device] < .5f) + if (!double.TryParse(s[3], out r2Sens[device]) || r2Sens[device] < .1f) r2Sens[device] = 1; if (!double.TryParse(s[4], out SXSens[device]) || SXSens[device] < .5f) SXSens[device] = 1; @@ -1419,24 +1980,99 @@ namespace DS4Windows int shiftM = 0; if (m_Xdoc.SelectSingleNode("/" + rootname + "/ShiftModifier") != null) int.TryParse(m_Xdoc.SelectSingleNode("/" + rootname + "/ShiftModifier").InnerText, out shiftM); + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LaunchProgram"); launchProgram[device] = Item.InnerText; - if (launchprogram == true && launchProgram[device] != string.Empty) System.Diagnostics.Process.Start(launchProgram[device]); } catch { launchProgram[device] = string.Empty; missingSetting = true; } + + if (launchprogram == true && launchProgram[device] != string.Empty) + { + string programPath = launchProgram[device]; + System.Diagnostics.Process[] localAll = System.Diagnostics.Process.GetProcesses(); + bool procFound = false; + for (int procInd = 0, procsLen = localAll.Length; !procFound && procInd < procsLen; procInd++) + { + try + { + string temp = localAll[procInd].MainModule.FileName; + if (temp == programPath) + { + procFound = true; + } + } + // Ignore any process for which this information + // is not exposed + catch { } + } + + if (!procFound) + { + Task processTask = new Task(() => + { + System.Diagnostics.Process tempProcess = new System.Diagnostics.Process(); + tempProcess.StartInfo.FileName = programPath; + tempProcess.StartInfo.WorkingDirectory = new FileInfo(programPath).Directory.ToString(); + //tempProcess.StartInfo.UseShellExecute = false; + try { tempProcess.Start(); } + catch { } + }); + + processTask.Start(); + } + } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/DinputOnly"); - Boolean.TryParse(Item.InnerText, out dinputOnly[device]); - if (device < 4) - { - if (dinputOnly[device] == true) control.x360Bus.Unplug(device); - else if (control.DS4Controllers[device] != null && control.DS4Controllers[device].IsAlive()) control.x360Bus.Plugin(device); - } + bool.TryParse(Item.InnerText, out dinputOnly[device]); } catch { missingSetting = true; } + + Global.useDInputOnly[device] = dinputOnly[device]; + + // Only change xinput devices under certain conditions. Avoid + // performing this upon program startup before loading devices. + if (xinputChange) + { + bool changed = false; + if (device < 4) + { + DS4Device tempDevice = control.DS4Controllers[device]; + if (dinputOnly[device] == true) + { + bool xinputResult = control.x360Bus.Unplug(device); + if (xinputResult) + { + int xinputIndex = control.x360Bus.FirstController + device; + Log.LogToGui("X360 Controller # " + xinputIndex + " unplugged", false); + Global.useDInputOnly[device] = false; + } + + changed = true; + } + else if (tempDevice != null && tempDevice.IsAlive()) + { + bool xinputResult = control.x360Bus.Plugin(device); + if (xinputResult) + { + int xinputIndex = control.x360Bus.FirstController + device; + Log.LogToGui("X360 Controller # " + xinputIndex + " connected", false); + Global.useDInputOnly[device] = true; + } + + changed = true; + } + } + + if (changed) + { + System.Threading.Thread.Sleep(Global.XINPUT_UNPLUG_SETTLE_TIME); + } + } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/StartTouchpadOff"); @@ -1468,13 +2104,34 @@ namespace DS4Windows Item = m_Xdoc.SelectSingleNode("/" + rootname + "/ProfileActions"); profileActions[device].Clear(); if (!string.IsNullOrEmpty(Item.InnerText)) - profileActions[device].AddRange(Item.InnerText.Split('/')); + { + string[] actionNames = Item.InnerText.Split('/'); + for (int actIndex = 0, actLen = actionNames.Length; actIndex < actLen; actIndex++) + { + string tempActionName = actionNames[actIndex]; + if (!profileActions[device].Contains(tempActionName)) + { + profileActions[device].Add(tempActionName); + } + } + } } catch { profileActions[device].Clear(); missingSetting = true; } foreach (DS4ControlSettings dcs in ds4settings[device]) dcs.Reset(); + containsCustomAction[device] = false; + containsCustomExtras[device] = false; + profileActionCount[device] = profileActions[device].Count; + profileActionDict[device].Clear(); + profileActionIndexDict[device].Clear(); + foreach (string actionname in profileActions[device]) + { + profileActionDict[device][actionname] = Global.GetAction(actionname); + profileActionIndexDict[device][actionname] = Global.GetActionIndexOf(actionname); + } + DS4KeyType keyType; ushort wvk; @@ -1648,6 +2305,8 @@ namespace DS4Windows if (missingSetting && Loaded)// && buttons != null) SaveProfile(device, profilepath); + containsCustomAction[device] = HasCustomActions(device); + containsCustomExtras[device] = HasCustomExtras(device); return Loaded; } @@ -1784,13 +2443,37 @@ namespace DS4Windows catch { missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/Profile/formHeight"); Int32.TryParse(Item.InnerText, out formHeight); } catch { missingSetting = true; } - try { Item = m_Xdoc.SelectSingleNode("/Profile/Controller1"); profilePath[0] = Item.InnerText; } + try { + Item = m_Xdoc.SelectSingleNode("/Profile/Controller1"); profilePath[0] = Item.InnerText; + if (profilePath[0].ToLower().Contains("distance")) + { + distanceProfiles[0] = true; + } + } catch { missingSetting = true; } - try { Item = m_Xdoc.SelectSingleNode("/Profile/Controller2"); profilePath[1] = Item.InnerText; } + try { + Item = m_Xdoc.SelectSingleNode("/Profile/Controller2"); profilePath[1] = Item.InnerText; + if (profilePath[1].ToLower().Contains("distance")) + { + distanceProfiles[1] = true; + } + } catch { missingSetting = true; } - try { Item = m_Xdoc.SelectSingleNode("/Profile/Controller3"); profilePath[2] = Item.InnerText; } + try { + Item = m_Xdoc.SelectSingleNode("/Profile/Controller3"); profilePath[2] = Item.InnerText; + if (profilePath[2].ToLower().Contains("distance")) + { + distanceProfiles[2] = true; + } + } catch { missingSetting = true; } - try { Item = m_Xdoc.SelectSingleNode("/Profile/Controller4"); profilePath[3] = Item.InnerText; } + try { + Item = m_Xdoc.SelectSingleNode("/Profile/Controller4"); profilePath[3] = Item.InnerText; + if (profilePath[3].ToLower().Contains("distance")) + { + distanceProfiles[3] = true; + } + } catch { missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/Profile/LastChecked"); DateTime.TryParse(Item.InnerText, out lastChecked); } catch { missingSetting = true; } @@ -2100,7 +2783,6 @@ namespace DS4Windows catch { saved = false; } return saved; } - public void UpdateDS4CSetting(int deviceNum, string buttonName, bool shift, object action, string exts, DS4KeyType kt, int trigger = 0) { @@ -2109,12 +2791,18 @@ namespace DS4Windows dc = getDS4ControlsByName(buttonName); else dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true); - foreach (DS4ControlSettings dcs in ds4settings[deviceNum]) + + //foreach (DS4ControlSettings dcs in ds4settings[deviceNum]) + List ds4settingsList = ds4settings[deviceNum]; + for (int i = 0, settingsLen = ds4settingsList.Count; i < settingsLen; i++) + { + DS4ControlSettings dcs = ds4settingsList[i]; if (dcs.control == dc) { dcs.UpdateSettings(shift, action, exts, kt, trigger); break; } + } } public void UpdateDS4CExtra(int deviceNum, string buttonName, bool shift, string exts) @@ -2124,15 +2812,22 @@ namespace DS4Windows dc = getDS4ControlsByName(buttonName); else dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true); - foreach (DS4ControlSettings dcs in ds4settings[deviceNum]) + + //foreach (DS4ControlSettings dcs in ds4settings[deviceNum]) + List ds4settingsList = ds4settings[deviceNum]; + for (int i = 0, settingsLen = ds4settingsList.Count; i < settingsLen; i++) + { + DS4ControlSettings dcs = ds4settingsList[i]; if (dcs.control == dc) { if (shift) dcs.shiftExtras = exts; else dcs.extras = exts; + break; } + } } private void UpdateDS4CKeyType(int deviceNum, string buttonName, bool shift, DS4KeyType keyType) @@ -2142,15 +2837,22 @@ namespace DS4Windows dc = getDS4ControlsByName(buttonName); else dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true); - foreach (DS4ControlSettings dcs in ds4settings[deviceNum]) + + //foreach (DS4ControlSettings dcs in ds4settings[deviceNum]) + List ds4settingsList = ds4settings[deviceNum]; + for (int i = 0, settingsLen = ds4settingsList.Count; i < settingsLen; i++) + { + DS4ControlSettings dcs = ds4settingsList[i]; if (dcs.control == dc) { if (shift) dcs.shiftKeyType = keyType; else dcs.keyType = keyType; + break; } + } } public object GetDS4Action(int deviceNum, string buttonName, bool shift) @@ -2160,7 +2862,12 @@ namespace DS4Windows dc = getDS4ControlsByName(buttonName); else dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true); - foreach (DS4ControlSettings dcs in ds4settings[deviceNum]) + + //foreach (DS4ControlSettings dcs in ds4settings[deviceNum]) + List ds4settingsList = ds4settings[deviceNum]; + for (int i = 0, settingsLen = ds4settingsList.Count; i < settingsLen; i++) + { + DS4ControlSettings dcs = ds4settingsList[i]; if (dcs.control == dc) { if (shift) @@ -2168,6 +2875,28 @@ namespace DS4Windows else return dcs.action; } + } + + return null; + } + + public object GetDS4Action(int deviceNum, DS4Controls dc, bool shift) + { + int temp = (int)dc; + if (temp > 0) + { + int index = temp - 1; + DS4ControlSettings dcs = ds4settings[deviceNum][index]; + if (shift) + { + return dcs.shiftTrigger; + } + else + { + return dcs.action; + } + } + return null; } @@ -2178,7 +2907,12 @@ namespace DS4Windows dc = getDS4ControlsByName(buttonName); else dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true); - foreach (DS4ControlSettings dcs in ds4settings[deviceNum]) + + //foreach (DS4ControlSettings dcs in ds4settings[deviceNum]) + List ds4settingsList = ds4settings[deviceNum]; + for (int i = 0, settingsLen = ds4settingsList.Count; i < settingsLen; i++) + { + DS4ControlSettings dcs = ds4settingsList[i]; if (dcs.control == dc) { if (shift) @@ -2186,6 +2920,8 @@ namespace DS4Windows else return dcs.extras; } + } + return null; } @@ -2196,7 +2932,12 @@ namespace DS4Windows dc = getDS4ControlsByName(buttonName); else dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true); - foreach (DS4ControlSettings dcs in ds4settings[deviceNum]) + + //foreach (DS4ControlSettings dcs in ds4settings[deviceNum]) + List ds4settingsList = ds4settings[deviceNum]; + for (int i = 0, settingsLen = ds4settingsList.Count; i < settingsLen; i++) + { + DS4ControlSettings dcs = ds4settingsList[i]; if (dcs.control == dc) { if (shift) @@ -2204,6 +2945,8 @@ namespace DS4Windows else return dcs.keyType; } + } + return DS4KeyType.None; } @@ -2214,9 +2957,29 @@ namespace DS4Windows dc = getDS4ControlsByName(buttonName); else dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true); - foreach (DS4ControlSettings dcs in ds4settings[deviceNum]) + + //foreach (DS4ControlSettings dcs in ds4settings[deviceNum]) + List ds4settingsList = ds4settings[deviceNum]; + for (int i = 0, settingsLen = ds4settingsList.Count; i < settingsLen; i++) + { + DS4ControlSettings dcs = ds4settingsList[i]; if (dcs.control == dc) - return dcs.shiftTrigger; + return dcs.shiftTrigger; + } + + return 0; + } + + public int GetDS4STrigger(int deviceNum, DS4Controls dc) + { + int temp = (int)dc; + if (temp > 0) + { + int index = temp - 1; + DS4ControlSettings dcs = ds4settings[deviceNum][index]; + return dcs.shiftTrigger; + } + return 0; } @@ -2227,35 +2990,70 @@ namespace DS4Windows dc = getDS4ControlsByName(buttonName); else dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true); - foreach (DS4ControlSettings dcs in ds4settings[deviceNum]) + + //foreach (DS4ControlSettings dcs in ds4settings[deviceNum]) + List ds4settingsList = ds4settings[deviceNum]; + for (int i = 0, settingsLen = ds4settingsList.Count; i < settingsLen; i++) + { + DS4ControlSettings dcs = ds4settingsList[i]; if (dcs.control == dc) return dcs; + } + + return null; + } + + public DS4ControlSettings getDS4CSetting(int deviceNum, DS4Controls dc) + { + int temp = (int)dc; + if (temp > 0) + { + int index = temp - 1; + DS4ControlSettings dcs = ds4settings[deviceNum][index]; + return dcs; + } + return null; } public bool HasCustomActions(int deviceNum) { - foreach (DS4ControlSettings dcs in ds4settings[deviceNum]) + //foreach (DS4ControlSettings dcs in ds4settings[deviceNum]) + List ds4settingsList = ds4settings[deviceNum]; + for (int i = 0, settingsLen = ds4settingsList.Count; i < settingsLen; i++) + { + DS4ControlSettings dcs = ds4settingsList[i]; if (dcs.action != null || dcs.shiftAction != null) return true; + } + return false; } public bool HasCustomExtras(int deviceNum) { - foreach (DS4ControlSettings dcs in ds4settings[deviceNum]) + //foreach (DS4ControlSettings dcs in ds4settings[deviceNum]) + List ds4settingsList = ds4settings[deviceNum]; + for (int i = 0, settingsLen = ds4settingsList.Count; i < settingsLen; i++) + { + DS4ControlSettings dcs = ds4settingsList[i]; if (dcs.extras != null || dcs.shiftExtras != null) return true; + } + return false; } } public class SpecialAction { + public enum ActionTypeId { None, Key, Program, Profile, Macro, DisconnectBT, BatteryCheck, MultiAction, XboxGameDVR } + public string name; public List trigger = new List(); public string type; + public ActionTypeId typeID; public string controls; public List macro = new List(); public string details; @@ -2269,25 +3067,16 @@ namespace DS4Windows { this.name = name; this.type = type; + this.typeID = ActionTypeId.None; this.controls = controls; delayTime = delay; string[] ctrls = controls.Split('/'); foreach (string s in ctrls) trigger.Add(getDS4ControlsByName(s)); - if (type == "Macro") - { - string[] macs = details.Split('/'); - foreach (string s in macs) - { - int v; - if (int.TryParse(s, out v)) - macro.Add(v); - } - if (extras.Contains("Scan Code")) - keyType |= DS4KeyType.ScanCode; - } - else if (type == "Key") + + if (type == "Key") { + typeID = ActionTypeId.Key; this.details = details.Split(' ')[0]; if (!string.IsNullOrEmpty(extras)) { @@ -2303,12 +3092,51 @@ namespace DS4Windows } else if (type == "Program") { + typeID = ActionTypeId.Program; this.details = details; if (extras != string.Empty) extra = extras; } + else if (type == "Profile") + { + typeID = ActionTypeId.Profile; + this.details = details; + if (extras != string.Empty) + { + extra = extras; + } + } + else if (type == "Macro") + { + typeID = ActionTypeId.Macro; + string[] macs = details.Split('/'); + foreach (string s in macs) + { + int v; + if (int.TryParse(s, out v)) + macro.Add(v); + } + if (extras.Contains("Scan Code")) + keyType |= DS4KeyType.ScanCode; + } + else if (type == "DisconnectBT") + { + typeID = ActionTypeId.DisconnectBT; + } + else if (type == "BatteryCheck") + { + typeID = ActionTypeId.BatteryCheck; + string[] dets = details.Split('|'); + this.details = string.Join(",", dets); + } + else if (type == "MultiAction") + { + typeID = ActionTypeId.MultiAction; + this.details = details; + } else if (type == "XboxGameDVR") { + this.typeID = ActionTypeId.XboxGameDVR; string[] dets = details.Split(','); List macros = new List(); //string dets = ""; diff --git a/DS4Windows/DS4Control/X360Device.cs b/DS4Windows/DS4Control/X360Device.cs index 7a0fda1..2d000f2 100644 --- a/DS4Windows/DS4Control/X360Device.cs +++ b/DS4Windows/DS4Control/X360Device.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.ComponentModel; -using System.Windows.Forms; using System.Runtime.InteropServices; using Microsoft.Win32.SafeHandles; @@ -12,6 +11,9 @@ namespace DS4Windows { private const String DS3_BUS_CLASS_GUID = "{F679F562-3164-42CE-A4DB-E7DDBE723909}"; private const int CONTROLLER_OFFSET = 1; // Device 0 is the virtual USB hub itself, and we leave devices 1-10 available for other software (like the Scarlet.Crush DualShock driver itself) + private const int inputResolution = 127 - (-128); + private const float reciprocalInputResolution = 1 / (float)inputResolution; + private const int outputResolution = 32767 - (-32768); private int firstController = 1; // Device 0 is the virtual USB hub itself, and we can leave more available for other software (like the Scarlet.Crush DualShock driver) @@ -25,10 +27,11 @@ namespace DS4Windows { Value -= 0x80; - if (Value == -128) Value = -127; - if (Flip) Value *= -1; + //float temp = (Value - (-128)) / (float)inputResolution; + float temp = (Value - (-128)) * reciprocalInputResolution; + if (Flip) temp = (temp - 0.5f) * -1.0f + 0.5f; - return (Int32)((float)Value * 258.00787401574803149606299212599f); + return (Int32)(temp * outputResolution + (-32768)); } @@ -105,10 +108,11 @@ namespace DS4Windows Output[4] = (Byte)(device + firstController); Output[9] = 0x14; - for (int i = 10; i < Output.Length; i++) + for (int i = 10, outLen = Output.Length; i < outLen; i++) { Output[i] = 0; } + if (state.Share) Output[10] |= (Byte)(1 << 5); // Back if (state.L3) Output[10] |= (Byte)(1 << 6); // Left Thumb if (state.R3) Output[10] |= (Byte)(1 << 7); // Right Thumb @@ -133,9 +137,9 @@ namespace DS4Windows Output[13] = state.R2; // Right Trigger Int32 ThumbLX = Scale(state.LX, false); - Int32 ThumbLY = -Scale(state.LY, false); + Int32 ThumbLY = Scale(state.LY, true); Int32 ThumbRX = Scale(state.RX, false); - Int32 ThumbRY = -Scale(state.RY, false); + Int32 ThumbRY = Scale(state.RY, true); Output[14] = (Byte)((ThumbLX >> 0) & 0xFF); // LX Output[15] = (Byte)((ThumbLX >> 8) & 0xFF); Output[16] = (Byte)((ThumbLY >> 0) & 0xFF); // LY diff --git a/DS4Windows/DS4Forms/AdvancedColorDialog.cs b/DS4Windows/DS4Forms/AdvancedColorDialog.cs index 8e2b313..0e47bd1 100644 --- a/DS4Windows/DS4Forms/AdvancedColorDialog.cs +++ b/DS4Windows/DS4Forms/AdvancedColorDialog.cs @@ -19,26 +19,26 @@ namespace DS4Windows internal class WindowsEnumerator { private delegate int EnumCallBackDelegate(IntPtr hwnd, int lParam); - [DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] + [DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] private static extern int EnumWindows(EnumCallBackDelegate lpEnumFunc, int lParam); - [DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] + [DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] private static extern int EnumChildWindows(IntPtr hWndParent, EnumCallBackDelegate lpEnumFunc, int lParam); + [DllImport("user32", EntryPoint = "GetClassNameA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] - private static extern int GetClassName(IntPtr hwnd, System.Text.StringBuilder lpClassName, int nMaxCount); - [DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] + [DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] private static extern int IsWindowVisible(IntPtr hwnd); + [DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] - private static extern int GetParent(IntPtr hwnd); - [DllImport("user32", EntryPoint = "SendMessageA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] + [DllImport("user32", EntryPoint = "SendMessageA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] private static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam); - [DllImport("user32", EntryPoint = "SendMessageA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] + [DllImport("user32", EntryPoint = "SendMessageA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] private static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, System.Text.StringBuilder lParam); private List _listChildren = new List(); diff --git a/DS4Windows/DS4Forms/DS4Form.Designer.cs b/DS4Windows/DS4Forms/DS4Form.Designer.cs index 7135a85..12517ee 100644 --- a/DS4Windows/DS4Forms/DS4Form.Designer.cs +++ b/DS4Windows/DS4Forms/DS4Form.Designer.cs @@ -118,6 +118,11 @@ this.hideDS4CheckBox = new System.Windows.Forms.CheckBox(); this.cBSwipeProfiles = new System.Windows.Forms.CheckBox(); this.StartWindowsCheckBox = new System.Windows.Forms.CheckBox(); + this.runStartupPanel = new System.Windows.Forms.Panel(); + this.uacPictureBox = new System.Windows.Forms.PictureBox(); + this.runStartTaskRadio = new System.Windows.Forms.RadioButton(); + this.label1 = new System.Windows.Forms.Label(); + this.runStartProgRadio = new System.Windows.Forms.RadioButton(); this.startMinimizedCheckBox = new System.Windows.Forms.CheckBox(); this.panel1 = new System.Windows.Forms.Panel(); this.lbNotifications = new System.Windows.Forms.Label(); @@ -129,6 +134,7 @@ this.cBFlashWhenLate = new System.Windows.Forms.CheckBox(); this.cBCloseMini = new System.Windows.Forms.CheckBox(); this.cBQuickCharge = new System.Windows.Forms.CheckBox(); + this.cBUseWhiteIcon = new System.Windows.Forms.CheckBox(); this.cBDownloadLangauge = new System.Windows.Forms.CheckBox(); this.cBUpdate = new System.Windows.Forms.CheckBox(); this.pNUpdate = new System.Windows.Forms.Panel(); @@ -139,7 +145,6 @@ this.lbUseXIPorts = new System.Windows.Forms.Label(); this.nUDXIPorts = new System.Windows.Forms.NumericUpDown(); this.lbLastXIPort = new System.Windows.Forms.Label(); - this.cBUseWhiteIcon = new System.Windows.Forms.CheckBox(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.linkProfiles = new System.Windows.Forms.LinkLabel(); this.lnkControllers = new System.Windows.Forms.LinkLabel(); @@ -168,6 +173,8 @@ this.toolStrip1.SuspendLayout(); this.tabSettings.SuspendLayout(); this.fLPSettings.SuspendLayout(); + this.runStartupPanel.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.uacPictureBox)).BeginInit(); this.panel1.SuspendLayout(); this.panel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nUDLatency)).BeginInit(); @@ -632,8 +639,8 @@ this.lBProfiles.ContextMenuStrip = this.cMProfile; resources.ApplyResources(this.lBProfiles, "lBProfiles"); this.lBProfiles.FormattingEnabled = true; - this.lBProfiles.MultiColumn = true; this.lBProfiles.Name = "lBProfiles"; + this.lBProfiles.SelectedIndexChanged += new System.EventHandler(this.lBProfiles_SelectedIndexChanged); this.lBProfiles.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lBProfiles_KeyDown); this.lBProfiles.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lBProfiles_MouseDoubleClick); this.lBProfiles.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lBProfiles_MouseDown); @@ -795,36 +802,36 @@ // // tsBEditProfile // - this.tsBEditProfile.Image = global::DS4Windows.Properties.Resources.edit; resources.ApplyResources(this.tsBEditProfile, "tsBEditProfile"); + this.tsBEditProfile.Image = global::DS4Windows.Properties.Resources.edit; this.tsBEditProfile.Name = "tsBEditProfile"; this.tsBEditProfile.Click += new System.EventHandler(this.tsBNEditProfile_Click); // // tsBDeleteProfile // - this.tsBDeleteProfile.Image = global::DS4Windows.Properties.Resources.delete; resources.ApplyResources(this.tsBDeleteProfile, "tsBDeleteProfile"); + this.tsBDeleteProfile.Image = global::DS4Windows.Properties.Resources.delete; this.tsBDeleteProfile.Name = "tsBDeleteProfile"; this.tsBDeleteProfile.Click += new System.EventHandler(this.tsBDeleteProfle_Click); // // tSBDupProfile // - this.tSBDupProfile.Image = global::DS4Windows.Properties.Resources.copy; resources.ApplyResources(this.tSBDupProfile, "tSBDupProfile"); + this.tSBDupProfile.Image = global::DS4Windows.Properties.Resources.copy; this.tSBDupProfile.Name = "tSBDupProfile"; this.tSBDupProfile.Click += new System.EventHandler(this.tSBDupProfile_Click); // // tSBImportProfile // - this.tSBImportProfile.Image = global::DS4Windows.Properties.Resources.import; resources.ApplyResources(this.tSBImportProfile, "tSBImportProfile"); + this.tSBImportProfile.Image = global::DS4Windows.Properties.Resources.import; this.tSBImportProfile.Name = "tSBImportProfile"; this.tSBImportProfile.Click += new System.EventHandler(this.tSBImportProfile_Click); // // tSBExportProfile // - this.tSBExportProfile.Image = global::DS4Windows.Properties.Resources.export; resources.ApplyResources(this.tSBExportProfile, "tSBExportProfile"); + this.tSBExportProfile.Image = global::DS4Windows.Properties.Resources.export; this.tSBExportProfile.Name = "tSBExportProfile"; this.tSBExportProfile.Click += new System.EventHandler(this.tSBExportProfile_Click); // @@ -847,6 +854,7 @@ this.fLPSettings.Controls.Add(this.hideDS4CheckBox); this.fLPSettings.Controls.Add(this.cBSwipeProfiles); this.fLPSettings.Controls.Add(this.StartWindowsCheckBox); + this.fLPSettings.Controls.Add(this.runStartupPanel); this.fLPSettings.Controls.Add(this.startMinimizedCheckBox); this.fLPSettings.Controls.Add(this.panel1); this.fLPSettings.Controls.Add(this.cBDisconnectBT); @@ -884,6 +892,44 @@ this.StartWindowsCheckBox.UseVisualStyleBackColor = true; this.StartWindowsCheckBox.CheckedChanged += new System.EventHandler(this.StartWindowsCheckBox_CheckedChanged); // + // runStartupPanel + // + this.runStartupPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.runStartupPanel.Controls.Add(this.uacPictureBox); + this.runStartupPanel.Controls.Add(this.runStartTaskRadio); + this.runStartupPanel.Controls.Add(this.label1); + this.runStartupPanel.Controls.Add(this.runStartProgRadio); + resources.ApplyResources(this.runStartupPanel, "runStartupPanel"); + this.runStartupPanel.Name = "runStartupPanel"; + // + // uacPictureBox + // + resources.ApplyResources(this.uacPictureBox, "uacPictureBox"); + this.uacPictureBox.Name = "uacPictureBox"; + this.uacPictureBox.TabStop = false; + // + // runStartTaskRadio + // + resources.ApplyResources(this.runStartTaskRadio, "runStartTaskRadio"); + this.runStartTaskRadio.Name = "runStartTaskRadio"; + this.runStartTaskRadio.TabStop = true; + this.runStartTaskRadio.UseVisualStyleBackColor = true; + this.runStartTaskRadio.Click += new System.EventHandler(this.runStartTaskRadio_Click); + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // + // runStartProgRadio + // + resources.ApplyResources(this.runStartProgRadio, "runStartProgRadio"); + this.runStartProgRadio.Checked = true; + this.runStartProgRadio.Name = "runStartProgRadio"; + this.runStartProgRadio.TabStop = true; + this.runStartProgRadio.UseVisualStyleBackColor = true; + this.runStartProgRadio.Click += new System.EventHandler(this.runStartProgRadio_Click); + // // startMinimizedCheckBox // resources.ApplyResources(this.startMinimizedCheckBox, "startMinimizedCheckBox"); @@ -940,7 +986,7 @@ 0}); this.nUDLatency.Name = "nUDLatency"; this.nUDLatency.Value = new decimal(new int[] { - 10, + 20, 0, 0, 0}); @@ -974,6 +1020,13 @@ this.cBQuickCharge.UseVisualStyleBackColor = true; this.cBQuickCharge.CheckedChanged += new System.EventHandler(this.cBQuickCharge_CheckedChanged); // + // cBUseWhiteIcon + // + resources.ApplyResources(this.cBUseWhiteIcon, "cBUseWhiteIcon"); + this.cBUseWhiteIcon.Name = "cBUseWhiteIcon"; + this.cBUseWhiteIcon.UseVisualStyleBackColor = true; + this.cBUseWhiteIcon.CheckedChanged += new System.EventHandler(this.cBUseWhiteIcon_CheckedChanged); + // // cBDownloadLangauge // resources.ApplyResources(this.cBDownloadLangauge, "cBDownloadLangauge"); @@ -1068,13 +1121,6 @@ resources.ApplyResources(this.lbLastXIPort, "lbLastXIPort"); this.lbLastXIPort.Name = "lbLastXIPort"; // - // cBUseWhiteIcon - // - resources.ApplyResources(this.cBUseWhiteIcon, "cBUseWhiteIcon"); - this.cBUseWhiteIcon.Name = "cBUseWhiteIcon"; - this.cBUseWhiteIcon.UseVisualStyleBackColor = true; - this.cBUseWhiteIcon.CheckedChanged += new System.EventHandler(this.cBUseWhiteIcon_CheckedChanged); - // // flowLayoutPanel1 // resources.ApplyResources(this.flowLayoutPanel1, "flowLayoutPanel1"); @@ -1157,10 +1203,6 @@ resources.ApplyResources(this.useCustomColorToolStripMenuItem, "useCustomColorToolStripMenuItem"); this.useCustomColorToolStripMenuItem.Click += new System.EventHandler(this.useCustomColorToolStripMenuItem_Click); // - // advColorDialog - // - this.advColorDialog.OnUpdateColor += new DS4Windows.AdvancedColorDialog.ColorUpdateHandler(this.advColorDialog_OnUpdateColor); - // // DS4Form // this.AllowDrop = true; @@ -1196,6 +1238,9 @@ this.tabSettings.ResumeLayout(false); this.fLPSettings.ResumeLayout(false); this.fLPSettings.PerformLayout(); + this.runStartupPanel.ResumeLayout(false); + this.runStartupPanel.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.uacPictureBox)).EndInit(); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); this.panel2.ResumeLayout(false); @@ -1340,6 +1385,11 @@ private System.Windows.Forms.ToolStripMenuItem useCustomColorToolStripMenuItem; private AdvancedColorDialog advColorDialog; private System.Windows.Forms.CheckBox cBUseWhiteIcon; + private System.Windows.Forms.Panel runStartupPanel; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.RadioButton runStartProgRadio; + private System.Windows.Forms.RadioButton runStartTaskRadio; + private System.Windows.Forms.PictureBox uacPictureBox; //private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2; } } diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index c3f63a2..22a860c 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -14,13 +14,20 @@ using System.Text; using System.Globalization; using System.Threading.Tasks; using System.ServiceProcess; +using Microsoft.Win32.TaskScheduler; using static DS4Windows.Global; +using System.Security.Principal; + namespace DS4Windows { public partial class DS4Form : Form { public string[] arguements; delegate void LogDebugDelegate(DateTime Time, String Data, bool warning); + delegate void NotificationDelegate(object sender, DebugEventArgs args); + delegate void BatteryStatusDelegate(object sender, BatteryReportArgs args); + delegate void ControllerRemovedDelegate(object sender, ControllerRemovedArgs args); + delegate void DeviceStatusChangedDelegate(object sender, DeviceStatusChangeEventArgs args); protected Label[] Pads, Batteries; protected ComboBox[] cbs; protected Button[] ebns; @@ -28,7 +35,8 @@ namespace DS4Windows protected PictureBox[] statPB; protected ToolStripMenuItem[] shortcuts; WebClient wc = new WebClient(); - Timer test = new Timer(), hotkeysTimer = new Timer(); + Timer hotkeysTimer = new Timer(); + Timer autoProfilesTimer = new Timer(); string exepath = Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName; string appDataPpath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\DS4Windows"; string oldappdatapath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\DS4Tool"; @@ -49,10 +57,14 @@ namespace DS4Windows public bool mAllowVisible; bool contextclose; string logFile = appdatapath + @"\DS4Service.log"; - StreamWriter logWriter; + //StreamWriter logWriter; bool turnOffTemp; bool runningBat; //bool outputlog = false; + Dictionary hoverTextDict = new Dictionary(); + + internal const int BCM_FIRST = 0x1600; // Normal button + internal const int BCM_SETSHIELD = (BCM_FIRST + 0x000C); // Elevated button [DllImport("user32.dll")] private static extern IntPtr GetForegroundWindow(); @@ -60,6 +72,9 @@ namespace DS4Windows [DllImport("user32.dll")] private static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId); + [DllImport("user32.dll")] + private static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, uint lParam); + [DllImport("kernel32.dll")] private static extern IntPtr OpenProcess(uint dwDesiredAccess, bool bInheritHandle, uint dwProcessId); @@ -75,6 +90,9 @@ namespace DS4Windows public DS4Form(string[] args) { InitializeComponent(); + + this.StartWindowsCheckBox.CheckedChanged -= this.StartWindowsCheckBox_CheckedChanged; + saveProfiles.Filter = Properties.Resources.XMLFiles + "|*.xml"; openProfiles.Filter = Properties.Resources.XMLFiles + "|*.xml"; arguements = args; @@ -125,6 +143,7 @@ namespace DS4Windows firstrun = true; new SaveWhere(false).ShowDialog(); } + if (firstrun) CheckDrivers(); else @@ -139,6 +158,7 @@ namespace DS4Windows Close(); return; } + Graphics g = this.CreateGraphics(); try { @@ -149,6 +169,9 @@ namespace DS4Windows { g.Dispose(); } + + blankControllerTab(); + Program.rootHub.Debug += On_Debug; Log.GuiLog += On_Debug; @@ -160,6 +183,7 @@ namespace DS4Windows Directory.CreateDirectory(appdatapath); Global.Load(); if (!Save()) //if can't write to file + { if (MessageBox.Show("Cannot write at current location\nCopy Settings to appdata?", "DS4Windows", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Yes) { @@ -187,12 +211,15 @@ namespace DS4Windows Close(); return; } + } + //MessageBox.Show(Environment.OSVersion.VersionString); cBUseWhiteIcon.Checked = UseWhiteIcon; Icon = Properties.Resources.DS4W; notifyIcon1.Icon = UseWhiteIcon ? Properties.Resources.DS4W___White : Properties.Resources.DS4W; foreach (ToolStripMenuItem t in shortcuts) t.DropDownItemClicked += Profile_Changed_Menu; + hideDS4CheckBox.CheckedChanged -= hideDS4CheckBox_CheckedChanged; hideDS4CheckBox.Checked = UseExclusiveMode; hideDS4CheckBox.CheckedChanged += hideDS4CheckBox_CheckedChanged; @@ -204,6 +231,7 @@ namespace DS4Windows } else btnConnectDS4Win10.Visible = false; + cBDisconnectBT.Checked = DCBTatStop; cBQuickCharge.Checked = QuickCharge; nUDXIPorts.Value = FirstXinputPort; @@ -218,6 +246,7 @@ namespace DS4Windows string lang = CultureInfo.CurrentCulture.ToString(); if (lang.StartsWith("en")) cBDownloadLangauge.Visible = false; + cBDownloadLangauge.Checked = DownloadLang; cBFlashWhenLate.Checked = FlashWhenLate; nUDLatency.Value = FlashWhenLateAt; @@ -251,9 +280,10 @@ namespace DS4Windows } catch { } } + bool start = true; bool mini = false; - for (int i = 0; i < arguements.Length; i++) + for (int i = 0, argslen = arguements.Length; i < argslen; i++) { if (arguements[i] == "-stop") start = false; @@ -262,11 +292,13 @@ namespace DS4Windows if (mini && start) break; } + if (!(startMinimizedCheckBox.Checked || mini)) { mAllowVisible = true; Show(); } + Form_Resize(null, null); RefreshProfiles(); opt = new Options(this); @@ -276,27 +308,43 @@ namespace DS4Windows opt.Dock = DockStyle.Fill; opt.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; tabProfiles.Controls.Add(opt); - NewVersion(); + //NewVersion(); for (int i = 0; i < 4; i++) { - LoadProfile(i, true, Program.rootHub); + LoadProfile(i, false, Program.rootHub, false); if (UseCustomLed[i]) lights[i].BackColor = CustomColor[i].ToColorA; else lights[i].BackColor = MainColor[i].ToColorA; } + + autoProfilesTimer.Tick += CheckAutoProfiles; + autoProfilesTimer.Interval = 1000; + LoadP(); Global.ControllerStatusChange += ControllerStatusChange; + Global.BatteryStatusChange += BatteryStatusUpdate; + Global.ControllerRemoved += ControllerRemovedChange; + Global.DeviceStatusChange += DeviceStatusChanged; Enable_Controls(0, false); Enable_Controls(1, false); Enable_Controls(2, false); Enable_Controls(3, false); btnStartStop.Text = Properties.Resources.StartText; + + hotkeysTimer.Tick += Hotkeys; + if (SwipeProfiles) + { + hotkeysTimer.Start(); + } + if (btnStartStop.Enabled && start) btnStartStop_Clicked(); + startToolStripMenuItem.Text = btnStartStop.Text; - if (!tLPControllers.Visible) - tabMain.SelectedIndex = 1; + //if (!tLPControllers.Visible) + // tabMain.SelectedIndex = 1; + //cBNotifications.Checked = Notifications; cBoxNotifications.SelectedIndex = Notifications; cBSwipeProfiles.Checked = SwipeProfiles; @@ -312,8 +360,8 @@ namespace DS4Windows cBUpdateTime.SelectedIndex = 0; nUDUpdateTime.Value = checkwhen; } - Uri url = new Uri("http://ds4windows.com/Files/Builds/newest.txt"); //Sorry other devs, gonna have to find your own server + Uri url = new Uri("http://23.236.26.40/ds4windows/files/builds/newest.txt"); //Sorry other devs, gonna have to find your own server if (checkwhen > 0 && DateTime.Now >= LastChecked + TimeSpan.FromHours(checkwhen)) { @@ -327,23 +375,106 @@ namespace DS4Windows System.Threading.Thread.Sleep(2000); File.Delete(exepath + "\\Updater.exe"); } - //test.Start(); - hotkeysTimer.Start(); - hotkeysTimer.Tick += Hotkeys; - test.Tick += test_Tick; + if (!Directory.Exists(appdatapath + "\\Virtual Bus Driver")) linkUninstall.Visible = false; + + bool isElevated = Global.IsAdministrator(); + if (!isElevated) + { + Image tempImg = new Bitmap(uacPictureBox.Width, uacPictureBox.Height); + AddUACShieldToImage(tempImg); + uacPictureBox.BackgroundImage = tempImg; + uacPictureBox.Visible = true; + new ToolTip().SetToolTip(uacPictureBox, Properties.Resources.UACTask); + runStartTaskRadio.Enabled = false; + } + else + { + runStartTaskRadio.Enabled = true; + } + if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\DS4Windows.lnk")) { StartWindowsCheckBox.Checked = true; + runStartupPanel.Visible = true; + string lnkpath = WinProgs.ResolveShortcutAndArgument(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\DS4Windows.lnk"); - if (!lnkpath.EndsWith("-m")) + string onlylnkpath = WinProgs.ResolveShortcut(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\DS4Windows.lnk"); + if (!lnkpath.EndsWith("-runtask")) + { + runStartProgRadio.Checked = true; + } + else + { + runStartTaskRadio.Checked = true; + } + + if (onlylnkpath != Process.GetCurrentProcess().MainModule.FileName) { File.Delete(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\DS4Windows.lnk"); appShortcutToStartup(); + changeStartupRoutine(); } } + UpdateTheUpdater(); + + this.StartWindowsCheckBox.CheckedChanged += new System.EventHandler(this.StartWindowsCheckBox_CheckedChanged); + new ToolTip().SetToolTip(StartWindowsCheckBox, Properties.Resources.RunAtStartup); + + populateHoverTextDict(); + } + + private void populateHoverTextDict() + { + hoverTextDict.Clear(); + hoverTextDict[linkUninstall] = Properties.Resources.IfRemovingDS4Windows; + hoverTextDict[cBSwipeProfiles] = Properties.Resources.TwoFingerSwipe; + hoverTextDict[cBQuickCharge] = Properties.Resources.QuickCharge; + hoverTextDict[pnlXIPorts] = Properties.Resources.XinputPorts; + hoverTextDict[lbUseXIPorts] = Properties.Resources.XinputPorts; + hoverTextDict[nUDXIPorts] = Properties.Resources.XinputPorts; + hoverTextDict[lbLastXIPort] = Properties.Resources.XinputPorts; + hoverTextDict[cBCloseMini] = Properties.Resources.CloseMinimize; + hoverTextDict[uacPictureBox] = Properties.Resources.UACTask; + hoverTextDict[StartWindowsCheckBox] = Properties.Resources.RunAtStartup; + } + + private Image AddUACShieldToImage(Image image) + { + Bitmap shield = SystemIcons.Shield.ToBitmap(); + shield.MakeTransparent(); + + Graphics g = Graphics.FromImage(image); + g.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver; + double aspectRatio = shield.Width / (double)shield.Height; + int finalWidth = Convert.ToInt32(image.Height * aspectRatio); + int finalHeight = Convert.ToInt32(image.Width / aspectRatio); + g.DrawImage(shield, new Rectangle(0, 0, finalWidth, finalHeight)); + + return image; + } + + private void blankControllerTab() + { + bool nocontrollers = true; + for (Int32 Index = 0, PadsLen = Pads.Length; Index < PadsLen; Index++) + { + // Make sure a controller exists + if (Index < ControlService.DS4_CONTROLLER_COUNT) + { + Pads[Index].Text = ""; + + statPB[Index].Visible = false; toolTip1.SetToolTip(statPB[Index], ""); + Batteries[Index].Text = Properties.Resources.NA; + Pads[Index].Text = Properties.Resources.Disconnected; + Enable_Controls(Index, false); + } + } + + lbNoControllers.Visible = nocontrollers; + tLPControllers.Visible = !nocontrollers; } private async void UpdateTheUpdater() @@ -353,7 +484,7 @@ namespace DS4Windows Process[] processes = Process.GetProcessesByName("DS4Updater"); while (processes.Length > 0) { - await Task.Delay(500); + await System.Threading.Tasks.Task.Delay(500); } File.Delete(exepath + "\\DS4Updater.exe"); File.Move(exepath + "\\Update Files\\DS4Updater.exe", exepath + "\\DS4Updater.exe"); @@ -361,7 +492,8 @@ namespace DS4Windows } } - void NewVersion() + /* TODO: Possibly remove */ + /*void NewVersion() { if (File.Exists(exepath + "\\1.4.22.ds4w")) { @@ -407,6 +539,7 @@ namespace DS4Windows File.Delete(exepath + "\\1.4.22.ds4w"); } } + */ protected override void SetVisibleCore(bool value) { @@ -415,6 +548,7 @@ namespace DS4Windows value = false; if (!this.IsHandleCreated) CreateHandle(); } + base.SetVisibleCore(value); } @@ -445,6 +579,7 @@ namespace DS4Windows switch (e.Mode) { case PowerModes.Resume: + { if (btnStartStop.Text == Properties.Resources.StartText && wasrunning) { DS4LightBar.shuttingdown = false; @@ -452,7 +587,9 @@ namespace DS4Windows btnStartStop_Clicked(); } break; + } case PowerModes.Suspend: + { if (btnStartStop.Text == Properties.Resources.StopText) { DS4LightBar.shuttingdown = true; @@ -460,48 +597,67 @@ namespace DS4Windows wasrunning = true; } break; + } + default: break; } } - private void test_Tick(object sender, EventArgs e) - { - //testing values - lbTest.Visible = true; - lbTest.Text = ((int)(Program.rootHub.ExposedState[0].AccelX * 2) / 2f).ToString(); - } void Hotkeys(object sender, EventArgs e) { if (SwipeProfiles) + { for (int i = 0; i < 4; i++) { string slide = Program.rootHub.TouchpadSlide(i); if (slide == "left") + { if (cbs[i].SelectedIndex <= 0) cbs[i].SelectedIndex = cbs[i].Items.Count - 2; else cbs[i].SelectedIndex--; + + } else if (slide == "right") + { if (cbs[i].SelectedIndex == cbs[i].Items.Count - 2) cbs[i].SelectedIndex = 0; else cbs[i].SelectedIndex++; + } + if (slide.Contains("t")) ShowNotification(this, Properties.Resources.UsingProfile.Replace("*number*", (i + 1).ToString()).Replace("*Profile name*", cbs[i].Text)); } + } + if (bat != null && bat.HasExited && runningBat) + { + Process.Start("explorer.exe"); + bat = null; + runningBat = false; + } + } + + private void CheckAutoProfiles(object sender, EventArgs e) + { //Check for process for auto profiles if (tempProfileProgram == "null") - for (int i = 0; i < programpaths.Count; i++) + { + string windowName = GetTopWindowName().ToLower().Replace('/', '\\'); + for (int i = 0, pathsLen = programpaths.Count; i < pathsLen; i++) { string name = programpaths[i].ToLower().Replace('/', '\\'); - if (name == GetTopWindowName().ToLower().Replace('/', '\\')) + if (name == windowName) { for (int j = 0; j < 4; j++) + { if (proprofiles[j][i] != "(none)" && proprofiles[j][i] != Properties.Resources.noneProfile) { LoadTempProfile(j, proprofiles[j][i], true, Program.rootHub); //j is controller index, i is filename if (LaunchProgram[j] != string.Empty) Process.Start(LaunchProgram[j]); } + } + if (turnOffTempProfiles[i]) { turnOffTemp = true; @@ -509,20 +665,25 @@ namespace DS4Windows { btnStartStop_Clicked(); hotkeysTimer.Start(); + autoProfilesTimer.Start(); btnStartStop.Text = Properties.Resources.StartText; } } + tempProfileProgram = name; break; } } + } else { - if (tempProfileProgram != GetTopWindowName().ToLower().Replace('/', '\\')) + string windowName = GetTopWindowName().ToLower().Replace('/', '\\'); + if (tempProfileProgram != windowName) { tempProfileProgram = "null"; for (int j = 0; j < 4; j++) LoadProfile(j, false, Program.rootHub); + if (turnOffTemp) { turnOffTemp = false; @@ -534,14 +695,8 @@ namespace DS4Windows } } } - if (bat != null && bat.HasExited && runningBat) - { - Process.Start("explorer.exe"); - bat = null; - runningBat = false; - } - GC.Collect(); + //GC.Collect(); } public void LoadP() @@ -572,7 +727,19 @@ namespace DS4Windows else turnOffTempProfiles.Add(false); } + + int pathCount = programpaths.Count; + bool timerEnabled = autoProfilesTimer.Enabled; + if (pathCount > 0 && !timerEnabled) + { + autoProfilesTimer.Start(); + } + else if (pathCount == 0 && timerEnabled) + { + autoProfilesTimer.Stop(); + } } + string originalsettingstext; private void CheckDrivers() { @@ -626,14 +793,14 @@ namespace DS4Windows if (!File.Exists(exepath + "\\DS4Updater.exe") || (File.Exists(exepath + "\\DS4Updater.exe") && (FileVersionInfo.GetVersionInfo(exepath + "\\DS4Updater.exe").FileVersion.CompareTo("1.1.0.0") == -1))) { - Uri url2 = new Uri("http://ds4windows.com/Files/DS4Updater.exe"); + Uri url2 = new Uri("http://23.239.26.40/ds4windows/files/DS4Updater.exe"); WebClient wc2 = new WebClient(); if (appdatapath == exepath) wc2.DownloadFile(url2, exepath + "\\DS4Updater.exe"); else { MessageBox.Show(Properties.Resources.PleaseDownloadUpdater); - Process.Start("http://ds4windows.com/Files/DS4Updater.exe"); + Process.Start("http://23.239.26.40/ds4windows/files/DS4Updater.exe"); } } Process p = new Process(); @@ -728,6 +895,7 @@ namespace DS4Windows WP.Dock = DockStyle.Fill; tabAutoProfiles.Controls.Add(WP); } + protected void LogDebug(DateTime Time, String Data, bool warning) { if (lvDebug.InvokeRequired) @@ -735,7 +903,9 @@ namespace DS4Windows LogDebugDelegate d = new LogDebugDelegate(LogDebug); try { - this.Invoke(d, new Object[] { Time, Data, warning }); + // Make sure to invoke method asynchronously instead of waiting for result + this.BeginInvoke(d, new object[] { Time, Data, warning }); + //this.Invoke(d, new object[] { Time, Data, warning }); } catch { } } @@ -744,7 +914,7 @@ namespace DS4Windows String Posted = Time.ToString("G"); lvDebug.Items.Add(new ListViewItem(new String[] { Posted, Data })).EnsureVisible(); if (warning) lvDebug.Items[lvDebug.Items.Count - 1].ForeColor = Color.Red; - //Added alternative + // Added alternative lbLastMessage.Text = Data; lbLastMessage.ForeColor = (warning ? Color.Red : SystemColors.GrayText); } @@ -752,11 +922,25 @@ namespace DS4Windows protected void ShowNotification(object sender, DebugEventArgs args) { - if (Form.ActiveForm != this && (Notifications == 2 || (Notifications == 1 && args.Warning) || sender != null)) + if (this.InvokeRequired) { - this.notifyIcon1.BalloonTipText = args.Data; - notifyIcon1.BalloonTipTitle = "DS4Windows"; - notifyIcon1.ShowBalloonTip(1); + NotificationDelegate d = new NotificationDelegate(ShowNotification); + + try + { + // Make sure to invoke method asynchronously instead of waiting for result + this.BeginInvoke(d, new object[] { sender, args }); + } + catch { } + } + else + { + if (Form.ActiveForm != this && (Notifications == 2 || (Notifications == 1 && args.Warning) || sender != null)) + { + this.notifyIcon1.BalloonTipText = args.Data; + notifyIcon1.BalloonTipTitle = "DS4Windows"; + notifyIcon1.ShowBalloonTip(1); + } } } @@ -786,6 +970,7 @@ namespace DS4Windows this.ShowInTaskbar = true; this.FormBorderStyle = FormBorderStyle.Sizable; } + chData.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize); } @@ -793,39 +978,56 @@ namespace DS4Windows { btnStartStop_Clicked(); } + public void btnStartStop_Clicked(bool log = true) { if (btnStartStop.Text == Properties.Resources.StartText) { Program.rootHub.Start(log); - hotkeysTimer.Start(); + if (SwipeProfiles && !hotkeysTimer.Enabled) + { + hotkeysTimer.Start(); + } + + if (programpaths.Count > 0 && !autoProfilesTimer.Enabled) + { + autoProfilesTimer.Start(); + } + btnStartStop.Text = Properties.Resources.StopText; } - else if (btnStartStop.Text == Properties.Resources.StopText) { + blankControllerTab(); Program.rootHub.Stop(log); hotkeysTimer.Stop(); + autoProfilesTimer.Stop(); btnStartStop.Text = Properties.Resources.StartText; + blankControllerTab(); } + startToolStripMenuItem.Text = btnStartStop.Text; } + protected void btnClear_Click(object sender, EventArgs e) { lvDebug.Items.Clear(); lbLastMessage.Text = string.Empty; } + //delegate void OldHotPlugDelegate(); + bool skipHotplug = false; + bool inHotPlug = false; protected override void WndProc(ref Message m) { try { if (m.Msg == ScpDevice.WM_DEVICECHANGE) { - Int32 Type = m.WParam.ToInt32(); - lock (this) + if (runHotPlug) { - Program.rootHub.HotPlug(); + Int32 Type = m.WParam.ToInt32(); + InnerHotplug2(); } } } @@ -839,6 +1041,170 @@ namespace DS4Windows catch { } } + delegate bool HotPlugDelegate(); + protected void InnerHotplug() + { + lock (this) + { + // Reset flag and execute hotplug routine in main thread + skipHotplug = false; + HotPlugDelegate d = new HotPlugDelegate(Program.rootHub.HotPlug); + this.BeginInvoke(d); + //Program.rootHub.HotPlug(); + } + } + + protected async void InnerHotplug2() + { + await System.Threading.Tasks.Task.Delay(50); + + if (inHotPlug) + { + await System.Threading.Tasks.Task.Run(() => { while (inHotPlug) { System.Threading.Thread.Sleep(50); } }); + } + + lock (this) + { + skipHotplug = true; + //System.Threading.Tasks.Task.Delay(50).ContinueWith((t) => InnerHotplug()); + //System.Threading.Tasks.Task tempTask = System.Threading.Tasks.Task.Delay(50).ContinueWith((t) => { }); + //tempTask.Wait(); + //OldHotPlugDelegate d = new OldHotPlugDelegate(InnerHotplug); + //this.BeginInvoke(d); + //skipHotplug = false; + inHotPlug = true; + Program.rootHub.HotPlug(); + inHotPlug = false; + } + } + + protected void BatteryStatusUpdate(object sender, BatteryReportArgs args) + { + if (this.InvokeRequired) + { + try + { + BatteryStatusDelegate d = new BatteryStatusDelegate(BatteryStatusUpdate); + this.BeginInvoke(d, new object[] { sender, args }); + } + catch { } + } + else + { + string battery; + int level = args.getLevel(); + if (level >= 100) + battery = Properties.Resources.Full; + else + battery = level + "%+"; + + Batteries[args.getIndex()].Text = battery; + } + } + + protected void DeviceStatusChanged(object sender, DeviceStatusChangeEventArgs args) + { + if (this.InvokeRequired) + { + DeviceStatusChangedDelegate d = new DeviceStatusChangedDelegate(DeviceStatusChanged); + this.BeginInvoke(d, new object[] { sender, args }); + } + else + { + bool nocontrollers = true; + for (int i = 0, arlen = Program.rootHub.DS4Controllers.Length; nocontrollers && i < arlen; i++) + { + DS4Device dev = Program.rootHub.DS4Controllers[i]; + if (dev != null) + { + nocontrollers = false; + } + } + + string tooltip = "DS4Windows v" + FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion; + int Index = args.getIndex(); + if (Index >= 0 && Index < ControlService.DS4_CONTROLLER_COUNT) + { + Pads[Index].Text = Program.rootHub.getDS4MacAddress(Index); + + switch (Program.rootHub.getDS4Status(Index)) + { + case "USB": statPB[Index].Visible = true; statPB[Index].Image = Properties.Resources.USB; toolTip1.SetToolTip(statPB[Index], ""); break; + case "BT": statPB[Index].Visible = true; statPB[Index].Image = Properties.Resources.BT; toolTip1.SetToolTip(statPB[Index], "Right click to disconnect"); break; + case "SONYWA": statPB[Index].Visible = true; statPB[Index].Image = Properties.Resources.BT; toolTip1.SetToolTip(statPB[Index], "Right click to disconnect"); break; + default: statPB[Index].Visible = false; toolTip1.SetToolTip(statPB[Index], ""); break; + } + + Batteries[Index].Text = Program.rootHub.getDS4Battery(Index); + if (Pads[Index].Text != String.Empty) + { + if (runningBat) + { + SendKeys.Send("A"); + runningBat = false; + } + + Pads[Index].Enabled = true; + if (Pads[Index].Text != Properties.Resources.Connecting) + { + Enable_Controls(Index, true); + } + } + else + { + Pads[Index].Text = Properties.Resources.Disconnected; + Enable_Controls(Index, false); + } + + if (Program.rootHub.getShortDS4ControllerInfo(Index) != Properties.Resources.NoneText) + tooltip += "\n" + (Index + 1) + ": " + Program.rootHub.getShortDS4ControllerInfo(Index); // Carefully stay under the 63 character limit. + } + + lbNoControllers.Visible = nocontrollers; + tLPControllers.Visible = !nocontrollers; + if (tooltip.Length > 63) + notifyIcon1.Text = tooltip.Substring(0, 63); + else + notifyIcon1.Text = tooltip; + } + } + + protected void ControllerRemovedChange(object sender, ControllerRemovedArgs args) + { + if (this.InvokeRequired) + { + try + { + ControllerRemovedDelegate d = new ControllerRemovedDelegate(ControllerRemovedChange); + this.BeginInvoke(d, new object[] { sender, args }); + } + catch { } + } + else + { + int devIndex = args.getIndex(); + Pads[devIndex].Text = Properties.Resources.Disconnected; + Enable_Controls(devIndex, false); + statPB[devIndex].Visible = false; + toolTip1.SetToolTip(statPB[devIndex], ""); + + DS4Device[] devices = Program.rootHub.DS4Controllers; + int controllerLen = devices.Length; + bool nocontrollers = true; + for (Int32 i = 0, PadsLen = Pads.Length; nocontrollers && i < PadsLen; i++) + { + DS4Device d = devices[i]; + if (d != null) + { + nocontrollers = false; + } + } + + lbNoControllers.Visible = nocontrollers; + tLPControllers.Visible = !nocontrollers; + } + } + protected void ControllerStatusChange(object sender, EventArgs e) { if (InvokeRequired) @@ -846,59 +1212,59 @@ namespace DS4Windows else ControllerStatusChanged(); } + protected void ControllerStatusChanged() { String tooltip = "DS4Windows v" + FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion; bool nocontrollers = true; - for (Int32 Index = 0; Index < Pads.Length; Index++) + DS4Device[] devices = Program.rootHub.DS4Controllers; + int controllerLen = devices.Length; + for (Int32 Index = 0, PadsLen = Pads.Length; Index < PadsLen; Index++) { - Pads[Index].Text = Program.rootHub.getDS4MacAddress(Index); - DS4Device d = Program.rootHub.DS4Controllers[Index]; - if (QuickCharge && d?.ConnectionType == ConnectionType.BT && (bool)d?.Charging) + // Make sure a controller exists + if (Index < controllerLen) { - d.DisconnectBT(); - return; - } - switch (Program.rootHub.getDS4Status(Index)) - { - case "USB": statPB[Index].Visible = true; statPB[Index].Image = Properties.Resources.USB; toolTip1.SetToolTip(statPB[Index], ""); break; - case "BT": statPB[Index].Visible = true; statPB[Index].Image = Properties.Resources.BT; toolTip1.SetToolTip(statPB[Index], "Right click to disconnect"); break; - default: statPB[Index].Visible = false; toolTip1.SetToolTip(statPB[Index], ""); break; - } - Batteries[Index].Text = Program.rootHub.getDS4Battery(Index); - if (Pads[Index].Text != String.Empty) - { - if (runningBat) + Pads[Index].Text = Program.rootHub.getDS4MacAddress(Index); + DS4Device d = devices[Index]; + + switch (Program.rootHub.getDS4Status(Index)) { - SendKeys.Send("A"); - runningBat = false; + case "USB": statPB[Index].Visible = true; statPB[Index].Image = Properties.Resources.USB; toolTip1.SetToolTip(statPB[Index], ""); break; + case "BT": statPB[Index].Visible = true; statPB[Index].Image = Properties.Resources.BT; toolTip1.SetToolTip(statPB[Index], "Right click to disconnect"); break; + case "SONYWA": statPB[Index].Visible = true; statPB[Index].Image = Properties.Resources.BT; toolTip1.SetToolTip(statPB[Index], "Right click to disconnect"); break; + default: statPB[Index].Visible = false; toolTip1.SetToolTip(statPB[Index], ""); break; } - Pads[Index].Enabled = true; - nocontrollers = false; - if (Pads[Index].Text != Properties.Resources.Connecting) + + Batteries[Index].Text = Program.rootHub.getDS4Battery(Index); + if (Pads[Index].Text != String.Empty) { - Enable_Controls(Index, true); - //if (opt != null) - // if (opt.Visible && tabMain.SelectedIndex == 1) - //opt.inputtimer.Start(); - //MinimumSize = new Size(MinimumSize.Width, 137 + 29 * Index); + if (runningBat) + { + SendKeys.Send("A"); + runningBat = false; + } + + Pads[Index].Enabled = true; + nocontrollers = false; + if (Pads[Index].Text != Properties.Resources.Connecting) + { + Enable_Controls(Index, true); + } } else - opt.inputtimer.Stop(); + { + Pads[Index].Text = Properties.Resources.Disconnected; + Enable_Controls(Index, false); + } + //if (((Index + 1) + ": " + Program.rootHub.getShortDS4ControllerInfo(Index)).Length > 50) + //MessageBox.Show(((Index + 1) + ": " + Program.rootHub.getShortDS4ControllerInfo(Index)).Length.ToString()); + if (Program.rootHub.getShortDS4ControllerInfo(Index) != Properties.Resources.NoneText) + tooltip += "\n" + (Index + 1) + ": " + Program.rootHub.getShortDS4ControllerInfo(Index); // Carefully stay under the 63 character limit. } - else - { - Pads[Index].Text = Properties.Resources.Disconnected; - Enable_Controls(Index, false); - } - //if (((Index + 1) + ": " + Program.rootHub.getShortDS4ControllerInfo(Index)).Length > 50) - //MessageBox.Show(((Index + 1) + ": " + Program.rootHub.getShortDS4ControllerInfo(Index)).Length.ToString()); - if (Program.rootHub.getShortDS4ControllerInfo(Index) != Properties.Resources.NoneText) - tooltip += "\n" + (Index + 1) + ": " + Program.rootHub.getShortDS4ControllerInfo(Index); // Carefully stay under the 63 character limit. } + lbNoControllers.Visible = nocontrollers; tLPControllers.Visible = !nocontrollers; - btnClear.Enabled = lvDebug.Items.Count > 0; if (tooltip.Length > 63) notifyIcon1.Text = tooltip.Substring(0, 63); else @@ -910,6 +1276,10 @@ namespace DS4Windows int i = Int32.Parse(((PictureBox)sender).Tag.ToString()); if (e.Button == System.Windows.Forms.MouseButtons.Right && Program.rootHub.getDS4Status(i) == "BT" && !Program.rootHub.DS4Controllers[i].Charging) Program.rootHub.DS4Controllers[i].DisconnectBT(); + else if (e.Button == System.Windows.Forms.MouseButtons.Right && Program.rootHub.getDS4Status(i) == "SONYWA" && !Program.rootHub.DS4Controllers[i].Charging) + { + Program.rootHub.DS4Controllers[i].DisconnectDongle(); + } } private void Enable_Controls(int device, bool on) @@ -1048,19 +1418,19 @@ namespace DS4Windows Stream stream; Stream profile = new StreamReader(appdatapath + "\\Profiles\\" + lBProfiles.SelectedItem.ToString() + ".xml").BaseStream; if (saveProfiles.ShowDialog() == System.Windows.Forms.DialogResult.OK) + { if ((stream = saveProfiles.OpenFile()) != null) { profile.CopyTo(stream); profile.Close(); stream.Close(); } + } } } private void ShowOptions(int devID, string profile) { - //if (opt != null) - //opt.Close(); Show(); WindowState = FormWindowState.Normal; toolStrip1.Enabled = false; @@ -1070,7 +1440,7 @@ namespace DS4Windows tSTBProfile.Text = profile; else tSTBProfile.Text = "<" + Properties.Resources.TypeProfileName + ">"; - //opt = new Options(devID, profile, this); + lBProfiles.SendToBack(); toolStrip1.SendToBack(); tSOptions.SendToBack(); @@ -1082,8 +1452,10 @@ namespace DS4Windows if (Size.Width < (int)(20 * dpix) + Options.mSize.Width) Size = new System.Drawing.Size((int)(20 * dpix) + Options.mSize.Width, Size.Height); } + tabMain.SelectedIndex = 1; opt.Reload(devID, profile); + opt.inputtimer.Start(); opt.Visible = true; } @@ -1099,8 +1471,19 @@ namespace DS4Windows toolStrip1.Visible = true; toolStrip1.Enabled = true; lbLastMessage.ForeColor = SystemColors.GrayText; - lbLastMessage.Text = lvDebug.Items[lvDebug.Items.Count - 1].SubItems[1].Text; + int lvDebugItemCount = lvDebug.Items.Count; + if (lvDebugItemCount > 0) + { + lbLastMessage.Text = lvDebug.Items[lvDebugItemCount - 1].SubItems[1].Text; + } + + if (!lbNoControllers.Visible) + tabMain.SelectedIndex = 0; + + opt.inputtimer.Stop(); + opt.sixaxisTimer.Stop(); } + private void editButtons_Click(object sender, EventArgs e) { Button bn = (Button)sender; @@ -1121,9 +1504,13 @@ namespace DS4Windows if (em.Text == Properties.Resources.ContextNew.Replace("*number*", (i + 1).ToString())) ShowOptions(i, ""); else + { for (int t = 0; t < em.DropDownItems.Count - 2; t++) + { if (((ToolStripMenuItem)em.DropDownItems[t]).Checked) ShowOptions(i, ((ToolStripMenuItem)em.DropDownItems[t]).Text); + } + } } private void lnkControllers_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) @@ -1136,13 +1523,19 @@ namespace DS4Windows // Prevent the Game Controllers window from throwing an error when controllers are un/hidden System.Diagnostics.Process[] rundll64 = System.Diagnostics.Process.GetProcessesByName("rundll64"); foreach (System.Diagnostics.Process rundll64Instance in rundll64) + { foreach (System.Diagnostics.ProcessModule module in rundll64Instance.Modules) + { if (module.FileName.Contains("joy.cpl")) module.Dispose(); + } + } - UseExclusiveMode = hideDS4CheckBox.Checked; + bool exclusiveMode = hideDS4CheckBox.Checked; + UseExclusiveMode = exclusiveMode; if (Environment.OSVersion.Version.Major >= 10 && Environment.OSVersion.Version.Build < 10586) - btnConnectDS4Win10.Visible = hideDS4CheckBox.Checked; + btnConnectDS4Win10.Visible = exclusiveMode; + btnStartStop_Clicked(false); btnStartStop_Clicked(false); Save(); @@ -1188,7 +1581,9 @@ namespace DS4Windows else ebns[tdevice].Text = Properties.Resources.EditProfile; } - ControllerStatusChanged(); //to update profile name in notify icon + + OnDeviceStatusChanged(this, tdevice); //to update profile name in notify icon + //ControllerStatusChanged(); //to update profile name in notify icon } private void Profile_Changed_Menu(object sender, ToolStripItemClickedEventArgs e) @@ -1196,10 +1591,12 @@ namespace DS4Windows ToolStripMenuItem tS = (ToolStripMenuItem)sender; int tdevice = Int32.Parse(tS.Tag.ToString()); if (!(e.ClickedItem is ToolStripSeparator)) + { if (e.ClickedItem != tS.DropDownItems[tS.DropDownItems.Count - 1]) //if +New Profile not selected cbs[tdevice].SelectedIndex = tS.DropDownItems.IndexOf(e.ClickedItem); else //if +New Profile selected ShowOptions(tdevice, ""); + } } private void exitToolStripMenuItem_Click(object sender, EventArgs e) @@ -1220,6 +1617,7 @@ namespace DS4Windows { btnStartStop_Clicked(); } + private void notifyIcon1_MouseClick(object sender, MouseEventArgs e) { if (e.Button == System.Windows.Forms.MouseButtons.Middle) @@ -1228,6 +1626,7 @@ namespace DS4Windows this.Close(); } } + private void notifyIcon1_BalloonTipClicked(object sender, EventArgs e) { this.Show(); @@ -1244,12 +1643,31 @@ namespace DS4Windows private void StartWindowsCheckBox_CheckedChanged(object sender, EventArgs e) { + bool isChecked = StartWindowsCheckBox.Checked; RegistryKey KeyLoc = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); - if (StartWindowsCheckBox.Checked && !File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\DS4Windows.lnk")) + if (isChecked && !File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\DS4Windows.lnk")) + { appShortcutToStartup(); - else if (!StartWindowsCheckBox.Checked) + } + else if (!isChecked) + { File.Delete(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\DS4Windows.lnk"); + } + KeyLoc.DeleteValue("DS4Tool", false); + + if (isChecked) + { + runStartupPanel.Visible = true; + } + else + { + runStartupPanel.Visible = false; + runStartTaskRadio.Checked = false; + runStartProgRadio.Checked = true; + } + + changeStartupRoutine(); } private void appShortcutToStartup() @@ -1263,7 +1681,18 @@ namespace DS4Windows { string app = Assembly.GetExecutingAssembly().Location; lnk.TargetPath = Assembly.GetExecutingAssembly().Location; - lnk.Arguments = "-m"; + + if (runStartProgRadio.Checked) + { + lnk.Arguments = "-m"; + } + else if (runStartTaskRadio.Checked) + { + lnk.Arguments = "-runtask"; + } + + //lnk.TargetPath = Assembly.GetExecutingAssembly().Location; + //lnk.Arguments = "-m"; lnk.IconLocation = app.Replace('\\', '/'); lnk.Save(); } @@ -1300,18 +1729,26 @@ namespace DS4Windows else lbLastMessage.Text = ""; - if (tabMain.SelectedIndex != 1 || !opt.Visible) + /*if (tabMain.SelectedIndex != 1 || !opt.Visible) opt.inputtimer.Stop(); else if (opt.Visible && tabMain.SelectedIndex == 1) opt.inputtimer.Start(); - Program.rootHub.eastertime = tabMain.SelectedTab == tabLog; + */ } private void Items_MouseHover(object sender, EventArgs e) { - switch (((System.Windows.Forms.Control)sender).Name) + string hoverText = Properties.Resources.HoverOverItems; + string temp = ""; + if (hoverTextDict.TryGetValue((Control)sender, out temp)) { + hoverText = temp; + } + lbLastMessage.Text = hoverText; + + /*switch (((System.Windows.Forms.Control)sender).Name) + { //if (File.Exists(appdatapath + "\\Auto Profiles.xml")) case "linkUninstall": lbLastMessage.Text = Properties.Resources.IfRemovingDS4Windows; break; case "cBSwipeProfiles": lbLastMessage.Text = Properties.Resources.TwoFingerSwipe; break; @@ -1323,7 +1760,10 @@ namespace DS4Windows case "cBCloseMini": lbLastMessage.Text = Properties.Resources.CloseMinimize; break; default: lbLastMessage.Text = Properties.Resources.HoverOverItems; break; } - if (lbLastMessage.Text != Properties.Resources.HoverOverItems) + */ + + //if (lbLastMessage.Text != Properties.Resources.HoverOverItems) + if (hoverText != Properties.Resources.HoverOverItems) lbLastMessage.ForeColor = Color.Black; else lbLastMessage.ForeColor = SystemColors.GrayText; @@ -1377,11 +1817,14 @@ namespace DS4Windows bool therewasanxml = false; string[] files = (string[])e.Data.GetData(DataFormats.FileDrop, false); for (int i = 0; i < files.Length; i++) + { if (files[i].EndsWith(".xml")) { File.Copy(files[i], appdatapath + "\\Profiles\\" + Path.GetFileName(files[i]), true); therewasanxml = true; } + } + if (therewasanxml) RefreshProfiles(); } @@ -1431,9 +1874,10 @@ namespace DS4Windows if (tSTBProfile.Text != null && tSTBProfile.Text != "" && !tSTBProfile.Text.Contains("\\") && !tSTBProfile.Text.Contains("/") && !tSTBProfile.Text.Contains(":") && !tSTBProfile.Text.Contains("*") && !tSTBProfile.Text.Contains("?") && !tSTBProfile.Text.Contains("\"") && !tSTBProfile.Text.Contains("<") && !tSTBProfile.Text.Contains(">") && !tSTBProfile.Text.Contains("|")) { - System.IO.File.Delete(appdatapath + @"\Profiles\" + opt.filename + ".xml"); + File.Delete(appdatapath + @"\Profiles\" + opt.filename + ".xml"); ProfilePath[opt.device] = tSTBProfile.Text; SaveProfile(opt.device, tSTBProfile.Text); + cacheProfileCustomsFlags(opt.device); Save(); opt.Close(); } @@ -1501,7 +1945,7 @@ namespace DS4Windows private void lLBUpdate_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { - Uri url = new Uri("http://ds4windows.com/Files/Builds/newest.txt"); //Sorry other devs, gonna have to find your own server + Uri url = new Uri("http://23.236.26.40/ds4windows/files/builds/newest.txt"); //Sorry other devs, gonna have to find your own server WebClient wct = new WebClient(); wct.DownloadFileAsync(url, appdatapath + "\\version.txt"); wct.DownloadFileCompleted += wct_DownloadFileCompleted; @@ -1596,12 +2040,14 @@ namespace DS4Windows e.Cancel = true; return; } + if (cBCloseMini.Checked && !contextclose) { this.WindowState = FormWindowState.Minimized; e.Cancel = true; return; } + if (systemShutdown) // Reset the variable because the user might cancel the // shutdown. @@ -1609,6 +2055,7 @@ namespace DS4Windows systemShutdown = false; DS4LightBar.shuttingdown = true; } + if (oldsize == new System.Drawing.Size(0, 0)) { FormWidth = this.Width; @@ -1619,16 +2066,28 @@ namespace DS4Windows FormWidth = oldsize.Width; FormHeight = oldsize.Height; } + if (!String.IsNullOrEmpty(appdatapath)) { Save(); + blankControllerTab(); Program.rootHub.Stop(); } } private void cBSwipeProfiles_CheckedChanged(object sender, EventArgs e) { - SwipeProfiles = cBSwipeProfiles.Checked; + bool swipe = false; + SwipeProfiles = swipe = cBSwipeProfiles.Checked; + bool timerEnabled = hotkeysTimer.Enabled; + if (swipe && !timerEnabled) + { + hotkeysTimer.Start(); + } + else if (!swipe && timerEnabled) + { + hotkeysTimer.Stop(); + } } private void cBQuickCharge_CheckedChanged(object sender, EventArgs e) @@ -1694,12 +2153,12 @@ namespace DS4Windows toolTip1.Show(Properties.Resources.InputDelay.Replace("*number*", latency.ToString()), lb, lb.Size.Width, 0); } } - private void Pads_MouseLeave(object sender, EventArgs e) { toolTip1.Hide((Label)sender); } + Process bat; private void btnConnectDS4Win10_Click(object sender, EventArgs e) { @@ -1716,6 +2175,7 @@ namespace DS4Windows bat = Process.Start(exepath + "\\ConnectDS4.bat"); } } + int currentCustomLed; private void EditCustomLed(object sender, EventArgs e) { @@ -1742,6 +2202,7 @@ namespace DS4Windows UseCustomLed[currentCustomLed] = true; Global.Save(); } + DS4LightBar.forcedFlash[currentCustomLed] = 0; DS4LightBar.forcelight[currentCustomLed] = false; } @@ -1765,6 +2226,81 @@ namespace DS4Windows } } + private void lBProfiles_SelectedIndexChanged(object sender, EventArgs e) + { + int index = lBProfiles.SelectedIndex; + if (index >= 0) + { + tsBNewProfle.Enabled = true; + tsBEditProfile.Enabled = true; + tsBDeleteProfile.Enabled = true; + tSBDupProfile.Enabled = true; + tSBImportProfile.Enabled = true; + tSBExportProfile.Enabled = true; + } + else + { + tsBNewProfle.Enabled = true; + tsBEditProfile.Enabled = false; + tsBDeleteProfile.Enabled = false; + tSBDupProfile.Enabled = false; + tSBImportProfile.Enabled = false; + tSBExportProfile.Enabled = false; + } + } + + private void runStartProgRadio_Click(object sender, EventArgs e) + { + appShortcutToStartup(); + changeStartupRoutine(); + } + + private void runStartTaskRadio_Click(object sender, EventArgs e) + { + appShortcutToStartup(); + changeStartupRoutine(); + } + + private void changeStartupRoutine() + { + if (runStartTaskRadio.Checked) + { + WindowsIdentity identity = WindowsIdentity.GetCurrent(); + WindowsPrincipal principal = new WindowsPrincipal(identity); + if (principal.IsInRole(WindowsBuiltInRole.Administrator)) + { + TaskService ts = new TaskService(); + Microsoft.Win32.TaskScheduler.Task tasker = ts.FindTask("RunDS4Windows"); + if (tasker != null) + { + ts.RootFolder.DeleteTask("RunDS4Windows"); + } + + TaskDefinition td = ts.NewTask(); + td.Actions.Add(new ExecAction(@"%windir%\System32\cmd.exe", + "/c start \"RunDS4Windows\" \"" + Process.GetCurrentProcess().MainModule.FileName + "\" -m", + new FileInfo(Process.GetCurrentProcess().MainModule.FileName).DirectoryName)); + + td.Principal.RunLevel = TaskRunLevel.Highest; + ts.RootFolder.RegisterTaskDefinition("RunDS4Windows", td); + } + } + else + { + WindowsIdentity identity = WindowsIdentity.GetCurrent(); + WindowsPrincipal principal = new WindowsPrincipal(identity); + if (principal.IsInRole(WindowsBuiltInRole.Administrator)) + { + TaskService ts = new TaskService(); + Microsoft.Win32.TaskScheduler.Task tasker = ts.FindTask("RunDS4Windows"); + if (tasker != null) + { + ts.RootFolder.DeleteTask("RunDS4Windows"); + } + } + } + } + private void cBDownloadLangauge_CheckedChanged(object sender, EventArgs e) { DownloadLang = cBDownloadLangauge.Checked; diff --git a/DS4Windows/DS4Forms/DS4Form.resx b/DS4Windows/DS4Forms/DS4Form.resx index c87e7e0..a53442c 100644 --- a/DS4Windows/DS4Forms/DS4Form.resx +++ b/DS4Windows/DS4Forms/DS4Form.resx @@ -117,19 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Time - - - - 167 - - - Data - - - 84 - Fill @@ -139,14 +126,12 @@ Lucida Console, 9.75pt - 4, 4 - - - 4, 4, 4, 4 + 3, 3 - 1114, 415 + 890, 330 + 0 @@ -162,9 +147,93 @@ 0 + + Time + + + 167 + + + Data + + + 84 + - 17, 17 + 153, 17 + + llbHelp + + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlButton + + + 0 + + + lbTest + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlButton + + + 1 + + + btnStartStop + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlButton + + + 2 + + + lbLastMessage + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlButton + + + 3 + + + Bottom + + + 0, 385 + + + 904, 30 + + + 10 + + + pnlButton + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + Bottom, Right @@ -175,13 +244,10 @@ NoControl - 943, 11 - - - 4, 0, 4, 0 + 754, 9 - 100, 17 + 79, 13 13 @@ -214,13 +280,10 @@ NoControl - 812, 11 - - - 4, 0, 4, 0 + 650, 9 - 129, 17 + 98, 13 46 @@ -250,13 +313,10 @@ NoControl - 1050, 5 - - - 4, 4, 4, 4 + 840, 4 - 72, 29 + 58, 23 1 @@ -283,13 +343,10 @@ NoControl - 5, 11 - - - 4, 0, 4, 0 + 4, 9 - 931, 22 + 745, 18 41 @@ -306,50 +363,17 @@ 3 - - Bottom - - - 0, 481 - - - 4, 4, 4, 4 - - - 1130, 38 - - - 10 - - - pnlButton - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 4 - Bottom - - False - NoControl - 4, 419 - - - 4, 4, 4, 4 + 3, 333 - 1114, 29 + 890, 23 9 @@ -370,64 +394,16 @@ 1 - 226, 17 + 264, 17 Scp server - 339, 17 + 377, 17 - - 262, 26 - - - Edit Profile for Controller 1 - - - 262, 26 - - - Edit Profile for Controller 2 - - - 262, 26 - - - Edit Profile for Controller 3 - - - 262, 26 - - - Edit Profile for Controller 4 - - - 259, 6 - - - 262, 26 - - - Start - - - Segoe UI, 9pt, style=Bold - - - 262, 26 - - - Open - - - 262, 26 - - - Exit (Middle Mouse) - - 263, 192 + 215, 164 cMTaskbar @@ -441,15 +417,1077 @@ True + + 214, 22 + + + Edit Profile for Controller 1 + + + 214, 22 + + + Edit Profile for Controller 2 + + + 214, 22 + + + Edit Profile for Controller 3 + + + 214, 22 + + + Edit Profile for Controller 4 + + + 211, 6 + + + 214, 22 + + + Start + + + Segoe UI, 9pt, style=Bold + + + 214, 22 + + + Open + + + 214, 22 + + + Exit (Middle Mouse) + 211, 6 - 449, 17 + 487, 17 XML Files (*.xml)|*.xml + + btnConnectDS4Win10 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabControllers + + + 0 + + + tLPControllers + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabControllers + + + 1 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="bnLight3" Row="3" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="pBStatus1" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbPad1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPad2" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="bnEditC3" Row="3" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="bnEditC4" Row="4" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="lbPad3" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPad4" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cBController1" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="bnEditC2" Row="2" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="cBController2" Row="2" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="cBController3" Row="3" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="bnEditC1" Row="1" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="cBController4" Row="4" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="lbSelectedProfile" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="lbID" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbStatus" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbBattery" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt1" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt2" Row="2" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt3" Row="3" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt4" Row="4" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="pBStatus2" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="pBStatus3" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="pBStatus4" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="bnLight1" Row="1" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="bnLight2" Row="2" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="bnLight4" Row="4" RowSpan="1" Column="5" ColumnSpan="1" /></Controls><Columns Styles="Percent,48.95498,Percent,26.82658,Percent,24.21844,AutoSize,0,AutoSize,0,Absolute,80" /><Rows Styles="AutoSize,0,Percent,25,Percent,25,Percent,25,Percent,25" /></TableLayoutSettings> + + + lbNoControllers + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabControllers + + + 2 + + + 4, 22 + + + 896, 359 + + + 3 + + + Controllers + + + tabControllers + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabMain + + + 0 + + + 17, 56 + + + 606, 17 + + + lBProfiles + + + System.Windows.Forms.ListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabProfiles + + + 0 + + + tSOptions + + + System.Windows.Forms.ToolStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabProfiles + + + 1 + + + toolStrip1 + + + System.Windows.Forms.ToolStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabProfiles + + + 2 + + + 4, 22 + + + 3, 3, 3, 3 + + + 896, 359 + + + 0 + + + Profiles + + + tabProfiles + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabMain + + + 1 + + + 4, 22 + + + 896, 359 + + + 2 + + + Auto Profiles + + + tabAutoProfiles + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabMain + + + 2 + + + True + + + True + + + NoControl + + + 10, 10 + + + 119, 17 + + + 13 + + + Hide DS4 Controller + + + hideDS4CheckBox + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 0 + + + True + + + NoControl + + + 10, 33 + + + 194, 17 + + + 54 + + + Swipe Touchpad to change profiles + + + cBSwipeProfiles + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 1 + + + True + + + NoControl + + + 10, 56 + + + 95, 17 + + + 40 + + + Run at Startup + + + StartWindowsCheckBox + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 2 + + + NoControl + + + 65, 54 + + + 20, 20 + + + 3 + + + uacPictureBox + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + runStartupPanel + + + 0 + + + True + + + NoControl + + + 10, 54 + + + 49, 17 + + + 2 + + + Task + + + runStartTaskRadio + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + runStartupPanel + + + 1 + + + True + + + NoControl + + + 10, 4 + + + 45, 13 + + + 1 + + + Run As: + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + runStartupPanel + + + 2 + + + True + + + NoControl + + + 10, 25 + + + 64, 17 + + + 0 + + + Program + + + runStartProgRadio + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + runStartupPanel + + + 3 + + + 10, 79 + + + 119, 80 + + + 59 + + + False + + + runStartupPanel + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 3 + + + True + + + NoControl + + + 10, 165 + + + 97, 17 + + + 40 + + + Start Minimized + + + startMinimizedCheckBox + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 4 + + + lbNotifications + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 0 + + + cBoxNotifications + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 1 + + + 10, 188 + + + 213, 22 + + + 45 + + + panel1 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 5 + + + True + + + NoControl + + + 10, 216 + + + 194, 17 + + + 53 + + + Disconnect from BT when Stopping + + + cBDisconnectBT + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 6 + + + nUDLatency + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 0 + + + lbMsLatency + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 1 + + + cBFlashWhenLate + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 2 + + + 10, 239 + + + 258, 22 + + + 57 + + + panel2 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 7 + + + True + + + NoControl + + + 10, 267 + + + 100, 17 + + + 55 + + + Close Minimizes + + + cBCloseMini + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 8 + + + True + + + NoControl + + + 10, 290 + + + 91, 17 + + + 55 + + + Quick Charge + + + cBQuickCharge + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 9 + + + True + + + NoControl + + + 9, 312 + + + 2, 2, 2, 2 + + + 146, 17 + + + 58 + + + White DS4Windows Icon + + + cBUseWhiteIcon + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 10 + + + True + + + NoControl + + + 274, 10 + + + 213, 17 + + + 41 + + + Download Language Pack with Update + + + cBDownloadLangauge + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 11 + + + True + + + NoControl + + + 274, 33 + + + 164, 17 + + + 41 + + + Check for Updates at Startup + + + cBUpdate + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 12 + + + cBUpdateTime + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pNUpdate + + + 0 + + + lbCheckEvery + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pNUpdate + + + 1 + + + nUDUpdateTime + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pNUpdate + + + 2 + + + False + + + 274, 56 + + + 189, 22 + + + 43 + + + pNUpdate + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 13 + + + lbUseXIPorts + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlXIPorts + + + 0 + + + nUDXIPorts + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlXIPorts + + + 1 + + + lbLastXIPort + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlXIPorts + + + 2 + + + 274, 84 + + + 186, 22 + + + 44 + + + pnlXIPorts + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 14 + + + True + + + linkProfiles + + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + flowLayoutPanel1 + + + 0 + + + lnkControllers + + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + flowLayoutPanel1 + + + 1 + + + linkUninstall + + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + flowLayoutPanel1 + + + 2 + + + linkSetup + + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + flowLayoutPanel1 + + + 3 + + + lLBUpdate + + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + flowLayoutPanel1 + + + 4 + + + TopDown + + + 274, 112 + + + 122, 65 + + + 56 + + + flowLayoutPanel1 + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 15 + + + Fill + + + TopDown + + + 3, 3 + + + 7, 7, 0, 9 + + + 890, 353 + + + 0 + + + fLPSettings + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabSettings + + + 0 + + + 4, 22 + + + 3, 3, 3, 3 + + + 896, 359 + + + 4 + + + Settings + + + tabSettings + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabMain + + + 3 + + + 4, 22 + + + 3, 3, 3, 3 + + + 896, 359 + + + 1 + + + Log + + + tabLog + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabMain + + + 4 + + + Fill + + + 0, 0 + + + 904, 385 + + + 12 + + + tabMain + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + Top @@ -457,13 +1495,10 @@ NoControl - 0, 162 - - - 4, 4, 4, 4 + 0, 127 - 1122, 29 + 896, 23 48 @@ -489,6 +1524,372 @@ 6 + + bnLight3 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 0 + + + pBStatus1 + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 1 + + + lbPad1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 2 + + + lbPad2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 3 + + + bnEditC3 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 4 + + + bnEditC4 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 5 + + + lbPad3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 6 + + + lbPad4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 7 + + + cBController1 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 8 + + + bnEditC2 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 9 + + + cBController2 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 10 + + + cBController3 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 11 + + + bnEditC1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 12 + + + cBController4 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 13 + + + lbSelectedProfile + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 14 + + + lbID + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 15 + + + lbStatus + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 16 + + + lbBattery + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 17 + + + lbBatt1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 18 + + + lbBatt2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 19 + + + lbBatt3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 20 + + + lbBatt4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 21 + + + pBStatus2 + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 22 + + + pBStatus3 + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 23 + + + pBStatus4 + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 24 + + + bnLight1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 25 + + + bnLight2 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 26 + + + bnLight4 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 27 + + + Top + + + 0, 0 + + + 5 + + + 896, 127 + + + 46 + + + tLPControllers + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabControllers + + + 1 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="bnLight3" Row="3" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="pBStatus1" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbPad1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPad2" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="bnEditC3" Row="3" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="bnEditC4" Row="4" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="lbPad3" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPad4" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cBController1" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="bnEditC2" Row="2" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="cBController2" Row="2" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="cBController3" Row="3" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="bnEditC1" Row="1" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="cBController4" Row="4" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="lbSelectedProfile" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="lbID" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbStatus" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbBattery" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt1" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt2" Row="2" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt3" Row="3" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt4" Row="4" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="pBStatus2" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="pBStatus3" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="pBStatus4" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="bnLight1" Row="1" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="bnLight2" Row="2" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="bnLight4" Row="4" RowSpan="1" Column="5" ColumnSpan="1" /></Controls><Columns Styles="Percent,48.95498,Percent,26.82658,Percent,24.21844,AutoSize,0,AutoSize,0,Absolute,80" /><Rows Styles="AutoSize,0,Percent,25,Percent,25,Percent,25,Percent,25" /></TableLayoutSettings> + Fill @@ -499,13 +1900,10 @@ NoControl - 1063, 94 - - - 4, 4, 4, 4 + 817, 74 - 55, 28 + 76, 22 50 @@ -529,10 +1927,7 @@ NoControl - 516, 26 - - - 4, 4, 4, 4 + 389, 19 39, 20 @@ -568,13 +1963,10 @@ NoControl - 4, 27 - - - 4, 0, 4, 0 + 3, 21 - 133, 18 + 111, 15 44 @@ -607,13 +1999,10 @@ NoControl - 4, 63 - - - 4, 0, 4, 0 + 3, 49 - 85, 18 + 70, 15 44 @@ -640,13 +2029,10 @@ NoControl - 1009, 94 - - - 4, 4, 4, 4 + 774, 74 - 46, 28 + 37, 22 43 @@ -673,13 +2059,10 @@ NoControl - 1009, 130 - - - 4, 4, 4, 4 + 774, 102 - 46, 28 + 37, 22 43 @@ -712,13 +2095,10 @@ NoControl - 4, 99 - - - 4, 0, 4, 0 + 3, 77 - 85, 18 + 70, 15 44 @@ -751,13 +2131,10 @@ NoControl - 4, 135 - - - 4, 0, 4, 0 + 3, 105 - 85, 18 + 70, 15 44 @@ -781,13 +2158,10 @@ None - 863, 23 - - - 4, 4, 4, 4 + 657, 18 - 138, 24 + 111, 21 42 @@ -811,13 +2185,10 @@ NoControl - 1009, 58 - - - 4, 4, 4, 4 + 774, 46 - 46, 28 + 37, 22 43 @@ -841,13 +2212,10 @@ None - 863, 59 - - - 4, 4, 4, 4 + 657, 46 - 138, 24 + 111, 21 42 @@ -868,13 +2236,10 @@ None - 863, 95 - - - 4, 4, 4, 4 + 657, 74 - 138, 24 + 111, 21 42 @@ -898,13 +2263,10 @@ NoControl - 1009, 22 - - - 4, 4, 4, 4 + 774, 18 - 46, 28 + 37, 22 43 @@ -928,13 +2290,10 @@ None - 863, 131 - - - 4, 4, 4, 4 + 657, 102 - 138, 24 + 111, 21 42 @@ -964,13 +2323,10 @@ NoControl - 868, 0 - - - 4, 0, 4, 0 + 658, 0 - 127, 18 + 109, 15 45 @@ -1003,13 +2359,10 @@ NoControl - 4, 0 - - - 4, 0, 4, 0 + 3, 0 - 24, 18 + 21, 15 45 @@ -1042,13 +2395,10 @@ NoControl - 508, 0 - - - 4, 0, 4, 0 + 385, 0 - 56, 18 + 47, 15 45 @@ -1081,13 +2431,10 @@ NoControl - 724, 0 - - - 4, 0, 4, 0 + 549, 0 - 61, 18 + 51, 15 45 @@ -1120,13 +2467,10 @@ NoControl - 732, 27 - - - 4, 0, 4, 0 + 555, 21 - 45, 18 + 39, 15 44 @@ -1159,13 +2503,10 @@ NoControl - 732, 63 - - - 4, 0, 4, 0 + 555, 49 - 45, 18 + 39, 15 44 @@ -1198,13 +2539,10 @@ NoControl - 732, 99 - - - 4, 0, 4, 0 + 555, 77 - 45, 18 + 39, 15 44 @@ -1237,13 +2575,10 @@ NoControl - 732, 135 - - - 4, 0, 4, 0 + 555, 105 - 45, 18 + 39, 15 44 @@ -1270,10 +2605,7 @@ NoControl - 516, 62 - - - 4, 4, 4, 4 + 389, 47 39, 20 @@ -1303,10 +2635,7 @@ NoControl - 516, 98 - - - 4, 4, 4, 4 + 389, 75 39, 20 @@ -1336,10 +2665,7 @@ NoControl - 516, 134 - - - 4, 4, 4, 4 + 389, 103 39, 20 @@ -1372,13 +2698,10 @@ NoControl - 1063, 22 - - - 4, 4, 4, 4 + 817, 18 - 55, 28 + 76, 22 50 @@ -1405,13 +2728,10 @@ NoControl - 1063, 58 - - - 4, 4, 4, 4 + 817, 46 - 55, 28 + 76, 22 51 @@ -1438,13 +2758,10 @@ NoControl - 1063, 130 - - - 4, 4, 4, 4 + 817, 102 - 55, 28 + 76, 22 52 @@ -1461,39 +2778,6 @@ 27 - - Top - - - 0, 0 - - - 4, 4, 4, 4 - - - 5 - - - 1122, 162 - - - 46 - - - tLPControllers - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabControllers - - - 1 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="bnLight3" Row="3" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="pBStatus1" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbPad1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPad2" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="bnEditC3" Row="3" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="bnEditC4" Row="4" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="lbPad3" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPad4" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cBController1" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="bnEditC2" Row="2" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="cBController2" Row="2" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="cBController3" Row="3" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="bnEditC1" Row="1" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="cBController4" Row="4" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="lbSelectedProfile" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="lbID" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbStatus" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbBattery" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt1" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt2" Row="2" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt3" Row="3" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt4" Row="4" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="pBStatus2" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="pBStatus3" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="pBStatus4" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="bnLight1" Row="1" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="bnLight2" Row="2" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="bnLight4" Row="4" RowSpan="1" Column="5" ColumnSpan="1" /></Controls><Columns Styles="Percent,48.95498,Percent,26.82658,Percent,24.21844,AutoSize,0,AutoSize,0,Absolute,62" /><Rows Styles="AutoSize,0,Percent,25,Percent,25,Percent,25,Percent,25" /></TableLayoutSettings> - Fill @@ -1506,11 +2790,8 @@ 0, 0 - - 4, 0, 4, 0 - - 1122, 452 + 896, 359 47 @@ -1533,101 +2814,11 @@ 2 - - 4, 25 - - - 4, 4, 4, 4 - - - 1122, 452 - - - 3 - - - Controllers - - - tabControllers - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabMain - - - 0 - - 788, 17 + 826, 17 - - Segoe UI, 9pt, style=Bold - - - 227, 26 - - - Edit - - - 227, 26 - - - Assign to Controller 1 - - - 227, 26 - - - Assign to Controller 2 - - - 227, 26 - - - Assign to Controller 3 - - - 227, 26 - - - Assign to Controller 4 - - - 227, 26 - - - Delete (Del) - - - 227, 26 - - - Duplicate (Ctrl+D) - - - 227, 26 - - - New Profile - - - 227, 26 - - - Import - - - 227, 26 - - - Export - - 228, 264 + 189, 224 cMProfile @@ -1642,16 +2833,13 @@ Microsoft Sans Serif, 9.75pt - 20 + 16 - 4, 58 - - - 4, 4, 4, 4 + 3, 57 - 1114, 390 + 890, 299 0 @@ -1668,56 +2856,77 @@ 0 + + Segoe UI, 9pt, style=Bold + + + 188, 22 + + + Edit + + + 188, 22 + + + Assign to Controller 1 + + + 188, 22 + + + Assign to Controller 2 + + + 188, 22 + + + Assign to Controller 3 + + + 188, 22 + + + Assign to Controller 4 + + + 188, 22 + + + Delete (Del) + + + 188, 22 + + + Duplicate (Ctrl+D) + + + 188, 22 + + + New Profile + + + 188, 22 + + + Import + + + 188, 22 + + + Export + - 891, 17 + 17, 56 - - 99, 24 - - - Profile Name: - - - 186, 27 - - - <type profile name here> - - - Magenta - - - 111, 24 - - - Save Profile - - - Magenta - - - 77, 24 - - - Cancel - - - 6, 27 - - - Magenta - - - 265, 24 - - - Keep this window size after closing - - 4, 31 + 3, 30 - 1114, 27 + 890, 27 2 @@ -1737,86 +2946,56 @@ 1 + + 79, 24 + + + Profile Name: + + + 150, 27 + + + <type profile name here> + + + Magenta + + + 92, 24 + + + Save Profile + + + Magenta + + + 67, 24 + + + Cancel + + + 6, 27 + + + Magenta + + + 214, 24 + + + Keep this window size after closing + - 568, 17 + 606, 17 - - Magenta - - - 63, 24 - - - New - - - Make a New Profile - - - Magenta - - - 59, 24 - - - Edit - - - Edit Selected Profile (Enter) - - - Magenta - - - 77, 24 - - - Delete - - - Delete Selected Profle (Delete) - - - Magenta - - - 97, 24 - - - Duplicate - - - Dupliacate Selected Profile (Ctrl+D) - - - Magenta - - - 78, 24 - - - Import - - - Import Profile or Profiles - - - Magenta - - - 76, 24 - - - Export - - - Export Selected Profile - - 4, 4 + 3, 3 - 1114, 27 + 890, 27 1 @@ -1836,197 +3015,92 @@ 2 - - 4, 25 + + Magenta - - 4, 4, 4, 4 + + 55, 24 - - 4, 4, 4, 4 + + New - - 1122, 452 + + Make a New Profile - - 0 + + False - - Profiles + + Magenta - - tabProfiles + + 51, 24 - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Edit - - tabMain + + Edit Selected Profile (Enter) - - 1 + + False - - 4, 25 + + Magenta - - 4, 4, 4, 4 + + 64, 24 - - 1122, 452 + + Delete - - 2 + + Delete Selected Profle (Delete) - - Auto Profiles + + False - - tabAutoProfiles + + Magenta - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 81, 24 - - tabMain + + Duplicate - - 2 + + Dupliacate Selected Profile (Ctrl+D) - - True + + False - - True + + Magenta - - NoControl + + 67, 24 - - 13, 13 + + Import - - 4, 4, 4, 4 + + Import Profile or Profiles - - 155, 21 + + False - - 13 + + Magenta - - Hide DS4 Controller + + 64, 24 - - hideDS4CheckBox + + Export - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - - 0 - - - True - - - NoControl - - - 13, 42 - - - 4, 4, 4, 4 - - - 252, 21 - - - 54 - - - Swipe Touchpad to change profiles - - - cBSwipeProfiles - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - - 1 - - - True - - - NoControl - - - 13, 71 - - - 4, 4, 4, 4 - - - 122, 21 - - - 40 - - - Run at Startup - - - StartWindowsCheckBox - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - - 2 - - - True - - - NoControl - - - 13, 100 - - - 4, 4, 4, 4 - - - 126, 21 - - - 40 - - - Start Minimized - - - startMinimizedCheckBox - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - - 3 + + Export Selected Profile True @@ -2035,13 +3109,10 @@ NoControl - 4, 5 - - - 4, 0, 4, 0 + 3, 4 - 123, 17 + 95, 13 45 @@ -2074,13 +3145,10 @@ All - 130, 1 - - - 4, 4, 4, 4 + 104, 1 - 132, 24 + 106, 21 44 @@ -2097,74 +3165,14 @@ 1 - - 13, 129 - - - 4, 4, 4, 4 - - - 266, 28 - - - 45 - - - panel1 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - - 4 - - - True - - - NoControl - - - 13, 165 - - - 4, 4, 4, 4 - - - 251, 21 - - - 53 - - - Disconnect from BT when Stopping - - - cBDisconnectBT - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - - 5 - Top, Right - 231, 2 - - - 4, 4, 4, 4 + 185, 2 - 55, 22 + 44, 20 42 @@ -2191,13 +3199,10 @@ NoControl - 294, 5 - - - 4, 0, 4, 0 + 235, 4 - 26, 17 + 20, 13 0 @@ -2224,13 +3229,10 @@ NoControl - 0, 4 - - - 4, 4, 4, 4 + 0, 3 - 223, 21 + 170, 17 53 @@ -2250,192 +3252,6 @@ 2 - - 13, 194 - - - 4, 4, 4, 4 - - - 323, 28 - - - 57 - - - panel2 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - - 6 - - - True - - - NoControl - - - 13, 230 - - - 4, 4, 4, 4 - - - 130, 21 - - - 55 - - - Close Minimizes - - - cBCloseMini - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - - 7 - - - True - - - NoControl - - - 13, 259 - - - 4, 4, 4, 4 - - - 116, 21 - - - 55 - - - Quick Charge - - - cBQuickCharge - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - - 8 - - - True - - - NoControl - - - 12, 287 - - - 183, 21 - - - 58 - - - White DS4Windows Icon - - - cBUseWhiteIcon - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - - 9 - - - True - - - NoControl - - - 13, 315 - - - 4, 4, 4, 4 - - - 273, 21 - - - 41 - - - Download Language Pack with Update - - - cBDownloadLangauge - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - - 10 - - - True - - - NoControl - - - 13, 344 - - - 4, 4, 4, 4 - - - 213, 21 - - - 41 - - - Check for Updates at Startup - - - cBUpdate - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - - 11 - Top, Right @@ -2446,13 +3262,10 @@ days - 158, 0 - - - 4, 4, 4, 4 + 126, 0 - 74, 24 + 60, 21 43 @@ -2479,13 +3292,10 @@ NoControl - 4, 4 - - - 4, 0, 4, 0 + 3, 3 - 86, 17 + 67, 13 0 @@ -2509,13 +3319,10 @@ Top, Right - 95, 1 - - - 4, 4, 4, 4 + 76, 1 - 55, 22 + 44, 20 42 @@ -2532,33 +3339,6 @@ 2 - - False - - - 13, 373 - - - 4, 4, 4, 4 - - - 236, 28 - - - 43 - - - pNUpdate - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - - 12 - Left @@ -2569,13 +3349,10 @@ NoControl - 4, 4 - - - 4, 0, 4, 0 + 3, 3 - 114, 17 + 86, 13 0 @@ -2599,13 +3376,10 @@ Top, Right - 125, 1 - - - 4, 4, 4, 4 + 100, 1 - 55, 22 + 44, 20 42 @@ -2632,13 +3406,10 @@ NoControl - 188, 4 - - - 4, 0, 4, 0 + 150, 3 - 25, 17 + 19, 13 0 @@ -2658,33 +3429,6 @@ 2 - - 344, 13 - - - 4, 4, 4, 4 - - - 232, 28 - - - 44 - - - pnlXIPorts - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - - 13 - - - True - True @@ -2692,13 +3436,10 @@ NoControl - 4, 0 - - - 4, 0, 4, 0 + 3, 0 - 88, 17 + 65, 13 50 @@ -2725,13 +3466,10 @@ NoControl - 4, 17 - - - 4, 0, 4, 0 + 3, 13 - 93, 17 + 70, 13 11 @@ -2758,13 +3496,10 @@ NoControl - 4, 34 - - - 4, 0, 4, 0 + 3, 26 - 141, 17 + 106, 13 44 @@ -2794,13 +3529,10 @@ NoControl - 4, 51 - - - 4, 0, 4, 0 + 3, 39 - 152, 17 + 115, 13 52 @@ -2827,13 +3559,10 @@ NoControl - 4, 68 - - - 4, 0, 4, 0 + 3, 52 - 149, 17 + 116, 13 49 @@ -2856,179 +3585,20 @@ 4 - - TopDown - - - 344, 49 - - - 4, 4, 4, 4 - - - 160, 85 - - - 56 - - - flowLayoutPanel1 - - - System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - - 14 - - - Fill - - - TopDown - - - 4, 4 - - - 4, 4, 4, 4 - - - 9, 9, 0, 11 - - - 1114, 444 - - - 0 - - - fLPSettings - - - System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabSettings - - - 0 - - - 4, 25 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 1122, 452 - - - 4 - - - Settings - - - tabSettings - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabMain - - - 3 - - - 4, 25 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 1122, 452 - - - 1 - - - Log - - - tabLog - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabMain - - - 4 - - - Fill - - - 0, 0 - - - 4, 4, 4, 4 - - - 1130, 481 - - - 12 - - - tabMain - - - System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - 673, 17 + 711, 17 XML Files (*.xml)|*.xml - 997, 17 + 123, 56 - 1110, 17 + 220, 56 - - 202, 26 - - - Use Profile Color - - - 202, 26 - - - Use Custom Color - - 203, 56 + 171, 48 cMCustomLed @@ -3036,26 +3606,38 @@ System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 170, 22 + + + Use Profile Color + + + 170, 22 + + + Use Custom Color + - 1264, 17 + 17, 17 True + + 91 + - 120, 120 + 96, 96 - 1130, 519 + 904, 415 NoControl - - 4, 4, 4, 4 - - 570, 277 + 459, 229 DS4Windows @@ -3304,7 +3886,7 @@ advColorDialog - DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.4.5.0, Culture=neutral, PublicKeyToken=null + DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.4.67.0, Culture=neutral, PublicKeyToken=null DS4Form diff --git a/DS4Windows/DS4Forms/Hotkeys.Designer.cs b/DS4Windows/DS4Forms/Hotkeys.Designer.cs index d910a0f..5643942 100644 --- a/DS4Windows/DS4Forms/Hotkeys.Designer.cs +++ b/DS4Windows/DS4Forms/Hotkeys.Designer.cs @@ -40,6 +40,7 @@ this.tPHotkeys = new System.Windows.Forms.TabPage(); this.lbHotkeys = new System.Windows.Forms.Label(); this.tPCredits = new System.Windows.Forms.TabPage(); + this.linkTeokp = new System.Windows.Forms.LinkLabel(); this.linkKiliansch = new System.Windows.Forms.LinkLabel(); this.linkChamilsaan = new System.Windows.Forms.LinkLabel(); this.linkBoganhobo = new System.Windows.Forms.LinkLabel(); @@ -85,7 +86,6 @@ this.lbTranslators = new System.Windows.Forms.Label(); this.linkSourceCode = new System.Windows.Forms.LinkLabel(); this.lbLinkText = new System.Windows.Forms.Label(); - this.linkTeokp = new System.Windows.Forms.LinkLabel(); this.tCAbout.SuspendLayout(); this.tPHotkeys.SuspendLayout(); this.tPCredits.SuspendLayout(); @@ -177,6 +177,13 @@ this.tPCredits.Name = "tPCredits"; this.tPCredits.UseVisualStyleBackColor = true; // + // linkTeokp + // + resources.ApplyResources(this.linkTeokp, "linkTeokp"); + this.linkTeokp.Name = "linkTeokp"; + this.linkTeokp.TabStop = true; + this.linkTeokp.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkTeokp_LinkClicked); + // // linkKiliansch // resources.ApplyResources(this.linkKiliansch, "linkKiliansch"); @@ -448,13 +455,6 @@ resources.ApplyResources(this.lbLinkText, "lbLinkText"); this.lbLinkText.Name = "lbLinkText"; // - // linkTeokp - // - resources.ApplyResources(this.linkTeokp, "linkTeokp"); - this.linkTeokp.Name = "linkTeokp"; - this.linkTeokp.TabStop = true; - this.linkTeokp.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkTeokp_LinkClicked); - // // Hotkeys // resources.ApplyResources(this, "$this"); diff --git a/DS4Windows/DS4Forms/Hotkeys.cs b/DS4Windows/DS4Forms/Hotkeys.cs index 0fbffb3..62b9961 100644 --- a/DS4Windows/DS4Forms/Hotkeys.cs +++ b/DS4Windows/DS4Forms/Hotkeys.cs @@ -77,7 +77,7 @@ namespace DS4Windows private void lLChangelog_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { - Process.Start("https://docs.google.com/document/d/1l4xcgVQkGUskc5CQ0p069yW22Cd5WAH_yE3Fz2hXo0E/edit?usp=sharing"); + Process.Start("https://docs.google.com/document/d/1CovpH08fbPSXrC6TmEprzgPwCe0tTjQ_HTFfDotpmxk/edit?usp=sharing"); } private void linkDonate_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) diff --git a/DS4Windows/DS4Forms/Hotkeys.resx b/DS4Windows/DS4Forms/Hotkeys.resx index fae6e6f..d37f105 100644 --- a/DS4Windows/DS4Forms/Hotkeys.resx +++ b/DS4Windows/DS4Forms/Hotkeys.resx @@ -123,14 +123,10 @@ - 8, 58 - - - - 4, 0, 4, 0 + 6, 47 - 201, 17 + 149, 13 18 @@ -154,13 +150,10 @@ True - 8, 4 - - - 4, 0, 4, 0 + 6, 3 - 80, 17 + 60, 13 18 @@ -180,6 +173,7 @@ 9 + Top @@ -189,11 +183,8 @@ 0, 0 - - 4, 0, 4, 0 - - 756, 44 + 567, 36 0 @@ -220,13 +211,10 @@ True - 8, 31 - - - 4, 0, 4, 0 + 6, 25 - 210, 17 + 159, 13 18 @@ -250,13 +238,10 @@ True - 8, 85 - - - 4, 0, 4, 0 + 6, 69 - 115, 17 + 87, 13 18 @@ -280,13 +265,10 @@ True - 5, 18 - - - 4, 0, 4, 0 + 4, 15 - 76, 17 + 58, 13 20 @@ -310,13 +292,10 @@ Top, Right - 513, 18 - - - 4, 0, 4, 0 + 385, 15 - 231, 17 + 173, 14 21 @@ -342,6 +321,801 @@ True + + lbHotkeys + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPHotkeys + + + 0 + + + 4, 22 + + + 3, 3, 3, 3 + + + 559, 447 + + + 0 + + + Hotkeys + + + tPHotkeys + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCAbout + + + 0 + + + True + + + NoControl + + + 208, 93 + + + 34, 13 + + + 23 + + + teokp + + + linkTeokp + + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPCredits + + + 0 + + + True + + + NoControl + + + 154, 93 + + + 48, 13 + + + 22 + + + kiliansch + + + linkKiliansch + + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPCredits + + + 1 + + + True + + + NoControl + + + 80, 93 + + + 61, 13 + + + 21 + + + Chamilsaan + + + linkChamilsaan + + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPCredits + + + 2 + + + True + + + NoControl + + + 7, 93 + + + 61, 13 + + + 20 + + + boganhobo + + + linkBoganhobo + + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPCredits + + + 3 + + + 2 + + + lbuk + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 0 + + + lbUkrainianT + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 1 + + + lbid + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 2 + + + lbIndonesianT + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 3 + + + lbhu + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 4 + + + lbHungarianT + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 5 + + + lbel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 6 + + + lbGreekT + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 7 + + + lbfi + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 8 + + + lbFinnishT + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 9 + + + lbcs + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 10 + + + lbCzechT + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 11 + + + lbpt + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 12 + + + lbPortugueseT + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 13 + + + lbes + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 14 + + + lbSpanishT + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 15 + + + lbpl + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 16 + + + lbPolishT + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 17 + + + lbde + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 18 + + + lbGermanT + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 19 + + + lbItalianT + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 20 + + + lbitIT + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 21 + + + lbruRU + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 22 + + + lbRussianT + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 23 + + + lbroRO + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 24 + + + lbRomanianT + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 25 + + + lbtr + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 26 + + + lbTurkishT + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 27 + + + lbzhHans + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 28 + + + lbChineseST + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 29 + + + lbzhHant + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 30 + + + lbChineseTT + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 31 + + + lbar + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 32 + + + lbArabicT + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 33 + + + lbhe + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 34 + + + lbHebrewT + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 35 + + + lbfrFR + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 36 + + + lbFrenchT + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPTranslators + + + 37 + + + Bottom + + + 3, 130 + + + 19 + + + 553, 301 + + + 19 + + + tLPTranslators + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPCredits + + + 4 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="lbuk" Row="18" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbUkrainianT" Row="18" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbid" Row="17" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbIndonesianT" Row="17" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbhu" Row="16" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbHungarianT" Row="16" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbel" Row="15" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbGreekT" Row="15" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbfi" Row="14" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbFinnishT" Row="14" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbcs" Row="13" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbCzechT" Row="13" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbpt" Row="12" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPortugueseT" Row="12" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbes" Row="11" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbSpanishT" Row="11" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbpl" Row="10" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPolishT" Row="10" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbde" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbGermanT" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbItalianT" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbitIT" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbruRU" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbRussianT" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbroRO" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbRomanianT" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbtr" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbTurkishT" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbzhHans" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbChineseST" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbzhHant" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbChineseTT" Row="6" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbar" Row="7" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbArabicT" Row="7" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbhe" Row="8" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbHebrewT" Row="8" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbfrFR" Row="9" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbFrenchT" Row="9" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="Percent,8.333333,Percent,8.333333,Percent,8.333333,Percent,8.333333,Percent,8.333333,Percent,8.333333,Percent,8.333333,Percent,8.333333,Percent,8.333333,Percent,8.333333,Percent,8.333333,Percent,8.333333,Absolute,16,Absolute,16,Absolute,16,Absolute,16,Absolute,16,Absolute,16,Absolute,16" /></TableLayoutSettings> + + + Bottom, Left + + + True + + + NoControl + + + 4, 114 + + + 59, 13 + + + 13 + + + Translators + + + lbTranslators + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPCredits + + + 5 + + + True + + + NoControl + + + 72, 3 + + + 69, 13 + + + 18 + + + Source Code + + + linkSourceCode + + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPCredits + + + 7 + + + True + + + Bottom + + + NoControl + + + 3, 431 + + + 103, 13 + + + 13 + + + Links displayed here + + + lbLinkText + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPCredits + + + 8 + + + 4, 22 + + + 3, 3, 3, 3 + + + 559, 447 + + + 1 + + + Credits + + + tPCredits + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCAbout + + + 1 + + + Fill + + + 0, 36 + + + 567, 473 + + + 22 + + + tCAbout + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + Top @@ -349,13 +1123,10 @@ NoControl - 4, 4 - - - 4, 0, 4, 0 + 3, 3 - 719, 559 + 536, 454 3 @@ -391,171 +1162,6 @@ Scan Code: Keys are interpreted differently. May be needed for certain games 0 - - 4, 25 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 748, 553 - - - 0 - - - Hotkeys - - - tPHotkeys - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tCAbout - - - 0 - - - True - - - NoControl - - - 278, 114 - - - 4, 0, 4, 0 - - - 43, 17 - - - 23 - - - teokp - - - linkTeokp - - - System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPCredits - - - 0 - - - True - - - NoControl - - - 205, 114 - - - 4, 0, 4, 0 - - - 62, 17 - - - 22 - - - kiliansch - - - linkKiliansch - - - System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPCredits - - - 1 - - - True - - - NoControl - - - 106, 114 - - - 4, 0, 4, 0 - - - 81, 17 - - - 21 - - - Chamilsaan - - - linkChamilsaan - - - System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPCredits - - - 2 - - - True - - - NoControl - - - 9, 114 - - - 4, 0, 4, 0 - - - 80, 17 - - - 20 - - - boganhobo - - - linkBoganhobo - - - System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPCredits - - - 3 - - - 2 - True @@ -563,10 +1169,13 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 3, 348 + 2, 276 + + + 2, 0, 2, 0 - 68, 17 + 52, 13 43 @@ -593,10 +1202,13 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 189, 348 + 147, 276 + + + 2, 0, 2, 0 - 78, 17 + 61, 13 42 @@ -623,10 +1235,13 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 3, 328 + 2, 260 + + + 2, 0, 2, 0 - 77, 17 + 59, 13 41 @@ -653,10 +1268,13 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 189, 328 + 147, 260 + + + 2, 0, 2, 0 - 95, 17 + 72, 13 40 @@ -683,10 +1301,13 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 3, 308 + 2, 244 + + + 2, 0, 2, 0 - 74, 17 + 56, 13 39 @@ -713,10 +1334,13 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 189, 308 + 147, 244 + + + 2, 0, 2, 0 - 165, 17 + 123, 13 38 @@ -743,10 +1367,13 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 3, 288 + 2, 228 + + + 2, 0, 2, 0 - 107, 17 + 84, 13 37 @@ -773,10 +1400,13 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 189, 288 + 147, 228 + + + 2, 0, 2, 0 - 415, 17 + 309, 13 36 @@ -803,10 +1433,13 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 3, 268 + 2, 212 + + + 2, 0, 2, 0 - 53, 17 + 40, 13 35 @@ -833,10 +1466,13 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 189, 268 + 147, 212 + + + 2, 0, 2, 0 - 23, 17 + 18, 13 34 @@ -863,10 +1499,13 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 3, 248 + 2, 196 + + + 2, 0, 2, 0 - 47, 17 + 37, 13 33 @@ -893,10 +1532,13 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 189, 248 + 147, 196 + + + 2, 0, 2, 0 - 147, 17 + 112, 13 32 @@ -923,10 +1565,13 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 3, 228 + 2, 180 + + + 2, 0, 2, 0 - 81, 17 + 61, 13 31 @@ -953,10 +1598,13 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 189, 228 + 147, 180 + + + 2, 0, 2, 0 - 56, 17 + 44, 13 30 @@ -980,10 +1628,13 @@ Scan Code: Keys are interpreted differently. May be needed for certain games True - 3, 209 + 2, 165 + + + 2, 0, 2, 0 - 114, 17 + 88, 13 0 @@ -1007,10 +1658,13 @@ Scan Code: Keys are interpreted differently. May be needed for certain games True - 189, 209 + 147, 165 + + + 2, 0, 2, 0 - 56, 17 + 43, 13 1 @@ -1034,10 +1688,13 @@ Scan Code: Keys are interpreted differently. May be needed for certain games True - 3, 190 + 2, 150 + + + 2, 0, 2, 0 - 86, 17 + 67, 13 2 @@ -1061,10 +1718,13 @@ Scan Code: Keys are interpreted differently. May be needed for certain games True - 189, 190 + 147, 150 + + + 2, 0, 2, 0 - 188, 17 + 145, 13 3 @@ -1091,13 +1751,10 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 4, 0 - - - 4, 0, 4, 0 + 3, 0 - 115, 17 + 89, 13 13 @@ -1127,13 +1784,10 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 190, 0 - - - 4, 0, 4, 0 + 148, 0 - 546, 19 + 402, 15 13 @@ -1163,13 +1817,10 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 190, 19 - - - 4, 0, 4, 0 + 148, 15 - 546, 19 + 402, 15 13 @@ -1196,13 +1847,10 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 4, 19 - - - 4, 0, 4, 0 + 3, 15 - 94, 17 + 74, 13 13 @@ -1229,13 +1877,10 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 4, 38 - - - 4, 0, 4, 0 + 3, 30 - 151, 17 + 120, 13 13 @@ -1265,13 +1910,10 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 190, 38 - - - 4, 0, 4, 0 + 148, 30 - 546, 19 + 402, 15 13 @@ -1298,13 +1940,10 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 4, 57 - - - 4, 0, 4, 0 + 3, 45 - 124, 17 + 95, 13 16 @@ -1334,13 +1973,10 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 190, 57 - - - 4, 0, 4, 0 + 148, 45 - 546, 19 + 402, 15 17 @@ -1367,13 +2003,10 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 4, 76 - - - 4, 0, 4, 0 + 3, 60 - 103, 17 + 81, 13 18 @@ -1403,13 +2036,10 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 190, 76 - - - 4, 0, 4, 0 + 148, 60 - 546, 19 + 402, 15 19 @@ -1436,13 +2066,10 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 4, 95 - - - 4, 0, 4, 0 + 3, 75 - 178, 17 + 139, 13 21 @@ -1469,13 +2096,10 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 190, 95 - - - 4, 0, 4, 0 + 148, 75 - 118, 17 + 89, 13 20 @@ -1502,13 +2126,10 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 4, 114 - - - 4, 0, 4, 0 + 3, 90 - 177, 17 + 138, 13 23 @@ -1535,13 +2156,10 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 190, 114 - - - 4, 0, 4, 0 + 148, 90 - 114, 17 + 86, 13 22 @@ -1568,13 +2186,10 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 4, 133 - - - 4, 0, 4, 0 + 3, 105 - 85, 17 + 75, 13 25 @@ -1601,13 +2216,10 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 190, 133 - - - 4, 0, 4, 0 + 148, 105 - 93, 17 + 72, 13 24 @@ -1634,13 +2246,10 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 4, 152 - - - 4, 0, 4, 0 + 3, 120 - 95, 17 + 81, 13 27 @@ -1667,13 +2276,10 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 190, 152 - - - 4, 0, 4, 0 + 148, 120 - 42, 17 + 33, 13 26 @@ -1697,10 +2303,13 @@ Scan Code: Keys are interpreted differently. May be needed for certain games True - 3, 171 + 2, 135 + + + 2, 0, 2, 0 - 110, 17 + 85, 13 28 @@ -1727,10 +2336,13 @@ Scan Code: Keys are interpreted differently. May be needed for certain games NoControl - 189, 171 + 147, 135 + + + 2, 0, 2, 0 - 163, 17 + 122, 13 29 @@ -1750,215 +2362,17 @@ Scan Code: Keys are interpreted differently. May be needed for certain games 37 - - Bottom - - - 4, 161 - - - 4, 4, 4, 4 - - - 19 - - - 740, 371 - - - 19 - - - tLPTranslators - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPCredits - - - 4 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="lbuk" Row="18" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbUkrainianT" Row="18" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbid" Row="17" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbIndonesianT" Row="17" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbhu" Row="16" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbHungarianT" Row="16" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbel" Row="15" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbGreekT" Row="15" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbfi" Row="14" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbFinnishT" Row="14" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbcs" Row="13" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbCzechT" Row="13" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbpt" Row="12" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPortugueseT" Row="12" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbes" Row="11" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbSpanishT" Row="11" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbpl" Row="10" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPolishT" Row="10" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbde" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbGermanT" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbItalianT" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbitIT" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbruRU" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbRussianT" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbroRO" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbRomanianT" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbtr" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbTurkishT" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbzhHans" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbChineseST" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbzhHant" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbChineseTT" Row="6" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbar" Row="7" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbArabicT" Row="7" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbhe" Row="8" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbHebrewT" Row="8" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbfrFR" Row="9" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbFrenchT" Row="9" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="Percent,8.333333,Percent,8.333333,Percent,8.333333,Percent,8.333333,Percent,8.333333,Percent,8.333333,Percent,8.333333,Percent,8.333333,Percent,8.333333,Percent,8.333333,Percent,8.333333,Percent,8.333333,Absolute,20,Absolute,20,Absolute,20,Absolute,20,Absolute,20,Absolute,20,Absolute,20" /></TableLayoutSettings> - - - Bottom, Left - - - True - - - NoControl - - - 5, 140 - - - 4, 0, 4, 0 - - - 80, 17 - - - 13 - - - Translators - - - lbTranslators - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPCredits - - - 5 - - - True - - - NoControl - - - 96, 4 - - - 4, 0, 4, 0 - - - 90, 17 - - - 18 - - - Source Code - - - linkSourceCode - - - System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPCredits - - - 7 - - - True - - - Bottom - - - NoControl - - - 4, 532 - - - 4, 0, 4, 0 - - - 138, 17 - - - 13 - - - Links displayed here - - - lbLinkText - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPCredits - - - 8 - - - 4, 25 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 748, 553 - - - 1 - - - Credits - - - tPCredits - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tCAbout - - - 1 - - - Fill - - - 0, 44 - - - 4, 4, 4, 4 - - - 756, 582 - - - 22 - - - tCAbout - - - System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - True - 8, 16 + 6, 13 - 756, 626 - - - 4, 4, 4, 4 + 567, 509 - 670, 516 + 506, 427 CenterParent diff --git a/DS4Windows/DS4Forms/KBM360.cs b/DS4Windows/DS4Forms/KBM360.cs index 0d1a9b3..84203e8 100644 --- a/DS4Windows/DS4Forms/KBM360.cs +++ b/DS4Windows/DS4Forms/KBM360.cs @@ -34,8 +34,9 @@ namespace DS4Windows device = deviceNum; ops = ooo; button = buton; - cBToggle.Checked = button.Font.Italic; - cBScanCode.Checked = button.Font.Bold; + DS4ControlSettings dcs = Global.getDS4CSetting(device, button.Name); + cBToggle.Checked = dcs.keyType.HasFlag(DS4KeyType.Toggle); + cBScanCode.Checked = dcs.keyType.HasFlag(DS4KeyType.ScanCode); oldSC = cBScanCode.Location; defaultText = btnDefault.Text; if (button.Name.StartsWith("bnShift")) @@ -140,7 +141,17 @@ namespace DS4Windows object keytag; //ushort val; if (((Button)sender).Tag != null && ((Button)sender).Tag.ToString().Contains("X360")) - keytag = ((Button)sender).Tag.ToString().Substring(4); + { + //keytag = ((Button)sender).Tag.ToString().Substring(4); + keytag = Global.getX360ControlsByName(((Button)sender).Tag.ToString().Substring(4)); + DS4Controls psButton = Global.getDS4ControlsByName(button.Name); + if ((X360Controls)keytag == Global.getDefaultX360ControlBinding(psButton) && + !cBScanCode.Checked && !cBToggle.Checked && !rBShiftModifer.Checked) + { + // Reset action + keytag = null; + } + } else if (((Button)sender).Tag != null && ushort.TryParse(((Button)sender).Tag.ToString(), out val)) keytag = val; else @@ -454,7 +465,7 @@ namespace DS4Windows lBMacroOn.Visible = true; foreach (int i in tag) macrostag.Add(i); - if (Global.GetDS4KeyType(device, button.Name, rBShiftModifer.Checked).HasFlag(DS4KeyType.RepeatMacro)) + if (Global.GetDS4KeyType(device, button.Name, rBShiftModifer.Checked).HasFlag(DS4KeyType.HoldMacro)) macrorepeat = true; } else if (tagO is string || tagO is X360Controls) @@ -509,55 +520,65 @@ namespace DS4Windows } } } - string[] extras = Global.GetDS4Extra(device, button.Name, rBShiftModifer.Checked).Split(','); - int b; - try + string dcExtras = Global.GetDS4Extra(device, button.Name, rBShiftModifer.Checked); + string[] extras = null; + if (!string.IsNullOrEmpty(dcExtras)) { - if (int.TryParse(extras[0], out b)) nUDHeavy.Value = b; - if (int.TryParse(extras[1], out b)) nUDLight.Value = b; - if (int.TryParse(extras[2], out b)) - if (b == 1) - { - cBLightbar.Checked = true; - if (int.TryParse(extras[3], out b)) tBRedBar.Value = b; - if (int.TryParse(extras[4], out b)) tBGreenBar.Value = b; - if (int.TryParse(extras[5], out b)) tBBlueBar.Value = b; - if (int.TryParse(extras[6], out b)) nUDLightFlash.Value = b; - } - else - { - - tBRedBar.Value = 255; - tBGreenBar.Value = 255; - tBBlueBar.Value = 255; - nUDLightFlash.Value = 0; - cBLightbar.Checked = false; - } - if (int.TryParse(extras[7], out b)) - if (b == 1) - { - cBMouse.Checked = true; - if (int.TryParse(extras[8], out b)) nUDMouse.Value = b; - } - else - { - nUDMouse.Value = 25; - cBMouse.Checked = false; - } - + extras = dcExtras.Split(','); } - catch + + if (extras != null) { - nUDHeavy.Value = 0; - nUDLight.Value = 0; - tBRedBar.Value = 255; - tBGreenBar.Value = 255; - tBBlueBar.Value = 255; - nUDLightFlash.Value = 0; - cBLightbar.Checked = false; - nUDMouse.Value = 25; - cBMouse.Checked = false; + int b; + try + { + if (int.TryParse(extras[0], out b)) nUDHeavy.Value = b; + if (int.TryParse(extras[1], out b)) nUDLight.Value = b; + if (int.TryParse(extras[2], out b)) + if (b == 1) + { + cBLightbar.Checked = true; + if (int.TryParse(extras[3], out b)) tBRedBar.Value = b; + if (int.TryParse(extras[4], out b)) tBGreenBar.Value = b; + if (int.TryParse(extras[5], out b)) tBBlueBar.Value = b; + if (int.TryParse(extras[6], out b)) nUDLightFlash.Value = b; + } + else + { + + tBRedBar.Value = 255; + tBGreenBar.Value = 255; + tBBlueBar.Value = 255; + nUDLightFlash.Value = 0; + cBLightbar.Checked = false; + } + if (int.TryParse(extras[7], out b)) + if (b == 1) + { + cBMouse.Checked = true; + if (int.TryParse(extras[8], out b)) nUDMouse.Value = b; + } + else + { + nUDMouse.Value = 25; + cBMouse.Checked = false; + } + + } + catch + { + nUDHeavy.Value = 0; + nUDLight.Value = 0; + tBRedBar.Value = 255; + tBGreenBar.Value = 255; + tBBlueBar.Value = 255; + nUDLightFlash.Value = 0; + cBLightbar.Checked = false; + nUDMouse.Value = 25; + cBMouse.Checked = false; + } } + extraChanged = false; } diff --git a/DS4Windows/DS4Forms/Options.Designer.cs b/DS4Windows/DS4Forms/Options.Designer.cs index 4e71cdc..e83efc3 100644 --- a/DS4Windows/DS4Forms/Options.Designer.cs +++ b/DS4Windows/DS4Forms/Options.Designer.cs @@ -114,6 +114,7 @@ this.bnSwipeRight = new System.Windows.Forms.Button(); this.lbSwipeRight = new System.Windows.Forms.Label(); this.gBOther = new System.Windows.Forms.GroupBox(); + this.enableTouchToggleCheckbox = new System.Windows.Forms.CheckBox(); this.cBDinput = new System.Windows.Forms.CheckBox(); this.pBProgram = new System.Windows.Forms.PictureBox(); this.cBLaunchProgram = new System.Windows.Forms.CheckBox(); @@ -256,6 +257,15 @@ this.lbRSCurvePercent = new System.Windows.Forms.Label(); this.lbLSCurvePercent = new System.Windows.Forms.Label(); this.lbLSCurve = new System.Windows.Forms.Label(); + this.antiDeadzoneTabPage = new System.Windows.Forms.TabPage(); + this.nUDR2AntiDead = new System.Windows.Forms.NumericUpDown(); + this.label3 = new System.Windows.Forms.Label(); + this.nUDL2AntiDead = new System.Windows.Forms.NumericUpDown(); + this.label4 = new System.Windows.Forms.Label(); + this.nUDRSAntiDead = new System.Windows.Forms.NumericUpDown(); + this.label2 = new System.Windows.Forms.Label(); + this.nUDLSAntiDead = new System.Windows.Forms.NumericUpDown(); + this.label1 = new System.Windows.Forms.Label(); this.fLPSettings = new System.Windows.Forms.FlowLayoutPanel(); this.gBGyro = new System.Windows.Forms.GroupBox(); this.rBSAControls = new System.Windows.Forms.RadioButton(); @@ -302,6 +312,15 @@ this.shareToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.pSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.alwaysOnToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.maxZoneTabPage = new System.Windows.Forms.TabPage(); + this.label5 = new System.Windows.Forms.Label(); + this.nUDLSMaxZone = new System.Windows.Forms.NumericUpDown(); + this.label6 = new System.Windows.Forms.Label(); + this.nUDRSMaxZone = new System.Windows.Forms.NumericUpDown(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.nUDL2Maxzone = new System.Windows.Forms.NumericUpDown(); + this.nUDR2Maxzone = new System.Windows.Forms.NumericUpDown(); this.advColorDialog = new DS4Windows.AdvancedColorDialog(); ((System.ComponentModel.ISupportInitialize)(this.nUDRainbow)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tBBlueBar)).BeginInit(); @@ -362,6 +381,11 @@ this.tPCurve.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nUDLSCurve)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDRSCurve)).BeginInit(); + this.antiDeadzoneTabPage.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nUDR2AntiDead)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDL2AntiDead)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDRSAntiDead)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDLSAntiDead)).BeginInit(); this.fLPSettings.SuspendLayout(); this.gBGyro.SuspendLayout(); this.pnlSAMouse.SuspendLayout(); @@ -374,12 +398,17 @@ ((System.ComponentModel.ISupportInitialize)(this.nUDSXS)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDSZS)).BeginInit(); this.cMGyroTriggers.SuspendLayout(); + this.maxZoneTabPage.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nUDLSMaxZone)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDRSMaxZone)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDL2Maxzone)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDR2Maxzone)).BeginInit(); this.SuspendLayout(); // // lowColorChooserButton // - resources.ApplyResources(this.lowColorChooserButton, "lowColorChooserButton"); this.lowColorChooserButton.BackColor = System.Drawing.Color.White; + resources.ApplyResources(this.lowColorChooserButton, "lowColorChooserButton"); this.lowColorChooserButton.Name = "lowColorChooserButton"; this.lowColorChooserButton.UseVisualStyleBackColor = false; this.lowColorChooserButton.Click += new System.EventHandler(this.lowColorChooserButton_Click); @@ -594,8 +623,8 @@ // // nUDIdleDisconnect // - resources.ApplyResources(this.nUDIdleDisconnect, "nUDIdleDisconnect"); this.nUDIdleDisconnect.DecimalPlaces = 1; + resources.ApplyResources(this.nUDIdleDisconnect, "nUDIdleDisconnect"); this.nUDIdleDisconnect.Maximum = new decimal(new int[] { 60, 0, @@ -606,13 +635,13 @@ // // nUDR2 // - resources.ApplyResources(this.nUDR2, "nUDR2"); this.nUDR2.DecimalPlaces = 2; this.nUDR2.Increment = new decimal(new int[] { 1, 0, 0, 65536}); + resources.ApplyResources(this.nUDR2, "nUDR2"); this.nUDR2.Maximum = new decimal(new int[] { 1, 0, @@ -718,7 +747,6 @@ // // pnlFull // - resources.ApplyResources(this.pnlFull, "pnlFull"); this.pnlFull.Controls.Add(this.lbFull); this.pnlFull.Controls.Add(this.lbRed); this.pnlFull.Controls.Add(this.lbGreen); @@ -726,11 +754,11 @@ this.pnlFull.Controls.Add(this.tBRedBar); this.pnlFull.Controls.Add(this.tBGreenBar); this.pnlFull.Controls.Add(this.tBBlueBar); + resources.ApplyResources(this.pnlFull, "pnlFull"); this.pnlFull.Name = "pnlFull"; // // pnlLowBattery // - resources.ApplyResources(this.pnlLowBattery, "pnlLowBattery"); this.pnlLowBattery.Controls.Add(this.lowColorChooserButton); this.pnlLowBattery.Controls.Add(this.lbLowRed); this.pnlLowBattery.Controls.Add(this.lbLowGreen); @@ -739,6 +767,7 @@ this.pnlLowBattery.Controls.Add(this.tBLowGreenBar); this.pnlLowBattery.Controls.Add(this.tBLowBlueBar); this.pnlLowBattery.Controls.Add(this.lbEmpty); + resources.ApplyResources(this.pnlLowBattery, "pnlLowBattery"); this.pnlLowBattery.Name = "pnlLowBattery"; // // lbRS @@ -753,23 +782,18 @@ // // nUDRS // - resources.ApplyResources(this.nUDRS, "nUDRS"); this.nUDRS.DecimalPlaces = 2; this.nUDRS.Increment = new decimal(new int[] { 1, 0, 0, 65536}); + resources.ApplyResources(this.nUDRS, "nUDRS"); this.nUDRS.Maximum = new decimal(new int[] { 1, 0, 0, 0}); - this.nUDRS.Minimum = new decimal(new int[] { - 1, - 0, - 0, - -2147483648}); this.nUDRS.Name = "nUDRS"; this.nUDRS.ValueChanged += new System.EventHandler(this.numUDRS_ValueChanged); // @@ -791,35 +815,30 @@ // // nUDLS // - resources.ApplyResources(this.nUDLS, "nUDLS"); this.nUDLS.DecimalPlaces = 2; this.nUDLS.Increment = new decimal(new int[] { 1, 0, 0, 65536}); + resources.ApplyResources(this.nUDLS, "nUDLS"); this.nUDLS.Maximum = new decimal(new int[] { 1, 0, 0, 0}); - this.nUDLS.Minimum = new decimal(new int[] { - 1, - 0, - 0, - -2147483648}); this.nUDLS.Name = "nUDLS"; this.nUDLS.ValueChanged += new System.EventHandler(this.numUDLS_ValueChanged); // // nUDL2 // - resources.ApplyResources(this.nUDL2, "nUDL2"); this.nUDL2.DecimalPlaces = 2; this.nUDL2.Increment = new decimal(new int[] { 1, 0, 0, 65536}); + resources.ApplyResources(this.nUDL2, "nUDL2"); this.nUDL2.Maximum = new decimal(new int[] { 1, 0, @@ -830,19 +849,18 @@ // // gBTouchpad // - resources.ApplyResources(this.gBTouchpad, "gBTouchpad"); this.gBTouchpad.BackColor = System.Drawing.Color.Transparent; this.gBTouchpad.Controls.Add(this.pnlTPMouse); this.gBTouchpad.Controls.Add(this.rBTPControls); this.gBTouchpad.Controls.Add(this.rBTPMouse); this.gBTouchpad.Controls.Add(this.fLPTouchSwipe); this.gBTouchpad.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.gBTouchpad, "gBTouchpad"); this.gBTouchpad.Name = "gBTouchpad"; this.gBTouchpad.TabStop = false; // // pnlTPMouse // - resources.ApplyResources(this.pnlTPMouse, "pnlTPMouse"); this.pnlTPMouse.Controls.Add(this.nUDScroll); this.pnlTPMouse.Controls.Add(this.cBDoubleTap); this.pnlTPMouse.Controls.Add(this.cBScroll); @@ -853,6 +871,7 @@ this.pnlTPMouse.Controls.Add(this.cBSlide); this.pnlTPMouse.Controls.Add(this.nUDTouch); this.pnlTPMouse.Controls.Add(this.cbStartTouchpadOff); + resources.ApplyResources(this.pnlTPMouse, "pnlTPMouse"); this.pnlTPMouse.Name = "pnlTPMouse"; // // cbStartTouchpadOff @@ -883,7 +902,6 @@ // // fLPTouchSwipe // - resources.ApplyResources(this.fLPTouchSwipe, "fLPTouchSwipe"); this.fLPTouchSwipe.Controls.Add(this.bnSwipeUp); this.fLPTouchSwipe.Controls.Add(this.lbSwipeUp); this.fLPTouchSwipe.Controls.Add(this.bnSwipeDown); @@ -892,13 +910,14 @@ this.fLPTouchSwipe.Controls.Add(this.lbSwipeLeft); this.fLPTouchSwipe.Controls.Add(this.bnSwipeRight); this.fLPTouchSwipe.Controls.Add(this.lbSwipeRight); + resources.ApplyResources(this.fLPTouchSwipe, "fLPTouchSwipe"); this.fLPTouchSwipe.Name = "fLPTouchSwipe"; // // bnSwipeUp // - resources.ApplyResources(this.bnSwipeUp, "bnSwipeUp"); this.bnSwipeUp.BackColor = System.Drawing.SystemColors.ControlText; this.bnSwipeUp.ContextMenuStrip = this.cMSPresets; + resources.ApplyResources(this.bnSwipeUp, "bnSwipeUp"); this.bnSwipeUp.ForeColor = System.Drawing.SystemColors.ControlLightLight; this.bnSwipeUp.Name = "bnSwipeUp"; this.bnSwipeUp.UseVisualStyleBackColor = false; @@ -906,7 +925,6 @@ // // cMSPresets // - resources.ApplyResources(this.cMSPresets, "cMSPresets"); this.cMSPresets.ImageScalingSize = new System.Drawing.Size(20, 20); this.cMSPresets.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.controlToolStripMenuItem, @@ -921,6 +939,7 @@ this.MouseToolStripMenuItem}); this.cMSPresets.Name = "contextMenuStrip1"; this.cMSPresets.ShowImageMargin = false; + resources.ApplyResources(this.cMSPresets, "cMSPresets"); this.cMSPresets.Opened += new System.EventHandler(this.cMSPresets_Opened); // // controlToolStripMenuItem @@ -930,173 +949,173 @@ // // toolStripSeparator1 // - resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1"); this.toolStripSeparator1.Name = "toolStripSeparator1"; + resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1"); // // defaultToolStripMenuItem // - resources.ApplyResources(this.defaultToolStripMenuItem, "defaultToolStripMenuItem"); this.defaultToolStripMenuItem.Name = "defaultToolStripMenuItem"; + resources.ApplyResources(this.defaultToolStripMenuItem, "defaultToolStripMenuItem"); this.defaultToolStripMenuItem.Click += new System.EventHandler(this.SetPreset); // // DpadToolStripMenuItem // - resources.ApplyResources(this.DpadToolStripMenuItem, "DpadToolStripMenuItem"); this.DpadToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.tSMIDPadInverted, this.tSMIDPadInvertedX, this.tSMIDPadInvertedY}); this.DpadToolStripMenuItem.Name = "DpadToolStripMenuItem"; + resources.ApplyResources(this.DpadToolStripMenuItem, "DpadToolStripMenuItem"); this.DpadToolStripMenuItem.Click += new System.EventHandler(this.SetPreset); // // tSMIDPadInverted // - resources.ApplyResources(this.tSMIDPadInverted, "tSMIDPadInverted"); this.tSMIDPadInverted.Name = "tSMIDPadInverted"; + resources.ApplyResources(this.tSMIDPadInverted, "tSMIDPadInverted"); this.tSMIDPadInverted.Click += new System.EventHandler(this.SetPreset); // // tSMIDPadInvertedX // - resources.ApplyResources(this.tSMIDPadInvertedX, "tSMIDPadInvertedX"); this.tSMIDPadInvertedX.Name = "tSMIDPadInvertedX"; + resources.ApplyResources(this.tSMIDPadInvertedX, "tSMIDPadInvertedX"); this.tSMIDPadInvertedX.Click += new System.EventHandler(this.SetPreset); // // tSMIDPadInvertedY // - resources.ApplyResources(this.tSMIDPadInvertedY, "tSMIDPadInvertedY"); this.tSMIDPadInvertedY.Name = "tSMIDPadInvertedY"; + resources.ApplyResources(this.tSMIDPadInvertedY, "tSMIDPadInvertedY"); this.tSMIDPadInvertedY.Click += new System.EventHandler(this.SetPreset); // // LSToolStripMenuItem // - resources.ApplyResources(this.LSToolStripMenuItem, "LSToolStripMenuItem"); this.LSToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.tSMILSInverted, this.tSMILSInvertedX, this.tSMILSInvertedY}); this.LSToolStripMenuItem.Name = "LSToolStripMenuItem"; + resources.ApplyResources(this.LSToolStripMenuItem, "LSToolStripMenuItem"); this.LSToolStripMenuItem.Click += new System.EventHandler(this.SetPreset); // // tSMILSInverted // - resources.ApplyResources(this.tSMILSInverted, "tSMILSInverted"); this.tSMILSInverted.Name = "tSMILSInverted"; + resources.ApplyResources(this.tSMILSInverted, "tSMILSInverted"); this.tSMILSInverted.Click += new System.EventHandler(this.SetPreset); // // tSMILSInvertedX // - resources.ApplyResources(this.tSMILSInvertedX, "tSMILSInvertedX"); this.tSMILSInvertedX.Name = "tSMILSInvertedX"; + resources.ApplyResources(this.tSMILSInvertedX, "tSMILSInvertedX"); this.tSMILSInvertedX.Click += new System.EventHandler(this.SetPreset); // // tSMILSInvertedY // - resources.ApplyResources(this.tSMILSInvertedY, "tSMILSInvertedY"); this.tSMILSInvertedY.Name = "tSMILSInvertedY"; + resources.ApplyResources(this.tSMILSInvertedY, "tSMILSInvertedY"); this.tSMILSInvertedY.Click += new System.EventHandler(this.SetPreset); // // RSToolStripMenuItem // - resources.ApplyResources(this.RSToolStripMenuItem, "RSToolStripMenuItem"); this.RSToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.tSMIRSInverted, this.tSMIRSInvertedX, this.tSMIRSInvertedY}); this.RSToolStripMenuItem.Name = "RSToolStripMenuItem"; + resources.ApplyResources(this.RSToolStripMenuItem, "RSToolStripMenuItem"); this.RSToolStripMenuItem.Click += new System.EventHandler(this.SetPreset); // // tSMIRSInverted // - resources.ApplyResources(this.tSMIRSInverted, "tSMIRSInverted"); this.tSMIRSInverted.Name = "tSMIRSInverted"; + resources.ApplyResources(this.tSMIRSInverted, "tSMIRSInverted"); this.tSMIRSInverted.Click += new System.EventHandler(this.SetPreset); // // tSMIRSInvertedX // - resources.ApplyResources(this.tSMIRSInvertedX, "tSMIRSInvertedX"); this.tSMIRSInvertedX.Name = "tSMIRSInvertedX"; + resources.ApplyResources(this.tSMIRSInvertedX, "tSMIRSInvertedX"); this.tSMIRSInvertedX.Click += new System.EventHandler(this.SetPreset); // // tSMIRSInvertedY // - resources.ApplyResources(this.tSMIRSInvertedY, "tSMIRSInvertedY"); this.tSMIRSInvertedY.Name = "tSMIRSInvertedY"; + resources.ApplyResources(this.tSMIRSInvertedY, "tSMIRSInvertedY"); this.tSMIRSInvertedY.Click += new System.EventHandler(this.SetPreset); // // ABXYToolStripMenuItem // - resources.ApplyResources(this.ABXYToolStripMenuItem, "ABXYToolStripMenuItem"); this.ABXYToolStripMenuItem.Name = "ABXYToolStripMenuItem"; + resources.ApplyResources(this.ABXYToolStripMenuItem, "ABXYToolStripMenuItem"); this.ABXYToolStripMenuItem.Click += new System.EventHandler(this.SetPreset); // // WASDToolStripMenuItem // - resources.ApplyResources(this.WASDToolStripMenuItem, "WASDToolStripMenuItem"); this.WASDToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.wScanCodeWASDToolStripMenuItem}); this.WASDToolStripMenuItem.Name = "WASDToolStripMenuItem"; + resources.ApplyResources(this.WASDToolStripMenuItem, "WASDToolStripMenuItem"); this.WASDToolStripMenuItem.Click += new System.EventHandler(this.SetPreset); // // wScanCodeWASDToolStripMenuItem // - resources.ApplyResources(this.wScanCodeWASDToolStripMenuItem, "wScanCodeWASDToolStripMenuItem"); this.wScanCodeWASDToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.wScanCodeWASDToolStripMenuItem.Name = "wScanCodeWASDToolStripMenuItem"; + resources.ApplyResources(this.wScanCodeWASDToolStripMenuItem, "wScanCodeWASDToolStripMenuItem"); this.wScanCodeWASDToolStripMenuItem.Click += new System.EventHandler(this.SetPreset); // // ArrowKeysToolStripMenuItem // - resources.ApplyResources(this.ArrowKeysToolStripMenuItem, "ArrowKeysToolStripMenuItem"); this.ArrowKeysToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.wScanCodeArrowKeysToolStripMenuItem}); this.ArrowKeysToolStripMenuItem.Name = "ArrowKeysToolStripMenuItem"; + resources.ApplyResources(this.ArrowKeysToolStripMenuItem, "ArrowKeysToolStripMenuItem"); this.ArrowKeysToolStripMenuItem.Click += new System.EventHandler(this.SetPreset); // // wScanCodeArrowKeysToolStripMenuItem // - resources.ApplyResources(this.wScanCodeArrowKeysToolStripMenuItem, "wScanCodeArrowKeysToolStripMenuItem"); this.wScanCodeArrowKeysToolStripMenuItem.Name = "wScanCodeArrowKeysToolStripMenuItem"; + resources.ApplyResources(this.wScanCodeArrowKeysToolStripMenuItem, "wScanCodeArrowKeysToolStripMenuItem"); this.wScanCodeArrowKeysToolStripMenuItem.Click += new System.EventHandler(this.SetPreset); // // MouseToolStripMenuItem // - resources.ApplyResources(this.MouseToolStripMenuItem, "MouseToolStripMenuItem"); this.MouseToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.tSMIMouseInverted, this.tSMIMouseInvertedX, this.tSMIMouseInvertedY}); this.MouseToolStripMenuItem.Name = "MouseToolStripMenuItem"; + resources.ApplyResources(this.MouseToolStripMenuItem, "MouseToolStripMenuItem"); this.MouseToolStripMenuItem.Click += new System.EventHandler(this.SetPreset); // // tSMIMouseInverted // - resources.ApplyResources(this.tSMIMouseInverted, "tSMIMouseInverted"); this.tSMIMouseInverted.Name = "tSMIMouseInverted"; + resources.ApplyResources(this.tSMIMouseInverted, "tSMIMouseInverted"); this.tSMIMouseInverted.Click += new System.EventHandler(this.SetPreset); // // tSMIMouseInvertedX // - resources.ApplyResources(this.tSMIMouseInvertedX, "tSMIMouseInvertedX"); this.tSMIMouseInvertedX.Name = "tSMIMouseInvertedX"; + resources.ApplyResources(this.tSMIMouseInvertedX, "tSMIMouseInvertedX"); this.tSMIMouseInvertedX.Click += new System.EventHandler(this.SetPreset); // // tSMIMouseInvertedY // - resources.ApplyResources(this.tSMIMouseInvertedY, "tSMIMouseInvertedY"); this.tSMIMouseInvertedY.Name = "tSMIMouseInvertedY"; + resources.ApplyResources(this.tSMIMouseInvertedY, "tSMIMouseInvertedY"); this.tSMIMouseInvertedY.Click += new System.EventHandler(this.SetPreset); // // lbSwipeUp // - resources.ApplyResources(this.lbSwipeUp, "lbSwipeUp"); this.lbSwipeUp.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbSwipeUp, "lbSwipeUp"); this.lbSwipeUp.Name = "lbSwipeUp"; // // bnSwipeDown // - resources.ApplyResources(this.bnSwipeDown, "bnSwipeDown"); this.bnSwipeDown.BackColor = System.Drawing.SystemColors.ControlText; this.bnSwipeDown.ContextMenuStrip = this.cMSPresets; + resources.ApplyResources(this.bnSwipeDown, "bnSwipeDown"); this.bnSwipeDown.ForeColor = System.Drawing.SystemColors.ControlLightLight; this.bnSwipeDown.Name = "bnSwipeDown"; this.bnSwipeDown.UseVisualStyleBackColor = false; @@ -1104,15 +1123,15 @@ // // lbSwipeDown // - resources.ApplyResources(this.lbSwipeDown, "lbSwipeDown"); this.lbSwipeDown.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbSwipeDown, "lbSwipeDown"); this.lbSwipeDown.Name = "lbSwipeDown"; // // bnSwipeLeft // - resources.ApplyResources(this.bnSwipeLeft, "bnSwipeLeft"); this.bnSwipeLeft.BackColor = System.Drawing.SystemColors.ControlText; this.bnSwipeLeft.ContextMenuStrip = this.cMSPresets; + resources.ApplyResources(this.bnSwipeLeft, "bnSwipeLeft"); this.bnSwipeLeft.ForeColor = System.Drawing.SystemColors.ControlLightLight; this.bnSwipeLeft.Name = "bnSwipeLeft"; this.bnSwipeLeft.UseVisualStyleBackColor = false; @@ -1120,15 +1139,15 @@ // // lbSwipeLeft // - resources.ApplyResources(this.lbSwipeLeft, "lbSwipeLeft"); this.lbSwipeLeft.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbSwipeLeft, "lbSwipeLeft"); this.lbSwipeLeft.Name = "lbSwipeLeft"; // // bnSwipeRight // - resources.ApplyResources(this.bnSwipeRight, "bnSwipeRight"); this.bnSwipeRight.BackColor = System.Drawing.SystemColors.ControlText; this.bnSwipeRight.ContextMenuStrip = this.cMSPresets; + resources.ApplyResources(this.bnSwipeRight, "bnSwipeRight"); this.bnSwipeRight.ForeColor = System.Drawing.SystemColors.ControlLightLight; this.bnSwipeRight.Name = "bnSwipeRight"; this.bnSwipeRight.UseVisualStyleBackColor = false; @@ -1136,14 +1155,14 @@ // // lbSwipeRight // - resources.ApplyResources(this.lbSwipeRight, "lbSwipeRight"); this.lbSwipeRight.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbSwipeRight, "lbSwipeRight"); this.lbSwipeRight.Name = "lbSwipeRight"; // // gBOther // - resources.ApplyResources(this.gBOther, "gBOther"); this.gBOther.BackColor = System.Drawing.Color.WhiteSmoke; + this.gBOther.Controls.Add(this.enableTouchToggleCheckbox); this.gBOther.Controls.Add(this.cBDinput); this.gBOther.Controls.Add(this.pBProgram); this.gBOther.Controls.Add(this.cBLaunchProgram); @@ -1158,9 +1177,17 @@ this.gBOther.Controls.Add(this.numUDMouseSens); this.gBOther.Controls.Add(this.cBFlushHIDQueue); this.gBOther.Controls.Add(this.lbIdleMinutes); + resources.ApplyResources(this.gBOther, "gBOther"); this.gBOther.Name = "gBOther"; this.gBOther.TabStop = false; // + // enableTouchToggleCheckbox + // + resources.ApplyResources(this.enableTouchToggleCheckbox, "enableTouchToggleCheckbox"); + this.enableTouchToggleCheckbox.Name = "enableTouchToggleCheckbox"; + this.enableTouchToggleCheckbox.UseVisualStyleBackColor = true; + this.enableTouchToggleCheckbox.CheckedChanged += new System.EventHandler(this.enableTouchToggleCheckbox_CheckedChanged); + // // cBDinput // resources.ApplyResources(this.cBDinput, "cBDinput"); @@ -1240,7 +1267,6 @@ // // gBLightbar // - resources.ApplyResources(this.gBLightbar, "gBLightbar"); this.gBLightbar.BackColor = System.Drawing.Color.WhiteSmoke; this.gBLightbar.Controls.Add(this.btnRainbow); this.gBLightbar.Controls.Add(this.lbRainbowB); @@ -1257,13 +1283,14 @@ this.gBLightbar.Controls.Add(this.cBLightbyBattery); this.gBLightbar.Controls.Add(this.pnlLowBattery); this.gBLightbar.Controls.Add(this.pnlFull); + resources.ApplyResources(this.gBLightbar, "gBLightbar"); this.gBLightbar.Name = "gBLightbar"; this.gBLightbar.TabStop = false; // // btnRainbow // - resources.ApplyResources(this.btnRainbow, "btnRainbow"); this.btnRainbow.Image = global::DS4Windows.Properties.Resources.rainbow; + resources.ApplyResources(this.btnRainbow, "btnRainbow"); this.btnRainbow.Name = "btnRainbow"; this.btnRainbow.UseVisualStyleBackColor = true; this.btnRainbow.Click += new System.EventHandler(this.btnRainbow_Click); @@ -1291,18 +1318,17 @@ // // cBFlashType // - resources.ApplyResources(this.cBFlashType, "cBFlashType"); this.cBFlashType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cBFlashType.FormattingEnabled = true; this.cBFlashType.Items.AddRange(new object[] { resources.GetString("cBFlashType.Items"), resources.GetString("cBFlashType.Items1")}); + resources.ApplyResources(this.cBFlashType, "cBFlashType"); this.cBFlashType.Name = "cBFlashType"; this.cBFlashType.SelectedIndexChanged += new System.EventHandler(this.cBFlashType_SelectedIndexChanged); // // cBWhileCharging // - resources.ApplyResources(this.cBWhileCharging, "cBWhileCharging"); this.cBWhileCharging.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cBWhileCharging.FormattingEnabled = true; this.cBWhileCharging.Items.AddRange(new object[] { @@ -1310,21 +1336,22 @@ resources.GetString("cBWhileCharging.Items1"), resources.GetString("cBWhileCharging.Items2"), resources.GetString("cBWhileCharging.Items3")}); + resources.ApplyResources(this.cBWhileCharging, "cBWhileCharging"); this.cBWhileCharging.Name = "cBWhileCharging"; this.cBWhileCharging.SelectedIndexChanged += new System.EventHandler(this.cBWhileCharging_SelectedIndexChanged); // // btnFlashColor // - resources.ApplyResources(this.btnFlashColor, "btnFlashColor"); this.btnFlashColor.BackColor = System.Drawing.Color.White; + resources.ApplyResources(this.btnFlashColor, "btnFlashColor"); this.btnFlashColor.Name = "btnFlashColor"; this.btnFlashColor.UseVisualStyleBackColor = false; this.btnFlashColor.Click += new System.EventHandler(this.btnFlashColor_Click); // // btnChargingColor // - resources.ApplyResources(this.btnChargingColor, "btnChargingColor"); this.btnChargingColor.BackColor = System.Drawing.Color.White; + resources.ApplyResources(this.btnChargingColor, "btnChargingColor"); this.btnChargingColor.Name = "btnChargingColor"; this.btnChargingColor.UseVisualStyleBackColor = false; this.btnChargingColor.Click += new System.EventHandler(this.btnChargingColor_Click); @@ -1341,23 +1368,23 @@ // // nUDflashLED // - resources.ApplyResources(this.nUDflashLED, "nUDflashLED"); this.nUDflashLED.Increment = new decimal(new int[] { 10, 0, 0, 0}); + resources.ApplyResources(this.nUDflashLED, "nUDflashLED"); this.nUDflashLED.Name = "nUDflashLED"; this.nUDflashLED.ValueChanged += new System.EventHandler(this.nUDflashLED_ValueChanged); // // gBRumble // - resources.ApplyResources(this.gBRumble, "gBRumble"); this.gBRumble.BackColor = System.Drawing.Color.WhiteSmoke; this.gBRumble.Controls.Add(this.lbPercentRumble); this.gBRumble.Controls.Add(this.btnRumbleLightTest); this.gBRumble.Controls.Add(this.btnRumbleHeavyTest); this.gBRumble.Controls.Add(this.nUDRumbleBoost); + resources.ApplyResources(this.gBRumble, "gBRumble"); this.gBRumble.Name = "gBRumble"; this.gBRumble.TabStop = false; // @@ -1385,13 +1412,13 @@ // // nUDSZ // - resources.ApplyResources(this.nUDSZ, "nUDSZ"); this.nUDSZ.DecimalPlaces = 2; this.nUDSZ.Increment = new decimal(new int[] { 1, 0, 0, 65536}); + resources.ApplyResources(this.nUDSZ, "nUDSZ"); this.nUDSZ.Maximum = new decimal(new int[] { 1, 0, @@ -1407,13 +1434,13 @@ // // nUDSX // - resources.ApplyResources(this.nUDSX, "nUDSX"); this.nUDSX.DecimalPlaces = 2; this.nUDSX.Increment = new decimal(new int[] { 1, 0, 0, 65536}); + resources.ApplyResources(this.nUDSX, "nUDSX"); this.nUDSX.Maximum = new decimal(new int[] { 1, 0, @@ -1427,13 +1454,8 @@ 131072}); this.nUDSX.ValueChanged += new System.EventHandler(this.nUDSX_ValueChanged); // - // openFileDialog1 - // - resources.ApplyResources(this.openFileDialog1, "openFileDialog1"); - // // lbL2TrackS // - resources.ApplyResources(this.lbL2TrackS, "lbL2TrackS"); this.lbL2TrackS.Controls.Add(this.pnlSATrack); this.lbL2TrackS.Controls.Add(this.lbL2Track); this.lbL2TrackS.Controls.Add(this.lbRSTip); @@ -1446,29 +1468,30 @@ this.lbL2TrackS.Controls.Add(this.pnlSixaxis); this.lbL2TrackS.Controls.Add(this.pnlLSTrack); this.lbL2TrackS.Controls.Add(this.pnlRSTrack); + resources.ApplyResources(this.lbL2TrackS, "lbL2TrackS"); this.lbL2TrackS.Name = "lbL2TrackS"; this.lbL2TrackS.UseVisualStyleBackColor = true; // // pnlSATrack // - resources.ApplyResources(this.pnlSATrack, "pnlSATrack"); this.pnlSATrack.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.pnlSATrack.Controls.Add(this.btnSATrack); this.pnlSATrack.Controls.Add(this.btnSATrackS); + resources.ApplyResources(this.pnlSATrack, "pnlSATrack"); this.pnlSATrack.Name = "pnlSATrack"; this.pnlSATrack.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlSATrack_Paint); // // btnSATrack // - resources.ApplyResources(this.btnSATrack, "btnSATrack"); this.btnSATrack.BackColor = System.Drawing.Color.Black; + resources.ApplyResources(this.btnSATrack, "btnSATrack"); this.btnSATrack.Name = "btnSATrack"; this.btnSATrack.UseVisualStyleBackColor = false; // // btnSATrackS // - resources.ApplyResources(this.btnSATrackS, "btnSATrackS"); this.btnSATrackS.BackColor = System.Drawing.Color.DimGray; + resources.ApplyResources(this.btnSATrackS, "btnSATrackS"); this.btnSATrackS.ForeColor = System.Drawing.SystemColors.ControlDark; this.btnSATrackS.Name = "btnSATrackS"; this.btnSATrackS.UseVisualStyleBackColor = false; @@ -1524,7 +1547,6 @@ // // pnlSixaxis // - resources.ApplyResources(this.pnlSixaxis, "pnlSixaxis"); this.pnlSixaxis.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.pnlSixaxis.Controls.Add(this.tBsixaxisAccelX); this.pnlSixaxis.Controls.Add(this.lb6Accel); @@ -1534,6 +1556,7 @@ this.pnlSixaxis.Controls.Add(this.tBsixaxisGyroZ); this.pnlSixaxis.Controls.Add(this.tBsixaxisAccelY); this.pnlSixaxis.Controls.Add(this.tBsixaxisAccelZ); + resources.ApplyResources(this.pnlSixaxis, "pnlSixaxis"); this.pnlSixaxis.Name = "pnlSixaxis"; this.pnlSixaxis.Click += new System.EventHandler(this.SixaxisPanel_Click); // @@ -1603,55 +1626,54 @@ // // pnlLSTrack // - resources.ApplyResources(this.pnlLSTrack, "pnlLSTrack"); this.pnlLSTrack.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.pnlLSTrack.Controls.Add(this.btnLSTrack); this.pnlLSTrack.Controls.Add(this.btnLSTrackS); + resources.ApplyResources(this.pnlLSTrack, "pnlLSTrack"); this.pnlLSTrack.Name = "pnlLSTrack"; this.pnlLSTrack.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlLSTrack_Paint); // // btnLSTrack // - resources.ApplyResources(this.btnLSTrack, "btnLSTrack"); this.btnLSTrack.BackColor = System.Drawing.Color.Black; + resources.ApplyResources(this.btnLSTrack, "btnLSTrack"); this.btnLSTrack.Name = "btnLSTrack"; this.btnLSTrack.UseVisualStyleBackColor = false; // // btnLSTrackS // - resources.ApplyResources(this.btnLSTrackS, "btnLSTrackS"); this.btnLSTrackS.BackColor = System.Drawing.Color.DimGray; + resources.ApplyResources(this.btnLSTrackS, "btnLSTrackS"); this.btnLSTrackS.ForeColor = System.Drawing.SystemColors.ControlDark; this.btnLSTrackS.Name = "btnLSTrackS"; this.btnLSTrackS.UseVisualStyleBackColor = false; // // pnlRSTrack // - resources.ApplyResources(this.pnlRSTrack, "pnlRSTrack"); this.pnlRSTrack.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.pnlRSTrack.Controls.Add(this.btnRSTrackS); this.pnlRSTrack.Controls.Add(this.btnRSTrack); + resources.ApplyResources(this.pnlRSTrack, "pnlRSTrack"); this.pnlRSTrack.Name = "pnlRSTrack"; this.pnlRSTrack.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlRSTrack_Paint); // // btnRSTrackS // - resources.ApplyResources(this.btnRSTrackS, "btnRSTrackS"); this.btnRSTrackS.BackColor = System.Drawing.Color.DimGray; + resources.ApplyResources(this.btnRSTrackS, "btnRSTrackS"); this.btnRSTrackS.ForeColor = System.Drawing.SystemColors.ControlDark; this.btnRSTrackS.Name = "btnRSTrackS"; this.btnRSTrackS.UseVisualStyleBackColor = false; // // btnRSTrack // - resources.ApplyResources(this.btnRSTrack, "btnRSTrack"); this.btnRSTrack.BackColor = System.Drawing.Color.Black; + resources.ApplyResources(this.btnRSTrack, "btnRSTrack"); this.btnRSTrack.Name = "btnRSTrack"; this.btnRSTrack.UseVisualStyleBackColor = false; // // fLPTiltControls // - resources.ApplyResources(this.fLPTiltControls, "fLPTiltControls"); this.fLPTiltControls.Controls.Add(this.bnGyroZN); this.fLPTiltControls.Controls.Add(this.lbGyroZN); this.fLPTiltControls.Controls.Add(this.bnGyroZP); @@ -1660,12 +1682,13 @@ this.fLPTiltControls.Controls.Add(this.lbGyroXP); this.fLPTiltControls.Controls.Add(this.bnGyroXN); this.fLPTiltControls.Controls.Add(this.lbGyroXN); + resources.ApplyResources(this.fLPTiltControls, "fLPTiltControls"); this.fLPTiltControls.Name = "fLPTiltControls"; // // bnGyroZN // - resources.ApplyResources(this.bnGyroZN, "bnGyroZN"); this.bnGyroZN.ContextMenuStrip = this.cMSPresets; + resources.ApplyResources(this.bnGyroZN, "bnGyroZN"); this.bnGyroZN.Name = "bnGyroZN"; this.bnGyroZN.UseVisualStyleBackColor = true; this.bnGyroZN.Click += new System.EventHandler(this.Show_ControlsBn); @@ -1677,8 +1700,8 @@ // // bnGyroZP // - resources.ApplyResources(this.bnGyroZP, "bnGyroZP"); this.bnGyroZP.ContextMenuStrip = this.cMSPresets; + resources.ApplyResources(this.bnGyroZP, "bnGyroZP"); this.bnGyroZP.Name = "bnGyroZP"; this.bnGyroZP.UseVisualStyleBackColor = true; this.bnGyroZP.Click += new System.EventHandler(this.Show_ControlsBn); @@ -1690,8 +1713,8 @@ // // bnGyroXP // - resources.ApplyResources(this.bnGyroXP, "bnGyroXP"); this.bnGyroXP.ContextMenuStrip = this.cMSPresets; + resources.ApplyResources(this.bnGyroXP, "bnGyroXP"); this.bnGyroXP.Name = "bnGyroXP"; this.bnGyroXP.UseVisualStyleBackColor = true; this.bnGyroXP.Click += new System.EventHandler(this.Show_ControlsBn); @@ -1703,8 +1726,8 @@ // // bnGyroXN // - resources.ApplyResources(this.bnGyroXN, "bnGyroXN"); this.bnGyroXN.ContextMenuStrip = this.cMSPresets; + resources.ApplyResources(this.bnGyroXN, "bnGyroXN"); this.bnGyroXN.Name = "bnGyroXN"; this.bnGyroXN.UseVisualStyleBackColor = true; this.bnGyroXN.Click += new System.EventHandler(this.Show_ControlsBn); @@ -1716,10 +1739,10 @@ // // tCControls // - resources.ApplyResources(this.tCControls, "tCControls"); this.tCControls.Controls.Add(this.tPControls); this.tCControls.Controls.Add(this.tPSpecial); this.tCControls.Controls.Add(this.lbL2TrackS); + resources.ApplyResources(this.tCControls, "tCControls"); this.tCControls.Name = "tCControls"; this.tCControls.SelectedIndex = 0; this.tCControls.SelectedIndexChanged += new System.EventHandler(this.tabControls_SelectedIndexChanged); @@ -1779,16 +1802,16 @@ // // lbControlTip // - resources.ApplyResources(this.lbControlTip, "lbControlTip"); this.lbControlTip.BackColor = System.Drawing.Color.Transparent; this.lbControlTip.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbControlTip, "lbControlTip"); this.lbControlTip.Name = "lbControlTip"; // // pnlController // - resources.ApplyResources(this.pnlController, "pnlController"); this.pnlController.BackColor = System.Drawing.Color.Transparent; this.pnlController.BackgroundImage = global::DS4Windows.Properties.Resources.DS4_Config; + resources.ApplyResources(this.pnlController, "pnlController"); this.pnlController.Controls.Add(this.pBHoveredButton); this.pnlController.Controls.Add(this.lbLRS); this.pnlController.Controls.Add(this.lbLLS); @@ -1852,22 +1875,22 @@ // // lbLRS // - resources.ApplyResources(this.lbLRS, "lbLRS"); this.lbLRS.BackColor = System.Drawing.SystemColors.ControlLightLight; this.lbLRS.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbLRS, "lbLRS"); this.lbLRS.Name = "lbLRS"; // // lbLLS // - resources.ApplyResources(this.lbLLS, "lbLLS"); this.lbLLS.BackColor = System.Drawing.SystemColors.ControlLightLight; this.lbLLS.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbLLS, "lbLLS"); this.lbLLS.Name = "lbLLS"; // // bnRSDown // - resources.ApplyResources(this.bnRSDown, "bnRSDown"); this.bnRSDown.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnRSDown, "bnRSDown"); this.bnRSDown.ContextMenuStrip = this.cMSPresets; this.bnRSDown.Cursor = System.Windows.Forms.Cursors.Default; this.bnRSDown.FlatAppearance.BorderColor = System.Drawing.Color.White; @@ -1882,22 +1905,22 @@ // // lbLTouchUpper // - resources.ApplyResources(this.lbLTouchUpper, "lbLTouchUpper"); this.lbLTouchUpper.BackColor = System.Drawing.SystemColors.ControlLightLight; this.lbLTouchUpper.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbLTouchUpper, "lbLTouchUpper"); this.lbLTouchUpper.Name = "lbLTouchUpper"; // // lbLTouchRight // - resources.ApplyResources(this.lbLTouchRight, "lbLTouchRight"); this.lbLTouchRight.BackColor = System.Drawing.SystemColors.ControlLightLight; this.lbLTouchRight.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbLTouchRight, "lbLTouchRight"); this.lbLTouchRight.Name = "lbLTouchRight"; // // bnL3 // - resources.ApplyResources(this.bnL3, "bnL3"); this.bnL3.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnL3, "bnL3"); this.bnL3.ContextMenuStrip = this.cMSPresets; this.bnL3.Cursor = System.Windows.Forms.Cursors.Default; this.bnL3.FlatAppearance.BorderColor = System.Drawing.Color.White; @@ -1912,15 +1935,15 @@ // // lbLTouchLM // - resources.ApplyResources(this.lbLTouchLM, "lbLTouchLM"); this.lbLTouchLM.BackColor = System.Drawing.SystemColors.ControlLightLight; this.lbLTouchLM.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbLTouchLM, "lbLTouchLM"); this.lbLTouchLM.Name = "lbLTouchLM"; // // bnRSUp // - resources.ApplyResources(this.bnRSUp, "bnRSUp"); this.bnRSUp.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnRSUp, "bnRSUp"); this.bnRSUp.ContextMenuStrip = this.cMSPresets; this.bnRSUp.Cursor = System.Windows.Forms.Cursors.Default; this.bnRSUp.FlatAppearance.BorderColor = System.Drawing.Color.White; @@ -1935,15 +1958,15 @@ // // lbLR2 // - resources.ApplyResources(this.lbLR2, "lbLR2"); this.lbLR2.BackColor = System.Drawing.SystemColors.ControlLightLight; this.lbLR2.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbLR2, "lbLR2"); this.lbLR2.Name = "lbLR2"; // // bnRSRight // - resources.ApplyResources(this.bnRSRight, "bnRSRight"); this.bnRSRight.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnRSRight, "bnRSRight"); this.bnRSRight.ContextMenuStrip = this.cMSPresets; this.bnRSRight.Cursor = System.Windows.Forms.Cursors.Default; this.bnRSRight.FlatAppearance.BorderColor = System.Drawing.Color.White; @@ -1958,15 +1981,15 @@ // // lbLL2 // - resources.ApplyResources(this.lbLL2, "lbLL2"); this.lbLL2.BackColor = System.Drawing.SystemColors.ControlLightLight; this.lbLL2.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbLL2, "lbLL2"); this.lbLL2.Name = "lbLL2"; // // bnR3 // - resources.ApplyResources(this.bnR3, "bnR3"); this.bnR3.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnR3, "bnR3"); this.bnR3.ContextMenuStrip = this.cMSPresets; this.bnR3.Cursor = System.Windows.Forms.Cursors.Default; this.bnR3.FlatAppearance.BorderColor = System.Drawing.Color.White; @@ -1981,15 +2004,15 @@ // // lbLR1 // - resources.ApplyResources(this.lbLR1, "lbLR1"); this.lbLR1.BackColor = System.Drawing.SystemColors.ControlLightLight; this.lbLR1.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbLR1, "lbLR1"); this.lbLR1.Name = "lbLR1"; // // bnRSLeft // - resources.ApplyResources(this.bnRSLeft, "bnRSLeft"); this.bnRSLeft.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnRSLeft, "bnRSLeft"); this.bnRSLeft.ContextMenuStrip = this.cMSPresets; this.bnRSLeft.Cursor = System.Windows.Forms.Cursors.Default; this.bnRSLeft.FlatAppearance.BorderColor = System.Drawing.Color.White; @@ -2004,15 +2027,15 @@ // // lbLL1 // - resources.ApplyResources(this.lbLL1, "lbLL1"); this.lbLL1.BackColor = System.Drawing.SystemColors.ControlLightLight; this.lbLL1.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbLL1, "lbLL1"); this.lbLL1.Name = "lbLL1"; // // bnLSLeft // - resources.ApplyResources(this.bnLSLeft, "bnLSLeft"); this.bnLSLeft.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnLSLeft, "bnLSLeft"); this.bnLSLeft.ContextMenuStrip = this.cMSPresets; this.bnLSLeft.Cursor = System.Windows.Forms.Cursors.Default; this.bnLSLeft.FlatAppearance.BorderColor = System.Drawing.Color.White; @@ -2027,15 +2050,15 @@ // // lbLPS // - resources.ApplyResources(this.lbLPS, "lbLPS"); this.lbLPS.BackColor = System.Drawing.SystemColors.ControlLightLight; this.lbLPS.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbLPS, "lbLPS"); this.lbLPS.Name = "lbLPS"; // // bnLSUp // - resources.ApplyResources(this.bnLSUp, "bnLSUp"); this.bnLSUp.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnLSUp, "bnLSUp"); this.bnLSUp.ContextMenuStrip = this.cMSPresets; this.bnLSUp.Cursor = System.Windows.Forms.Cursors.Default; this.bnLSUp.FlatAppearance.BorderColor = System.Drawing.Color.White; @@ -2050,15 +2073,15 @@ // // lbLLeft // - resources.ApplyResources(this.lbLLeft, "lbLLeft"); this.lbLLeft.BackColor = System.Drawing.SystemColors.ControlLightLight; this.lbLLeft.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbLLeft, "lbLLeft"); this.lbLLeft.Name = "lbLLeft"; // // bnLSRight // - resources.ApplyResources(this.bnLSRight, "bnLSRight"); this.bnLSRight.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnLSRight, "bnLSRight"); this.bnLSRight.ContextMenuStrip = this.cMSPresets; this.bnLSRight.Cursor = System.Windows.Forms.Cursors.Default; this.bnLSRight.FlatAppearance.BorderColor = System.Drawing.Color.White; @@ -2073,15 +2096,15 @@ // // lbLright // - resources.ApplyResources(this.lbLright, "lbLright"); this.lbLright.BackColor = System.Drawing.SystemColors.ControlLightLight; this.lbLright.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbLright, "lbLright"); this.lbLright.Name = "lbLright"; // // bnLSDown // - resources.ApplyResources(this.bnLSDown, "bnLSDown"); this.bnLSDown.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnLSDown, "bnLSDown"); this.bnLSDown.ContextMenuStrip = this.cMSPresets; this.bnLSDown.Cursor = System.Windows.Forms.Cursors.Default; this.bnLSDown.FlatAppearance.BorderColor = System.Drawing.Color.White; @@ -2096,15 +2119,15 @@ // // lbLDown // - resources.ApplyResources(this.lbLDown, "lbLDown"); this.lbLDown.BackColor = System.Drawing.SystemColors.ControlLightLight; this.lbLDown.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbLDown, "lbLDown"); this.lbLDown.Name = "lbLDown"; // // bnR2 // - resources.ApplyResources(this.bnR2, "bnR2"); this.bnR2.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnR2, "bnR2"); this.bnR2.Cursor = System.Windows.Forms.Cursors.Default; this.bnR2.FlatAppearance.BorderColor = System.Drawing.Color.White; this.bnR2.FlatAppearance.BorderSize = 0; @@ -2118,8 +2141,8 @@ // // bnUp // - resources.ApplyResources(this.bnUp, "bnUp"); this.bnUp.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnUp, "bnUp"); this.bnUp.ContextMenuStrip = this.cMSPresets; this.bnUp.Cursor = System.Windows.Forms.Cursors.Default; this.bnUp.DialogResult = System.Windows.Forms.DialogResult.Cancel; @@ -2135,8 +2158,8 @@ // // bnDown // - resources.ApplyResources(this.bnDown, "bnDown"); this.bnDown.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnDown, "bnDown"); this.bnDown.ContextMenuStrip = this.cMSPresets; this.bnDown.Cursor = System.Windows.Forms.Cursors.Default; this.bnDown.FlatAppearance.BorderColor = System.Drawing.Color.White; @@ -2151,8 +2174,8 @@ // // bnTriangle // - resources.ApplyResources(this.bnTriangle, "bnTriangle"); this.bnTriangle.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnTriangle, "bnTriangle"); this.bnTriangle.ContextMenuStrip = this.cMSPresets; this.bnTriangle.Cursor = System.Windows.Forms.Cursors.Default; this.bnTriangle.FlatAppearance.BorderColor = System.Drawing.Color.White; @@ -2167,8 +2190,8 @@ // // bnR1 // - resources.ApplyResources(this.bnR1, "bnR1"); this.bnR1.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnR1, "bnR1"); this.bnR1.Cursor = System.Windows.Forms.Cursors.Default; this.bnR1.FlatAppearance.BorderColor = System.Drawing.Color.White; this.bnR1.FlatAppearance.BorderSize = 0; @@ -2182,8 +2205,8 @@ // // bnSquare // - resources.ApplyResources(this.bnSquare, "bnSquare"); this.bnSquare.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnSquare, "bnSquare"); this.bnSquare.ContextMenuStrip = this.cMSPresets; this.bnSquare.Cursor = System.Windows.Forms.Cursors.Default; this.bnSquare.FlatAppearance.BorderColor = System.Drawing.Color.White; @@ -2198,8 +2221,8 @@ // // bnRight // - resources.ApplyResources(this.bnRight, "bnRight"); this.bnRight.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnRight, "bnRight"); this.bnRight.ContextMenuStrip = this.cMSPresets; this.bnRight.Cursor = System.Windows.Forms.Cursors.Default; this.bnRight.FlatAppearance.BorderColor = System.Drawing.Color.White; @@ -2214,15 +2237,15 @@ // // lbLUp // - resources.ApplyResources(this.lbLUp, "lbLUp"); this.lbLUp.BackColor = System.Drawing.SystemColors.ControlLightLight; this.lbLUp.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbLUp, "lbLUp"); this.lbLUp.Name = "lbLUp"; // // bnLeft // - resources.ApplyResources(this.bnLeft, "bnLeft"); this.bnLeft.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnLeft, "bnLeft"); this.bnLeft.ContextMenuStrip = this.cMSPresets; this.bnLeft.Cursor = System.Windows.Forms.Cursors.Default; this.bnLeft.FlatAppearance.BorderColor = System.Drawing.Color.White; @@ -2237,15 +2260,15 @@ // // lbLShare // - resources.ApplyResources(this.lbLShare, "lbLShare"); this.lbLShare.BackColor = System.Drawing.SystemColors.ControlLightLight; this.lbLShare.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbLShare, "lbLShare"); this.lbLShare.Name = "lbLShare"; // // bnOptions // - resources.ApplyResources(this.bnOptions, "bnOptions"); this.bnOptions.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnOptions, "bnOptions"); this.bnOptions.Cursor = System.Windows.Forms.Cursors.Default; this.bnOptions.FlatAppearance.BorderColor = System.Drawing.Color.White; this.bnOptions.FlatAppearance.BorderSize = 0; @@ -2259,8 +2282,8 @@ // // bnShare // - resources.ApplyResources(this.bnShare, "bnShare"); this.bnShare.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnShare, "bnShare"); this.bnShare.Cursor = System.Windows.Forms.Cursors.Default; this.bnShare.FlatAppearance.BorderColor = System.Drawing.Color.White; this.bnShare.FlatAppearance.BorderSize = 0; @@ -2274,15 +2297,15 @@ // // lbLOptions // - resources.ApplyResources(this.lbLOptions, "lbLOptions"); this.lbLOptions.BackColor = System.Drawing.SystemColors.ControlLightLight; this.lbLOptions.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbLOptions, "lbLOptions"); this.lbLOptions.Name = "lbLOptions"; // // bnL1 // - resources.ApplyResources(this.bnL1, "bnL1"); this.bnL1.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnL1, "bnL1"); this.bnL1.Cursor = System.Windows.Forms.Cursors.Default; this.bnL1.FlatAppearance.BorderColor = System.Drawing.Color.White; this.bnL1.FlatAppearance.BorderSize = 0; @@ -2296,8 +2319,8 @@ // // bnTouchRight // - resources.ApplyResources(this.bnTouchRight, "bnTouchRight"); this.bnTouchRight.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnTouchRight, "bnTouchRight"); this.bnTouchRight.Cursor = System.Windows.Forms.Cursors.Default; this.bnTouchRight.FlatAppearance.BorderColor = System.Drawing.Color.White; this.bnTouchRight.FlatAppearance.BorderSize = 0; @@ -2311,8 +2334,8 @@ // // bnL2 // - resources.ApplyResources(this.bnL2, "bnL2"); this.bnL2.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnL2, "bnL2"); this.bnL2.Cursor = System.Windows.Forms.Cursors.Default; this.bnL2.FlatAppearance.BorderColor = System.Drawing.Color.White; this.bnL2.FlatAppearance.BorderSize = 0; @@ -2326,15 +2349,15 @@ // // lbLTriangle // - resources.ApplyResources(this.lbLTriangle, "lbLTriangle"); this.lbLTriangle.BackColor = System.Drawing.SystemColors.ControlLightLight; this.lbLTriangle.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbLTriangle, "lbLTriangle"); this.lbLTriangle.Name = "lbLTriangle"; // // bnTouchLeft // - resources.ApplyResources(this.bnTouchLeft, "bnTouchLeft"); this.bnTouchLeft.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnTouchLeft, "bnTouchLeft"); this.bnTouchLeft.Cursor = System.Windows.Forms.Cursors.Default; this.bnTouchLeft.FlatAppearance.BorderColor = System.Drawing.Color.White; this.bnTouchLeft.FlatAppearance.BorderSize = 0; @@ -2348,15 +2371,15 @@ // // lbLSquare // - resources.ApplyResources(this.lbLSquare, "lbLSquare"); this.lbLSquare.BackColor = System.Drawing.SystemColors.ControlLightLight; this.lbLSquare.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbLSquare, "lbLSquare"); this.lbLSquare.Name = "lbLSquare"; // // bnTouchMulti // - resources.ApplyResources(this.bnTouchMulti, "bnTouchMulti"); this.bnTouchMulti.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnTouchMulti, "bnTouchMulti"); this.bnTouchMulti.Cursor = System.Windows.Forms.Cursors.Default; this.bnTouchMulti.FlatAppearance.BorderColor = System.Drawing.Color.White; this.bnTouchMulti.FlatAppearance.BorderSize = 0; @@ -2370,22 +2393,22 @@ // // lbLCircle // - resources.ApplyResources(this.lbLCircle, "lbLCircle"); this.lbLCircle.BackColor = System.Drawing.SystemColors.ControlLightLight; this.lbLCircle.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbLCircle, "lbLCircle"); this.lbLCircle.Name = "lbLCircle"; // // lbLCross // - resources.ApplyResources(this.lbLCross, "lbLCross"); this.lbLCross.BackColor = System.Drawing.SystemColors.ControlLightLight; this.lbLCross.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbLCross, "lbLCross"); this.lbLCross.Name = "lbLCross"; // // bnTouchUpper // - resources.ApplyResources(this.bnTouchUpper, "bnTouchUpper"); this.bnTouchUpper.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnTouchUpper, "bnTouchUpper"); this.bnTouchUpper.Cursor = System.Windows.Forms.Cursors.Default; this.bnTouchUpper.FlatAppearance.BorderColor = System.Drawing.Color.White; this.bnTouchUpper.FlatAppearance.BorderSize = 0; @@ -2399,9 +2422,9 @@ // // btnLightbar // - resources.ApplyResources(this.btnLightbar, "btnLightbar"); this.btnLightbar.BackColor = System.Drawing.Color.Transparent; this.btnLightbar.BackgroundImage = global::DS4Windows.Properties.Resources.DS4_lightbar; + resources.ApplyResources(this.btnLightbar, "btnLightbar"); this.btnLightbar.Cursor = System.Windows.Forms.Cursors.Default; this.btnLightbar.FlatAppearance.BorderColor = System.Drawing.Color.Red; this.btnLightbar.FlatAppearance.BorderSize = 0; @@ -2415,8 +2438,8 @@ // // bnPS // - resources.ApplyResources(this.bnPS, "bnPS"); this.bnPS.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnPS, "bnPS"); this.bnPS.Cursor = System.Windows.Forms.Cursors.Default; this.bnPS.FlatAppearance.BorderColor = System.Drawing.Color.White; this.bnPS.FlatAppearance.BorderSize = 0; @@ -2430,8 +2453,8 @@ // // bnCross // - resources.ApplyResources(this.bnCross, "bnCross"); this.bnCross.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnCross, "bnCross"); this.bnCross.ContextMenuStrip = this.cMSPresets; this.bnCross.Cursor = System.Windows.Forms.Cursors.Default; this.bnCross.FlatAppearance.BorderColor = System.Drawing.Color.White; @@ -2446,8 +2469,8 @@ // // bnCircle // - resources.ApplyResources(this.bnCircle, "bnCircle"); this.bnCircle.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.bnCircle, "bnCircle"); this.bnCircle.ContextMenuStrip = this.cMSPresets; this.bnCircle.Cursor = System.Windows.Forms.Cursors.Default; this.bnCircle.FlatAppearance.BorderColor = System.Drawing.Color.White; @@ -2462,34 +2485,34 @@ // // lbControlName // - resources.ApplyResources(this.lbControlName, "lbControlName"); this.lbControlName.BackColor = System.Drawing.Color.Transparent; this.lbControlName.ForeColor = System.Drawing.SystemColors.ControlLightLight; + resources.ApplyResources(this.lbControlName, "lbControlName"); this.lbControlName.Name = "lbControlName"; this.lbControlName.Click += new System.EventHandler(this.Show_ControlsList); // // tPSpecial // - resources.ApplyResources(this.tPSpecial, "tPSpecial"); this.tPSpecial.Controls.Add(this.pnlActions); + resources.ApplyResources(this.tPSpecial, "tPSpecial"); this.tPSpecial.Name = "tPSpecial"; this.tPSpecial.UseVisualStyleBackColor = true; // // pnlActions // - resources.ApplyResources(this.pnlActions, "pnlActions"); this.pnlActions.Controls.Add(this.lVActions); this.pnlActions.Controls.Add(this.panel2); + resources.ApplyResources(this.pnlActions, "pnlActions"); this.pnlActions.Name = "pnlActions"; // // lVActions // - resources.ApplyResources(this.lVActions, "lVActions"); this.lVActions.CheckBoxes = true; this.lVActions.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.cHName, this.cHTrigger, this.cHAction}); + resources.ApplyResources(this.lVActions, "lVActions"); this.lVActions.FullRowSelect = true; this.lVActions.HideSelection = false; this.lVActions.MultiSelect = false; @@ -2497,7 +2520,7 @@ this.lVActions.ShowItemToolTips = true; this.lVActions.UseCompatibleStateImageBehavior = false; this.lVActions.View = System.Windows.Forms.View.Details; - this.lVActions.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.lVActions_ItemChecked); + this.lVActions.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.lVActions_ItemCheck); // // cHName // @@ -2513,17 +2536,17 @@ // // panel2 // - resources.ApplyResources(this.panel2, "panel2"); this.panel2.Controls.Add(this.fLPActionButtons); this.panel2.Controls.Add(this.lbActionsTip); + resources.ApplyResources(this.panel2, "panel2"); this.panel2.Name = "panel2"; // // fLPActionButtons // - resources.ApplyResources(this.fLPActionButtons, "fLPActionButtons"); this.fLPActionButtons.Controls.Add(this.btnNewAction); this.fLPActionButtons.Controls.Add(this.btnEditAction); this.fLPActionButtons.Controls.Add(this.btnRemAction); + resources.ApplyResources(this.fLPActionButtons, "fLPActionButtons"); this.fLPActionButtons.Name = "fLPActionButtons"; // // btnNewAction @@ -2554,15 +2577,16 @@ // // tCSens // - resources.ApplyResources(this.tCSens, "tCSens"); this.tCSens.Controls.Add(this.tPDeadzone); this.tCSens.Controls.Add(this.tPCurve); + this.tCSens.Controls.Add(this.antiDeadzoneTabPage); + this.tCSens.Controls.Add(this.maxZoneTabPage); + resources.ApplyResources(this.tCSens, "tCSens"); this.tCSens.Name = "tCSens"; this.tCSens.SelectedIndex = 0; // // tPDeadzone // - resources.ApplyResources(this.tPDeadzone, "tPDeadzone"); this.tPDeadzone.BackColor = System.Drawing.Color.WhiteSmoke; this.tPDeadzone.Controls.Add(this.lbL2); this.tPDeadzone.Controls.Add(this.nUDL2); @@ -2576,11 +2600,11 @@ this.tPDeadzone.Controls.Add(this.lbRS); this.tPDeadzone.Controls.Add(this.lbLS); this.tPDeadzone.Controls.Add(this.nUDSZ); + resources.ApplyResources(this.tPDeadzone, "tPDeadzone"); this.tPDeadzone.Name = "tPDeadzone"; // // tPCurve // - resources.ApplyResources(this.tPCurve, "tPCurve"); this.tPCurve.BackColor = System.Drawing.Color.WhiteSmoke; this.tPCurve.Controls.Add(this.nUDLSCurve); this.tPCurve.Controls.Add(this.nUDRSCurve); @@ -2588,27 +2612,28 @@ this.tPCurve.Controls.Add(this.lbRSCurvePercent); this.tPCurve.Controls.Add(this.lbLSCurvePercent); this.tPCurve.Controls.Add(this.lbLSCurve); + resources.ApplyResources(this.tPCurve, "tPCurve"); this.tPCurve.Name = "tPCurve"; // // nUDLSCurve // - resources.ApplyResources(this.nUDLSCurve, "nUDLSCurve"); this.nUDLSCurve.Increment = new decimal(new int[] { 10, 0, 0, 0}); + resources.ApplyResources(this.nUDLSCurve, "nUDLSCurve"); this.nUDLSCurve.Name = "nUDLSCurve"; this.nUDLSCurve.ValueChanged += new System.EventHandler(this.nUDLSCurve_ValueChanged); // // nUDRSCurve // - resources.ApplyResources(this.nUDRSCurve, "nUDRSCurve"); this.nUDRSCurve.Increment = new decimal(new int[] { 10, 0, 0, 0}); + resources.ApplyResources(this.nUDRSCurve, "nUDRSCurve"); this.nUDRSCurve.Name = "nUDRSCurve"; this.nUDRSCurve.ValueChanged += new System.EventHandler(this.nUDRSCurve_ValueChanged); // @@ -2632,6 +2657,108 @@ resources.ApplyResources(this.lbLSCurve, "lbLSCurve"); this.lbLSCurve.Name = "lbLSCurve"; // + // antiDeadzoneTabPage + // + this.antiDeadzoneTabPage.Controls.Add(this.nUDR2AntiDead); + this.antiDeadzoneTabPage.Controls.Add(this.label3); + this.antiDeadzoneTabPage.Controls.Add(this.nUDL2AntiDead); + this.antiDeadzoneTabPage.Controls.Add(this.label4); + this.antiDeadzoneTabPage.Controls.Add(this.nUDRSAntiDead); + this.antiDeadzoneTabPage.Controls.Add(this.label2); + this.antiDeadzoneTabPage.Controls.Add(this.nUDLSAntiDead); + this.antiDeadzoneTabPage.Controls.Add(this.label1); + resources.ApplyResources(this.antiDeadzoneTabPage, "antiDeadzoneTabPage"); + this.antiDeadzoneTabPage.Name = "antiDeadzoneTabPage"; + this.antiDeadzoneTabPage.UseVisualStyleBackColor = true; + // + // nUDR2AntiDead + // + this.nUDR2AntiDead.DecimalPlaces = 2; + this.nUDR2AntiDead.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + resources.ApplyResources(this.nUDR2AntiDead, "nUDR2AntiDead"); + this.nUDR2AntiDead.Maximum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDR2AntiDead.Name = "nUDR2AntiDead"; + this.nUDR2AntiDead.ValueChanged += new System.EventHandler(this.nUDR2AntiDead_ValueChanged); + // + // label3 + // + resources.ApplyResources(this.label3, "label3"); + this.label3.Name = "label3"; + // + // nUDL2AntiDead + // + this.nUDL2AntiDead.DecimalPlaces = 2; + this.nUDL2AntiDead.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + resources.ApplyResources(this.nUDL2AntiDead, "nUDL2AntiDead"); + this.nUDL2AntiDead.Maximum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDL2AntiDead.Name = "nUDL2AntiDead"; + this.nUDL2AntiDead.ValueChanged += new System.EventHandler(this.nUDL2AntiDead_ValueChanged); + // + // label4 + // + resources.ApplyResources(this.label4, "label4"); + this.label4.Name = "label4"; + // + // nUDRSAntiDead + // + this.nUDRSAntiDead.DecimalPlaces = 2; + this.nUDRSAntiDead.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + resources.ApplyResources(this.nUDRSAntiDead, "nUDRSAntiDead"); + this.nUDRSAntiDead.Maximum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDRSAntiDead.Name = "nUDRSAntiDead"; + this.nUDRSAntiDead.ValueChanged += new System.EventHandler(this.nUDRSAntiDead_ValueChanged); + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // nUDLSAntiDead + // + this.nUDLSAntiDead.DecimalPlaces = 2; + this.nUDLSAntiDead.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + resources.ApplyResources(this.nUDLSAntiDead, "nUDLSAntiDead"); + this.nUDLSAntiDead.Maximum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDLSAntiDead.Name = "nUDLSAntiDead"; + this.nUDLSAntiDead.ValueChanged += new System.EventHandler(this.nUDLSAntiDead_ValueChanged); + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // // fLPSettings // resources.ApplyResources(this.fLPSettings, "fLPSettings"); @@ -2646,12 +2773,12 @@ // // gBGyro // - resources.ApplyResources(this.gBGyro, "gBGyro"); this.gBGyro.BackColor = System.Drawing.Color.WhiteSmoke; this.gBGyro.Controls.Add(this.rBSAControls); this.gBGyro.Controls.Add(this.rBSAMouse); this.gBGyro.Controls.Add(this.pnlSAMouse); this.gBGyro.Controls.Add(this.fLPTiltControls); + resources.ApplyResources(this.gBGyro, "gBGyro"); this.gBGyro.Name = "gBGyro"; this.gBGyro.TabStop = false; // @@ -2673,7 +2800,6 @@ // // pnlSAMouse // - resources.ApplyResources(this.pnlSAMouse, "pnlSAMouse"); this.pnlSAMouse.Controls.Add(this.cBGyroInvertY); this.pnlSAMouse.Controls.Add(this.cBGyroInvertX); this.pnlSAMouse.Controls.Add(this.lbGyroInvert); @@ -2681,6 +2807,7 @@ this.pnlSAMouse.Controls.Add(this.btnGyroTriggers); this.pnlSAMouse.Controls.Add(this.nUDGyroSensitivity); this.pnlSAMouse.Controls.Add(this.lbGyroSens); + resources.ApplyResources(this.pnlSAMouse, "pnlSAMouse"); this.pnlSAMouse.Name = "pnlSAMouse"; // // cBGyroInvertY @@ -2737,7 +2864,6 @@ // // gBSensitivity // - resources.ApplyResources(this.gBSensitivity, "gBSensitivity"); this.gBSensitivity.BackColor = System.Drawing.Color.WhiteSmoke; this.gBSensitivity.Controls.Add(this.lbL2S); this.gBSensitivity.Controls.Add(this.nUDL2S); @@ -2751,6 +2877,7 @@ this.gBSensitivity.Controls.Add(this.lbRSS); this.gBSensitivity.Controls.Add(this.lbLSS); this.gBSensitivity.Controls.Add(this.nUDSZS); + resources.ApplyResources(this.gBSensitivity, "gBSensitivity"); this.gBSensitivity.Name = "gBSensitivity"; this.gBSensitivity.TabStop = false; // @@ -2761,20 +2888,20 @@ // // nUDL2S // - resources.ApplyResources(this.nUDL2S, "nUDL2S"); this.nUDL2S.DecimalPlaces = 2; this.nUDL2S.Increment = new decimal(new int[] { 1, 0, 0, 65536}); + resources.ApplyResources(this.nUDL2S, "nUDL2S"); this.nUDL2S.Maximum = new decimal(new int[] { - 15, + 50, 0, 0, 65536}); this.nUDL2S.Minimum = new decimal(new int[] { - 5, + 1, 0, 0, 65536}); @@ -2788,13 +2915,13 @@ // // nUDLSS // - resources.ApplyResources(this.nUDLSS, "nUDLSS"); this.nUDLSS.DecimalPlaces = 2; this.nUDLSS.Increment = new decimal(new int[] { 1, 0, 0, 65536}); + resources.ApplyResources(this.nUDLSS, "nUDLSS"); this.nUDLSS.Maximum = new decimal(new int[] { 15, 0, @@ -2820,20 +2947,20 @@ // // nUDR2S // - resources.ApplyResources(this.nUDR2S, "nUDR2S"); this.nUDR2S.DecimalPlaces = 2; this.nUDR2S.Increment = new decimal(new int[] { 1, 0, 0, 65536}); + resources.ApplyResources(this.nUDR2S, "nUDR2S"); this.nUDR2S.Maximum = new decimal(new int[] { - 15, + 50, 0, 0, 65536}); this.nUDR2S.Minimum = new decimal(new int[] { - 5, + 1, 0, 0, 65536}); @@ -2852,13 +2979,13 @@ // // nUDRSS // - resources.ApplyResources(this.nUDRSS, "nUDRSS"); this.nUDRSS.DecimalPlaces = 2; this.nUDRSS.Increment = new decimal(new int[] { 1, 0, 0, 65536}); + resources.ApplyResources(this.nUDRSS, "nUDRSS"); this.nUDRSS.Maximum = new decimal(new int[] { 15, 0, @@ -2884,13 +3011,13 @@ // // nUDSXS // - resources.ApplyResources(this.nUDSXS, "nUDSXS"); this.nUDSXS.DecimalPlaces = 2; this.nUDSXS.Increment = new decimal(new int[] { 1, 0, 0, 65536}); + resources.ApplyResources(this.nUDSXS, "nUDSXS"); this.nUDSXS.Maximum = new decimal(new int[] { 15, 0, @@ -2921,13 +3048,13 @@ // // nUDSZS // - resources.ApplyResources(this.nUDSZS, "nUDSZS"); this.nUDSZS.DecimalPlaces = 2; this.nUDSZS.Increment = new decimal(new int[] { 1, 0, 0, 65536}); + resources.ApplyResources(this.nUDSZS, "nUDSZS"); this.nUDSZS.Maximum = new decimal(new int[] { 15, 0, @@ -2948,7 +3075,6 @@ // // cMGyroTriggers // - resources.ApplyResources(this.cMGyroTriggers, "cMGyroTriggers"); this.cMGyroTriggers.BackColor = System.Drawing.SystemColors.Control; this.cMGyroTriggers.ImageScalingSize = new System.Drawing.Size(20, 20); this.cMGyroTriggers.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -2975,166 +3101,289 @@ this.cMGyroTriggers.Name = "cMGyroTriggers"; this.cMGyroTriggers.ShowCheckMargin = true; this.cMGyroTriggers.ShowImageMargin = false; + resources.ApplyResources(this.cMGyroTriggers, "cMGyroTriggers"); // // crossToolStripMenuItem // - resources.ApplyResources(this.crossToolStripMenuItem, "crossToolStripMenuItem"); this.crossToolStripMenuItem.CheckOnClick = true; this.crossToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText; this.crossToolStripMenuItem.Name = "crossToolStripMenuItem"; + resources.ApplyResources(this.crossToolStripMenuItem, "crossToolStripMenuItem"); this.crossToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); // // circleToolStripMenuItem // - resources.ApplyResources(this.circleToolStripMenuItem, "circleToolStripMenuItem"); this.circleToolStripMenuItem.CheckOnClick = true; this.circleToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText; this.circleToolStripMenuItem.Name = "circleToolStripMenuItem"; + resources.ApplyResources(this.circleToolStripMenuItem, "circleToolStripMenuItem"); this.circleToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); // // squareToolStripMenuItem // - resources.ApplyResources(this.squareToolStripMenuItem, "squareToolStripMenuItem"); this.squareToolStripMenuItem.CheckOnClick = true; this.squareToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText; this.squareToolStripMenuItem.Name = "squareToolStripMenuItem"; + resources.ApplyResources(this.squareToolStripMenuItem, "squareToolStripMenuItem"); this.squareToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); // // triangleToolStripMenuItem // - resources.ApplyResources(this.triangleToolStripMenuItem, "triangleToolStripMenuItem"); this.triangleToolStripMenuItem.CheckOnClick = true; this.triangleToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText; this.triangleToolStripMenuItem.Name = "triangleToolStripMenuItem"; + resources.ApplyResources(this.triangleToolStripMenuItem, "triangleToolStripMenuItem"); this.triangleToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); // // l1ToolStripMenuItem // - resources.ApplyResources(this.l1ToolStripMenuItem, "l1ToolStripMenuItem"); this.l1ToolStripMenuItem.CheckOnClick = true; this.l1ToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText; this.l1ToolStripMenuItem.Name = "l1ToolStripMenuItem"; + resources.ApplyResources(this.l1ToolStripMenuItem, "l1ToolStripMenuItem"); this.l1ToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); // // l2ToolStripMenuItem // - resources.ApplyResources(this.l2ToolStripMenuItem, "l2ToolStripMenuItem"); this.l2ToolStripMenuItem.CheckOnClick = true; this.l2ToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText; this.l2ToolStripMenuItem.Name = "l2ToolStripMenuItem"; + resources.ApplyResources(this.l2ToolStripMenuItem, "l2ToolStripMenuItem"); this.l2ToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); // // r1ToolStripMenuItem // - resources.ApplyResources(this.r1ToolStripMenuItem, "r1ToolStripMenuItem"); this.r1ToolStripMenuItem.CheckOnClick = true; this.r1ToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText; this.r1ToolStripMenuItem.Name = "r1ToolStripMenuItem"; + resources.ApplyResources(this.r1ToolStripMenuItem, "r1ToolStripMenuItem"); this.r1ToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); // // r2ToolStripMenuItem // - resources.ApplyResources(this.r2ToolStripMenuItem, "r2ToolStripMenuItem"); this.r2ToolStripMenuItem.CheckOnClick = true; this.r2ToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText; this.r2ToolStripMenuItem.Name = "r2ToolStripMenuItem"; + resources.ApplyResources(this.r2ToolStripMenuItem, "r2ToolStripMenuItem"); this.r2ToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); // // onTouchpadToolStripMenuItem // - resources.ApplyResources(this.onTouchpadToolStripMenuItem, "onTouchpadToolStripMenuItem"); this.onTouchpadToolStripMenuItem.CheckOnClick = true; this.onTouchpadToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText; this.onTouchpadToolStripMenuItem.Name = "onTouchpadToolStripMenuItem"; + resources.ApplyResources(this.onTouchpadToolStripMenuItem, "onTouchpadToolStripMenuItem"); this.onTouchpadToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); // // downToolStripMenuItem // - resources.ApplyResources(this.downToolStripMenuItem, "downToolStripMenuItem"); this.downToolStripMenuItem.CheckOnClick = true; this.downToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText; this.downToolStripMenuItem.Name = "downToolStripMenuItem"; + resources.ApplyResources(this.downToolStripMenuItem, "downToolStripMenuItem"); this.downToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); // // leftToolStripMenuItem // - resources.ApplyResources(this.leftToolStripMenuItem, "leftToolStripMenuItem"); this.leftToolStripMenuItem.CheckOnClick = true; this.leftToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText; this.leftToolStripMenuItem.Name = "leftToolStripMenuItem"; + resources.ApplyResources(this.leftToolStripMenuItem, "leftToolStripMenuItem"); this.leftToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); // // rightToolStripMenuItem // - resources.ApplyResources(this.rightToolStripMenuItem, "rightToolStripMenuItem"); this.rightToolStripMenuItem.CheckOnClick = true; this.rightToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText; this.rightToolStripMenuItem.Name = "rightToolStripMenuItem"; + resources.ApplyResources(this.rightToolStripMenuItem, "rightToolStripMenuItem"); this.rightToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); // // l3ToolStripMenuItem // - resources.ApplyResources(this.l3ToolStripMenuItem, "l3ToolStripMenuItem"); this.l3ToolStripMenuItem.CheckOnClick = true; this.l3ToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText; this.l3ToolStripMenuItem.Name = "l3ToolStripMenuItem"; + resources.ApplyResources(this.l3ToolStripMenuItem, "l3ToolStripMenuItem"); this.l3ToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); // // r3ToolStripMenuItem // - resources.ApplyResources(this.r3ToolStripMenuItem, "r3ToolStripMenuItem"); this.r3ToolStripMenuItem.CheckOnClick = true; this.r3ToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText; this.r3ToolStripMenuItem.Name = "r3ToolStripMenuItem"; + resources.ApplyResources(this.r3ToolStripMenuItem, "r3ToolStripMenuItem"); this.r3ToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); // // fingerOnTouchpadToolStripMenuItem // - resources.ApplyResources(this.fingerOnTouchpadToolStripMenuItem, "fingerOnTouchpadToolStripMenuItem"); this.fingerOnTouchpadToolStripMenuItem.CheckOnClick = true; this.fingerOnTouchpadToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText; this.fingerOnTouchpadToolStripMenuItem.Name = "fingerOnTouchpadToolStripMenuItem"; + resources.ApplyResources(this.fingerOnTouchpadToolStripMenuItem, "fingerOnTouchpadToolStripMenuItem"); this.fingerOnTouchpadToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); // // fingersOnTouchpadToolStripMenuItem // - resources.ApplyResources(this.fingersOnTouchpadToolStripMenuItem, "fingersOnTouchpadToolStripMenuItem"); this.fingersOnTouchpadToolStripMenuItem.CheckOnClick = true; this.fingersOnTouchpadToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText; this.fingersOnTouchpadToolStripMenuItem.Name = "fingersOnTouchpadToolStripMenuItem"; + resources.ApplyResources(this.fingersOnTouchpadToolStripMenuItem, "fingersOnTouchpadToolStripMenuItem"); this.fingersOnTouchpadToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); // // optionsToolStripMenuItem // - resources.ApplyResources(this.optionsToolStripMenuItem, "optionsToolStripMenuItem"); this.optionsToolStripMenuItem.CheckOnClick = true; this.optionsToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText; this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; + resources.ApplyResources(this.optionsToolStripMenuItem, "optionsToolStripMenuItem"); this.optionsToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); // // shareToolStripMenuItem // - resources.ApplyResources(this.shareToolStripMenuItem, "shareToolStripMenuItem"); this.shareToolStripMenuItem.CheckOnClick = true; this.shareToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText; this.shareToolStripMenuItem.Name = "shareToolStripMenuItem"; + resources.ApplyResources(this.shareToolStripMenuItem, "shareToolStripMenuItem"); this.shareToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); // // pSToolStripMenuItem // - resources.ApplyResources(this.pSToolStripMenuItem, "pSToolStripMenuItem"); this.pSToolStripMenuItem.CheckOnClick = true; this.pSToolStripMenuItem.ForeColor = System.Drawing.SystemColors.ControlText; this.pSToolStripMenuItem.Name = "pSToolStripMenuItem"; + resources.ApplyResources(this.pSToolStripMenuItem, "pSToolStripMenuItem"); this.pSToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); // // alwaysOnToolStripMenuItem // - resources.ApplyResources(this.alwaysOnToolStripMenuItem, "alwaysOnToolStripMenuItem"); this.alwaysOnToolStripMenuItem.CheckOnClick = true; this.alwaysOnToolStripMenuItem.Name = "alwaysOnToolStripMenuItem"; + resources.ApplyResources(this.alwaysOnToolStripMenuItem, "alwaysOnToolStripMenuItem"); this.alwaysOnToolStripMenuItem.CheckedChanged += new System.EventHandler(this.SATrigger_CheckedChanged); // + // maxZoneTabPage + // + this.maxZoneTabPage.Controls.Add(this.nUDR2Maxzone); + this.maxZoneTabPage.Controls.Add(this.nUDL2Maxzone); + this.maxZoneTabPage.Controls.Add(this.label8); + this.maxZoneTabPage.Controls.Add(this.label7); + this.maxZoneTabPage.Controls.Add(this.nUDRSMaxZone); + this.maxZoneTabPage.Controls.Add(this.label6); + this.maxZoneTabPage.Controls.Add(this.nUDLSMaxZone); + this.maxZoneTabPage.Controls.Add(this.label5); + resources.ApplyResources(this.maxZoneTabPage, "maxZoneTabPage"); + this.maxZoneTabPage.Name = "maxZoneTabPage"; + this.maxZoneTabPage.UseVisualStyleBackColor = true; + // + // label5 + // + resources.ApplyResources(this.label5, "label5"); + this.label5.Name = "label5"; + // + // nUDLSMaxZone + // + this.nUDLSMaxZone.DecimalPlaces = 2; + this.nUDLSMaxZone.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + resources.ApplyResources(this.nUDLSMaxZone, "nUDLSMaxZone"); + this.nUDLSMaxZone.Maximum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDLSMaxZone.Name = "nUDLSMaxZone"; + this.nUDLSMaxZone.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDLSMaxZone.ValueChanged += new System.EventHandler(this.nUDLSMaxZone_ValueChanged); + // + // label6 + // + resources.ApplyResources(this.label6, "label6"); + this.label6.Name = "label6"; + // + // nUDRSMaxZone + // + this.nUDRSMaxZone.DecimalPlaces = 2; + this.nUDRSMaxZone.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + resources.ApplyResources(this.nUDRSMaxZone, "nUDRSMaxZone"); + this.nUDRSMaxZone.Maximum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDRSMaxZone.Name = "nUDRSMaxZone"; + this.nUDRSMaxZone.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDRSMaxZone.ValueChanged += new System.EventHandler(this.nUDRSMaxZone_ValueChanged); + // + // label7 + // + resources.ApplyResources(this.label7, "label7"); + this.label7.Name = "label7"; + // + // label8 + // + resources.ApplyResources(this.label8, "label8"); + this.label8.Name = "label8"; + // + // nUDL2Maxzone + // + this.nUDL2Maxzone.DecimalPlaces = 2; + this.nUDL2Maxzone.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + resources.ApplyResources(this.nUDL2Maxzone, "nUDL2Maxzone"); + this.nUDL2Maxzone.Maximum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDL2Maxzone.Name = "nUDL2Maxzone"; + this.nUDL2Maxzone.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDL2Maxzone.ValueChanged += new System.EventHandler(this.nUDL2Maxzone_ValueChanged); + // + // nUDR2Maxzone + // + this.nUDR2Maxzone.DecimalPlaces = 2; + this.nUDR2Maxzone.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + resources.ApplyResources(this.nUDR2Maxzone, "nUDR2Maxzone"); + this.nUDR2Maxzone.Maximum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDR2Maxzone.Name = "nUDR2Maxzone"; + this.nUDR2Maxzone.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDR2Maxzone.ValueChanged += new System.EventHandler(this.nUDR2Maxzone_ValueChanged); + // // Options // resources.ApplyResources(this, "$this"); @@ -3218,6 +3467,12 @@ this.tPCurve.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.nUDLSCurve)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDRSCurve)).EndInit(); + this.antiDeadzoneTabPage.ResumeLayout(false); + this.antiDeadzoneTabPage.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nUDR2AntiDead)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDL2AntiDead)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDRSAntiDead)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDLSAntiDead)).EndInit(); this.fLPSettings.ResumeLayout(false); this.gBGyro.ResumeLayout(false); this.gBGyro.PerformLayout(); @@ -3233,6 +3488,12 @@ ((System.ComponentModel.ISupportInitialize)(this.nUDSXS)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDSZS)).EndInit(); this.cMGyroTriggers.ResumeLayout(false); + this.maxZoneTabPage.ResumeLayout(false); + this.maxZoneTabPage.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nUDLSMaxZone)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDRSMaxZone)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDL2Maxzone)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDR2Maxzone)).EndInit(); this.ResumeLayout(false); } @@ -3514,5 +3775,24 @@ private System.Windows.Forms.Button btnRainbow; private System.Windows.Forms.ToolStripMenuItem alwaysOnToolStripMenuItem; public System.Windows.Forms.ToolStripMenuItem fingerOnTouchpadToolStripMenuItem; + private System.Windows.Forms.TabPage antiDeadzoneTabPage; + private System.Windows.Forms.NumericUpDown nUDRSAntiDead; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.NumericUpDown nUDLSAntiDead; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.NumericUpDown nUDR2AntiDead; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.NumericUpDown nUDL2AntiDead; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.CheckBox enableTouchToggleCheckbox; + private System.Windows.Forms.TabPage maxZoneTabPage; + private System.Windows.Forms.NumericUpDown nUDRSMaxZone; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.NumericUpDown nUDLSMaxZone; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.NumericUpDown nUDR2Maxzone; + private System.Windows.Forms.NumericUpDown nUDL2Maxzone; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label7; } } \ No newline at end of file diff --git a/DS4Windows/DS4Forms/Options.cs b/DS4Windows/DS4Forms/Options.cs index 1818675..1e1439a 100644 --- a/DS4Windows/DS4Forms/Options.cs +++ b/DS4Windows/DS4Forms/Options.cs @@ -27,8 +27,13 @@ namespace DS4Windows private float dpiy; public Dictionary defaults = new Dictionary(); public bool saving, loading; + public bool actionTabSeen = false; public static Size mSize { get; private set; } private Size settingsSize; + private Dictionary hoverIndexDict = new Dictionary(); + private Dictionary hoverImageDict = new Dictionary(); + private Dictionary hoverLabelDict = new Dictionary(); + public Options(DS4Form rt) { InitializeComponent(); @@ -46,18 +51,31 @@ namespace DS4Windows colored = btnRainbow.Image; greyscale = GreyscaleImage((Bitmap)btnRainbow.Image); fLPSettings.FlowDirection = FlowDirection.TopDown; + foreach (Control control in tPControls.Controls) + { if (control is Button && !((Button)control).Name.Contains("btn")) buttons.Add((Button)control); + } + foreach (Control control in fLPTouchSwipe.Controls) + { if (control is Button && !((Button)control).Name.Contains("btn")) buttons.Add((Button)control); + } + foreach (Control control in fLPTiltControls.Controls) + { if (control is Button && !((Button)control).Name.Contains("btn")) buttons.Add((Button)control); + } + foreach (Control control in pnlController.Controls) + { if (control is Button && !((Button)control).Name.Contains("btn")) buttons.Add((Button)control); + } + foreach (Button b in buttons) { defaults.Add(b.Name, b.Text); @@ -67,18 +85,27 @@ namespace DS4Windows foreach (System.Windows.Forms.Control control in Controls) { if (control.HasChildren) + { foreach (System.Windows.Forms.Control ctrl in control.Controls) { if (ctrl.HasChildren) + { foreach (System.Windows.Forms.Control ctrl2 in ctrl.Controls) { if (ctrl2.HasChildren) + { foreach (System.Windows.Forms.Control ctrl3 in ctrl2.Controls) ctrl3.MouseHover += Items_MouseHover; + } + ctrl2.MouseHover += Items_MouseHover; } + } + ctrl.MouseHover += Items_MouseHover; } + } + control.MouseHover += Items_MouseHover; } @@ -87,6 +114,7 @@ namespace DS4Windows b.MouseHover += button_MouseHover; b.MouseLeave += button_MouseLeave; } + advColorDialog.OnUpdateColor += advColorDialog_OnUpdateColor; inputtimer.Tick += InputDS4; sixaxisTimer.Tick += ControllerReadout_Tick; @@ -99,7 +127,122 @@ namespace DS4Windows bnSwipeDown.Text = Properties.Resources.SwipeDown; bnSwipeLeft.Text = Properties.Resources.SwipeLeft; bnSwipeRight.Text = Properties.Resources.SwipeRight; - } + + populateHoverIndexDict(); + populateHoverImageDict(); + populateHoverLabelDict(); + } + + private void populateHoverIndexDict() + { + hoverIndexDict.Clear(); + hoverIndexDict[bnCross] = 0; + hoverIndexDict[bnCircle] = 1; + hoverIndexDict[bnSquare] = 2; + hoverIndexDict[bnTriangle] = 3; + hoverIndexDict[bnOptions] = 4; + hoverIndexDict[bnShare] = 5; + hoverIndexDict[bnUp] = 6; + hoverIndexDict[bnDown] = 7; + hoverIndexDict[bnLeft] = 8; + hoverIndexDict[bnRight] = 9; + hoverIndexDict[bnPS] = 10; + hoverIndexDict[bnL1] = 11; + hoverIndexDict[bnR1] = 12; + hoverIndexDict[bnL2] = 13; + hoverIndexDict[bnR2] = 14; + hoverIndexDict[bnL3] = 15; + hoverIndexDict[bnR3] = 16; + hoverIndexDict[bnTouchLeft] = 17; + hoverIndexDict[bnTouchRight] = 18; + hoverIndexDict[bnTouchMulti] = 19; + hoverIndexDict[bnTouchUpper] = 20; + hoverIndexDict[bnLSUp] = 21; + hoverIndexDict[bnLSDown] = 22; + hoverIndexDict[bnLSLeft] = 23; + hoverIndexDict[bnLSRight] = 24; + hoverIndexDict[bnRSUp] = 25; + hoverIndexDict[bnRSDown] = 26; + hoverIndexDict[bnRSLeft] = 27; + hoverIndexDict[bnRSRight] = 28; + hoverIndexDict[bnGyroZN] = 29; + hoverIndexDict[bnGyroZP] = 30; + hoverIndexDict[bnGyroXP] = 31; + hoverIndexDict[bnGyroXN] = 32; + hoverIndexDict[bnSwipeUp] = 33; + hoverIndexDict[bnSwipeDown] = 34; + hoverIndexDict[bnSwipeLeft] = 35; + hoverIndexDict[bnSwipeRight] = 36; + } + + private void populateHoverImageDict() + { + hoverImageDict.Clear(); + hoverImageDict[bnCross] = Properties.Resources.DS4_Config_Cross; + hoverImageDict[bnCircle] = Properties.Resources.DS4_Config_Circle; + hoverImageDict[bnSquare] = Properties.Resources.DS4_Config_Square; + hoverImageDict[bnTriangle] = Properties.Resources.DS4_Config_Triangle; + hoverImageDict[bnOptions] = Properties.Resources.DS4_Config_Options; + hoverImageDict[bnShare] = Properties.Resources.DS4_Config_Share; + hoverImageDict[bnUp] = Properties.Resources.DS4_Config_Up; + hoverImageDict[bnDown] = Properties.Resources.DS4_Config_Down; + hoverImageDict[bnLeft] = Properties.Resources.DS4_Config_Left; + hoverImageDict[bnRight] = Properties.Resources.DS4_Config_Right; + hoverImageDict[bnPS] = Properties.Resources.DS4_Config_PS; + hoverImageDict[bnL1] = Properties.Resources.DS4_Config_L1; + hoverImageDict[bnR1] = Properties.Resources.DS4_Config_R1; + hoverImageDict[bnL2] = Properties.Resources.DS4_Config_L2; + hoverImageDict[bnR2] = Properties.Resources.DS4_Config_R2; + hoverImageDict[bnTouchLeft] = Properties.Resources.DS4_Config_TouchLeft; + hoverImageDict[bnTouchRight] = Properties.Resources.DS4_Config_TouchRight; + hoverImageDict[bnTouchMulti] = Properties.Resources.DS4_Config_TouchMulti; + hoverImageDict[bnTouchUpper] = Properties.Resources.DS4_Config_TouchUpper; + hoverImageDict[bnL3] = Properties.Resources.DS4_Config_LS; + hoverImageDict[bnLSUp] = Properties.Resources.DS4_Config_LS; + hoverImageDict[bnLSDown] = Properties.Resources.DS4_Config_LS; + hoverImageDict[bnLSLeft] = Properties.Resources.DS4_Config_LS; + hoverImageDict[bnLSRight] = Properties.Resources.DS4_Config_LS; + hoverImageDict[bnR3] = Properties.Resources.DS4_Config_RS; + hoverImageDict[bnRSUp] = Properties.Resources.DS4_Config_RS; + hoverImageDict[bnRSDown] = Properties.Resources.DS4_Config_RS; + hoverImageDict[bnRSLeft] = Properties.Resources.DS4_Config_RS; + hoverImageDict[bnRSRight] = Properties.Resources.DS4_Config_RS; + } + + private void populateHoverLabelDict() + { + hoverLabelDict.Clear(); + + hoverLabelDict[bnCross] = lbLCross; + hoverLabelDict[bnCircle] = lbLCircle; + hoverLabelDict[bnSquare] = lbLSquare; + hoverLabelDict[bnTriangle] = lbLTriangle; + hoverLabelDict[bnOptions] = lbLOptions; + hoverLabelDict[bnShare] = lbLShare; + hoverLabelDict[bnUp] = lbLUp; + hoverLabelDict[bnDown] = lbLDown; + hoverLabelDict[bnLeft] = lbLLeft; + hoverLabelDict[bnRight] = lbLright; + hoverLabelDict[bnPS] = lbLPS; + hoverLabelDict[bnL1] = lbLL1; + hoverLabelDict[bnR1] = lbLR1; + hoverLabelDict[bnL2] = lbLL2; + hoverLabelDict[bnR2] = lbLR2; + hoverLabelDict[bnTouchLeft] = lbLTouchLM; + hoverLabelDict[bnTouchRight] = lbLTouchRight; + hoverLabelDict[bnTouchMulti] = lbLTouchLM; + hoverLabelDict[bnTouchUpper] = lbLTouchUpper; + hoverLabelDict[bnL3] = lbLLS; + hoverLabelDict[bnLSUp] = lbLLS; + hoverLabelDict[bnLSDown] = lbLLS; + hoverLabelDict[bnLSLeft] = lbLLS; + hoverLabelDict[bnLSRight] = lbLLS; + hoverLabelDict[bnR3] = lbLRS; + hoverLabelDict[bnRSUp] = lbLRS; + hoverLabelDict[bnRSDown] = lbLRS; + hoverLabelDict[bnRSLeft] = lbLRS; + hoverLabelDict[bnRSRight] = lbLRS; + } public void Reload(int deviceNum, string name) { @@ -128,10 +271,12 @@ namespace DS4Windows root.lbLastMessage.Text = "Hover over items to see description or more about"; if (device < 4) nUDSixaxis.Value = deviceNum + 1; + if (filename != "") { if (device == 4) //if temp device is called ProfilePath[4] = name; + LoadProfile(device, false, Program.rootHub); if (Rainbow[device] == 0) @@ -144,6 +289,7 @@ namespace DS4Windows btnRainbow.Image = colored; ToggleRainbow(true); } + DS4Color color = MainColor[device]; tBRedBar.Value = color.red; tBGreenBar.Value = color.green; @@ -171,14 +317,18 @@ namespace DS4Windows cBFlashType.SelectedIndex = 0; else cBFlashType.SelectedIndex = FlashType[device]; + DS4Color fColor = FlashColor[device]; if (fColor.Equals(new DS4Color { red = 0, green = 0, blue = 0 })) + { if (Rainbow[device] == 0) btnFlashColor.BackColor = main; else btnFlashColor.BackgroundImage = rainbowImg; + } else btnFlashColor.BackColor = Color.FromArgb(fColor.red, fColor.green, fColor.blue); + nUDRumbleBoost.Value = RumbleBoost[device]; nUDTouch.Value = TouchSensitivity[device]; cBSlide.Checked = TouchSensitivity[device] > 0; @@ -190,6 +340,7 @@ namespace DS4Windows cBTouchpadJitterCompensation.Checked = TouchpadJitterCompensation[device]; cBlowerRCOn.Checked = LowerRCOn[device]; cBFlushHIDQueue.Checked = FlushHIDQueue[device]; + enableTouchToggleCheckbox.Checked = getEnableTouchToggle(device); nUDIdleDisconnect.Value = Math.Round((decimal)(IdleDisconnectTimeout[device] / 60d), 1); cBIdleDisconnect.Checked = IdleDisconnectTimeout[device] > 0; numUDMouseSens.Value = ButtonMouseSensitivity[device]; @@ -205,6 +356,7 @@ namespace DS4Windows cBWhileCharging.SelectedIndex = 0; else cBWhileCharging.SelectedIndex = ChargingType[device]; + try { nUDL2.Value = Math.Round((decimal)L2Deadzone[device] / 255, 2); @@ -221,6 +373,41 @@ namespace DS4Windows { nUDR2.Value = 0; } + + try + { + nUDL2AntiDead.Value = (decimal)(L2AntiDeadzone[device] / 100d); + } + catch + { + nUDL2AntiDead.Value = 0; + } + try + { + nUDR2AntiDead.Value = (decimal)(R2AntiDeadzone[device] / 100d); + } + catch + { + nUDR2AntiDead.Value = 0; + } + + try + { + nUDL2Maxzone.Value = (decimal)(L2Maxzone[device] / 100d); + } + catch + { + nUDL2Maxzone.Value = 1; + } + try + { + nUDR2Maxzone.Value = (decimal)(R2Maxzone[device] / 100d); + } + catch + { + nUDR2Maxzone.Value = 1; + } + try { nUDLS.Value = Math.Round((decimal)(LSDeadzone[device] / 127d), 3); @@ -237,6 +424,41 @@ namespace DS4Windows { nUDRS.Value = 0; } + + try + { + nUDLSAntiDead.Value = (decimal)(LSAntiDeadzone[device] / 100d); + } + catch + { + nUDLSAntiDead.Value = 0; + } + try + { + nUDRSAntiDead.Value = (decimal)(RSAntiDeadzone[device] / 100d); + } + catch + { + nUDRSAntiDead.Value = 0; + } + + try + { + nUDLSMaxZone.Value = (decimal)(LSMaxzone[device] / 100d); + } + catch + { + nUDLSMaxZone.Value = 1; + } + try + { + nUDRSMaxZone.Value = (decimal)(RSMaxzone[device] / 100d); + } + catch + { + nUDRSMaxZone.Value = 1; + } + try { nUDSX.Value = (decimal)SXDeadzone[device]; @@ -301,12 +523,14 @@ namespace DS4Windows { nUDSZS.Value = 1; } + if (LaunchProgram[device] != string.Empty) { cBLaunchProgram.Checked = true; pBProgram.Image = Icon.ExtractAssociatedIcon(LaunchProgram[device]).ToBitmap(); btnBrowse.Text = Path.GetFileNameWithoutExtension(LaunchProgram[device]); } + cBDinput.Checked = DinputOnly[device]; olddinputcheck = cBDinput.Checked; cbStartTouchpadOff.Checked = StartTouchpadOff[device]; @@ -320,7 +544,7 @@ namespace DS4Windows string[] satriggers = SATriggers[device].Split(','); List s = new List(); - for (int i = 0; i < satriggers.Length; i++) + for (int i = 0, satrigLen = satriggers.Length; i < satrigLen; i++) { int tr; if (int.TryParse(satriggers[i], out tr)) @@ -370,6 +594,7 @@ namespace DS4Windows case 3: tBRedBar.Value = 255; tBGreenBar.Value = 0; tBBlueBar.Value = 255; break; case 4: tBRedBar.Value = 255; tBGreenBar.Value = 255; tBBlueBar.Value = 255; break; } + tBLowBlueBar.Value = 0; tBLowGreenBar.Value = 0; tBLowBlueBar.Value = 0; cBLightbyBattery.Checked = false; @@ -387,7 +612,8 @@ namespace DS4Windows cBDoubleTap.Checked = false; cBTouchpadJitterCompensation.Checked = true; cBlowerRCOn.Checked = false; - cBFlushHIDQueue.Checked = true; + cBFlushHIDQueue.Checked = false; + enableTouchToggleCheckbox.Checked = true; nUDIdleDisconnect.Value = 5; cBIdleDisconnect.Checked = true; numUDMouseSens.Value = 25; @@ -397,8 +623,14 @@ namespace DS4Windows nUDRainbow.Value = 0; nUDL2.Value = 0; nUDR2.Value = 0; + nUDL2Maxzone.Value = 1; + nUDR2Maxzone.Value = 1; nUDLS.Value = 0; nUDRS.Value = 0; + nUDLSAntiDead.Value = 0; + nUDRSAntiDead.Value = 0; + nUDLSMaxZone.Value = 1; + nUDRSMaxZone.Value = 1; nUDSX.Value = .25m; nUDSZ.Value = .25m; @@ -426,13 +658,13 @@ namespace DS4Windows } UpdateLists(); - inputtimer.Start(); LoadActions(string.IsNullOrEmpty(filename)); loading = false; saving = false; } - private string getDS4ControlsByName(DS4Controls key) + /* TODO: Possibly remove. Currently not used. */ + /*private string getDS4ControlsByName(DS4Controls key) { switch (key) { @@ -479,8 +711,10 @@ namespace DS4Windows case DS4Controls.SwipeLeft: return "bnSwipeLeft"; case DS4Controls.SwipeRight: return "bnSwipeRight"; } + return ""; } + */ public void LoadActions(bool newp) { @@ -510,18 +744,26 @@ namespace DS4Windows lvi.SubItems.Add(Properties.Resources.MultiAction); break; } + if (newp) + { if (action.type == "DisconnectBT") lvi.Checked = true; else lvi.Checked = false; + } else + { foreach (string s in pactions) + { if (s == action.name) { lvi.Checked = true; break; } + } + } + lVActions.Items.Add(lvi); } } @@ -535,6 +777,7 @@ namespace DS4Windows else return value; } + void EnableReadings(bool on) { lbL2Track.Enabled = on; @@ -549,12 +792,14 @@ namespace DS4Windows btnSATrack.Visible = on; btnSATrackS.Visible = on; } + void ControllerReadout_Tick(object sender, EventArgs e) { // MEMS gyro data is all calibrated to roughly -1G..1G for values -0x2000..0x1fff // Enough additional acceleration and we are no longer mostly measuring Earth's gravity... // We should try to indicate setpoints of the calibration when exposing this measurement.... - if (Program.rootHub.DS4Controllers[(int)nUDSixaxis.Value - 1] == null) + DS4Device ds = Program.rootHub.DS4Controllers[(int)nUDSixaxis.Value - 1]; + if (ds == null) { EnableReadings(false); lbInputDelay.Text = Properties.Resources.InputDelay.Replace("*number*", Properties.Resources.NA); @@ -606,13 +851,18 @@ namespace DS4Windows btnLSTrack.Location = new Point((int)(dpix * x / 2.09), (int)(dpiy * y / 2.09)); btnLSTrackS.Visible = nUDLSS.Value != 1; } + if (nUDLSS.Value != 1) + { btnLSTrackS.Location = new Point((int)((float)nUDLSS.Value * (btnLSTrack.Location.X - pnlLSTrack.Size.Width / 2f) + pnlLSTrack.Size.Width / 2f), (int)((float)nUDLSS.Value * (btnLSTrack.Location.Y - pnlLSTrack.Size.Height / 2f) + pnlLSTrack.Size.Height / 2f)); + } + x = Program.rootHub.getDS4State((int)nUDSixaxis.Value - 1).RX; y = Program.rootHub.getDS4State((int)nUDSixaxis.Value - 1).RY; btnRSTrackS.Visible = nUDRSS.Value != 1; + if (nUDRSCurve.Value > 0) { float max = x + y; @@ -645,6 +895,7 @@ namespace DS4Windows btnRSTrack.Location = new Point((int)(dpix * x / 2.09), (int)(dpiy * y / 2.09)); btnRSTrackS.Visible = nUDRSS.Value != 1; } + if (nUDRSS.Value != 1) btnRSTrackS.Location = new Point((int)((float)nUDRSS.Value * (btnRSTrack.Location.X - pnlRSTrack.Size.Width / 2f) + pnlRSTrack.Size.Width / 2f), (int)((float)nUDRSS.Value * (btnRSTrack.Location.Y - pnlRSTrack.Size.Height / 2f) + pnlRSTrack.Size.Height / 2f)); @@ -661,6 +912,7 @@ namespace DS4Windows lbL2Track.Location = new Point(tBL2.Location.X - (int)(dpix * 25), Math.Max((int)(((tBL2.Location.Y + tBL2.Size.Height) - (tBL2.Value * (float)nUDL2S.Value) / (tBL2.Size.Height * .0209f / Math.Pow(dpix, 2))) - dpix * 20), (int)(1 * ((tBL2.Location.Y + tBL2.Size.Height) - 255 / (tBL2.Size.Height * .0209f / Math.Pow(dpix, 2))) - dpix * 20))); + if (tBL2.Value * (float)nUDL2S.Value >= 255) lbL2Track.ForeColor = Color.Green; else if (tBL2.Value * (float)nUDL2S.Value < (double)nUDL2.Value * 255) @@ -672,6 +924,7 @@ namespace DS4Windows lbR2Track.Location = new Point(tBR2.Location.X + (int)(dpix * 25), Math.Max((int)(1 * ((tBR2.Location.Y + tBR2.Size.Height) - (tBR2.Value * (float)nUDR2S.Value) / (tBR2.Size.Height * .0209f / Math.Pow(dpix, 2))) - dpix * 20), (int)(1 * ((tBR2.Location.Y + tBR2.Size.Height) - 255 / (tBR2.Size.Height * .0209f / Math.Pow(dpix, 2))) - dpix * 20))); + if (tBR2.Value * (float)nUDR2S.Value >= 255) lbR2Track.ForeColor = Color.Green; else if (tBR2.Value * (float)nUDR2S.Value < (double)nUDR2.Value * 255) @@ -680,14 +933,15 @@ namespace DS4Windows lbR2Track.ForeColor = Color.Black; - double latency = Program.rootHub.DS4Controllers[(int)nUDSixaxis.Value - 1].Latency; + double latency = ds.Latency; + int warnInterval = ds.getWarnInterval(); lbInputDelay.Text = Properties.Resources.InputDelay.Replace("*number*", latency.ToString()); - if (latency > 10) + if (latency > warnInterval) { lbInputDelay.BackColor = Color.Red; lbInputDelay.ForeColor = Color.White; } - else if (latency > 5) + else if (latency > (warnInterval / 2)) { lbInputDelay.BackColor = Color.Yellow; lbInputDelay.ForeColor = Color.Black; @@ -705,11 +959,14 @@ namespace DS4Windows percent /= 100f; return value1 * percent + value2 * (1 - percent); } + private void InputDS4(object sender, EventArgs e) { if (Form.ActiveForm == root && cBControllerInput.Checked && tCControls.SelectedIndex < 1) + { switch (Program.rootHub.GetInputkeys((int)nUDSixaxis.Value - 1)) { + case ("nothing"): break; case ("Cross"): Show_ControlsBn(bnCross, e); break; case ("Circle"): Show_ControlsBn(bnCircle, e); break; case ("Square"): Show_ControlsBn(bnSquare, e); break; @@ -743,10 +1000,11 @@ namespace DS4Windows case ("GyroXN"): Show_ControlsBn(bnGyroXN, e); break; case ("GyroZP"): Show_ControlsBn(bnGyroZP, e); break; case ("GyroZN"): Show_ControlsBn(bnGyroZN, e); break; + default: break; } + } } - private void button_MouseHoverB(object sender, EventArgs e) { Control[] b = Controls.Find(((Button)sender).Name.Remove(1, 1), true); @@ -791,10 +1049,17 @@ namespace DS4Windows private void button_MouseHover(object sender, EventArgs e) { bool swipesOn = lBControls.Items.Count > 33; - string name = ((Button)sender).Name; + Button senderControl = (Button)sender; + string name = senderControl.Name; if (e != null) { - switch (name) + int tempIndex = 0; + if (hoverIndexDict.TryGetValue(senderControl, out tempIndex)) + { + lBControls.SelectedIndex = tempIndex; + } + + /*switch (name) { #region case "bnCross": lBControls.SelectedIndex = 0; break; @@ -832,7 +1097,9 @@ namespace DS4Windows case "bnGyroXN": lBControls.SelectedIndex = 32; break; #endregion } + if (swipesOn) + { switch (name) { case "bnSwipeUp": if (swipesOn) lBControls.SelectedIndex = 33; break; @@ -840,21 +1107,38 @@ namespace DS4Windows case "bnSwipeLeft": if (swipesOn) lBControls.SelectedIndex = 35; break; case "bnSwipeRight": if (swipesOn) lBControls.SelectedIndex = 36; break; } + } + */ } + DS4ControlSettings dcs = getDS4CSetting(device, name); if (lBControls.SelectedIndex >= 0) { string tipText = lBControls.SelectedItem.ToString().Split(':')[0]; tipText += ": "; - tipText += UpdateButtonList(((Button)sender)); + tipText += UpdateButtonList(senderControl); if (GetDS4Action(device, name, true) != null && GetDS4STrigger(device, name) > 0) { tipText += "\n Shift: "; - tipText += ShiftTrigger(GetDS4STrigger(device, name)) + " -> " + UpdateButtonList(((Button)sender), true); + tipText += ShiftTrigger(GetDS4STrigger(device, name)) + " -> " + UpdateButtonList(senderControl, true); } + lbControlName.Text = tipText; } - switch (name) + + Bitmap tempBit = null; + if (hoverImageDict.TryGetValue(senderControl, out tempBit)) + { + pBHoveredButton.Image = tempBit; + } + + Label tempLabel = null; + if (hoverLabelDict.TryGetValue(senderControl, out tempLabel)) + { + pBHoveredButton.Location = tempLabel.Location; + } + + /*switch (name) { #region case "bnCross": @@ -975,6 +1259,8 @@ namespace DS4Windows break; #endregion } + */ + if (pBHoveredButton.Image != null) pBHoveredButton.Size = new Size((int)(pBHoveredButton.Image.Size.Width * (dpix / 1.25f)), (int)(pBHoveredButton.Image.Size.Height * (dpix / 1.25f))); } @@ -993,6 +1279,7 @@ namespace DS4Windows trackBar.Maximum = value; else if (trackBar.Minimum > value) trackBar.Minimum = value; + trackBar.Value = value; } @@ -1008,8 +1295,11 @@ namespace DS4Windows FlashColor[device] = new DS4Color(btnFlashColor.BackColor); else FlashColor[device] = new DS4Color(Color.Black); + L2Deadzone[device] = (byte)Math.Round((nUDL2.Value * 255), 0); R2Deadzone[device] = (byte)Math.Round((nUDR2.Value * 255), 0); + L2AntiDeadzone[device] = (int)(nUDL2AntiDead.Value * 100); + R2AntiDeadzone[device] = (int)(nUDR2AntiDead.Value * 100); RumbleBoost[device] = (byte)nUDRumbleBoost.Value; TouchSensitivity[device] = (byte)nUDTouch.Value; TouchpadJitterCompensation[device] = cBTouchpadJitterCompensation.Checked; @@ -1021,6 +1311,8 @@ namespace DS4Windows Rainbow[device] = (int)nUDRainbow.Value; RSDeadzone[device] = (int)Math.Round((nUDRS.Value * 127), 0); LSDeadzone[device] = (int)Math.Round((nUDLS.Value * 127), 0); + LSAntiDeadzone[device] = (int)(nUDLSAntiDead.Value * 100); + RSAntiDeadzone[device] = (int)(nUDRSAntiDead.Value * 100); ButtonMouseSensitivity[device] = (int)numUDMouseSens.Value; FlashAt[device] = (int)nUDflashLED.Value; SXDeadzone[device] = (double)nUDSX.Value; @@ -1035,9 +1327,14 @@ namespace DS4Windows RSCurve[device] = (int)Math.Round(nUDRSCurve.Value, 0); List pactions = new List(); foreach (ListViewItem lvi in lVActions.Items) + { if (lvi.Checked) pactions.Add(lvi.Text); + } + ProfileActions[device] = pactions; + calculateProfileActionCount(device); + calculateProfileActionDicts(device); pnlTPMouse.Visible = rBTPMouse.Checked; pnlSAMouse.Visible = rBSAMouse.Checked; fLPTiltControls.Visible = rBSAControls.Checked; @@ -1047,17 +1344,24 @@ namespace DS4Windows int invert = 0; if (cBGyroInvertX.Checked) invert += 2; + if (cBGyroInvertY.Checked) invert += 1; + GyroInvert[device] = invert; List ints = new List(); for (int i = 0; i < cMGyroTriggers.Items.Count - 1; i++) + { if (((ToolStripMenuItem)cMGyroTriggers.Items[i]).Checked) ints.Add(i); + } + if (ints.Count == 0) ints.Add(-1); + SATriggers[device] = string.Join(",", ints); + if (nUDRainbow.Value == 0) btnRainbow.Image = greyscale; else btnRainbow.Image = colored; } @@ -1076,13 +1380,14 @@ namespace DS4Windows kbm360.ShowDialog(); } - public void ChangeButtonText(Control ctrl, bool shift, KeyValuePair tag, bool SC, bool TG, bool MC, bool MR, int sTrigger = 0) + public void ChangeButtonText(Control ctrl, bool shift, KeyValuePair tag, + bool SC, bool TG, bool MC, bool MR, int sTrigger = 0) { DS4KeyType kt = DS4KeyType.None; if (SC) kt |= DS4KeyType.ScanCode; if (TG) kt |= DS4KeyType.Toggle; if (MC) kt |= DS4KeyType.Macro; - if (MR) kt |= DS4KeyType.RepeatMacro; + if (MR) kt |= DS4KeyType.HoldMacro; UpdateDS4CSetting(device, ctrl.Name, shift, tag.Key, tag.Value, kt, sTrigger); } @@ -1137,26 +1442,30 @@ namespace DS4Windows btnLightbar.BackgroundImage = RecolorImage((Bitmap)btnLightbar.BackgroundImage, main); if (FlashColor[device].Equals(new DS4Color { red = 0, green = 0, blue = 0 })) btnFlashColor.BackColor = main; + btnFlashColor.BackgroundImage = nUDRainbow.Enabled ? rainbowImg : null; tBRedBar.Value = advColorDialog.Color.R; tBGreenBar.Value = advColorDialog.Color.G; tBBlueBar.Value = advColorDialog.Color.B; } + if (device < 4) DS4LightBar.forcelight[device] = false; } private void lowColorChooserButton_Click(object sender, EventArgs e) { - advColorDialog.Color = lowColorChooserButton.BackColor; - advColorDialog_OnUpdateColor(lowColorChooserButton.BackColor, e); + Color chooserBackColor = lowColorChooserButton.BackColor; + advColorDialog.Color = chooserBackColor; + advColorDialog_OnUpdateColor(chooserBackColor, e); if (advColorDialog.ShowDialog() == DialogResult.OK) { - lowColorChooserButton.BackColor = advColorDialog.Color; + lowColorChooserButton.BackColor = chooserBackColor = advColorDialog.Color; tBLowRedBar.Value = advColorDialog.Color.R; tBLowGreenBar.Value = advColorDialog.Color.G; tBLowBlueBar.Value = advColorDialog.Color.B; } + if (device < 4) DS4LightBar.forcelight[device] = false; } @@ -1164,16 +1473,20 @@ namespace DS4Windows private void btnChargingColor_Click(object sender, EventArgs e) { - advColorDialog.Color = btnChargingColor.BackColor; - advColorDialog_OnUpdateColor(btnChargingColor.BackColor, e); + Color chargingBackColor = btnChargingColor.BackColor; + advColorDialog.Color = chargingBackColor; + advColorDialog_OnUpdateColor(chargingBackColor, e); if (advColorDialog.ShowDialog() == DialogResult.OK) { - btnChargingColor.BackColor = advColorDialog.Color; + btnChargingColor.BackColor = chargingBackColor = advColorDialog.Color; } + if (device < 4) DS4LightBar.forcelight[device] = false; - ChargingColor[device] = new DS4Color(btnChargingColor.BackColor); + + ChargingColor[device] = new DS4Color(chargingBackColor); } + private void advColorDialog_OnUpdateColor(object sender, EventArgs e) { if (sender is Color && device < 4) @@ -1185,6 +1498,7 @@ namespace DS4Windows DS4LightBar.forcelight[device] = true; } } + private void SetColorToolTip(TrackBar tb, int type) { if (tb != null) @@ -1194,7 +1508,8 @@ namespace DS4Windows int som = bgc + 11 * (int)(value * 0.0039215); tb.BackColor = Color.FromArgb(tb.Name.ToLower().Contains("red") ? som : sat, tb.Name.ToLower().Contains("green") ? som : sat, tb.Name.ToLower().Contains("blue") ? som : sat); } - if (type == 0) //main + + if (type == 0) // main { alphacolor = Math.Max(tBRedBar.Value, Math.Max(tBGreenBar.Value, tBBlueBar.Value)); reg = Color.FromArgb(tBRedBar.Value, tBGreenBar.Value, tBBlueBar.Value); @@ -1214,6 +1529,7 @@ namespace DS4Windows lowColorChooserButton.BackColor = Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full); LowColor[device] = new DS4Color((byte)tBLowRedBar.Value, (byte)tBLowGreenBar.Value, (byte)tBLowBlueBar.Value); } + if (!saving && !loading && tb != null) tp.Show(tb.Value.ToString(), tb, (int)(dpix * 100), 0, 2000); } @@ -1236,6 +1552,7 @@ namespace DS4Windows float X = (C * (1 - Math.Abs((hue / 60) % 2 - 1))); float m = L - C / 2; float R =0, G=0, B=0; + if (light == 1) return Color.White; else if (rgb.R == rgb.G && rgb.G == rgb.B) return Color.White; else if (0 <= hue && hue < 60) { R = C; G = X; } @@ -1248,18 +1565,22 @@ namespace DS4Windows } private void rumbleBoostBar_ValueChanged(object sender, EventArgs e) { - RumbleBoost[device] = (byte)nUDRumbleBoost.Value; - byte h = (byte)Math.Min(255, (255 * nUDRumbleBoost.Value / 100)); - byte l = (byte)Math.Min(255, (255 * nUDRumbleBoost.Value / 100)); - bool hB = btnRumbleHeavyTest.Text == Properties.Resources.TestLText; - bool lB = btnRumbleLightTest.Text == Properties.Resources.TestLText; - Program.rootHub.setRumble((byte)(hB ? h : 0), (byte)(lB ? l : 0), device); + if (!loading) + { + RumbleBoost[device] = (byte)nUDRumbleBoost.Value; + byte h = (byte)Math.Min(255, (255 * nUDRumbleBoost.Value / 100)); + byte l = (byte)Math.Min(255, (255 * nUDRumbleBoost.Value / 100)); + bool hB = btnRumbleHeavyTest.Text == Properties.Resources.TestLText; + bool lB = btnRumbleLightTest.Text == Properties.Resources.TestLText; + Program.rootHub.setRumble((byte)(hB ? h : 0), (byte)(lB ? l : 0), device); + } } private void btnRumbleHeavyTest_Click(object sender, EventArgs e) { DS4Device d = Program.rootHub.DS4Controllers[(int)nUDSixaxis.Value - 1]; if (d != null) + { if (((Button)sender).Text == Properties.Resources.TestHText) { Program.rootHub.setRumble((byte)Math.Min(255, (255 * nUDRumbleBoost.Value / 100)), d.RightLightFastRumble, (int)nUDSixaxis.Value - 1); @@ -1270,12 +1591,14 @@ namespace DS4Windows Program.rootHub.setRumble(0, d.RightLightFastRumble, (int)nUDSixaxis.Value - 1); ((Button)sender).Text = Properties.Resources.TestHText; } + } } private void btnRumbleLightTest_Click(object sender, EventArgs e) { DS4Device d = Program.rootHub.DS4Controllers[(int)nUDSixaxis.Value - 1]; if (d != null) + { if (((Button)sender).Text == Properties.Resources.TestLText) { Program.rootHub.setRumble(d.LeftHeavySlowRumble, (byte)Math.Min(255, (255 * nUDRumbleBoost.Value / 100)), (int)nUDSixaxis.Value - 1); @@ -1286,6 +1609,7 @@ namespace DS4Windows Program.rootHub.setRumble(d.LeftHeavySlowRumble, 0, (int)nUDSixaxis.Value - 1); ((Button)sender).Text = Properties.Resources.TestLText; } + } } private void numUDTouch_ValueChanged(object sender, EventArgs e) @@ -1302,12 +1626,14 @@ namespace DS4Windows { ScrollSensitivity[device] = (int)nUDScroll.Value; } + private void ledAsBatteryIndicator_CheckedChanged(object sender, EventArgs e) { - LedAsBatteryIndicator[device] = cBLightbyBattery.Checked; - pnlLowBattery.Visible = cBLightbyBattery.Checked; - //pnlFull.Location = new Point(pnlFull.Location.X, (cBLightbyBattery.Checked ? (int)(dpix * 42) : (pnlFull.Location.Y + pnlLowBattery.Location.Y) / 2)); - lbFull.Text = (cBLightbyBattery.Checked ? Properties.Resources.Full + ":" : Properties.Resources.Color + ":"); + bool lightByBatteryChecked = cBLightbyBattery.Checked; + LedAsBatteryIndicator[device] = lightByBatteryChecked; + pnlLowBattery.Visible = lightByBatteryChecked; + //pnlFull.Location = new Point(pnlFull.Location.X, (lightByBatteryChecked ? (int)(dpix * 42) : (pnlFull.Location.Y + pnlLowBattery.Location.Y) / 2)); + lbFull.Text = (lightByBatteryChecked ? Properties.Resources.Full + ":" : Properties.Resources.Color + ":"); } private void lowerRCOffCheckBox_CheckedChanged(object sender, EventArgs e) @@ -1334,24 +1660,29 @@ namespace DS4Windows private void cBIdleDisconnect_CheckedChanged(object sender, EventArgs e) { - if (cBIdleDisconnect.Checked) + bool idleDisconnectChecked = cBIdleDisconnect.Checked; + if (idleDisconnectChecked) nUDIdleDisconnect.Value = 5; else nUDIdleDisconnect.Value = 0; - nUDIdleDisconnect.Enabled = cBIdleDisconnect.Checked; + + nUDIdleDisconnect.Enabled = idleDisconnectChecked; } private void Options_FormClosing(object sender, FormClosingEventArgs e) { for (int i = 0; i < 4; i++) - LoadProfile(i, false, Program.rootHub); //Refreshes all profiles in case other controllers are using the same profile + LoadProfile(i, false, Program.rootHub); // Refreshes all profiles in case other controllers are using the same profile + if (olddinputcheck != cBDinput.Checked) { root.btnStartStop_Clicked(false); root.btnStartStop_Clicked(false); } + if (btnRumbleHeavyTest.Text == Properties.Resources.StopText) Program.rootHub.setRumble(0, 0, (int)nUDSixaxis.Value - 1); + inputtimer.Stop(); sixaxisTimer.Stop(); root.OptionsClosed(); @@ -1377,30 +1708,36 @@ namespace DS4Windows private void cBSlide_CheckedChanged(object sender, EventArgs e) { - if (cBSlide.Checked) + bool slideChecked = cBSlide.Checked; + if (slideChecked) nUDTouch.Value = 100; else nUDTouch.Value = 0; - nUDTouch.Enabled = cBSlide.Checked; + + nUDTouch.Enabled = slideChecked; } private void cBScroll_CheckedChanged(object sender, EventArgs e) { - if (cBScroll.Checked) + bool scrollChecked = cBScroll.Checked; + if (scrollChecked) nUDScroll.Value = 5; else nUDScroll.Value = 0; - nUDScroll.Enabled = cBScroll.Checked; + + nUDScroll.Enabled = scrollChecked; } private void cBTap_CheckedChanged(object sender, EventArgs e) { - if (cBTap.Checked) + bool tapChecked = cBTap.Checked; + if (tapChecked) nUDTap.Value = 100; else nUDTap.Value = 0; - nUDTap.Enabled = cBTap.Checked; - cBDoubleTap.Enabled = cBTap.Checked; + + nUDTap.Enabled = tapChecked; + cBDoubleTap.Enabled = tapChecked; } private void cBDoubleTap_CheckedChanged(object sender, EventArgs e) @@ -1471,21 +1808,23 @@ namespace DS4Windows { if (tagO is int || tagO is ushort) { - return (Keys)int.Parse(tagO.ToString()) + (SC ? " (" + Properties.Resources.ScanCode + ")" : ""); + //return (Keys)int.Parse(tagO.ToString()) + (SC ? " (" + Properties.Resources.ScanCode + ")" : ""); + return (Keys)Convert.ToInt32(tagO) + (SC ? " (" + Properties.Resources.ScanCode + ")" : ""); } else if (tagO is int[]) { return Properties.Resources.Macro + (SC ? " (" + Properties.Resources.ScanCode + ")" : ""); } - else if (tagO is string || tagO is X360Controls) + else if (tagO is X360Controls) { string tag; - if (tagO is X360Controls) - { - tag = KBM360.getX360ControlsByName((X360Controls)tagO); - } - else - tag = tagO.ToString(); + tag = KBM360.getX360ControlsByName((X360Controls)tagO); + return tag; + } + else if (tagO is string) + { + string tag; + tag = tagO.ToString(); return tag; } else @@ -1498,49 +1837,52 @@ namespace DS4Windows else return Properties.Resources.Unassigned; } + private void Show_ControlsList(object sender, EventArgs e) { - if (lBControls.SelectedIndex == 0) Show_ControlsBn(bnCross, e); - if (lBControls.SelectedIndex == 1) Show_ControlsBn(bnCircle, e); - if (lBControls.SelectedIndex == 2) Show_ControlsBn(bnSquare, e); - if (lBControls.SelectedIndex == 3) Show_ControlsBn(bnTriangle, e); - if (lBControls.SelectedIndex == 4) Show_ControlsBn(bnOptions, e); - if (lBControls.SelectedIndex == 5) Show_ControlsBn(bnShare, e); - if (lBControls.SelectedIndex == 6) Show_ControlsBn(bnUp, e); - if (lBControls.SelectedIndex == 7) Show_ControlsBn(bnDown, e); - if (lBControls.SelectedIndex == 8) Show_ControlsBn(bnLeft, e); - if (lBControls.SelectedIndex == 9) Show_ControlsBn(bnRight, e); - if (lBControls.SelectedIndex == 10) Show_ControlsBn(bnPS, e); - if (lBControls.SelectedIndex == 11) Show_ControlsBn(bnL1, e); - if (lBControls.SelectedIndex == 12) Show_ControlsBn(bnR1, e); - if (lBControls.SelectedIndex == 13) Show_ControlsBn(bnL2, e); - if (lBControls.SelectedIndex == 14) Show_ControlsBn(bnR2, e); - if (lBControls.SelectedIndex == 15) Show_ControlsBn(bnL3, e); - if (lBControls.SelectedIndex == 16) Show_ControlsBn(bnR3, e); + int controlSelectedIndex = lBControls.SelectedIndex; - if (lBControls.SelectedIndex == 17) Show_ControlsBn(bnTouchLeft, e); - if (lBControls.SelectedIndex == 18) Show_ControlsBn(bnTouchRight, e); - if (lBControls.SelectedIndex == 19) Show_ControlsBn(bnTouchMulti, e); - if (lBControls.SelectedIndex == 20) Show_ControlsBn(bnTouchUpper, e); + if (controlSelectedIndex == 0) Show_ControlsBn(bnCross, e); + else if (controlSelectedIndex == 1) Show_ControlsBn(bnCircle, e); + else if (controlSelectedIndex == 2) Show_ControlsBn(bnSquare, e); + else if (controlSelectedIndex == 3) Show_ControlsBn(bnTriangle, e); + else if (controlSelectedIndex == 4) Show_ControlsBn(bnOptions, e); + else if (controlSelectedIndex == 5) Show_ControlsBn(bnShare, e); + else if (controlSelectedIndex == 6) Show_ControlsBn(bnUp, e); + else if (controlSelectedIndex == 7) Show_ControlsBn(bnDown, e); + else if (controlSelectedIndex == 8) Show_ControlsBn(bnLeft, e); + else if (controlSelectedIndex == 9) Show_ControlsBn(bnRight, e); + else if (controlSelectedIndex == 10) Show_ControlsBn(bnPS, e); + else if (controlSelectedIndex == 11) Show_ControlsBn(bnL1, e); + else if (controlSelectedIndex == 12) Show_ControlsBn(bnR1, e); + else if (controlSelectedIndex == 13) Show_ControlsBn(bnL2, e); + else if (controlSelectedIndex == 14) Show_ControlsBn(bnR2, e); + else if (controlSelectedIndex == 15) Show_ControlsBn(bnL3, e); + else if (controlSelectedIndex == 16) Show_ControlsBn(bnR3, e); - if (lBControls.SelectedIndex == 21) Show_ControlsBn(bnLSUp, e); - if (lBControls.SelectedIndex == 22) Show_ControlsBn(bnLSDown, e); - if (lBControls.SelectedIndex == 23) Show_ControlsBn(bnLSLeft, e); - if (lBControls.SelectedIndex == 24) Show_ControlsBn(bnLSRight, e); - if (lBControls.SelectedIndex == 25) Show_ControlsBn(bnRSUp, e); - if (lBControls.SelectedIndex == 26) Show_ControlsBn(bnRSDown, e); - if (lBControls.SelectedIndex == 27) Show_ControlsBn(bnRSLeft, e); - if (lBControls.SelectedIndex == 28) Show_ControlsBn(bnRSRight, e); + else if (controlSelectedIndex == 17) Show_ControlsBn(bnTouchLeft, e); + else if (controlSelectedIndex == 18) Show_ControlsBn(bnTouchRight, e); + else if (controlSelectedIndex == 19) Show_ControlsBn(bnTouchMulti, e); + else if (controlSelectedIndex == 20) Show_ControlsBn(bnTouchUpper, e); - if (lBControls.SelectedIndex == 29) Show_ControlsBn(bnGyroZN, e); - if (lBControls.SelectedIndex == 30) Show_ControlsBn(bnGyroZP, e); - if (lBControls.SelectedIndex == 31) Show_ControlsBn(bnGyroXP, e); - if (lBControls.SelectedIndex == 32) Show_ControlsBn(bnGyroXN, e); + else if (controlSelectedIndex == 21) Show_ControlsBn(bnLSUp, e); + else if (controlSelectedIndex == 22) Show_ControlsBn(bnLSDown, e); + else if (controlSelectedIndex == 23) Show_ControlsBn(bnLSLeft, e); + else if (controlSelectedIndex == 24) Show_ControlsBn(bnLSRight, e); + else if (controlSelectedIndex == 25) Show_ControlsBn(bnRSUp, e); + else if (controlSelectedIndex == 26) Show_ControlsBn(bnRSDown, e); + else if (controlSelectedIndex == 27) Show_ControlsBn(bnRSLeft, e); + else if (controlSelectedIndex == 28) Show_ControlsBn(bnRSRight, e); - if (lBControls.SelectedIndex == 33) Show_ControlsBn(bnSwipeUp, e); - if (lBControls.SelectedIndex == 34) Show_ControlsBn(bnSwipeDown, e); - if (lBControls.SelectedIndex == 35) Show_ControlsBn(bnSwipeLeft, e); - if (lBControls.SelectedIndex == 36) Show_ControlsBn(bnSwipeRight, e); + else if (controlSelectedIndex == 29) Show_ControlsBn(bnGyroZN, e); + else if (controlSelectedIndex == 30) Show_ControlsBn(bnGyroZP, e); + else if (controlSelectedIndex == 31) Show_ControlsBn(bnGyroXP, e); + else if (controlSelectedIndex == 32) Show_ControlsBn(bnGyroXN, e); + + else if (controlSelectedIndex == 33) Show_ControlsBn(bnSwipeUp, e); + else if (controlSelectedIndex == 34) Show_ControlsBn(bnSwipeDown, e); + else if (controlSelectedIndex == 35) Show_ControlsBn(bnSwipeLeft, e); + else if (controlSelectedIndex == 36) Show_ControlsBn(bnSwipeRight, e); } private void List_MouseDoubleClick(object sender, MouseEventArgs e) @@ -1595,8 +1937,10 @@ namespace DS4Windows btnLightbar.BackgroundImage = RecolorImage((Bitmap)btnLightbar.BackgroundImage, main); cBLightbyBattery.Text = Properties.Resources.ColorByBattery.Replace("*nl*", "\n"); } + if (FlashColor[device].Equals(new DS4Color { red = 0, green = 0, blue = 0 })) btnFlashColor.BackColor = main; + btnFlashColor.BackgroundImage = nUDRainbow.Enabled ? rainbowImg : null; lbspc.Enabled = on; pnlLowBattery.Enabled = !on; @@ -1608,9 +1952,9 @@ namespace DS4Windows Bitmap c = image; Bitmap d = new Bitmap(c.Width, c.Height); - for (int i = 0; i < c.Width; i++) + for (int i = 0, bitwidth = c.Width; i < bitwidth; i++) { - for (int x = 0; x < c.Height; x++) + for (int x = 0, bitheight = c.Height; x < bitheight; x++) { Color oc = c.GetPixel(i, x); int grayScale = (int)((oc.R * 0.3) + (oc.G * 0.59) + (oc.B * 0.11)); @@ -1618,6 +1962,7 @@ namespace DS4Windows d.SetPixel(i, x, nc); } } + return d; } @@ -1626,8 +1971,10 @@ namespace DS4Windows Bitmap c = Properties.Resources.DS4_lightbar; Bitmap d = new Bitmap(c.Width, c.Height); - for (int i = 0; i < c.Width; i++) - for (int x = 0; x < c.Height; x++) + for (int i = 0, bitwidth = c.Width; i < bitwidth; i++) + { + for (int x = 0, bitheight = c.Height; x < bitheight; x++) + { if (!nUDRainbow.Enabled) { Color col = c.GetPixel(i, x); @@ -1639,6 +1986,9 @@ namespace DS4Windows Color col = HuetoRGB((i / (float)c.Width) * 360, .5f, Color.Red); d.SetPixel(i, x, Color.FromArgb(c.GetPixel(i, x).A, col)); } + } + } + return d; } @@ -1757,6 +2107,7 @@ namespace DS4Windows { if (nUDflashLED.Value % 10 != 0) nUDflashLED.Value = Math.Round(nUDflashLED.Value / 10, 0) * 10; + FlashAt[device] = (int)nUDflashLED.Value; } @@ -1767,10 +2118,16 @@ namespace DS4Windows private void tabControls_SelectedIndexChanged(object sender, EventArgs e) { - if (tCControls.SelectedIndex == 2) + int index = tCControls.SelectedIndex; + if (index == 2) sixaxisTimer.Start(); else sixaxisTimer.Stop(); + + if (index == 1) + { + actionTabSeen = true; + } } private void DrawCircle(object sender, PaintEventArgs e) @@ -1832,7 +2189,7 @@ namespace DS4Windows private void cBDinput_CheckedChanged(object sender, EventArgs e) { DinputOnly[device] = cBDinput.Checked; - if (device < 4) + if (!loading && device < 4) { root.btnStartStop_Clicked(false); root.btnStartStop_Clicked(false); @@ -1844,12 +2201,12 @@ namespace DS4Windows StartTouchpadOff[device] = cbStartTouchpadOff.Checked; } - private void Items_MouseHover(object sender, EventArgs e) { string name = ((Control)sender).Name; if (name.Contains("btn") && !name.Contains("Flash") && !name.Contains("Stick") && !name.Contains("Rainbow")) name = name.Remove(1, 1); + switch (name) { case "cBlowerRCOn": root.lbLastMessage.Text = Properties.Resources.BestUsedRightSide; break; @@ -1872,7 +2229,6 @@ namespace DS4Windows case "btnFlashColor": root.lbLastMessage.Text = Properties.Resources.FlashAtTip; break; case "cbStartTouchpadOff": root.lbLastMessage.Text = Properties.Resources.TouchpadOffTip; break; case "cBTPforControls": root.lbLastMessage.Text = Properties.Resources.UsingTPSwipes; break; - default: root.lbLastMessage.Text = Properties.Resources.HoverOverItems; break; case "bnUp": root.lbLastMessage.Text = Properties.Resources.RightClickPresets; break; case "bnLeft": root.lbLastMessage.Text = Properties.Resources.RightClickPresets; break; @@ -1893,12 +2249,15 @@ namespace DS4Windows case "bnSwipeUp": root.lbLastMessage.Text = Properties.Resources.RightClickPresets; break; case "bnSwipeLeft": root.lbLastMessage.Text = Properties.Resources.RightClickPresets; break; case "bnSwipeRight": root.lbLastMessage.Text = Properties.Resources.RightClickPresets; break; - case "bnSwipeDown": root.lbLastMessage.Text = Properties.Resources.RightClickPresets; break; - case "bnL3": root.lbLastMessage.Text = Properties.Resources.RightClickPresets; break; - case "bnR3": root.lbLastMessage.Text = Properties.Resources.RightClickPresets; break; + case "bnSwipeDown": root.lbLastMessage.Text = Properties.Resources.RightClickPresets; break; + case "bnL3": root.lbLastMessage.Text = Properties.Resources.RightClickPresets; break; + case "bnR3": root.lbLastMessage.Text = Properties.Resources.RightClickPresets; break; + default: root.lbLastMessage.Text = Properties.Resources.HoverOverItems; break; } + if (name.Contains("bnLS") || name.Contains("bnRS")) root.lbLastMessage.Text = Properties.Resources.RightClickPresets; + if (root.lbLastMessage.Text != Properties.Resources.HoverOverItems) root.lbLastMessage.ForeColor = Color.Black; else @@ -1958,22 +2317,12 @@ namespace DS4Windows { RemoveAction(lVActions.SelectedItems[0].Text); lVActions.Items.Remove(lVActions.SelectedItems[0]); + calculateProfileActionCount(device); + calculateProfileActionDicts(device); + cacheProfileCustomsFlags(device); } } - private void lVActions_ItemChecked(object sender, ItemCheckedEventArgs e) - { - List pactions = new List(); - foreach (ListViewItem lvi in lVActions.Items) - if (lvi != null && lvi.Checked) - pactions.Add(lvi.Text); - ProfileActions[device] = pactions; - /*if (lVActions.Items.Count >= 50) - { - btnNewAction.Enabled = false; - }*/ - } - private void nUDLSCurve_ValueChanged(object sender, EventArgs e) { LSCurve[device] = (int)Math.Round(nUDLSCurve.Value, 0); @@ -1989,6 +2338,7 @@ namespace DS4Windows string name = cMSPresets.SourceControl.Name; if (name.Contains("btn") && !name.Contains("Stick")) name = name.Remove(1, 1); + if (name == "bnUp" || name == "bnLeft" || name == "bnRight" || name == "bnDown") controlToolStripMenuItem.Text = "Dpad"; else if (name == "btnLeftStick" || name.Contains("bnLS") || name.Contains("bnL3")) @@ -2003,6 +2353,7 @@ namespace DS4Windows controlToolStripMenuItem.Text = "Touchpad Swipes"; else controlToolStripMenuItem.Text = "Select another control"; + MouseToolStripMenuItem.Visible = !(name == "lbTPSwipes" || name.StartsWith("bnSwipe")); } @@ -2014,7 +2365,6 @@ namespace DS4Windows Toggle_Bn(scancode, false, false, false, button4); }*/ - private void SetPreset(object sender, EventArgs e) { bool scancode = false; @@ -2022,7 +2372,8 @@ namespace DS4Windows KeyValuePair tagL; KeyValuePair tagR; KeyValuePair tagD; - KeyValuePair tagM = new KeyValuePair(null, "0,0,0,0,0,0,0,0"); ; + KeyValuePair tagM = new KeyValuePair(null, "0,0,0,0,0,0,0,0"); + string name = ((ToolStripMenuItem)sender).Name; if (name.Contains("Dpad") || name.Contains("DPad")) { @@ -2186,14 +2537,15 @@ namespace DS4Windows } Button button1, button2, button3, button4, button5 = null; - if (controlToolStripMenuItem.Text == "Dpad") + string toolStripMenuText = controlToolStripMenuItem.Text; + if (toolStripMenuText == "Dpad") { button1 = bnUp; button2 = bnLeft; button3 = bnRight; button4 = bnDown; } - else if (controlToolStripMenuItem.Text == "Left Stick") + else if (toolStripMenuText == "Left Stick") { button1 = bnLSUp; button2 = bnLSLeft; @@ -2201,7 +2553,7 @@ namespace DS4Windows button4 = bnLSDown; button5 = bnL3; } - else if (controlToolStripMenuItem.Text == "Right Stick") + else if (toolStripMenuText == "Right Stick") { button1 = bnRSUp; button2 = bnRSLeft; @@ -2209,21 +2561,21 @@ namespace DS4Windows button4 = bnRSDown; button5 = bnR3; } - else if (controlToolStripMenuItem.Text == "Face Buttons") + else if (toolStripMenuText == "Face Buttons") { button1 = bnTriangle; button2 = bnSquare; button3 = bnCircle; button4 = bnCross; } - else if (controlToolStripMenuItem.Text == "Sixaxis") + else if (toolStripMenuText == "Sixaxis") { button1 = bnGyroZN; button2 = bnGyroXP; button3 = bnGyroXN; button4 = bnGyroZP; } - else if (controlToolStripMenuItem.Text == "Touchpad Swipes") + else if (toolStripMenuText == "Touchpad Swipes") { button1 = bnSwipeUp; button2 = bnSwipeLeft; @@ -2232,6 +2584,7 @@ namespace DS4Windows } else button1 = button2 = button3 = button4 = null; + ChangeButtonText(tagU, button1, scancode); ChangeButtonText(tagL, button2, scancode); ChangeButtonText(tagR, button3, scancode); @@ -2256,6 +2609,7 @@ namespace DS4Windows advColorDialog.Color = btnFlashColor.BackColor; else advColorDialog.Color = Color.Black; + advColorDialog_OnUpdateColor(lbPercentFlashBar.ForeColor, e); if (advColorDialog.ShowDialog() == DialogResult.OK) { @@ -2263,8 +2617,10 @@ namespace DS4Windows btnFlashColor.BackColor = advColorDialog.Color; else btnFlashColor.BackColor = main; + FlashColor[device] = new DS4Color(advColorDialog.Color); } + if (device < 4) DS4LightBar.forcelight[device] = false; } @@ -2292,16 +2648,20 @@ namespace DS4Windows List ints = new List(); List s = new List(); for (int i = 0; i < cMGyroTriggers.Items.Count - 1; i++) + { if (((ToolStripMenuItem)cMGyroTriggers.Items[i]).Checked) { ints.Add(i); s.Add(cMGyroTriggers.Items[i].Text); } + } + if (ints.Count == 0) { ints.Add(-1); s.Add(cMGyroTriggers.Items[cMGyroTriggers.Items.Count - 1].Text); } + SATriggers[device] = string.Join(",", ints); if (s.Count > 0) btnGyroTriggers.Text = string.Join(", ", s); @@ -2312,8 +2672,10 @@ namespace DS4Windows int invert = 0; if (cBGyroInvertX.Checked) invert += 2; + if (cBGyroInvertY.Checked) invert += 1; + GyroInvert[device] = invert; } @@ -2335,6 +2697,69 @@ namespace DS4Windows } } + private void nUDLSAntiDead_ValueChanged(object sender, EventArgs e) + { + LSAntiDeadzone[device] = (int)(nUDLSAntiDead.Value * 100); + } + + private void nUDRSAntiDead_ValueChanged(object sender, EventArgs e) + { + RSAntiDeadzone[device] = (int)(nUDRSAntiDead.Value * 100); + } + + private void nUDL2AntiDead_ValueChanged(object sender, EventArgs e) + { + L2AntiDeadzone[device] = (int)(nUDL2AntiDead.Value * 100); + } + + private void nUDR2AntiDead_ValueChanged(object sender, EventArgs e) + { + R2AntiDeadzone[device] = (int)(nUDR2AntiDead.Value * 100); + } + + private void lVActions_ItemCheck(object sender, ItemCheckEventArgs e) + { + if (actionTabSeen) + { + List pactions = new List(); + foreach (ListViewItem lvi in lVActions.Items) + { + if (lvi != null && lvi.Checked) + pactions.Add(lvi.Text); + } + + ProfileActions[device] = pactions; + calculateProfileActionCount(device); + calculateProfileActionDicts(device); + cacheProfileCustomsFlags(device); + } + } + + private void enableTouchToggleCheckbox_CheckedChanged(object sender, EventArgs e) + { + EnableTouchToggle[device] = enableTouchToggleCheckbox.Checked; + } + + private void nUDRSMaxZone_ValueChanged(object sender, EventArgs e) + { + RSMaxzone[device] = (int)(nUDRSMaxZone.Value * 100); + } + + private void nUDLSMaxZone_ValueChanged(object sender, EventArgs e) + { + LSMaxzone[device] = (int)(nUDLSMaxZone.Value * 100); + } + + private void nUDL2Maxzone_ValueChanged(object sender, EventArgs e) + { + L2Maxzone[device] = (int)(nUDL2Maxzone.Value * 100); + } + + private void nUDR2Maxzone_ValueChanged(object sender, EventArgs e) + { + R2Maxzone[device] = (int)(nUDR2Maxzone.Value * 100); + } + private void Options_Resize(object sender, EventArgs e) { fLPSettings.AutoScroll = false; @@ -2343,61 +2768,64 @@ namespace DS4Windows private void lBControls_SelectedIndexChanged(object sender, EventArgs e) { + int controlSelectedIndex = lBControls.SelectedIndex; + if (lBControls.SelectedItem != null) { //lbControlName.Text = lBControls.SelectedItem.ToString(); - if (lBControls.SelectedIndex == 0) + if (controlSelectedIndex == 0) lbControlName.ForeColor = Color.FromArgb(153, 205, 204); - else if (lBControls.SelectedIndex == 1) + else if (controlSelectedIndex == 1) lbControlName.ForeColor = Color.FromArgb(247, 131, 150); - else if (lBControls.SelectedIndex == 2) + else if (controlSelectedIndex == 2) lbControlName.ForeColor = Color.FromArgb(237, 170, 217); - else if (lBControls.SelectedIndex == 3) + else if (controlSelectedIndex == 3) lbControlName.ForeColor = Color.FromArgb(75, 194, 202); else lbControlName.ForeColor = Color.White; } - if (lBControls.SelectedIndex == 0) button_MouseHover(bnCross, null); - if (lBControls.SelectedIndex == 1) button_MouseHover(bnCircle, null); - if (lBControls.SelectedIndex == 2) button_MouseHover(bnSquare, null); - if (lBControls.SelectedIndex == 3) button_MouseHover(bnTriangle, null); - if (lBControls.SelectedIndex == 4) button_MouseHover(bnOptions, null); - if (lBControls.SelectedIndex == 5) button_MouseHover(bnShare, null); - if (lBControls.SelectedIndex == 6) button_MouseHover(bnUp, null); - if (lBControls.SelectedIndex == 7) button_MouseHover(bnDown, null); - if (lBControls.SelectedIndex == 8) button_MouseHover(bnLeft, null); - if (lBControls.SelectedIndex == 9) button_MouseHover(bnRight, null); - if (lBControls.SelectedIndex == 10) button_MouseHover(bnPS, null); - if (lBControls.SelectedIndex == 11) button_MouseHover(bnL1, null); - if (lBControls.SelectedIndex == 12) button_MouseHover(bnR1, null); - if (lBControls.SelectedIndex == 13) button_MouseHover(bnL2, null); - if (lBControls.SelectedIndex == 14) button_MouseHover(bnR2, null); - if (lBControls.SelectedIndex == 15) button_MouseHover(bnL3, null); - if (lBControls.SelectedIndex == 16) button_MouseHover(bnR3, null); - if (lBControls.SelectedIndex == 17) button_MouseHover(bnTouchLeft, null); - if (lBControls.SelectedIndex == 18) button_MouseHover(bnTouchRight, null); - if (lBControls.SelectedIndex == 19) button_MouseHover(bnTouchMulti, null); - if (lBControls.SelectedIndex == 20) button_MouseHover(bnTouchUpper, null); + if (controlSelectedIndex == 0) button_MouseHover(bnCross, null); + else if (controlSelectedIndex == 1) button_MouseHover(bnCircle, null); + else if (controlSelectedIndex == 2) button_MouseHover(bnSquare, null); + else if (controlSelectedIndex == 3) button_MouseHover(bnTriangle, null); + else if (controlSelectedIndex == 4) button_MouseHover(bnOptions, null); + else if (controlSelectedIndex == 5) button_MouseHover(bnShare, null); + else if (controlSelectedIndex == 6) button_MouseHover(bnUp, null); + else if (controlSelectedIndex == 7) button_MouseHover(bnDown, null); + else if (controlSelectedIndex == 8) button_MouseHover(bnLeft, null); + else if (controlSelectedIndex == 9) button_MouseHover(bnRight, null); + else if (controlSelectedIndex == 10) button_MouseHover(bnPS, null); + else if (controlSelectedIndex == 11) button_MouseHover(bnL1, null); + else if (controlSelectedIndex == 12) button_MouseHover(bnR1, null); + else if (controlSelectedIndex == 13) button_MouseHover(bnL2, null); + else if (controlSelectedIndex == 14) button_MouseHover(bnR2, null); + else if (controlSelectedIndex == 15) button_MouseHover(bnL3, null); + else if (controlSelectedIndex == 16) button_MouseHover(bnR3, null); - if (lBControls.SelectedIndex == 21) button_MouseHover(bnLSUp, null); - if (lBControls.SelectedIndex == 22) button_MouseHover(bnLSDown, null); - if (lBControls.SelectedIndex == 23) button_MouseHover(bnLSLeft, null); - if (lBControls.SelectedIndex == 24) button_MouseHover(bnLSRight, null); - if (lBControls.SelectedIndex == 25) button_MouseHover(bnRSUp, null); - if (lBControls.SelectedIndex == 26) button_MouseHover(bnRSDown, null); - if (lBControls.SelectedIndex == 27) button_MouseHover(bnRSLeft, null); - if (lBControls.SelectedIndex == 28) button_MouseHover(bnRSRight, null); + else if (controlSelectedIndex == 17) button_MouseHover(bnTouchLeft, null); + else if (controlSelectedIndex == 18) button_MouseHover(bnTouchRight, null); + else if (controlSelectedIndex == 19) button_MouseHover(bnTouchMulti, null); + else if (controlSelectedIndex == 20) button_MouseHover(bnTouchUpper, null); - if (lBControls.SelectedIndex == 29) button_MouseHover(bnGyroZN, null); - if (lBControls.SelectedIndex == 30) button_MouseHover(bnGyroZP, null); - if (lBControls.SelectedIndex == 31) button_MouseHover(bnGyroXP, null); - if (lBControls.SelectedIndex == 32) button_MouseHover(bnGyroXN, null); + else if (controlSelectedIndex == 21) button_MouseHover(bnLSUp, null); + else if (controlSelectedIndex == 22) button_MouseHover(bnLSDown, null); + else if (controlSelectedIndex == 23) button_MouseHover(bnLSLeft, null); + else if (controlSelectedIndex == 24) button_MouseHover(bnLSRight, null); + else if (controlSelectedIndex == 25) button_MouseHover(bnRSUp, null); + else if (controlSelectedIndex == 26) button_MouseHover(bnRSDown, null); + else if (controlSelectedIndex == 27) button_MouseHover(bnRSLeft, null); + else if (controlSelectedIndex == 28) button_MouseHover(bnRSRight, null); - if (lBControls.SelectedIndex == 33) button_MouseHover(bnSwipeUp, null); - if (lBControls.SelectedIndex == 34) button_MouseHover(bnSwipeDown, null); - if (lBControls.SelectedIndex == 35) button_MouseHover(bnSwipeLeft, null); - if (lBControls.SelectedIndex == 36) button_MouseHover(bnSwipeRight, null); + else if (controlSelectedIndex == 29) button_MouseHover(bnGyroZN, null); + else if (controlSelectedIndex == 30) button_MouseHover(bnGyroZP, null); + else if (controlSelectedIndex == 31) button_MouseHover(bnGyroXP, null); + else if (controlSelectedIndex == 32) button_MouseHover(bnGyroXN, null); + + else if (controlSelectedIndex == 33) button_MouseHover(bnSwipeUp, null); + else if (controlSelectedIndex == 34) button_MouseHover(bnSwipeDown, null); + else if (controlSelectedIndex == 35) button_MouseHover(bnSwipeLeft, null); + else if (controlSelectedIndex == 36) button_MouseHover(bnSwipeRight, null); } private void nUDGyroSensitivity_ValueChanged(object sender, EventArgs e) @@ -2408,7 +2836,7 @@ namespace DS4Windows private void cBFlashType_SelectedIndexChanged(object sender, EventArgs e) { - FlashType[device]= (byte)cBFlashType.SelectedIndex; + FlashType[device] = (byte)cBFlashType.SelectedIndex; } private void nUDRainbowB_ValueChanged(object sender, EventArgs e) diff --git a/DS4Windows/DS4Forms/Options.resx b/DS4Windows/DS4Forms/Options.resx index d59a458..6c9bff1 100644 --- a/DS4Windows/DS4Forms/Options.resx +++ b/DS4Windows/DS4Forms/Options.resx @@ -118,7612 +118,7672 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - NoControl - - - - 151, 26 - - - - False - - - 256 - - - 300 - - - NoControl - - - 32, 30 - - - tPDeadzone - - - pnlController - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Other - - - fLPSettings - - - fLPSettings - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - bnL2 - - - 288 - - - Right Stick - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 40 - - - btnRumbleHeavyTest - - - 72 - - - False - - - lbLRS - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBLightbar - - - 4, 4, 4, 4 - - - R1 - - - pnlLowBattery - - - 3 - - - 4, 4, 4, 4 - - - 11 - - - 4, 4, 4, 4 - - - gBRumble - - - 5 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPCurve - - - Yes - - - 11 - - - NoControl - - - pnlController - - - r3ToolStripMenuItem - - - 3 - - - 4, 4, 4, 4 - - - 229 - - - pnlController - - - 2 - - - tPDeadzone - - - 0 - - - 4, 4, 4, 4 - - - 4 - - - 340, 98 - - - 31, 156 - - - 216 - - - Controller Readings - - - bnCircle - - - 4, 25 - - - 237 - - - 211 - - - 375, 291 - - - NoControl - - - 61, 24 - - - G - - - 151, 26 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 8 - - - 214 - - - 91, 151 - - - 50, 22 - - - 211 - - - 265, 3 - - - tBGreenBar - - - 285 - - - gBSensitivity - - - True - - - L2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 5, 69 - - - Left Touch : - - - btnChargingColor - - - Right Stick Left : - - - 4, 4, 4, 4 - - - Pulse - - - 4, 4, 4, 4 - - - lbGyroXP - - - gBSensitivity - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 54, 22 - - - 100, 29 - - - Left Button - - - Yes - - - btnRumbleLightTest - - - NoControl - - - Flat - - - pnlSAMouse - - - lbLowBlue - - - Left Stick - - - lbGyroInvert - - - 251 - - - NoControl - - - False - - - None - - - None - - - Yes - - - 6 - - - lbSixaxisZS - - - 18, 109 - - - btnLightbar - - - lbSwipeLeft - - - 705, 593 - - - Right X-Axis- - - - btnNewAction - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 50, 22 - - - 109, 92 - - - bnR3 - - - 151, 26 - - - 226 - - - tPCurve - - - gBOther - - - 5 - - - False - - - NoControl - - - NoControl - - - 4, 4, 4, 4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - 4, 4, 4, 4 - - - fLPTiltControls - - - Popup - - - 61, 22 - - - 233, 76 - - - Mouse Acceleration - - - 4, 4 - - - DpadToolStripMenuItem - - - Flat - - - 328, 190 - - - Flat - - - 203 - - - -4, 62 - - - 0 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 51 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - NoControl - - - fingersOnTouchpadToolStripMenuItem - - - lBControls - - - True - - - 55, 11 - - - pnlSAMouse - - - 10 - - - 4, 4, 4, 4 - - - lbEmpty - - - 233, 26 - - - $this - - - tPDeadzone - - - None - - - 4, 4, 4, 4 - - - NoControl - - - R2 - - - 167 - - - MiddleLeft - - - Flat - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbLSS - - - cBFlashType - - - 4, 4, 4, 4 - - - 9, 56 - - - Flat - - - B - - - 151, 26 - - - lbActionsTip - - - 4, 41 - - - pnlController - - - Sixaxis Z - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - NoControl - - - L2 - - - 4, 4, 4, 4 - - - Action - - - NoControl - - - advColorDialog - - - 250 - - - 170 - - - lbSixaxisZ - - - 28, 90 - - - 125, 25 - - - 237 - - - Flat - - - True - - - 160 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - lbR2LS - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - tPControls - - - 38, 269 - - - NoControl - - - G - - - 208 - - - 4, 4, 4, 4 - - - Zoom - - - cBMouseAccel - - - NoControl - - - 4, 4, 4, 4 - - - pnlSATrack - - - 2 - - - 6 - - - False - - - bnTouchRight - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - Right Stick - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - r2ToolStripMenuItem - - - pnlSixaxis - - - NoControl - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 5 - - - 257 - - - Flat - - - gBLightbar - - - 151, 26 - - - 288 - - - lbspc - - - 231 - - - 216 - - - 136, 26 - - - 205 - - - 101, 5 - - - Cross: A - - - 4, 0, 4, 0 - - - bnGyroZP - - - Fill - - - 100, 29 - - - PS - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlTPMouse - - - 2, 2 - - - wScanCodeArrowKeysToolStripMenuItem - - - 67, 25 - - - 9, 70 - - - NoControl - - - Rumble - - - 10 - - - mins - - - fLPTouchSwipe - - - R1 : - - - Left Y-Axis+ - - - Left Stick Down : - - - 182, 2 - - - NoControl - - - NoControl - - - 4, 4 - - - 61, 22 - - - 97, 168 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 29 - - - 0 - - - 250 - - - Idle Disconnect - - - pnlController - - - 205, 11 - - - 36, 2 - - - 4, 4 - - - 159 - - - 100, 29 - - - True - - - NoControl - - - 4, 0, 4, 0 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbPercentFlashBar - - - lbLTouchRight - - - Finger on Touchpad - - - 0 - - - fLPActionButtons - - - 159 - - - pnlFull - - - pnlTPMouse - - - 10 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 250 - - - pBProgram - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlLowBattery - - - None - - - 4, 0, 4, 0 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 29, 29 - - - 4, 4, 4, 4 - - - True - - - 125, 25 - - - Vertical - - - False - - - 49, 22 - - - NoControl - - - gBLightbar - - - True - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - None - - - 6, 209 - - - 4, 0, 4, 0 - - - 4 - - - 282 - - - pnlFull - - - NoControl - - - MiddleLeft - - - 210, 29 - - - lVActions - - - No - - - 250 - - - NoControl - - - 13 - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - 405, 162 - - - No - - - Flat - - - 4, 4, 4, 4 - - - True - - - Right - - - 2 - - - 135, 24 - - - 2 - - - 4 - - - 164 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Flat - - - 4, 0, 4, 0 - - - 96, 19 - - - MiddleCenter - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 9 - - - None - - - panel2 - - - 14 - - - Up Button - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 329, 150 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 227, 28 - - - 191 - - - lbControlName - - - Lower Right as RMB - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - - 4, 4, 4, 4 - - - 33 - - - NoControl - - - 3 - - - 168, 120 - - - True - - - 256 - - - 285 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - 1 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSixaxis - - - 186, 21 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 65, 17 - - - bnOptions - - - Flat - - - 50, 21 - - - False - - - 4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 38, 37 - - - 2, 2 - - - 528, 287 - - - TopRight - - - bnRight - - - pnlController - - - False - - - NoControl - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbSwipeRight - - - Edit Action - - - gBLightbar - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0 - - - Flat - - - Options - - - tCSens - - - True - - - 26, 17 - - - 6 - - - 5 - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0 - - - 0, 82 - - - False - - - 4, 4, 4, 4 - - - Lightbar - - - pnlController - - - 65, 21 - - - 196, 41 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 9, 4 - - - False - - - 79, 49 - - - pnlSATrack - - - 1 - - - 4, 25 - - - Popup - - - NoControl - - - Multitouch : - - - NoControl - - - Sixaxis Up : - - - Inverted Y - - - 3, 65 - - - False - - - 50, 22 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Flat - - - System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - Start - - - lbSixaxisXS - - - L3 - - - tCControls - - - % - - - NoControl - - - 136, 26 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - 549, 564 - - - 4, 4, 4, 4 - - - pnlController - - - NoControl - - - 16, 6 - - - 4, 4, 4, 4 - - - Remove Action - - - Flat - - - 4, 4, 4, 4 - - - % - - - 297 - - - NoControl - - - RSToolStripMenuItem - - - cBlowerRCOn - - - 4, 4, 4, 4 - - - Options - - - tPDeadzone - - - 50, 22 - - - Options - - - 147, 179 - - - Click the lightbar for color picker - - - lbLTouchLM - - - pnlTPMouse - - - gBOther - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - fLPTiltControls - - - 213 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 202 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4 - - - 205 - - - fLPTiltControls - - - True - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 26 - - - 6 - - - 4, 4, 4, 4 - - - 39 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 117, 423 - - - 2, 2 - - - NoControl - - - Triggers: - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 250, 192 - - - True - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 37 - - - fLPSettings - - - 111, 111 - - - True - - - pnlLSTrack - - - 292 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 340, 95 - - - 167 - - - 4, 4, 4, 4 - - - 20, 17 - - - tPDeadzone - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 16 - - - Gyro Sensitivity: - - - 46 - - - NoControl - - - 1 - - - NoControl - - - 7, 172 - - - True - - - 84 - - - NoControl - - - 4, 0, 4, 0 - - - 8, 5 - - - bnGyroZN - - - Left Y-Axis- - - - 252 - - - 2 - - - 5 - - - pnlController - - - 1 - - - NoControl - - - R2 : - - - 4, 4, 4, 4 - - - Left Stick Right : - - - 4 - - - Flat - - - 236 - - - for Mapping and readout - - - 549, 82 - - - $this - - - True - - - System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 158 - - - 125, 25 - - - 250 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 126, 21 - - - pnlLSTrack - - - 63, 17 - - - 8, 292 - - - tSMIRSInverted - - - lbLCircle - - - bnLSLeft - - - 219 - - - NoControl - - - pnlLSTrack - - - lbSATip - - - LSToolStripMenuItem - - - 0 - - - 202 - - - 549, 482 - - - 4, 4, 4, 4 - - - tBLowRedBar - - - 557, 0 - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 302 - - - 136, 26 - - - 240 - - - nUDRS - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBSensitivity - - - 2 - - - Normal - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbGyroTriggers - - - 106, 27 - - - MiddleRight - - - NoControl - - - 0 - - - 120, 131 - - - 1 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - openFileDialog1 - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 105, 5 - - - NoControl - - - 259 - - - 74, 28 - - - 61, 22 - - - pSToolStripMenuItem - - - Inverted Y - - - False - - - 3 - - - lbLTriangle - - - tBBlueBar - - - 169 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 2 - - - lbL2TrackS - - - NoControl - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 250 - - - 4, 0, 4, 0 - - - 39, 17 - - - 259 - - - 15 - - - tBLowBlueBar - - - 179, 53 - - - 4, 4, 4, 4 - - - flushHIDQueue - - - 110, 17 - - - 203, 204 - - - 2 - - - 4, 0, 4, 0 - - - Up - - - NoControl - - - 4 - - - 210 - - - 8, 42 - - - 36, 17 - - - 286 - - - 9 - - - Top - - - 84, 62 - - - 253, 133 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - TopDown - - - 50, 22 - - - bnLSDown - - - NoControl - - - 102, 43 - - - 4, 4, 4, 4 - - - 549, 564 - - - 12, 26 - - - pnlController - - - 2 - - - 247 - - - Flat - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 316, 204 - - - Swipe Right - - - squareToolStripMenuItem - - - gBLightbar - - - circleToolStripMenuItem - - - lbL2TrackS - - - 156, 156 - - - 0 - - - tCControls - - - 4, 4, 4, 4 - - - Dpad - - - 4, 4, 4, 4 - - - lbGyroZN - - - 1 - - - wScanCodeWASDToolStripMenuItem - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 190 - - - 42, 17 - - - lbLCross - - - 7 - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - 119, 21 - - - 100, 29 - - - 9, 94 - - - 4, 4, 4, 4 - - - fLPTiltControls - - - 369, 129 - - - Square : - - - 220 - - - 1 - - - shareToolStripMenuItem - - - 9, 11 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - - Double Tap - - - pnlFull - - - 4, 0, 4, 0 - - - tPDeadzone - - - 3 - - - crossToolStripMenuItem - - - cBIdleDisconnect - - - True - - - 90, 273 - - - 200 - - - 215 - - - pnlController - - - 112, 244 - - - rBTPMouse - - - Flat - - - 25, 25 - - - NoControl - - - 4, 4, 4, 4 - - - pnlController - - - 260 - - - 83 - - - pnlController - - - Sensitivity - - - bnSwipeRight - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - lbLSTip - - - 1 - - - pnlController - - - fLPActionButtons - - - L2 : - - - 227 - - - Left Stick Left : - - - Use as Mouse - - - gBLightbar - - - lbL2TrackS - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Empty: - - - 18, 17 - - - Use Dinput only - - - 4, 4, 4, 4 - - - tBL2 - - - Arrow Keys - - - 6, 21 - - - 233, 26 - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBRumble - - - w/ Scan Code - - - lbL2Track - - - cBDoubleTap - - - False - - - 166 - - - 4, 4, 4, 4 - - - gBRumble - - - 1 - - - 9 - - - gBOther - - - 71 - - - True - - - pnlTPMouse - - - 42, 27 - - - 4 - - - 4, 4, 4, 4 - - - Flush HID - - - 5 - - - NoControl - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - lbLL2 - - - 32, 91 - - - 1 - - - Gyro - - - 4, 4, 4, 4 - - - btnRSTrackS - - - NoControl - - - tPDeadzone - - - NoControl - - - 189, 70 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - l3ToolStripMenuItem - - - gBOther - - - System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - % - - - tPSpecial - - - pnlTPMouse - - - lbL2TrackS - - - lbLSCurve - - - cBTouchpadJitterCompensation - - - NoControl - - - 32, 96 - - - lbGyroXN - - - Left Mouse Button - - - Test Light - - - Right Mouse Button - - - bnLeft - - - fLPActionButtons - - - 35, 27 - - - 2 - - - NoControl - - - pnlController - - - 251 - - - 89 - - - 0 - - - Right Stick - - - gBOther - - - tPDeadzone - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 269, 24 - - - 42, 60 - - - 4, 4, 4, 4 - - - 224 - - - bnTouchUpper - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 2 Fingers on Touchpad - - - 311, 179 - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4 - - - bnUp - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - 125, 25 - - - tSMIDPadInvertedY - - - 4, 4, 4, 4 - - - nUDScroll - - - 179, 37 - - - gBOther - - - 4, 4, 4, 4 - - - cMSPresets - - - NoControl - - - pnlFull - - - 2 - - - Zoom - - - 4, 4, 4, 4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ArrowKeysToolStripMenuItem - - - 242 - - - gBLightbar - - - 210, 29 - - - 2, 2 - - - 27, 17 - - - lbLowRed - - - 24 - - - btnRemAction - - - 0, 0 - - - 2, 2 - - - 4 - - - Swipe Up - - - 549, 564 - - - 1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - 181 - - - 35, 14 - - - 5 - - - btnSATrack - - - No - - - fLPTouchSwipe - - - 1 - - - Flat - - - lbButtonMouseSens - - - Sixaxis X - - - tCControls - - - 216 - - - Share : - - - 88 - - - 290 - - - TopRight - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 2, 2 - - - True - - - NoControl - - - NoControl - - - Left Stick Up : - - - 218 - - - lb6Gryo - - - 299 - - - Flat - - - 61, 24 - - - False - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 6, 110 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 81 - - - 49 - - - 84, 29 - - - 10 - - - 325, 151 - - - bnLSUp - - - NoControl - - - 8 - - - pnlFull - - - 111, 74 - - - pnlSATrack - - - 12, 24 - - - 4, 4, 4, 4 - - - 4 - - - pnlController - - - bnRSUp - - - rightToolStripMenuItem - - - 111, 0 - - - Flat - - - 125, 25 - - - 293 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 225 - - - 121, 17 - - - True - - - True - - - 204 - - - NoControl - Flat - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Use as Mouse - - - r1ToolStripMenuItem - - - 136, 26 - - - 293, 78 - - - None - - - 4, 4, 4, 4 - - - 203, 423 - - + NoControl - - NoControl + + + 44, 9 - - 8 + + 13, 13 - - Slide + + + 49 - - 233, 26 + + lowColorChooserButton - - 5 - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 120, 120 - - - 4, 4, 4, 4 - - - NoControl - - - 390, 29 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - None - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 84, 24 - - - nUDR2S - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 156, 39 - - - Default - - - 8 - - - lbGreen - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - MiddleLeft - - - 52, 133 - - - 4, 0, 4, 0 - - - None - - - 248 - - - Right Stick Up : - - - nUDSZ - - - NoControl - - - NoControl - - - Fill - - - Yes - - - 50, 22 - - - button1 - - - Flat - - - nUDflashLED - - - NoControl - - - 11 - - - True - - - 1 - - - Scroll - - - Swipe Left - - - Right : - - - lbControlTip - - - pnlFull - - - fLPActionButtons - - - 162 - - - Circle : - - - While Charging: - - - Triangle : - - - 136, 26 - - - pnlController - - - Options : - - - Flat - - - Up : - - - 3 - - - 54, 22 - - - LS - - - 203 - - - 24, 17 - - - button1 - - - 14 - - - 196 - - - 178, 291 - - - 2 - - - 4, 0, 4, 0 - - - 36, 34 - - - False - - - bnRSRight - - - 4, 4, 4, 4 - - - tSMIRSInvertedX - - - 50, 22 - - - 156, 171 - - - 8, 5 - - - 251, 5 - - - 6 - - - 4, 4, 4, 4 - - - lbPercentRumble - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlTPMouse - - - 197 - - - 4, 0, 4, 0 - - - nUDRSCurve - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 443, 126 - - - L3 : - - - 63, 17 - - - Cross - - - Reset - - - 255 - - - 4, 4, 4, 4 - - - NoControl - - - 12 - - - 348, 318 - - - 4, 4, 4, 4 - - - True - - - 133, 6 - - - MiddleCenter - - - None - - - 234 - - - False - - - NoControl - - - 247 - - - 50, 22 - - - rBSAControls - - - None - - - fLPTiltControls - - - No - - - lbFull - - - 9 - - - gBLightbar - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Inverted - - - 73, 28 - - - Right Y-Axis- - - - R3 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0 - - - nUDTap - - - gBLightbar - - - 4, 4, 4, 4 - - - True - - - bnSwipeUp - - - Guide - - - 4, 4, 4, 4 - - - 233, 26 - - - NoControl - - - 253 - - - 207 - - - 288 - - - btnFlashColor - - - pnlTPMouse - - - None - - - 233, 26 - - - pnlController - - - 214 - - - True - - - 5 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 151, 26 - - - pnlLowBattery - - - 91 - - - Flat - - - 172 - - - 90 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - None - - - Controls - - - 4, 4, 4, 4 - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 175, 26 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - Options - - - 100, 29 - - - 180, 2 - - - 8, 66 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 85 - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0 - - - NoControl - - - bnPS - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - L2 - - - True - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - 200, 62 - - - fLPTouchSwipe - - - btnSATrackS - - - 111, 0 - - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 pnlLowBattery - - False - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 172, 16 - - - LS - - - leftToolStripMenuItem - - - tSMIMouseInvertedX - - - 2 - - - 4, 4, 4, 4 - - - None - - - Swipe Down - - - tSMIRSInvertedY - - - 4, 4, 4, 4 - - - 61, 22 - - - 4, 4, 4, 4 - - - nUDLSCurve - - - 163, 135 - - - tCSens - - - lbInputDelay - - - 254 - - + 0 - - 4, 4 + + 30, 215 - - NoControl + + 39, 20 - - False - - - nUDRSS - - - Down : - - - 100, 29 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - 4, 0, 4, 0 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 0, 4, 0 - - - gBSensitivity - - - lbRainbowB - - - Hold selected controls to perform an action, check the Action to use it while profile is loaded - - - 3 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - 258 - - - 3 - - - cBGyroInvertX - - - L2 - - - 18, 17 - - - MiddleLeft - - - tBR2 - - - 1 - - - MiddleCenter - - - 131, 21 - - - Accel - - - True - - - 19, 17 - - - 5 - - - Full: - - - NoControl - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - None - - - True - - - 331, 234 - - - System.Windows.Forms.OpenFileDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tBsixaxisGyroX - - - 136, 291 - - - PS : - - - 36, 22 - - - True - - - Right Touch : - - - pnlController - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 0, 4, 0 - - - 35, 40 - - - NoControl - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - lb6Accel - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbSwipeDown - - - NoControl - - - 212 + + 167 nUDRainbow - - Left X-Axis- - - - 207 - - - 4, 115 - - - Flat - - - NoControl - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tBsixaxisAccelY - - - 17, 17 - - - 3, 324 - - - 217 - - - 0 - - - 4, 4, 4, 4 - - - 7 - - - 50, 22 - - - l1ToolStripMenuItem - - - pnlController - - - 0 - - - 254 - - - NoControl - - - 242 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4 - - - 21 - - - 235 - - - 50, 22 - - - 313, 37 - - - 200, 31 - - - True - - - MiddleLeft - - - 88, 2 - - - 121, 95 - - - lbLPS - - - 12, 66 - - - 2, 2 - - - Inverted - - - 180, 25 - - - Sensitivity - - - 0 - - - 4, 4, 4, 4 - - - 0 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - bnSquare - - - 392, -1 - - - 2, 2 - - - None - - - cBSlide - - - bnShare - - - lbRSCurvePercent - - - 367, 129 - - - 0, 35 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Color - - - 4, 4, 4, 4 - - - 0 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 171 - - - lbLowGreen - - - 230 - - - 17, 136 - - - pnlRSTrack - - - 4, 0, 4, 0 - - - None - - - 4, 4, 4, 4 - - - gBSensitivity - - - Flash at - - - Inverted X - - - NoControl - - - NoControl - - - Yes - - - True - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - NoControl - - - WASDToolStripMenuItem - - - R2 - - - 4, 0, 4, 0 - - - True - - - 157, 204 - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - bnRSDown - - - bnRSLeft - - - 151, 26 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 216 - - - No - - - tPCurve - - - 4, 4, 4, 4 - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 6 - - - Inverted - - - tPDeadzone - - - 49 - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - bnDown - - - MouseToolStripMenuItem - - - Left - - - 4, 99 - - - False - - - 4, 4, 4, 4 - - - pnlController - - - 215 - - - gBLightbar - - - 98, 17 - - - 4 - - - 11 - - - True - - - 151, 26 - - - 1 - - - True - - - 4 - - - 112, 133 - - - B - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - Touchpad - - - 14 - - - 35 - - - NoControl - - - 375, 110 - - - 364, 204 - - - pnlController - - - tCControls - - - Pulse at - - - Sixaxis: X axis is flipped for easier reading - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - WASD - - - 156, 156 - - - Color by Battery % - - - 170, 29 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 261 - - - Gyro - - - 8, 17 - - - False - - - % - - - 114, 207 - - - 4, 0, 4, 0 - - - 233, 26 - - - 209, 11 - - - pnlActions - - - Inverted X - - - gBLightbar - - - gBGyro - - - 172, 22 - - - 2, 2 - - - lbRS - - - nUDL2S - - - 0 - - - 2, 2 - - - 241 - - - Left Stick - - - NoControl - - - 210, 29 - - - True - - - 4, 0, 4, 0 - - - NoControl - - - 8, 57 - - - Input Delay: N/Ams - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - cBWhileCharging - - - btnLSTrack - - - lbGyroSens - - - tPDeadzone - - - gBSensitivity - - - 208, 29 - - - pnlController - - - 391, 2 - - - 250 - - - A Button - - - 7 - - - gBSensitivity - - - 265, 39 - - - 4, 4, 4, 4 - - - No - - - NoControl - - - 0, 0 - - - nUDSX - - - Use Controller - - - 3 - - - Browse... - - - fLPTouchSwipe - - - 80 - - - 136, 26 - - - 4, 25 - - - 234 - - - NoControl - - - pnlSixaxis - - - tBRedBar - - - 206 - - - Yes - - - 13 - - - 208, 29 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0 - - - 73, 17 - - - 4, 4, 4, 4 - - - lbLDown - - - Y Button - - - 119, 21 - - - lbLOptions - - - Start with Slide/Scroll off - - - 233, 26 - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbL2TrackS - - - fLPTouchSwipe - - - 27, 17 - - - False - - - 5 - - - 3 - - - 233, 26 - - - 298 - - - No - - - lbLSCurvePercent - - - 204 - - - fLPTouchSwipe - - - lbLLS - - - Yes - - - 49 - - - 405, 160 - - - 4, 4 - - - NoControl - - - 79, 11 - - - 4, 4, 4, 4 - - - 10 - - - NoControl - - - 50, 22 - - - 7 - - - NoControl - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 61, 24 - - - bnTouchMulti - - - 492, -3 - - - 12, 63 - - - 257 - - - NoControl - - - 2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBOther - - - lbL2 - - - tSMILSInvertedX - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 5, 166 - - - 233, 26 - - - Left X-Axis+ - - - pnlController - - - gBTouchpad - - - 237 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 156, 39 - - - 4 - - - 4, 0, 4, 0 - - - 4, 78 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - 34, 27 - - - 39, 21 - - - 9 - - - 1 - - - fLPTiltControls - - - 0 - - - NoControl - - - 2, 2 - - - False - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlRSTrack - - - 233, 26 - - - 14 - - - Mouse - - - NoControl - - - Middle Mouse Button - - - 156, 156 - - - 3 - - - gBTouchpad - - - lbL2TrackS - - - 1 - - - 18, 108 - - - 111, 37 - - - 235 - - - Right Button - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 150, 24 - - - True - - - 1 - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 48 - - - NoControl - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - nUDLS - - - 8, 22 - - - NoControl - - - LS - - - 2 - - - 5 - - - Control - - - btnRainbow - - - Right Bumper - - - tPControls - - - 4, 4, 4, 4 - - - No - - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tBsixaxisGyroZ - - - 334, 160 - - - None - - - 340, 227 - - - System.Windows.Forms.ListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Down Button - - - pnlSAMouse - - - btnGyroTriggers - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - 135, 12 - - - 20, 17 - - - pnlController - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 12 - - - 59, 84 - - - 4, 4, 4, 4 - - - 180 - - - 31, 156 - - - NoControl - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 10, 28 - - - 286 - - - NoControl - - - Inverted Y - - - pnlSAMouse - - - 33, 33 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbL2TrackS - - - 82, 2 - - - 250 - - - Circle - - - 206 - - - 4, 0, 4, 0 - - - 4, 4, 4, 4 - - - NoControl - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 2 - - - Fill - - - pnlRSTrack - - - Left Trigger - - - 284 - - - Triangle - - - 4, 4, 4, 4 - - - 23 - - - NoControl - - - 4, 4, 4, 4 - - - 208, 29 - - - 6 - - - Right X-Axis+ - - - 45 - - - 162, 56 - - - NoControl - - - 58, 81 - - - 207 - - - 233, 26 - - - 3 - - - NoControl - - - 4, 4, 4, 4 - - - True - - - Flat - - - lbL2TrackS - - - 7 - - - lbLR1 - - - 4, 4, 4, 4 - - - 1 - - - 2 - - - tPDeadzone - - - 4, 4 - - - NoControl - - - 5 - - - 4, 4, 4, 4 - - - 340, 305 - - - True - - - Flat - - - 3 - - - Rainbow - - - True - - - 136, 26 - - - bnGyroXN - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBOther - - - NoControl - - - None - - - 3 - - - Popup - - - 4, 0, 4, 0 - - - 90, 29 - - - None - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlSAMouse - - - NoControl - - - 1 - - - NoControl - - - 4, 4, 4, 4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 0, 4, 0 - - - 294 - - - 289 - - - True - - - X Button - - - 4, 317 - - - True - - - lbRed - - - tBLowGreenBar - - - 340, 57 - - - 3 - - - 25, 17 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 339, 152 - - - 8 - - - 4, 25 - - - 4, 4, 4, 4 - - - 12 - - - 4, 4, 4, 4 - - - Flat - - - Zoom - - - Inverted Y - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - nUDR2 - - - 165 - - - 340, 237 - - - 2, 2 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 157 - - - gBOther - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Flat - - - 14, 26 - - - 180, 56 - - - bnSwipeLeft - - - 4, 4, 4, 4 - - - 193 - - - 8, 64 - - - 6 - - - 4, 0, 4, 0 - - - No - - - No - - - 250 - - - 287 - - - 111, 111 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - L1 : - - - 4, 4, 4, 4 - - - Sixaxis Left : - - - 4, 4, 4, 4 - - - 204 - - - 21, 21 - - - ABXYToolStripMenuItem - - - NoControl - - - gBOther - - - nUDRumbleBoost - - - NoControl - - - 167, 191 - - - 151, 26 - - - 32, 62 - - - 206 - - - 8, 267 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Left Bumper - - - Right Y-Axis+ - - - 375, 70 - - - tCSens - - - 100, 29 - - - Options - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 83, 93 - - - panel2 - - - 128, 17 - - - 50, 22 - - - cBControllerInput - - - 42, 23 - - - 19, 17 - - - MiddleCenter - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - cBScroll - - - Mouse Sensitivity: - - - pBHoveredButton - - - pnlLowBattery - - - 15 - - - Top, Bottom, Left - - - pnlTPMouse - - - pnlController - - - False - - - 0 - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - NoControl - - - secs/cycle - - - Sixaxis X - - - True - - - 4, 4, 4, 4 - - - 12, 34 - - - gBOther - - - 16, 16 - - - btnBrowse - - - 0 - - - 4, 4, 4, 4 - - - Flat - - - pnlSAMouse - - - fLPSettings - - - nUDSZS - - - 11 - - - fLPTiltControls - - - 296 - - - 37, 36 - - - 131, 21 - - - 6 - - - NoControl - - - False - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 5, 23 - - - 201 - - - Deadzone - - - gBSensitivity - - - NoControl - - - 25 - - - gBLightbar - - - tPCurve - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - 139, 38 - - - 4 - - - Always on - - - 137, 244 - - - TopRight - - - 15 - - - 38, 2 - - - 291 - - - 0 - - - 47 - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 89, 65 - - - NoControl - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 246 - - - 358, 82 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 111, 74 - - - nUDTouch - - - tPControls - - - 4, 4, 4, 4 - - - 204 - - - 10 - - - NoControl - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - 156, 39 - - - 130, 21 - - - True - - - pnlController - - - 4, 0, 4, 0 - - - 443, 129 - gBLightbar - - fLPSettings + + 10 - - 131, 3 + + False - - 14 - - - 12, 24 - - - 36, 38 - - - 4, 41 - - - cBTap - - - RS - - - 55, 21 - - - True - - - gBSensitivity - - - MiddleCenter - - - None - - - 4 - - - 0 - - + NoControl - - 1 + + 26, 73 - - 182, 4 + + 100, 20 - - NoControl + + 12 - - 61, 22 + + tBBlueBar - - 0 + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - numUDMouseSens - - - 106, 62 - - - 150, 93 - - - 257 - - - 295 - - - 4, 30 - - - pnlController - - - 13 - - - 50, 22 - - - NoControl - - - 287 - - - 4, 0, 4, 0 - - - System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbIdleMinutes - - - 38, 39 - - - True - - - 4, 0, 4, 0 - - - nUDGyroSensitivity - - - NoControl - - - Y - - - 203 - - - 4, 4 - - - Left - - - 289 - - - NoControl - - - TopCenter - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - + pnlFull - - 20, 17 - - - pnlTPMouse - - - lbRSS - - - gBSensitivity - - - 4, 0, 4, 0 - - - 1 - - - lbL2TrackS - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 2 - - - NoControl - - - False - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBTouchpad - - - tSMILSInvertedY - - - 4, 4, 4, 4 - - - NoControl - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - False - - - 100 - - - 74 - - - 30 - - - 167 - - - 138, 56 - - - 100, 29 - - - 4, 0, 4, 0 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - 189, 268 - - - Controller Readings - - - 35, 13 - - - MiddleLeft - - - 102, 6 - - - 163 - - - 18 - - - MiddleCenter - - - tSMIDPadInvertedX - - - 4, 4, 4, 4 - - - 56, 26 - - - Square - - - pnlLowBattery - - - 61, 24 - - + 6 - - 254 - - - None - - - defaultToolStripMenuItem - - - 36, 76 - - - pnlController - - - 4, 0, 4, 0 - - - lbL2S - - - Left Stick - - - 39, 21 - - - 4, 0, 4, 0 - - - 24, 17 - - - 4, 4, 4, 4 - - - 11, 95 - - - 50, 22 - - - NoControl - - - 4, 42 - - - NoControl - - - NoControl - - - 154, 5 - - - Back - - - button1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - NoControl - - - 221 - - - Down - - + False - - False - - - 33, 10 - - - lbLS - - - pnlActions - - - 4, 0, 4, 0 - - + NoControl - - Tap + + 26, 50 - - lbR2Track - - - No - - - 15 - - - False - - - 104, 21 - - - cBFlushHIDQueue - - - toolStripSeparator1 - - - 34, 17 - - - R2 - - - 16, 16 - - - 136, 20 - - - pnlActions - - - cBDinput - - - False - - - 332, 69 + + 100, 20 11 - + + tBGreenBar + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlFull + + 5 - - 286 - - - 151, 26 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 232 - - - 7, 202 - - - NoControl - - - No - - - pnlSAMouse - - - 158 - - - NoControl - - - pnlController - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPTouchSwipe - - - 2, 2 - - - 210, 59 - - - Flat - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Sixaxis Right : - - - 7 - - - NoControl - - - 4, 4, 4, 4 - - - 160 - - - 247 - - - 136, 26 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 82 - - - Invert: - - - gBGyro - - - 352, 72 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17 - - - 4, 0, 4, 0 - - - 7 - - - 4, 4, 4, 4 - - - lowColorChooserButton - - - Flat - - - 222 - - - None - - - Inverted - - - 1262, 593 - - - bnR2 - - - NoControl - - + False - + NoControl - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 26, 24 - - 4, 4, 4, 4 + + 100, 20 - - NoControl + + 10 - - 20, 17 + + tBRedBar - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 255 + + pnlFull - - StretchImage + + 4 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 89, 29 - - - 0 - - - 167, 231 - - - 269, 60 - - - 404, 94 - - - 4, 4, 4, 4 - - - lbL2TrackS - - - Fill - - - 4, 0, 4, 0 - - + True - - gBSensitivity + + NoControl - - 70, 28 + + 6, 191 - - rBTPControls + + 111, 17 - - triangleToolStripMenuItem + + 162 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Color by Battery % - - None + + cBLightbyBattery - - Curve + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + gBLightbar - - Sixaxis Down : + + 12 - + + True + + + NoControl + + + 9, 76 + + + 14, 13 + + + 160 + + + B + + + lbBlue + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlFull + + + 3 + + + True + + + NoControl + + + 10, 53 + + + 15, 13 + + + 159 + + + G + + + lbGreen + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlFull + + 2 - - Inverted X + + True - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + NoControl - - 216 + + 72, 218 - - 135, 60 + + 59, 13 - - Left Mouse Button + + 157 - - 47, 17 + + secs/cycle + + + lbspc + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + + + 11 + + + True + + + NoControl + + + 10, 27 + + + 15, 13 + + + 158 + + + R + + + lbRed + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlFull + + + 1 True - - 153, 82 - - + NoControl - + + 109, 39 + + + No + + + 82, 17 + + + 226 + + + Double Tap + + + cBDoubleTap + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + pnlTPMouse - - 352, 278 + + 1 - + + True + + + NoControl + + + 11, 39 + + + Yes + + + 45, 17 + + + 230 + + + Tap + + + cBTap + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 6 + + + 63, 39 + + + 40, 20 + + + 227 + + + nUDTap + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 4 + + + True + + + NoControl + + + 108, 10 + + + Yes + + + 52, 17 + + + 231 + + + Scroll + + + cBScroll + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 2 + + + True + + + NoControl + + + 7, 10 + + + Yes + + + 49, 17 + + + 232 + + + Slide + + + cBSlide + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 7 + + + 167, 9 + + + 40, 20 + + + 228 + + + nUDScroll + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 0 + + + 63, 9 + + + 40, 20 + + + 229 + + + nUDTouch + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + 8 - - RS + + True - - MiddleLeft + + NoControl + + + 5, 17 + + + 92, 13 + + + 206 + + + Mouse Sensitivity: + + + TopRight + + + lbButtonMouseSens + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 11 + + + True + + + NoControl + + + 14, 87 + + + No + + + 124, 17 + + + 223 + + + Lower Right as RMB + + + cBlowerRCOn + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 5 + + + True + + + NoControl + + + 14, 66 + + + No + + + 118, 17 + + + 224 + + + Jitter Compensation + + + cBTouchpadJitterCompensation + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 3 + + + True + + + NoControl + + + 6, 31 + + + 19, 13 + + + 196 + + + L2 + + + lbL2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPDeadzone + + + 0 + + + True + + + NoControl + + + 82, 32 + + + 21, 13 + + + 197 + + + R2 + + + lbR2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPDeadzone + + + 7 + + + True + + + NoControl + + + 169, 67 + + + 28, 13 + + + 200 + + + mins + + + lbIdleMinutes + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 14 + + + 115, 64 + + + 49, 20 + + + 201 + + + nUDIdleDisconnect + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 9 + + + 105, 29 + + + 40, 20 + + + 202 + + + nUDR2 + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPDeadzone + + + 4 + + + flushHIDQueue + + + True + + + NoControl + + + 8, 178 + + + Yes + + + 73, 17 + + + 198 + + + Flush HID + + + cBFlushHIDQueue + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 13 + + + 4, 18 + + + 43, 20 + + + 211 + + + nUDRumbleBoost + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBRumble 3 - + + NoControl + + + 77, 15 + + + 71, 23 + + + 214 + + + Test Heavy + + + btnRumbleHeavyTest + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBRumble + + + 2 + + + True + + + NoControl + + + 7, 7 + + + 26, 13 + + + 225 + + + Full: + + + lbFull + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlFull + + + 0 + + + True + + + NoControl + + + 6, 30 + + + 15, 13 + + + 158 + + + R + + + lbLowRed + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlLowBattery + + + 1 + + + True + + + NoControl + + + 6, 53 + + + 15, 13 + + + 159 + + + G + + + lbLowGreen + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlLowBattery + + + 2 + + + True + + + NoControl + + + 6, 76 + + + 14, 13 + + + 160 + + + B + + + lbLowBlue + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlLowBattery + + + 3 + + False - - 337, 227 + + NoControl - - pnlController + + 22, 26 + + + 100, 20 + + + 10 + + + tBLowRedBar + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlLowBattery + + + 4 + + + False + + + NoControl + + + 22, 49 + + + 100, 20 + + + 11 + + + tBLowGreenBar + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlLowBattery + + + 5 + + + False + + + NoControl + + + 22, 72 + + + 100, 20 + + + 12 + + + tBLowBlueBar + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlLowBattery + + + 6 + + + True + + + NoControl + + + 7, 9 + + + 39, 13 + + + 225 + + + Empty: + + + lbEmpty + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlLowBattery + + + 7 + + + 1, 19 + + + 134, 96 + + + 235 + + + pnlFull + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + + + 14 + + + 142, 18 + + + 126, 97 + + + 234 + + + pnlLowBattery + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + + + 13 + + + True + + + NoControl + + + 82, 6 + + + 22, 13 + + + 197 + + + RS + + + lbRS + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPDeadzone + + + 9 + + + True + + + NoControl + + + 6, 6 + + + 20, 13 + + + 196 + + + LS + + + lbLS + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPDeadzone + + + 10 + + + 105, 3 + + + No + + + 40, 20 + + + 203 + + + nUDRS + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPDeadzone + + + 6 + + + 109, 16 + + + 49, 20 + + + 241 + + + numUDMouseSens + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 12 + + + 30, 3 + + + No + + + 40, 20 + + + 203 + + + nUDLS + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPDeadzone + + + 2 + + + 30, 29 + + + No + + + 40, 20 + + + 203 + + + nUDL2 + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPDeadzone + + + 1 + + + True + + + NoControl + + + 14, 109 + + + 142, 17 + + + 233 + + + Start with Slide/Scroll off + + + cbStartTouchpadOff + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 9 + + + -3, 50 + + + 2, 2, 2, 2 + + + 267, 128 + + + 257 + + + pnlTPMouse + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBTouchpad + + + 0 + + + True + + + NoControl + + + 138, 18 + + + 2, 2, 2, 2 + + + 100, 17 + + + 235 + + + Use for Controls + + + rBTPControls + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBTouchpad + + + 1 + + + True + + + NoControl + + + 6, 18 + + + 2, 2, 2, 2 + + + 93, 17 + + + 234 + + + Use as Mouse + + + rBTPMouse + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBTouchpad + + + 2 + + + 326, 13 + + + False + + + 117, 22 + + + Control + + + 114, 6 + + + 117, 22 + + + Default + + + 127, 22 + + + Inverted + + + 127, 22 + + + Inverted X + + + 127, 22 + + + Inverted Y + + + 117, 22 + + + Dpad + + + 127, 22 + + + Inverted + + + 127, 22 + + + Inverted X + + + 127, 22 + + + Inverted Y + + + 117, 22 + + + Left Stick + + + 127, 22 + + + Inverted + + + 127, 22 + + + Inverted X + + + 127, 22 + + + Inverted Y + + + 117, 22 + + + Right Stick + + + 117, 22 + + + Face Buttons + + + 147, 22 + + + w/ Scan Code + + + False + + + 117, 22 + + + WASD + + + 147, 22 + + + w/ Scan Code + + + 117, 22 + + + Arrow Keys + + + 127, 22 + + + Inverted + + + 127, 22 + + + Inverted X + + + 127, 22 + + + Inverted Y + + + 117, 22 + + + Mouse + + + 118, 208 + + + cMSPresets + + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Flat + + + NoControl + + + 3, 3 + + + 80, 23 + + + 250 + + + Swipe Up + + + bnSwipeUp + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTouchSwipe + + + 0 + + + NoControl + + + 88, 0 + + + 2, 0, 2, 0 + + + 168, 23 + + + 285 + + + Options + + + MiddleLeft + + + lbSwipeUp + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTouchSwipe + + + 1 + + + Flat + + + NoControl + + + 3, 32 + + + 80, 23 + + + 250 + + + Swipe Down + + + bnSwipeDown + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTouchSwipe + + + 2 + + + NoControl + + + 88, 29 + + + 2, 0, 2, 0 + + + 168, 23 + + + 286 + + + Options + + + MiddleLeft + + + lbSwipeDown + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTouchSwipe + + + 3 + + + Flat + + + NoControl + + + 3, 61 + + + 80, 23 + + + 250 + + + Swipe Left + + + bnSwipeLeft + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTouchSwipe + + + 4 + + + NoControl + + + 88, 58 + + + 2, 0, 2, 0 + + + 168, 23 + + + 287 + + + Options + + + MiddleLeft + + + lbSwipeLeft + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTouchSwipe + + + 5 + + + Flat + + + NoControl + + + 3, 90 + + + 80, 23 + + + 250 + + + Swipe Right + + + bnSwipeRight + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTouchSwipe + + + 6 + + + NoControl + + + 88, 87 + + + 2, 0, 2, 0 + + + 168, 23 + + + 288 + + + Options + + + MiddleLeft + + + lbSwipeRight + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTouchSwipe + + + 7 + + + 4, 55 + + + 260, 121 + + + 256 + + + fLPTouchSwipe + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBTouchpad 3 - - 549, 35 + + 2, 259 + + + 270, 182 + + + 246 + + + Touchpad + + + gBTouchpad + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPControls + + + 1 + + + True + + + NoControl + + + 8, 202 + + + Yes + + + 147, 17 + + + 257 + + + Enable Touchpad Toggle + + + enableTouchToggleCheckbox + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 0 + + + True + + + NoControl + + + 8, 154 + + + Yes + + + 101, 17 + + + 256 + + + Use Dinput only + + + cBDinput + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 1 + + + NoControl + + + 215, 122 + + + 23, 23 + + + Zoom + + + 255 + + + pBProgram + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 2 + + + True + + + NoControl + + + 4, 118 + + + Yes + + + 107, 30 + + + 254 Launch Program with profile - - 196, 19 + + cBLaunchProgram - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 6 + + gBOther - - pnlController + + 3 - - 90, 97 - - - lbBlue - - - 3, 2 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 43 - - - 4, 4, 4, 4 - - - 183, 171 - - - False - - - System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbR2 - - - 234 - - - Yes - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - 27, 40 - - - gBGyro - - - 5 - - - 120, 10 - - - 7, 131 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - NoControl - - - 10 - - - 6 - - - nUDRainbowB - - - 87 - - - cBGyroInvertY - - - 20, 17 - - - 9 - - - pnlLowBattery - - - 7 - - - 4, 4, 4, 4 - - - pnlSixaxis - - - 4, 4, 4, 4 - - - 61, 24 - - + Zoom - + + MiddleRight + + NoControl - - 2, 2 + + 132, 122 - - 196 + + 67, 23 - - fLPTouchSwipe + + 253 - - Flat + + Browse... - - 330, 207 + + btnBrowse - - Face Buttons - - - True - - - cBLightbyBattery - - - 228 - - - System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 247 - - - Flat - - - lbLright - - - pnlSixaxis - - - btnEditAction - - - 4, 4, 4, 4 - - - 233, 26 - - - pnlController - - - NoControl - - - NoControl - - - NoControl - - - 4, 0, 4, 0 - - - NoControl - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - 1, 24 - - - 3 - - - pnlSAMouse - - - lbUseController - - - 4, 4, 4, 4 - - - NoControl - - - pnlController - - - TopRight - - - 2 - - - pnlController - - - 4, 4, 4, 4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - pnlSixaxis - - - 8, 37 - - - 236 - - - gBGyro - - - Sixaxis Z - - - 4, 4, 4, 4 - - - 73 - - - NoControl - - - NoControl - - - 0 - - - Flat - - - 4, 4, 4, 4 - - - fLPTouchSwipe - - - 147, 21 - - - False - - - bnR1 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - optionsToolStripMenuItem - - - 214 - - - nUDSXS - - - 175, 26 - - - 3 - - - fLPTiltControls - - - Use for Controls - - - 272, 210 - - - lbLLeft - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbLSquare - - - 37, 17 - - - 197 - - - 8, 239 - - - pnlController - - - NoControl - - - 158, 121 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 16 - - - 195, 244 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 26, 40 - - - Cross : - - - 4, 4, 4, 4 - - - Test Heavy - - - bnLSRight - - - 0, 0 - - - 4, 0, 4, 0 - - - 16, 16 - - - 93, 96 - - - 158, 21 - - - 28, 32 - - - pnlLowBattery - - - tPDeadzone - - - R3 : - - - Jitter Compensation - - - Yes - - - Right Stick Down : - - - 233 - - - NoControl - - - None - - - fLPTiltControls - - - 549, 47 - - - 1280, 640 - - - NoControl - - - 254, 192 - - - 14, 49 - - - 189, 110 - - - 61, 24 - - - 108, 17 - - - Use for Controls - - - bnSwipeDown - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Vertical - - - pnlSixaxis - - - 151, 26 - - - 287 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - None - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 352, 69 - - - MiddleLeft - - - Flat - - - 25, 17 - - - pnlController - - - 18, 82 - - - nUDSixaxis - - - 405, 96 - - - 12 - - - 4, 0, 4, 0 - - + gBOther - - tPControls + + 4 - - pnlController - - - 136, 49 - - - 172, 24 - - - gBOther - - - RS - - - NoControl - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - NoControl - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Top - - - 151, 26 - - - 1 - - - 6 - - - nUDLSS - - - 4, 4, 4, 4 - - - lbSwipeUp - - - 92, 151 - - - NoControl - - - 54, 22 - - - 208, 29 - - - Flat - - - None - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 258 - - - 168 - - - 4, 0, 4, 0 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbLTouchUpper - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.4.5.0, Culture=neutral, PublicKeyToken=null - - - 4, 4, 4, 4 - - - None - - - None - - - NoControl - - - pnlController - - - NoControl - - + True - - 2 + + NoControl - - Flat + + 5, 96 - - 233, 26 - - - 303 - - - 4, 25 - - - 156, 156 - - - pnlController - - - 89, 99 - - - tPCurve - - - bnL1 - - - 4, 0, 4, 0 - - - 216 - - - 69, 27 - - - False - - - 209 - - - 13 - - - gBLightbar - - - 283 + + 73, 13 252 - - gBTouchpad + + Use Controller - - lbRSCurve + + lbUseController - - B Button - - - 4, 4, 4, 4 - - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - onTouchpadToolStripMenuItem - - - 91, 21 - - - Right Trigger - - - 248 - - - 50, 22 - - - 233, 26 - - - bnCross - - - 1 - - + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 19 + + gBOther - - btnLSTrackS + + 5 - - Share - - - 36 - - - tSMILSInverted - - - 42 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Flat - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 233, 26 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 63, 17 - - - tPControls - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 86 - - - panel2 - - - 51, 17 - - - lbLUp - - - 4, 0, 4, 0 - - - 31 - - - NoControl - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 301 - - - 105 - - - nUDIdleDisconnect - - - tBsixaxisAccelZ - - - Name - - - False - - - 3 - - - cBLaunchProgram - - - 4, 4, 4, 4 - - - 216 - - + True - + NoControl - - gBSensitivity + + 8, 42 - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Yes - - 50 + + 120, 17 - - pnlController + + 251 - - lbWhileCharging + + Mouse Acceleration - - lbLShare + + cBMouseAccel - - cbStartTouchpadOff + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - NoControl + + gBOther - + + 6 + + + 85, 95 + + + 29, 20 + + + 250 + + + nUDSixaxis + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + 7 - - 203 - - - 170, 29 - - - Flat - - - nUDL2 - - - lbSixaxisX - - - 4, 0, 4, 0 - - - NoControl - - - downToolStripMenuItem - - - pnlController - - - 7 - - - False - - + True - - MiddleCenter + + NoControl - - 4, 4, 4, 4 + + 118, 95 - - 49 + + Yes - - False + + 142, 17 - - tSMIDPadInverted + + 242 - - Special Actions + + for Mapping and readout - - Flat + + cBControllerInput - - 2 + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - MiddleCenter + + gBOther - - 4, 4, 4, 4 + + 8 - - pnlController + + True - - bnTouchLeft + + NoControl - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlController - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 7, 54 - - - cHName - - - lbL2TrackS - - - fingerOnTouchpadToolStripMenuItem - - - pnlController - - - lbRSTip - - - 244 - - - 239 - - - Options + + 8, 65 Yes - - cMGyroTriggers - - - R2 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 2, 2 + + 100, 17 232 + + Idle Disconnect + + + cBIdleDisconnect + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 10 + + + 281, 221 + + + 272, 236 + + + 247 + + + Other + + + gBOther + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 5 + + + NoControl + + + 6, 214 + + + 2, 2, 2, 2 + + + 20, 20 + + + 243 + + + btnRainbow + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + + + 0 + + + True + + + NoControl + + + 203, 214 + + + 15, 13 + + + 241 + + + % + + + False + + + lbRainbowB + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + + + 1 + + + 151, 214 + + + 43, 20 + + + 242 + + + False + + + nUDRainbowB + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + + + 2 + + + Flash at + + + Pulse at + + + 4, 133 + + + 68, 21 + + + 240 + + + cBFlashType + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + + + 3 + + + Normal + + + Pulse + + + Rainbow + + + Color + + + 91, 166 + + + 121, 21 + + + 239 + + + cBWhileCharging + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + + + 4 + + + Zoom + + + Flat + + + NoControl + + + 146, 137 + + + 13, 13 + + + 49 + + + btnFlashColor + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + + + 5 + + + Flat + + + NoControl + + + 218, 168 + + + 13, 13 + + + 49 + + + False + + + btnChargingColor + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + + + 6 + + + True + + + NoControl + + + 5, 167 + + + 82, 13 + + + 236 + + + While Charging: + + + lbWhileCharging + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + + + 7 + + + True + + + NoControl + + + 125, 137 + + + 15, 13 + + + 207 + + + % + + + lbPercentFlashBar + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + + + 8 + + + 78, 134 + + + 43, 20 + + + 167 + + + nUDflashLED + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + + + 9 + + + 3, 3 + + + 272, 244 + + + 247 + + + Lightbar + + + gBLightbar + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 0 + + + True + + + NoControl + + + 54, 20 + + + 15, 13 + + + 207 + + + % + + + lbPercentRumble + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBRumble + + + 0 + + + NoControl + + + 157, 15 + + + 72, 23 + + + 214 + + + Test Light + + + btnRumbleLightTest + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBRumble + + + 1 + + + 281, 3 + + + 272, 46 + + + 247 + + + Rumble + + + gBRumble + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 2 + + + True + + + NoControl + + + 157, 4 + + + 49, 13 + + + 197 + + + Sixaxis X + + + lbSixaxisX + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPDeadzone + + + 3 + + + True + + + NoControl + + + 157, 33 + + + 49, 13 + + + 197 + + + Sixaxis Z + + + lbSixaxisZ + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPDeadzone + + + 5 + + + 212, 31 + + + No + + + 40, 20 + + + 203 + + + nUDSZ + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPDeadzone + + + 11 + + + 212, 2 + + + 40, 20 + + + 202 + + + nUDSX + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPDeadzone + + + 8 + + + 153, 17 + + + False + + + Popup + + + NoControl + + + 44, 26 + + + 3, 3 + + + 237 + + + button1 + + + btnSATrack + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSATrack + + + 0 + + + False + + + Flat + + + NoControl + + + 26, 77 + + + 3, 3 + + + 249 + + + btnSATrackS + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSATrack + + + 1 + + + 300, 88 + + + 2, 2, 2, 2 + + + 125, 125 + + + 252 + + + pnlSATrack + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 0 + + + True + + + NoControl + + + 94, 338 + + + 19, 13 + + + 216 + + + L2 + + + MiddleCenter + + + lbL2Track + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 1 + + + NoControl + + + 151, 56 + + + 125, 31 + + + 216 + + + Right Stick + + + MiddleCenter + + + lbRSTip + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 2 + + + True + + + NoControl + + + 7, 3 + + + 100, 13 + + + 216 + + + Input Delay: N/Ams + + + MiddleCenter + + + lbInputDelay + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 3 + + + True + + + NoControl + + + 162, 338 + + + 21, 13 + + + 216 + + + R2 + + + MiddleCenter + + + lbR2Track + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 4 + + + NoControl + + + 7, 56 + + + 125, 31 + + + 216 + + + Left Stick + + + MiddleCenter + + + lbLSTip + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 5 + + + NoControl + + + 300, 56 + + + 125, 31 + + + 216 + + + Sixaxis: X axis is flipped for easier reading + + + MiddleCenter + + + lbSATip + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 6 + + + False + + + False + + + NoControl + + + 142, 233 + + + Vertical + + + Yes + + + 25, 125 + + + 244 + + + tBR2 + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 7 + + + False + + + False + + + NoControl + + + 109, 233 + + + Vertical + + + Yes + + + True + + + 25, 125 + + + 244 + + + tBL2 + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 8 + + + False + + + NoControl + + + 71, 25 + + + 49, 19 + + + 219 + + + tBsixaxisAccelX + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSixaxis + + + 0 + + + True + + + NoControl + + + 81, 4 + + + 34, 13 + + + 215 + + + Accel + + + lb6Accel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSixaxis + + + 1 + + + False + + + NoControl + + + 3, 24 + + + 49, 19 + + + 222 + + + tBsixaxisGyroX + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSixaxis + + + 2 + + + True + + + NoControl + + + 13, 5 + + + 29, 13 + + + 216 + + + Gyro + + + lb6Gryo + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSixaxis + + + 3 + + + False + + + NoControl + + + 2, 52 + + + 49, 19 + + + 221 + + + tBsixaxisGyroY + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSixaxis + + + 4 + + + False + + + NoControl + + + 3, 79 + + + 49, 19 + + + 220 + + + tBsixaxisGyroZ + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSixaxis + + + 5 + + + False + + + NoControl + + + 71, 52 + + + 49, 19 + + + 218 + + + tBsixaxisAccelY + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSixaxis + + + 6 + + + False + + + NoControl + + + 71, 79 + + + 49, 19 + + + 217 + + + tBsixaxisAccelZ + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSixaxis + + + 7 + + + 300, 233 + + + 125, 125 + + + 236 + + + pnlSixaxis + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 9 + + + False + + + Popup + + + NoControl + + + 29, 61 + + + 3, 3 + + + 237 + + + button1 + + + btnLSTrack + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlLSTrack + + + 0 + + + False + + + Flat + + + NoControl + + + 67, 50 + + + 3, 3 + + + 247 + + + btnLSTrackS + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlLSTrack + + + 1 + + + 5, 88 + + + 2, 2, 2, 2 + + + 125, 125 + + + 250 + + + pnlLSTrack + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 10 + + + False + + + Flat + + + NoControl + + + 3, 34 + + + 3, 3 + + + 248 + + + btnRSTrackS + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlRSTrack + + + 0 + + + False + + + Popup + + + NoControl + + + 66, 74 + + + 3, 3 + + + 237 + + + button1 + + + btnRSTrack + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlRSTrack + + + 1 + + + 151, 88 + + + 2, 2, 2, 2 + + + 125, 125 + + + 251 + + + pnlRSTrack + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 11 + + + 4, 22 + + + 3, 3, 3, 3 + + + 438, 448 + + + 2 + + + Controller Readings + + + lbL2TrackS + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCControls + + + 2 + + + NoControl + + + 3, 3 + + + 80, 23 + + + 250 + + + bnGyroZN + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTiltControls + + + 0 + + + NoControl + + + 88, 0 + + + 2, 0, 2, 0 + + + 166, 23 + + + 286 + + + MiddleLeft + + + lbGyroZN + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTiltControls + + + 1 + + + NoControl + + + 3, 32 + + + 80, 23 + + + 250 + + + bnGyroZP + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTiltControls + + + 2 + + + NoControl + + + 88, 29 + + + 2, 0, 2, 0 + + + 166, 23 + + + 287 + + + MiddleLeft + + + lbGyroZP + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTiltControls + + + 3 + + + NoControl + + + 3, 61 + + + 80, 23 + + + 250 + + + bnGyroXP + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTiltControls + + + 4 + + + NoControl + + + 88, 58 + + + 2, 0, 2, 0 + + + 166, 23 + + + 288 + + + MiddleLeft + + + lbGyroXP + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTiltControls + + + 5 + + + NoControl + + + 3, 90 + + + 80, 23 + + + 250 + + + bnGyroXN + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTiltControls + + + 6 + + + NoControl + + + 88, 87 + + + 2, 0, 2, 0 + + + 166, 23 + + + 289 + + + MiddleLeft + + + lbGyroXN + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTiltControls + + + 7 + + + 6, 51 + + + 271, 122 + + + 254 + + + fLPTiltControls + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBGyro + + + 3 + + + True + + + Top, Bottom, Left + + + Cross : + + + Circle : + + + Square : + + + Triangle : + + + Options : + + + Share : + + + Up : + + + Down : + + + Left : + + + Right : + + + PS : + + + L1 : + + + R1 : + + + L2 : + + + R2 : + + + L3 : + + + R3 : + + + Left Touch : + + + Upper Touch : + + + Multitouch : + + + Right Touch : + + + Left Stick Up : + + + Left Stick Down : + + + Left Stick Left : + + + Left Stick Right : + + + Right Stick Up : + + + Right Stick Down : + + + Right Stick Left : + + + Right Stick Right : + + + Sixaxis Up : + + + Sixaxis Down : + + + Sixaxis Left : + + + Sixaxis Right : + + + 278, 254 + + + 157, 186 + + + 180 + + + lBControls + + + System.Windows.Forms.ListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPControls + + + 0 + + + NoControl + + + 6, 234 + + + 182, 22 + + + 181 + + + Click the lightbar for color picker + + + MiddleCenter + + + False + + + lbControlTip + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPControls + + + 2 + + + Zoom + + + False + + + NoControl + + + 394, -2 + + + 2, 2, 2, 2 + + + 29, 27 + + + StretchImage + + + 284 + + + pBHoveredButton + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 0 + + + NoControl + + + 249, 143 + + + 2, 0, 2, 0 + + + 2, 2 + + + 304 + + + False + + + lbLRS + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 1 + + + NoControl + + + 118, 143 + + + 2, 0, 2, 0 + + + 2, 2 + + + 303 + + + False + + + lbLLS + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 2 + + + None + + + Flat + + + NoControl + + + 265, 187 + + + 26, 8 + + + 172 + + + Right Y-Axis+ + + + bnRSDown + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 3 + + + NoControl + + + 144, 2 + + + 2, 0, 2, 0 + + + 2, 2 + + + 302 + + + False + + + lbLTouchUpper + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 4 + + + NoControl + + + 144, 45 + + + 2, 0, 2, 0 + + + 2, 2 + + + 301 + + + False + + + lbLTouchRight + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 5 + + + None + + + Flat + + + NoControl + + + 134, 164 + + + 28, 22 + + + 163 + + + Left Stick + + + bnL3 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 6 + + + NoControl + + + 130, 45 + + + 2, 0, 2, 0 + + + 2, 2 + + + 300 + + + False + + + lbLTouchLM + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 7 + + + None + + + Flat + + + NoControl + + + 262, 152 + + + 29, 14 + + + 171 + + + Right Y-Axis- + + + bnRSUp + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 8 + + + NoControl + + + 313, 2 + + + 2, 0, 2, 0 + + + 2, 2 + + + 299 + + + False + + + lbLR2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 9 + + + None + + + Flat + + + NoControl + + + 291, 163 + + + 10, 19 + + + 170 + + + Right X-Axis+ + + + bnRSRight + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 10 + + + NoControl + + + 66, 2 + + + 2, 0, 2, 0 + + + 2, 2 + + + 298 + + + False + + + lbLL2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 11 + + + None + + + Flat + + + NoControl + + + 264, 166 + + + 27, 22 + + + 168 + + + Right Stick + + + bnR3 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 12 + + + NoControl + + + 312, 23 + + + 2, 0, 2, 0 + + + 2, 2 + + + 297 + + + False + + + lbLR1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 13 + + + None + + + Flat + + + NoControl + + + 253, 163 + + + 10, 19 + + + 169 + + + Right X-Axis- + + + bnRSLeft + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 14 + + + NoControl + + + 59, 22 + + + 2, 0, 2, 0 + + + 2, 2 + + + 296 + + + False + + + lbLL1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 15 + + + None + + + Flat + + + NoControl + + + 126, 163 + + + 8, 22 + + + 164 + + + Left X-Axis- + + + bnLSLeft + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 16 + + + NoControl + + + 200, 154 + + + 2, 0, 2, 0 + + + 2, 2 + + + 295 + + + False + + + lbLPS + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 17 + + + None + + + Flat + + + NoControl + + + 134, 153 + + + 28, 11 + + + 167 + + + Left Y-Axis- + + + bnLSUp + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 18 + + + NoControl + - 52, 134 + 42, 107 - - 549, 564 + + 2, 0, 2, 0 - - System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 2, 2 - - 233, 26 + + 294 - - 28 + + False - - 0, 0 + + lbLLeft - + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 19 + + + None + + + Flat + + + NoControl + + + 162, 163 + + + 11, 21 + + + 165 + + + Left X-Axis+ + + + bnLSRight + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 20 + + + NoControl + + + 90, 106 + + + 2, 0, 2, 0 + + + 2, 2 + + + 293 + + + False + + + lbLright + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 21 + + + None + + + Flat + + + NoControl + + + 134, 185 + + + 28, 10 + + + 166 + + + Left Y-Axis+ + + + bnLSDown + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 22 + + + NoControl + + + 73, 121 + + + 2, 0, 2, 0 + + + 2, 2 + + + 292 + + + False + + + lbLDown + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 23 + + + None + + + Flat + + + NoControl + + + 314, -1 + + + 45, 21 + + + 89 + + + Right Trigger + + + bnR2 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 24 + + + None + + + Flat + + + NoControl + + + 74, 77 + + + 21, 32 + + + 80 + + + Up Button + + + bnUp + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 25 + + + None + + + Flat + + + NoControl + + + 74, 121 + + + 20, 27 + + + 81 + + + Down Button + + + bnDown + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 26 + + + None + + + Flat + + + NoControl + + + 323, 75 + + + 30, 30 + + + 73 + + + Y Button + + + bnTriangle + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 pnlController - - 210, 29 - - - True - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 7, 95 - - - 20 - - - 89, 31 - - - NoControl - - - 253 - - - 4, 4, 4, 4 - - - 2, 2 - - - 197 - - - 233, 26 - - - lbLL1 - - - True - - - NoControl - - - 140 - - - 11 - - - 150, 71 - - - No - - - 155, 21 - - - 1 - - - 243 - - - 233, 26 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tPDeadzone - - - tBsixaxisAccelX - - - bnL3 - - - gBLightbar - - - 254, 268 - - - gBOther - - - pnlController - - - Yes - - - 249 - - - 11, 96 - - - 196, 5 - - - L1 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 61, 21 - - - 27, 17 - - - 67, 95 - - - 4, 4, 4, 4 - - - X - - - 4, 0, 4, 0 - - - cHAction - - - Left : - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 25, 34 - - - 241 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 2, 2 - - - tBsixaxisGyroY - - - 12 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - rBSAMouse - - - NoControl - - - gBLightbar - - - tPCurve - - - gBOther - - - tPSpecial - - - 223 - - - Trigger - - - False - - - gBRumble - - - False - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - 257 - - - 4, 0, 4, 0 - - - 4, 0, 4, 0 - - - 44 - - - l2ToolStripMenuItem - - - 8 - - - 352, 4 - - - None - - - New Action - - - Zoom - - - 15, 15 - - - 197 - - - 136, 26 - - - gBSensitivity - - - tPCurve - - - 131, 39 - - - tSMIMouseInverted - - - lbL2TrackS - - - pnlSixaxis - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 55, 33 - - - 0 - - - 4, 4, 4, 4 - - - 200, 25 - - - 1 - - - NoControl - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - 2 - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - R - - - 250 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - alwaysOnToolStripMenuItem - - - 2, 2 - - - 26, 17 - - - 2, 2 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - 27 - - 53, 79 + + None + + + Flat + + + NoControl + + + 310, 22 + + + 56, 22 + + + 87 + + + Right Bumper + + + bnR1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 28 + + + None + + + Flat + + + NoControl + + + 295, 103 + + + 26, 26 + + + 72 + + + X Button + + + bnSquare + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 29 + + + None + + + Flat + + + NoControl + + + 96, 105 + + + 33, 23 + + + 82 + + + Right Button + + + bnRight + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 30 + + + NoControl + + + 72, 78 + + + 2, 0, 2, 0 + + + 2, 2 + + + 291 + + + False + + + lbLUp + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 31 + + + None + + + Flat + + + NoControl + + + 42, 106 + + + 34, 22 + + + 83 + + + Left Button + + + bnLeft + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController 32 - + NoControl - - 198 + + 122, 66 - - 225 + + 2, 0, 2, 0 - - 207 + + 2, 2 - - 4, 0, 4, 0 + + 290 - - 38 + + False - + + lbLShare + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 33 + + + None + + + Flat + + NoControl - - 233, 26 + + 282, 58 - - gBGyro + + 28, 32 - - 63, 17 + + 84 - - True + + Start - - 16 + + bnOptions - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Yes - - - pnlFull - - - 360, 4 - - - 352, 175 - - - 256 - - - 108, 38 - - - True - - - Profile Options - - - w/ Scan Code - - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 170, 29 - - - 11 - - - 4, 4, 4, 4 - - - NoControl - - - 4, 4, 4, 4 - - - 3 - - - 24, 17 - - - 4, 115 + + pnlController 34 - - 4 + + None - - lbLR2 + + Flat - - R - - - controlToolStripMenuItem - - - 4, 4, 4, 4 - - - 5, 5, 5, 5 - - - 111, 37 - - - True - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 125, 25 - - - 167, 205 - - - gBTouchpad - - - 244 - - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 10 - - - tSMIMouseInvertedY - - - 41, 29 - - - 4, 0, 4, 0 - - - 182, 21 - - - 16, 25 - - - 304 - - - 17, 17 - - - 4, 4, 4, 4 - - - % - - - pnlTPMouse - - - 26, 17 - - - bnTriangle - - - 25, 17 - - - 234, 524 - - - 388, 28 - - - bnGyroXP - - - 557, 593 - - - 4, 78 - - - cHTrigger - - - System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - 332, 69 - - - 9 - - - 4, 4, 4, 4 - - - 28, 61 - - - True - - + NoControl - - lbL2TrackS + + 120, 57 - - Upper Touch : + + 22, 32 - - 4, 4, 4, 4 + + 85 - - 177, 23 + + Back - - Right Stick Right : + + bnShare - - 192 - - - 233, 26 - - - pnlLowBattery - - - 179, 79 - - - 7 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 142, 55 - - - 9, 12 - - - 22 - - - 9, 9 - - - Inverted X - - - 1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - + pnlController - - gBRumble + + 35 - - lbGyroZP - - + NoControl + + 286, 66 + + + 2, 0, 2, 0 + + + 12, 12 + + + 289 + + + False + + + lbLOptions + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 36 + + + None + + + Flat + + + NoControl + + + 58, 22 + + + 55, 22 + + + 88 + + + Left Bumper + + + bnL1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 37 + + + None + + + Flat + + + NoControl + + + 234, 62 + + + 46, 65 + + + 190 + + + Left Mouse Button + + + bnTouchRight + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 38 + + + None + + + Flat + + + NoControl + + + 70, 2 + + + 40, 17 + + + 90 + + + Left Trigger + + + bnL2 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 39 + + + NoControl + + + 324, 77 + + + 2, 0, 2, 0 + + + 2, 2 + + + 288 + + + False + + + lbLTriangle + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 40 + + + None + + + Flat + + + NoControl + + + 143, 63 + + + 42, 63 + + + 191 + + + Left Mouse Button + + + bnTouchLeft + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + 41 - - 4, 4, 4, 4 + + NoControl - - btnRSTrack + + 294, 103 - - pnlSixaxis + + 2, 0, 2, 0 + + + 2, 2 + + + 287 + + + False + + + lbLSquare + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 42 + + + None + + + Flat + + + NoControl + + + 186, 61 + + + 47, 67 + + + 192 + + + Right Mouse Button + + + bnTouchMulti + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 43 + + + NoControl + + + 354, 103 + + + 2, 0, 2, 0 + + + 2, 2 + + + 286 + + + False + + + lbLCircle + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 44 + + + NoControl + + + 324, 130 + + + 2, 0, 2, 0 + + + 2, 2 + + + 285 + + + False + + + lbLCross + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 45 + + + None + + + Flat + + + NoControl + + + 143, 42 + + + 138, 19 + + + 193 + + + Middle Mouse Button + + + bnTouchUpper + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 46 + + + Zoom + + + Flat + + + NoControl + + + 143, 30 + + + 138, 13 + + + 91 + + + btnLightbar + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 47 + + + None + + + Flat + + + NoControl + + + 203, 154 + + + 17, 17 + + + 86 + + + Guide + + + bnPS + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 48 + + + None + + + Flat + + + NoControl + + + 324, 128 + + + 30, 29 + + + 74 + + + A Button + + + bnCross + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 49 + + + None + + + Flat + + + NoControl + + + 354, 101 + + + 29, 30 + + + 71 + + + B Button + + + bnCircle + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 50 + + + NoControl + + + 90, 195 + + + 250, 30 + + + 283 + + + Cross: A + + + TopCenter + + + lbControlName + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 51 + + + 2, 2 + + + 2, 2, 2, 2 + + + 422, 230 + + + 282 + + + pnlController + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPControls + + + 3 + + + 4, 22 + + + 3, 3, 3, 3 + + + 438, 448 + + + 0 + + + Controls + + + tPControls + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCControls + + + 0 + + + Name + + + 140 + + + Trigger + + + 105 + + + Action + + + 100 + + + Fill + + + 0, 66 + + + 438, 382 + + + 13 + + + lVActions + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlActions + + + 0 + + + NoControl + + + 3, 3 + + + 136, 23 + + + 14 + + + New Action + + + btnNewAction + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPActionButtons + + + 0 + + + NoControl + + + 145, 3 + + + 136, 23 + + + 14 + + + Edit Action + + + btnEditAction + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPActionButtons + + + 1 + + + NoControl + + + 287, 3 + + + 136, 23 + + + 14 + + + Remove Action + + + btnRemAction + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPActionButtons + + + 2 + + + Fill + + + 0, 28 + + + 438, 38 + + + 15 + + + fLPActionButtons + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 0 + + + Top + + + NoControl + + + 0, 0 + + + 438, 28 + + + 15 + + + Hold selected controls to perform an action, check the Action to use it while profile is loaded + + + MiddleCenter + + + lbActionsTip + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 1 + + + Top + + + 0, 0 + + + 2, 2, 2, 2 + + + 438, 66 + + + 16 + + + panel2 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlActions + + + 1 + + + Fill + + + 0, 0 + + + 438, 448 + + + 15 + + + pnlActions + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPSpecial + + + 0 + + + 4, 22 + + + 438, 448 + + + 3 + + + Special Actions + + + tPSpecial + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCControls + + + 1 + + + Left + + + 0, 0 + + + 446, 474 + + + 253 + + + tCControls + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + 4, 22 + + + 3, 3, 3, 3 + + + 264, 52 + + + 0 + + + Deadzone + + + tPDeadzone + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCSens + + + 0 + + + 36, 16 + + + No + + + 49, 20 + + + 206 + + + nUDLSCurve + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPCurve + + + 0 + + + 153, 16 + + + No + + + 49, 20 + + + 207 + + + nUDRSCurve + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPCurve + + + 1 + + + True + + + NoControl + + + 130, 18 + + + 22, 13 + + + 205 + + + RS + + + lbRSCurve + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPCurve + + + 2 + + + True + + + NoControl + + + 208, 18 + + + 15, 13 + + + 204 + + + % + + + lbRSCurvePercent + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPCurve + + + 3 + + + True + + + NoControl + + + 91, 18 + + + 15, 13 + + + 204 + + + % + + + lbLSCurvePercent + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPCurve + + + 4 + + + True + + + NoControl + + + 13, 18 + + + 20, 13 + + + 204 + + + LS + + + lbLSCurve + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPCurve + + + 5 + + + 4, 22 + + + 3, 3, 3, 3 + + + 264, 52 + + + 1 + + + Curve + + + tPCurve + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCSens + + + 1 + + + 158, 30 + + + 68, 20 + + + 7 + + + nUDR2AntiDead + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 0 + + + True + + + NoControl + + + 117, 32 + + + 24, 13 + + + 6 + + + R2: + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 1 + + + 51, 29 + + + 50, 20 + + + 5 + + + nUDL2AntiDead + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 2 + + + True + + + NoControl + + + 7, 31 + + + 22, 13 + + + 4 + + + L2: + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 3 + + + 157, 4 + + + 68, 20 + + + 3 + + + nUDRSAntiDead + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 4 + + + True + + + NoControl + + + 116, 6 + + + 25, 13 + + + 2 + + + RS: + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 5 + + + 50, 3 + + + 50, 20 + + + 1 + + + nUDLSAntiDead + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 6 + + + True + + + NoControl + + + 6, 5 + + + 23, 13 + + + 0 + + + LS: + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 7 + + + 4, 22 + + + 3, 3, 3, 3 + + + 264, 52 + + + 2 + + + Anti-Deadzone + + + antiDeadzoneTabPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCSens + + + 2 + + + 161, 29 + + + 50, 20 + + + 7 + + + nUDR2Maxzone + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 0 + + + 42, 29 + + + 51, 20 + + + 6 + + + nUDL2Maxzone + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 1 + + + True + + + NoControl + + + 129, 31 + + + 24, 13 + + + 5 + + + R2: + + + label8 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 2 + + + True + + + NoControl + + + 8, 31 + + + 22, 13 + + + 4 + + + L2: + + + label7 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 3 + + + 160, 3 + + + 51, 20 + + + 3 + + + nUDRSMaxZone + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 4 + + + True + + + NoControl + + + 129, 5 + + + 25, 13 + + + 2 + + + RS: + + + label6 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 5 + + + 42, 3 + + + 51, 20 + + + 1 + + + nUDLSMaxZone + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 6 + + + True + + + NoControl + + + 8, 5 + + + 23, 13 + + + 0 + + + LS: + + + label5 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 7 + + + 4, 22 + + + 3, 3, 3, 3 + + + 264, 52 + + + 3 + + + Max Zone + + + maxZoneTabPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCSens + + + 3 + + + 281, 55 + + + 272, 78 + + + 234 + + + tCSens + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 3 + + + True + + + True + + + NoControl + + + 144, 20 + + + 2, 2, 2, 2 + + + 100, 17 + + + 258 + + + Use for Controls + + + rBSAControls + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBGyro + + + 0 + + + True + + + NoControl + + + 13, 20 + + + 2, 2, 2, 2 + + + 93, 17 + + + 257 + + + Use as Mouse + + + rBSAMouse + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBGyro + + + 1 + + + True + + + NoControl + + + 97, 76 + + + Yes + + + 33, 17 + + + 261 + + + Y + + + cBGyroInvertY + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 0 + + + True + + + NoControl + + + 54, 76 + + + Yes + + + 33, 17 + + + 260 + + + X + + + cBGyroInvertX + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse 1 - - 4, 4, 4, 4 + + True + + + NoControl + + + 9, 77 + + + 37, 13 + + + 259 + + + Invert: + + + TopRight + + + lbGyroInvert + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 2 + + + True + + + NoControl + + + 6, 14 + + + 48, 13 + + + 258 + + + Triggers: + + + TopRight + + + lbGyroTriggers + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 3 + + + NoControl + + + 96, 8 + + + 2, 2, 2, 2 + + + 160, 25 + + + 257 + + + None + + + btnGyroTriggers + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 4 + + + 110, 45 + + + 49, 20 + + + 256 + + + nUDGyroSensitivity + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 5 + + + True + + + NoControl + + + 6, 46 + + + 82, 13 + + + 255 + + + Gyro Sensitivity: + + + TopRight + + + lbGyroSens + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 6 + + + 6, 43 + + + 2, 2, 2, 2 + + + 263, 120 + + + 259 + + + pnlSAMouse + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBGyro + + + 2 + + + 3, 253 + + + 272, 182 + + + 248 + + + Gyro + + + gBGyro + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 1 + + + True + + + NoControl + + + 10, 21 + + + 19, 13 + + + 204 + + + L2 + + + lbL2S + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBSensitivity + + + 0 + + + 34, 18 + + + No + + + 40, 20 + + + 212 + + + nUDL2S + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBSensitivity + + + 1 + + + 34, 48 + + + No + + + 40, 20 + + + 213 + + + nUDLSS + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBSensitivity + + + 2 + + + True + + + NoControl + + + 160, 20 + + + 49, 13 + + + 206 + + + Sixaxis X + + + lbSixaxisXS + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBSensitivity + + + 3 + + + 108, 19 + + + 40, 20 + + + 210 + + + nUDR2S + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBSensitivity + + + 4 + + + True + + + NoControl + + + 160, 50 + + + 49, 13 + + + 207 + + + Sixaxis Z + + + lbSixaxisZS + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBSensitivity + + + 5 + + + 108, 48 + + + No + + + 40, 20 + + + 214 + + + nUDRSS + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBSensitivity + + + 6 + + + True + + + NoControl + + + 85, 22 + + + 21, 13 + + + 208 + + + R2 + + + lbR2LS + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBSensitivity + + + 7 + + + 215, 19 + + + 40, 20 + + + 211 + + + nUDSXS + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBSensitivity + + + 8 + + + True + + + NoControl + + + 85, 50 + + + 22, 13 + + + 209 + + + RS + + + lbRSS + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBSensitivity + + + 9 + + + True + + + NoControl + + + 10, 50 + + + 20, 13 + + + 205 + + + LS + + + lbLSS + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBSensitivity + + + 10 + + + 215, 48 + + + No + + + 40, 20 + + + 215 + + + nUDSZS + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBSensitivity + + + 11 + + + 281, 139 + + + 272, 76 + + + 257 + + + Sensitivity + + + gBSensitivity + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 4 + + + Fill + + + TopDown + + + 446, 0 + + + 2, 2, 2, 2 + + + 564, 474 + + + 254 + + + fLPSettings + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 482, 17 - - 326, 13 + + 194, 22 + + + Cross + + + 194, 22 + + + Circle + + + 194, 22 + + + Square + + + 194, 22 + + + Triangle + + + 194, 22 + + + L1 + + + 194, 22 + + + L2 + + + 194, 22 + + + R1 + + + 194, 22 + + + R2 + + + 194, 22 + + + Up + + + 194, 22 + + + Down + + + 194, 22 + + + Left + + + 194, 22 + + + Right + + + 194, 22 + + + L3 + + + 194, 22 + + + R3 + + + 194, 22 + + + Finger on Touchpad + + + 194, 22 + + + 2 Fingers on Touchpad + + + 194, 22 + + + Options + + + 194, 22 + + + Share + + + 194, 22 + + + PS + + + 194, 22 + + + Always on + + + 195, 444 + + + cMGyroTriggers + + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 647, 17 True - - 153, 17 - - - 647, 17 - + + 96, 96 + + + True + + + 1010, 474 + + + 4, 4, 4, 4 + + + 1027, 520 + + + 18, 94 + + + Profile Options + + + controlToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + toolStripSeparator1 + + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + defaultToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + DpadToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tSMIDPadInverted + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tSMIDPadInvertedX + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tSMIDPadInvertedY + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + LSToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tSMILSInverted + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tSMILSInvertedX + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tSMILSInvertedY + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + RSToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tSMIRSInverted + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tSMIRSInvertedX + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tSMIRSInvertedY + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ABXYToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + WASDToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + wScanCodeWASDToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ArrowKeysToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + wScanCodeArrowKeysToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + MouseToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tSMIMouseInverted + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tSMIMouseInvertedX + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tSMIMouseInvertedY + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + openFileDialog1 + + + System.Windows.Forms.OpenFileDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + cHName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + cHTrigger + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + cHAction + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + crossToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + circleToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + squareToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + triangleToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + l1ToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + l2ToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + r1ToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + r2ToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + onTouchpadToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + downToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + leftToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + rightToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + l3ToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + r3ToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fingerOnTouchpadToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fingersOnTouchpadToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + optionsToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + shareToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pSToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + alwaysOnToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + advColorDialog + + + DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.4.67.0, Culture=neutral, PublicKeyToken=null + + + Options + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/DS4Windows/DS4Forms/RecordBox.cs b/DS4Windows/DS4Forms/RecordBox.cs index 4f2ecdb..25861b8 100644 --- a/DS4Windows/DS4Forms/RecordBox.cs +++ b/DS4Windows/DS4Forms/RecordBox.cs @@ -86,7 +86,6 @@ namespace DS4Windows void AddtoDS4List() { - dcs.Add(DS4Controls.Cross); dcs.Add(DS4Controls.Cross); dcs.Add(DS4Controls.Circle); dcs.Add(DS4Controls.Square); @@ -121,7 +120,9 @@ namespace DS4Windows else macros.Add(value); } + bool[] pTP = new bool[4]; + void ds4_Tick(object sender, EventArgs e) { if (Program.rootHub.DS4Controllers[0] != null) @@ -147,17 +148,25 @@ namespace DS4Windows pTP[0] = tP.leftDown; pTP[1] = tP.rightDown; } - foreach (DS4Controls dc in dcs) + + //foreach (DS4Controls dc in dcs) + for (int controlIndex = 0, dcsLen = dcs.Count; controlIndex < dcsLen; controlIndex++) + { + DS4Controls dc = dcs[controlIndex]; if (Mapping.getBoolMapping(0, dc, cState, null, null)) { int value = DS4ControltoInt(dc); int count = 0; - foreach (int i in macros) + int macroLen = macros.Count; + //foreach (int i in macros) + for (int macroIndex = 0; macroIndex < macroLen; macroIndex++) { + int i = macros[macroIndex]; if (i == value) count++; } - if (macros.Count == 0) + + if (macroLen == 0) { AddMacroValue(value); lVMacros.Items.Add(DS4ControltoX360(dc), 0); @@ -179,22 +188,28 @@ namespace DS4Windows AddMacroValue(value); lVMacros.Items.Add(DS4ControltoX360(dc), 0); } + lVMacros.Items[lVMacros.Items.Count - 1].EnsureVisible(); } else if (!Mapping.getBoolMapping(0, dc, cState, null, null)) { - if (macros.Count != 0) + int macroLen = macros.Count; + if (macroLen != 0) { int value = DS4ControltoInt(dc); int count = 0; - foreach (int i in macros) + //foreach (int i in macros) + for (int macroIndex = 0; macroIndex < macroLen; macroIndex++) { + int i = macros[macroIndex]; if (i == value) count++; } + /*for (int i = macros.Count - 1; i >= 0; i--) if (macros.Count == 261) count++;*/ + if (count % 2 == 1) { if (cBRecordDelays.Checked) @@ -204,12 +219,14 @@ namespace DS4Windows sw.Reset(); sw.Start(); } + AddMacroValue(value); lVMacros.Items.Add(DS4ControltoX360(dc), 1); lVMacros.Items[lVMacros.Items.Count - 1].EnsureVisible(); } } } + } } } } @@ -279,8 +296,10 @@ namespace DS4Windows } return "None"; } + bool recordAfter = false; int recordAfterInt = 0; + private void btnRecord_Click(object sender, EventArgs e) { if (btnRecord.Text != Properties.Resources.StopText) @@ -784,8 +803,7 @@ namespace DS4Windows kbm.macrostag = macros; kbm.macros = macronames; kbm.lBMacroOn.Visible = true; - if (cBStyle.SelectedIndex == 1) - kbm.macrorepeat = true; + kbm.macrorepeat = cBStyle.SelectedIndex == 1; saved = true; if (sender != kbm) kbm.Close(); @@ -796,8 +814,7 @@ namespace DS4Windows sA.macros = macronames; sA.lbMacroRecorded.Text = string.Join(", ", macronames); //kbm.lBMacroOn.Visible = true; - if (cBStyle.SelectedIndex == 1) - sA.macrorepeat = true; + sA.macrorepeat = cBStyle.SelectedIndex == 1; saved = true; //if (sender != sA) // sA.Close(); diff --git a/DS4Windows/DS4Forms/WelcomeDialog.cs b/DS4Windows/DS4Forms/WelcomeDialog.cs index 9ede6f9..3b8b345 100644 --- a/DS4Windows/DS4Forms/WelcomeDialog.cs +++ b/DS4Windows/DS4Forms/WelcomeDialog.cs @@ -42,7 +42,7 @@ namespace DS4Windows WebClient wb = new WebClient(); if (!driverinstalling) { - wb.DownloadFileAsync(new Uri("http://ds4windows.com/Files/Virtual Bus Driver.zip"), exepath + "\\VBus.zip"); + wb.DownloadFileAsync(new Uri("http://23.239.26.40/ds4windows/files/Virtual Bus Driver.zip"), exepath + "\\VBus.zip"); wb.DownloadProgressChanged += wb_DownloadProgressChanged; wb.DownloadFileCompleted += wb_DownloadFileCompleted; driverinstalling = true; @@ -131,7 +131,7 @@ namespace DS4Windows private void button2_Click(object sender, EventArgs e) { - Process.Start("http://www.microsoft.com/hardware/en-us/d/xbox-360-controller-for-windows"); + Process.Start("http://www.microsoft.com/accessories/en-gb/d/xbox-360-controller-for-windows"); } } } diff --git a/DS4Windows/DS4Library/DS4Audio.cs b/DS4Windows/DS4Library/DS4Audio.cs new file mode 100644 index 0000000..b256870 --- /dev/null +++ b/DS4Windows/DS4Library/DS4Audio.cs @@ -0,0 +1,251 @@ +using System; +using System.Runtime.InteropServices; +using DS4Windows.DS4Library.CoreAudio; + +namespace DS4Windows.DS4Library +{ + public class DS4Audio + { + private IAudioEndpointVolume endpointVolume; + + private static Guid IID_IAudioEndpointVolume = new Guid("5CDF2C82-841E-4546-9722-0CF74078229A"); + private static readonly PropertyKey PKEY_Device_FriendlyName = + new PropertyKey(new Guid(unchecked((int)0xa45c254e), unchecked((short)0xdf1c), 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0), 14); + + public uint Volume + { + get + { + float pfLevel = 0; + + if (endpointVolume != null) + endpointVolume.GetMasterVolumeLevelScalar(out pfLevel); + + return Convert.ToUInt32(pfLevel * 100); + } + } + + public uint getVolume() + { + float pfLevel = 0; + + if (endpointVolume != null) + endpointVolume.GetMasterVolumeLevelScalar(out pfLevel); + + return Convert.ToUInt32(pfLevel * 100); + } + + public DS4Audio(DataFlow audioFlags = DataFlow.Render) + { + var audioEnumerator = new MMDeviceEnumeratorComObject() as IMMDeviceEnumerator; + IMMDeviceCollection audioDevices; + audioEnumerator.EnumAudioEndpoints(audioFlags, DeviceState.Active, out audioDevices); + + int numAudioDevices; + Marshal.ThrowExceptionForHR(audioDevices.GetCount(out numAudioDevices)); + + for (int deviceNumber = 0; deviceNumber < numAudioDevices; ++deviceNumber) + { + IMMDevice audioDevice; + Marshal.ThrowExceptionForHR(audioDevices.Item(deviceNumber, out audioDevice)); + string deviceName = GetAudioDeviceName(ref audioDevice); + + if (deviceName.Contains("DUALSHOCK®4 USB Wireless Adaptor")) + { + object interfacePointer; + Marshal.ThrowExceptionForHR(audioDevice.Activate(ref IID_IAudioEndpointVolume, ClsCtx.ALL, IntPtr.Zero, out interfacePointer)); + endpointVolume = interfacePointer as IAudioEndpointVolume; + } + + Marshal.ReleaseComObject(audioDevice); + } + + Marshal.ReleaseComObject(audioDevices); + Marshal.ReleaseComObject(audioEnumerator); + } + + ~DS4Audio() + { + if (endpointVolume != null) + { + Marshal.ReleaseComObject(endpointVolume); + endpointVolume = null; + } + } + + private string GetAudioDeviceName(ref IMMDevice audioDevice) + { + IPropertyStore propertyStore; + Marshal.ThrowExceptionForHR(audioDevice.OpenPropertyStore(StorageAccessMode.Read, out propertyStore)); + + int numProperties; + Marshal.ThrowExceptionForHR(propertyStore.GetCount(out numProperties)); + + string deviceName = String.Empty; + + for (int propertyNum = 0; propertyNum < numProperties; ++propertyNum) + { + PropertyKey propertyKey; + Marshal.ThrowExceptionForHR(propertyStore.GetAt(propertyNum, out propertyKey)); + + if ((propertyKey.formatId == PKEY_Device_FriendlyName.formatId) && (propertyKey.propertyId == PKEY_Device_FriendlyName.propertyId)) + { + PropVariant propertyValue; + Marshal.ThrowExceptionForHR(propertyStore.GetValue(ref propertyKey, out propertyValue)); + deviceName = Marshal.PtrToStringUni(propertyValue.pointerValue); + break; + } + } + + Marshal.ReleaseComObject(propertyStore); + return deviceName; + } + } +} + +namespace DS4Windows.DS4Library.CoreAudio +{ + public enum DataFlow + { + Render, + Capture, + All + }; + + [Flags] + public enum DeviceState + { + Active = 0x00000001, + Disabled = 0x00000002, + NotPresent = 0x00000004, + Unplugged = 0x00000008, + All = 0x0000000F + } + + enum StorageAccessMode + { + Read, + Write, + ReadWrite + } + + [Flags] + public enum ClsCtx + { + INPROC_SERVER = 0x1, + INPROC_HANDLER = 0x2, + LOCAL_SERVER = 0x4, + INPROC_SERVER16 = 0x8, + REMOTE_SERVER = 0x10, + INPROC_HANDLER16 = 0x20, + NO_CODE_DOWNLOAD = 0x400, + NO_CUSTOM_MARSHAL = 0x1000, + ENABLE_CODE_DOWNLOAD = 0x2000, + NO_FAILURE_LOG = 0x4000, + DISABLE_AAA = 0x8000, + ENABLE_AAA = 0x10000, + FROM_DEFAULT_CONTEXT = 0x20000, + ACTIVATE_32_BIT_SERVER = 0x40000, + ACTIVATE_64_BIT_SERVER = 0x80000, + ENABLE_CLOAKING = 0x100000, + PS_DLL = unchecked((int)0x80000000), + INPROC = INPROC_SERVER | INPROC_HANDLER, + SERVER = INPROC_SERVER | LOCAL_SERVER | REMOTE_SERVER, + ALL = SERVER | INPROC_HANDLER + } + + public struct PropertyKey + { + public Guid formatId; + public int propertyId; + public PropertyKey(Guid formatId, int propertyId) + { + this.formatId = formatId; + this.propertyId = propertyId; + } + } + + [StructLayout(LayoutKind.Explicit)] + public struct PropVariant + { + [FieldOffset(0)] private short vt; + [FieldOffset(2)] private short wReserved1; + [FieldOffset(4)] private short wReserved2; + [FieldOffset(6)] private short wReserved3; + [FieldOffset(8)] public IntPtr pointerValue; + } + + [Guid("886d8eeb-8cf2-4446-8d02-cdba1dbdcf99"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + interface IPropertyStore + { + int GetCount(out int propCount); + int GetAt(int property, out PropertyKey key); + int GetValue(ref PropertyKey key, out PropVariant value); + int SetValue(ref PropertyKey key, ref PropVariant value); + int Commit(); + } + + [Guid("D666063F-1587-4E43-81F1-B948E807363F"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + interface IMMDevice + { + int Activate(ref Guid id, ClsCtx clsCtx, IntPtr activationParams, + [MarshalAs(UnmanagedType.IUnknown)] out object interfacePointer); + + int OpenPropertyStore(StorageAccessMode stgmAccess, out IPropertyStore properties); + + int GetId([MarshalAs(UnmanagedType.LPWStr)] out string id); + } + + [Guid("0BD7A1BE-7A1A-44DB-8397-CC5392387B5E"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + interface IMMDeviceCollection + { + int GetCount(out int numDevices); + int Item(int deviceNumber, out IMMDevice device); + } + + [Guid("A95664D2-9614-4F35-A746-DE8DB63617E6"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + interface IMMDeviceEnumerator + { + int EnumAudioEndpoints(DataFlow dataFlow, DeviceState stateMask, out IMMDeviceCollection devices); + } + + [ComImport, Guid("BCDE0395-E52F-467C-8E3D-C4579291692E")] + class MMDeviceEnumeratorComObject + { + } + + [Guid("657804FA-D6AD-4496-8A60-352752AF4F89"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + internal interface IAudioEndpointVolumeCallback + { + void OnNotify(IntPtr notifyData); + }; + + [Guid("5CDF2C82-841E-4546-9722-0CF74078229A"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + internal interface IAudioEndpointVolume + { + int RegisterControlChangeNotify(IAudioEndpointVolumeCallback pNotify); + int UnregisterControlChangeNotify(IAudioEndpointVolumeCallback pNotify); + int GetChannelCount(out int pnChannelCount); + int SetMasterVolumeLevel(float fLevelDB, ref Guid pguidEventContext); + int SetMasterVolumeLevelScalar(float fLevel, ref Guid pguidEventContext); + int GetMasterVolumeLevel(out float pfLevelDB); + int GetMasterVolumeLevelScalar(out float pfLevel); + int SetChannelVolumeLevel(uint nChannel, float fLevelDB, ref Guid pguidEventContext); + int SetChannelVolumeLevelScalar(uint nChannel, float fLevel, ref Guid pguidEventContext); + int GetChannelVolumeLevel(uint nChannel, out float pfLevelDB); + int GetChannelVolumeLevelScalar(uint nChannel, out float pfLevel); + int SetMute([MarshalAs(UnmanagedType.Bool)] Boolean bMute, ref Guid pguidEventContext); + int GetMute(out bool pbMute); + int GetVolumeStepInfo(out uint pnStep, out uint pnStepCount); + int VolumeStepUp(ref Guid pguidEventContext); + int VolumeStepDown(ref Guid pguidEventContext); + int QueryHardwareSupport(out uint pdwHardwareSupportMask); + int GetVolumeRange(out float pflVolumeMindB, out float pflVolumeMaxdB, out float pflVolumeIncrementdB); + } +} \ No newline at end of file diff --git a/DS4Windows/DS4Library/DS4Device.cs b/DS4Windows/DS4Library/DS4Device.cs index 83de17f..c04aeb7 100644 --- a/DS4Windows/DS4Library/DS4Device.cs +++ b/DS4Windows/DS4Library/DS4Device.cs @@ -14,6 +14,7 @@ using System.Text; using System.IO; using System.Collections; using System.Drawing; +using DS4Windows.DS4Library; namespace DS4Windows { @@ -28,12 +29,14 @@ namespace DS4Windows green = c.G; blue = c.B; } + public DS4Color(byte r, byte g, byte b) { red = r; green = g; blue = b; } + public override bool Equals(object obj) { if (obj is DS4Color) @@ -44,6 +47,7 @@ namespace DS4Windows else return false; } + public Color ToColor => Color.FromArgb(red, green, blue); public Color ToColorA { @@ -83,10 +87,11 @@ namespace DS4Windows } catch { return false; } } + public override string ToString() => $"Red: {red} Green: {green} Blue: {blue}"; } - public enum ConnectionType : byte { BT, USB }; // Prioritize Bluetooth when both are connected. + public enum ConnectionType : byte { BT, SONYWA, USB }; // Prioritize Bluetooth when both BT and USB are connected. /** * The haptics engine uses a stack of these states representing the light bar and rumble motor settings. @@ -99,20 +104,32 @@ namespace DS4Windows public byte LightBarFlashDurationOn, LightBarFlashDurationOff; public byte RumbleMotorStrengthLeftHeavySlow, RumbleMotorStrengthRightLightFast; public bool RumbleMotorsExplicitlyOff; + public bool IsLightBarSet() { return LightBarExplicitlyOff || LightBarColor.red != 0 || LightBarColor.green != 0 || LightBarColor.blue != 0; } + public bool IsRumbleSet() { return RumbleMotorsExplicitlyOff || RumbleMotorStrengthLeftHeavySlow != 0 || RumbleMotorStrengthRightLightFast != 0; } } - + public class DS4Device { private const int BT_OUTPUT_REPORT_LENGTH = 78; private const int BT_INPUT_REPORT_LENGTH = 547; + // Use large value for worst case scenario + private const int READ_STREAM_TIMEOUT = 100; + // Isolated BT report can have latency as high as 15 ms + // due to hardware. + private const int WARN_INTERVAL_BT = 20; + private const int WARN_INTERVAL_USB = 10; + // Maximum values for battery level when no USB cable is connected + // and when a USB cable is connected + private const int BATTERY_MAX = 8; + private const int BATTERY_MAX_USB = 11; private HidDevice hDevice; private string Mac; private DS4State cState = new DS4State(); @@ -121,6 +138,7 @@ namespace DS4Windows private byte[] accel = new byte[6]; private byte[] gyro = new byte[6]; private byte[] inputReport; + private byte[] inputReport2; private byte[] btInputReport = null; private byte[] outputReportBuffer, outputReport; private readonly DS4Touchpad touchpad = null; @@ -131,31 +149,129 @@ namespace DS4Windows private byte ledFlashOn, ledFlashOff; private Thread ds4Input, ds4Output; private int battery; + private DS4Audio audio = null; + private DS4Audio micAudio = null; public DateTime lastActive = DateTime.UtcNow; public DateTime firstActive = DateTime.UtcNow; private bool charging; + private bool outputRumble = false; + private int warnInterval = WARN_INTERVAL_USB; + public int getWarnInterval() + { + return warnInterval; + } + + private bool exitOutputThread = false; + private bool exitInputThread = false; + private object exitLocker = new object(); public event EventHandler Report = null; public event EventHandler Removal = null; public HidDevice HidDevice => hDevice; public bool IsExclusive => HidDevice.IsExclusive; - public bool IsDisconnecting { get; private set; } + public bool isExclusive() + { + return HidDevice.IsExclusive; + } + + private bool isDisconnecting = false; + public bool IsDisconnecting + { + get { return isDisconnecting; } + private set + { + this.isDisconnecting = value; + } + } + + public bool isDisconnectingStatus() + { + return this.isDisconnecting; + } + + private bool isRemoving = false; + public bool IsRemoving + { + get { return isRemoving; } + set + { + this.isRemoving = value; + } + } + + private bool isRemoved = false; + public bool IsRemoved + { + get { return isRemoved; } + set + { + this.isRemoved = value; + } + } + + public object removeLocker = new object(); public string MacAddress => Mac; + public string getMacAddress() + { + return this.Mac; + } public ConnectionType ConnectionType => conType; - public int IdleTimeout { get; set; } // behavior only active when > 0 + public ConnectionType getConnectionType() + { + return this.conType; + } + + // behavior only active when > 0 + private int idleTimeout = 0; + public int IdleTimeout + { + get { return idleTimeout; } + set + { + idleTimeout = value; + } + } + + public int getIdleTimeout() + { + return idleTimeout; + } + + public void setIdleTimeout(int value) + { + if (idleTimeout != value) + { + idleTimeout = value; + } + } public int Battery => battery; + public int getBattery() + { + return battery; + } + public bool Charging => charging; + public bool isCharging() + { + return charging; + } + + private long lastTimeElapsed = 0; + public long getLastTimeElapsed() + { + return lastTimeElapsed; + } public byte RightLightFastRumble { get { return rightLightFastRumble; } set { - if (value == rightLightFastRumble) return; - rightLightFastRumble = value; + if (rightLightFastRumble != value) + rightLightFastRumble = value; } } @@ -164,11 +280,16 @@ namespace DS4Windows get { return leftHeavySlowRumble; } set { - if (value == leftHeavySlowRumble) return; - leftHeavySlowRumble = value; + if (leftHeavySlowRumble != value) + leftHeavySlowRumble = value; } } + public byte getLeftHeavySlowRumble() + { + return leftHeavySlowRumble; + } + public DS4Color LightBarColor { get { return ligtBarColor; } @@ -192,6 +313,11 @@ namespace DS4Windows } } } + + public byte getLightBarOnDuration() + { + return ledFlashOn; + } public byte LightBarOffDuration { @@ -205,24 +331,55 @@ namespace DS4Windows } } + public byte getLightBarOffDuration() + { + return ledFlashOff; + } + public DS4Touchpad Touchpad { get { return touchpad; } } public DS4SixAxis SixAxis { get { return sixAxis; } } public static ConnectionType HidConnectionType(HidDevice hidDevice) { - return hidDevice.Capabilities.InputReportByteLength == 64 ? ConnectionType.USB : ConnectionType.BT; + ConnectionType result = ConnectionType.USB; + if (hidDevice.Capabilities.InputReportByteLength == 64) + { + if (hidDevice.Capabilities.NumberFeatureDataIndices == 22) + { + result = ConnectionType.SONYWA; + } + } + else + { + result = ConnectionType.BT; + } + + return result; } + private SynchronizationContext uiContext = null; + public DS4Device(HidDevice hidDevice) { hDevice = hidDevice; conType = HidConnectionType(hDevice); Mac = hDevice.readSerial(); - if (conType == ConnectionType.USB) + if (conType == ConnectionType.USB || conType == ConnectionType.SONYWA) { inputReport = new byte[64]; + inputReport2 = new byte[64]; outputReport = new byte[hDevice.Capabilities.OutputReportByteLength]; outputReportBuffer = new byte[hDevice.Capabilities.OutputReportByteLength]; + if (conType == ConnectionType.USB) + { + warnInterval = WARN_INTERVAL_USB; + } + else + { + warnInterval = WARN_INTERVAL_BT; + audio = new DS4Audio(); + micAudio = new DS4Audio(DS4Library.CoreAudio.DataFlow.Render); + } } else { @@ -230,22 +387,41 @@ namespace DS4Windows inputReport = new byte[btInputReport.Length - 2]; outputReport = new byte[BT_OUTPUT_REPORT_LENGTH]; outputReportBuffer = new byte[BT_OUTPUT_REPORT_LENGTH]; + warnInterval = WARN_INTERVAL_BT; } + touchpad = new DS4Touchpad(); sixAxis = new DS4SixAxis(); + uiContext = SynchronizationContext.Current; } public void StartUpdate() { if (ds4Input == null) { - Console.WriteLine(MacAddress.ToString() + " " + System.DateTime.UtcNow.ToString("o") + "> start"); + if (!hDevice.IsFileStreamOpen()) + { + hDevice.OpenFileStream(inputReport.Length); + } + + //Console.WriteLine(MacAddress.ToString() + " " + System.DateTime.UtcNow.ToString("o") + "> start"); sendOutputReport(true); // initialize the output report - ds4Output = new Thread(performDs4Output); - ds4Output.Name = "DS4 Output thread: " + Mac; - ds4Output.Start(); + + if (conType == ConnectionType.BT) + { + // Only use the output thread for Bluetooth connections. + // USB will utilize overlapped IO instead. + ds4Output = new Thread(performDs4Output); + ds4Output.Priority = ThreadPriority.AboveNormal; + ds4Output.Name = "DS4 Output thread: " + Mac; + ds4Output.IsBackground = true; + ds4Output.Start(); + } + ds4Input = new Thread(performDs4Input); + ds4Input.Priority = ThreadPriority.AboveNormal; ds4Input.Name = "DS4 Input thread: " + Mac; + ds4Input.IsBackground = true; ds4Input.Start(); } else @@ -254,11 +430,14 @@ namespace DS4Windows public void StopUpdate() { - if (ds4Input.ThreadState != System.Threading.ThreadState.Stopped || ds4Input.ThreadState != System.Threading.ThreadState.Aborted) + if (ds4Input != null && + ds4Input.IsAlive && !ds4Input.ThreadState.HasFlag(System.Threading.ThreadState.Stopped) && + !ds4Input.ThreadState.HasFlag(System.Threading.ThreadState.AbortRequested)) { try { - ds4Input.Abort(); + exitInputThread = true; + //ds4Input.Abort(); ds4Input.Join(); } catch (Exception e) @@ -266,21 +445,34 @@ namespace DS4Windows Console.WriteLine(e.Message); } } + StopOutputUpdate(); } private void StopOutputUpdate() { - if (ds4Output.ThreadState != System.Threading.ThreadState.Stopped || ds4Output.ThreadState != System.Threading.ThreadState.Aborted) + lock (exitLocker) { - try + if (ds4Output != null && + ds4Output.IsAlive && !ds4Output.ThreadState.HasFlag(System.Threading.ThreadState.Stopped) && + !ds4Output.ThreadState.HasFlag(System.Threading.ThreadState.AbortRequested)) { - ds4Output.Abort(); - ds4Output.Join(); - } - catch (Exception e) - { - Console.WriteLine(e.Message); + try + { + exitOutputThread = true; + /*lock (outputReport) + { + Monitor.PulseAll(outputReport); + } + */ + + ds4Output.Interrupt(); + ds4Output.Join(); + } + catch (Exception e) + { + Console.WriteLine(e.Message); + } } } } @@ -293,7 +485,7 @@ namespace DS4Windows } else { - return hDevice.WriteOutputReportViaInterrupt(outputReport, 8); + return hDevice.WriteAsyncOutputReportViaInterrupt(outputReport); } } @@ -301,27 +493,47 @@ namespace DS4Windows { lock (outputReport) { - int lastError = 0; - while (true) + try { - if (writeOutput()) + int lastError = 0; + while (!exitOutputThread) { - lastError = 0; - if (testRumble.IsRumbleSet()) // repeat test rumbles periodically; rumble has auto-shut-off in the DS4 firmware - Monitor.Wait(outputReport, 10000); // DS4 firmware stops it after 5 seconds, so let the motors rest for that long, too. - else - Monitor.Wait(outputReport); - } - else - { - int thisError = Marshal.GetLastWin32Error(); - if (lastError != thisError) + bool result = false; + if (outputRumble) { - Console.WriteLine(MacAddress.ToString() + " " + System.DateTime.UtcNow.ToString("o") + "> encountered write failure: " + thisError); - lastError = thisError; + result = writeOutput(); + + if (!result) + { + int thisError = Marshal.GetLastWin32Error(); + if (lastError != thisError) + { + Console.WriteLine(MacAddress.ToString() + " " + System.DateTime.UtcNow.ToString("o") + "> encountered write failure: " + thisError); + lastError = thisError; + } + } + else + { + outputRumble = false; + } + } + + if (!outputRumble) + { + lastError = 0; + Monitor.Wait(outputReport); + /*if (testRumble.IsRumbleSet()) // repeat test rumbles periodically; rumble has auto-shut-off in the DS4 firmware + Monitor.Wait(outputReport, 10000); // DS4 firmware stops it after 5 seconds, so let the motors rest for that long, too. + else + Monitor.Wait(outputReport); + */ } } } + catch (ThreadInterruptedException) + { + + } } } @@ -330,49 +542,37 @@ namespace DS4Windows { return priorInputReport30 != 0xff; } + private byte priorInputReport30 = 0xff; public double Latency = 0; - bool warn; public string error; + public bool firstReport = false; + private void performDs4Input() { firstActive = DateTime.UtcNow; - System.Timers.Timer readTimeout = new System.Timers.Timer(); // Await 30 seconds for the initial packet, then 3 seconds thereafter. - readTimeout.Elapsed += delegate { HidDevice.CancelIO(); }; - List Latency = new List(); + NativeMethods.HidD_SetNumInputBuffers(hDevice.safeReadHandle.DangerousGetHandle(), 2); + List Latency = new List(100); long oldtime = 0; Stopwatch sw = new Stopwatch(); sw.Start(); - while (true) + while (!exitInputThread) { string currerror = string.Empty; - Latency.Add(sw.ElapsedMilliseconds - oldtime); - oldtime = sw.ElapsedMilliseconds; + long curtime = sw.ElapsedMilliseconds; + this.lastTimeElapsed = curtime - oldtime; + Latency.Add(this.lastTimeElapsed); + oldtime = curtime; if (Latency.Count > 100) Latency.RemoveAt(0); this.Latency = Latency.Average(); - if (this.Latency > 10 && !warn && sw.ElapsedMilliseconds > 4000) + if (conType == ConnectionType.BT) { - warn = true; - //System.Diagnostics.Trace.WriteLine(System.DateTime.UtcNow.ToString("o") + "> " + "Controller " + /*this.DeviceNum*/ + 1 + " (" + this.MacAddress + ") is experiencing latency issues. Currently at " + Math.Round(this.Latency, 2).ToString() + "ms of recomended maximum 10ms"); - } - else if (this.Latency <= 10 && warn) warn = false; - - if (readTimeout.Interval != 3000.0) - { - if (readTimeout.Interval != 30000.0) - readTimeout.Interval = 30000.0; - else - readTimeout.Interval = 3000.0; - } - readTimeout.Enabled = true; - if (conType != ConnectionType.USB) - { - HidDevice.ReadStatus res = hDevice.ReadFile(btInputReport); - readTimeout.Enabled = false; + //HidDevice.ReadStatus res = hDevice.ReadFile(btInputReport); + HidDevice.ReadStatus res = hDevice.ReadAsyncWithFileStream(btInputReport, READ_STREAM_TIMEOUT); if (res == HidDevice.ReadStatus.Success) { Array.Copy(btInputReport, 2, inputReport, 0, inputReport.Length); @@ -382,32 +582,51 @@ namespace DS4Windows Console.WriteLine(MacAddress.ToString() + " " + System.DateTime.UtcNow.ToString("o") + "> disconnect due to read failure: " + Marshal.GetLastWin32Error()); sendOutputReport(true); // Kick Windows into noticing the disconnection. StopOutputUpdate(); - IsDisconnecting = true; + isDisconnecting = true; + uiContext.Send(new SendOrPostCallback(delegate (object state4) + { + Removal?.Invoke(this, EventArgs.Empty); + }), null); + + /* if (Removal != null) Removal(this, EventArgs.Empty); + */ return; } } else { - HidDevice.ReadStatus res = hDevice.ReadFile(inputReport); - readTimeout.Enabled = false; + //HidDevice.ReadStatus res = hDevice.ReadFile(inputReport); + //Array.Clear(inputReport, 0, inputReport.Length); + HidDevice.ReadStatus res = hDevice.ReadAsyncWithFileStream(inputReport, READ_STREAM_TIMEOUT); if (res != HidDevice.ReadStatus.Success) { Console.WriteLine(MacAddress.ToString() + " " + System.DateTime.UtcNow.ToString("o") + "> disconnect due to read failure: " + Marshal.GetLastWin32Error()); StopOutputUpdate(); - IsDisconnecting = true; - if (Removal != null) - Removal(this, EventArgs.Empty); + isDisconnecting = true; + uiContext.Send(new SendOrPostCallback(delegate (object state4) + { + Removal?.Invoke(this, EventArgs.Empty); + }), null); + + //if (Removal != null) + // Removal(this, EventArgs.Empty); return; } + else + { + //Array.Copy(inputReport2, 0, inputReport, 0, inputReport.Length); + } } - if (ConnectionType == ConnectionType.BT && btInputReport[0] != 0x11) + + if (conType == ConnectionType.BT && btInputReport[0] != 0x11) { //Received incorrect report, skip it continue; } + DateTime utcNow = System.DateTime.UtcNow; // timestamp with UTC in case system time zone changes resetHapticState(); cState.ReportTimeStamp = utcNow; @@ -418,23 +637,14 @@ namespace DS4Windows cState.L2 = inputReport[8]; cState.R2 = inputReport[9]; - cState.Triangle = ((byte)inputReport[5] & (1 << 7)) != 0; - cState.Circle = ((byte)inputReport[5] & (1 << 6)) != 0; - cState.Cross = ((byte)inputReport[5] & (1 << 5)) != 0; - cState.Square = ((byte)inputReport[5] & (1 << 4)) != 0; - cState.DpadUp = ((byte)inputReport[5] & (1 << 3)) != 0; - cState.DpadDown = ((byte)inputReport[5] & (1 << 2)) != 0; - cState.DpadLeft = ((byte)inputReport[5] & (1 << 1)) != 0; - cState.DpadRight = ((byte)inputReport[5] & (1 << 0)) != 0; + cState.Triangle = (inputReport[5] & (1 << 7)) != 0; + cState.Circle = (inputReport[5] & (1 << 6)) != 0; + cState.Cross = (inputReport[5] & (1 << 5)) != 0; + cState.Square = (inputReport[5] & (1 << 4)) != 0; - //Convert dpad into individual On/Off bits instead of a clock representation - byte dpad_state = 0; - - dpad_state = (byte)( - ((cState.DpadRight ? 1 : 0) << 0) | - ((cState.DpadLeft ? 1 : 0) << 1) | - ((cState.DpadDown ? 1 : 0) << 2) | - ((cState.DpadUp ? 1 : 0) << 3)); + // First 4 bits denote dpad state. Clock representation + // with 8 meaning centered and 0 meaning DpadUp. + byte dpad_state = (byte)(inputReport[5] & 0x0F); switch (dpad_state) { @@ -446,17 +656,18 @@ namespace DS4Windows case 5: cState.DpadUp = false; cState.DpadDown = true; cState.DpadLeft = true; cState.DpadRight = false; break; case 6: cState.DpadUp = false; cState.DpadDown = false; cState.DpadLeft = true; cState.DpadRight = false; break; case 7: cState.DpadUp = true; cState.DpadDown = false; cState.DpadLeft = true; cState.DpadRight = false; break; - case 8: cState.DpadUp = false; cState.DpadDown = false; cState.DpadLeft = false; cState.DpadRight = false; break; + case 8: + default: cState.DpadUp = false; cState.DpadDown = false; cState.DpadLeft = false; cState.DpadRight = false; break; } - cState.R3 = ((byte)inputReport[6] & (1 << 7)) != 0; - cState.L3 = ((byte)inputReport[6] & (1 << 6)) != 0; - cState.Options = ((byte)inputReport[6] & (1 << 5)) != 0; - cState.Share = ((byte)inputReport[6] & (1 << 4)) != 0; - cState.R1 = ((byte)inputReport[6] & (1 << 1)) != 0; - cState.L1 = ((byte)inputReport[6] & (1 << 0)) != 0; + cState.R3 = (inputReport[6] & (1 << 7)) != 0; + cState.L3 = (inputReport[6] & (1 << 6)) != 0; + cState.Options = (inputReport[6] & (1 << 5)) != 0; + cState.Share = (inputReport[6] & (1 << 4)) != 0; + cState.R1 = (inputReport[6] & (1 << 1)) != 0; + cState.L1 = (inputReport[6] & (1 << 0)) != 0; - cState.PS = ((byte)inputReport[7] & (1 << 0)) != 0; + cState.PS = (inputReport[7] & (1 << 0)) != 0; cState.TouchButton = (inputReport[7] & (1 << 2 - 1)) != 0; cState.FrameCounter = (byte)(inputReport[7] >> 2); @@ -467,20 +678,26 @@ namespace DS4Windows try { - charging = (inputReport[30] & 0x10) != 0; - battery = (inputReport[30] & 0x0f) * 10; - cState.Battery = (byte)battery; + charging = (inputReport[30] & 0x10) != 0; + int maxBatteryValue = charging ? BATTERY_MAX_USB : BATTERY_MAX; + int tempBattery = (inputReport[30] & 0x0f) * 100 / maxBatteryValue; + battery = Math.Min((byte)tempBattery, (byte)100); + cState.Battery = (byte)battery; if (inputReport[30] != priorInputReport30) { priorInputReport30 = inputReport[30]; - Console.WriteLine(MacAddress.ToString() + " " + System.DateTime.UtcNow.ToString("o") + "> power subsystem octet: 0x" + inputReport[30].ToString("x02")); + //Console.WriteLine(MacAddress.ToString() + " " + System.DateTime.UtcNow.ToString("o") + "> power subsystem octet: 0x" + inputReport[30].ToString("x02")); } } catch { currerror = "Index out of bounds: battery"; } + // XXX DS4State mapping needs fixup, turn touches into an array[4] of structs. And include the touchpad details there instead. try { - for (int touches = inputReport[-1 + DS4Touchpad.TOUCHPAD_DATA_OFFSET - 1], touchOffset = 0; touches > 0; touches--, touchOffset += 9) + // Only care if one touch packet is detected. Other touch packets + // don't seem to contain relevant data. ds4drv does not use them either. + for (int touches = Math.Max((int)(inputReport[-1 + DS4Touchpad.TOUCHPAD_DATA_OFFSET - 1]), 1), touchOffset = 0; touches > 0; touches--, touchOffset += 9) + //for (int touches = inputReport[-1 + DS4Touchpad.TOUCHPAD_DATA_OFFSET - 1], touchOffset = 0; touches > 0; touches--, touchOffset += 9) { cState.TouchPacketCounter = inputReport[-1 + DS4Touchpad.TOUCHPAD_DATA_OFFSET + touchOffset]; cState.Touch1 = (inputReport[0 + DS4Touchpad.TOUCHPAD_DATA_OFFSET + touchOffset] >> 7) != 0 ? false : true; // >= 1 touch detected @@ -494,7 +711,7 @@ namespace DS4Windows } } catch { currerror = "Index out of bounds: touchpad"; } - + /* Debug output of incoming HID data: if (cState.L2 == 0xff && cState.R2 == 0xff) { @@ -503,31 +720,70 @@ namespace DS4Windows Console.Write(" " + inputReport[i].ToString("x2")); Console.WriteLine(); } */ - if (!isDS4Idle()) + + bool ds4Idle = cState.FrameCounter == pState.FrameCounter; + if (!ds4Idle) + { + isRemoved = false; + } + + if (conType == ConnectionType.USB) + { lastActive = utcNow; - if (conType == ConnectionType.BT) + } + else { bool shouldDisconnect = false; - if (IdleTimeout > 0) + int idleTime = idleTimeout; + if (!isRemoved && idleTime > 0) { - if (isDS4Idle()) + bool idleInput = isDS4Idle(); + if (idleInput) { - DateTime timeout = lastActive + TimeSpan.FromSeconds(IdleTimeout); - if (!Charging) + DateTime timeout = lastActive + TimeSpan.FromSeconds(idleTime); + if (!charging) shouldDisconnect = utcNow >= timeout; } + else + { + lastActive = utcNow; + } + } + else + { + lastActive = utcNow; + } + + if (shouldDisconnect) + { + if (conType == ConnectionType.BT) + { + if (DisconnectBT(true)) + return; // all done + } + else if (conType == ConnectionType.SONYWA) + { + DisconnectDongle(); + } } - if (shouldDisconnect && DisconnectBT()) - return; // all done } - // XXX fix initialization ordering so the null checks all go away + if (Report != null) Report(this, EventArgs.Empty); - sendOutputReport(false); + + bool syncWriteReport = true; + if (conType == ConnectionType.BT) + { + syncWriteReport = false; + } + sendOutputReport(syncWriteReport); + if (!string.IsNullOrEmpty(error)) error = string.Empty; + if (!string.IsNullOrEmpty(currerror)) - error = currerror; + error = currerror; + cState.CopyTo(pState); } } @@ -536,10 +792,12 @@ namespace DS4Windows { hDevice.flush_Queue(); } + private void sendOutputReport(bool synchronous) { setTestRumble(); setHapticState(); + if (conType == ConnectionType.BT) { outputReportBuffer[0] = 0x11; @@ -564,19 +822,29 @@ namespace DS4Windows outputReportBuffer[8] = LightBarColor.blue; //blue outputReportBuffer[9] = ledFlashOn; //flash on duration outputReportBuffer[10] = ledFlashOff; //flash off duration + if (conType == ConnectionType.SONYWA) + { + // Headphone volume levels + outputReportBuffer[19] = outputReportBuffer[20] = Convert.ToByte(audio.getVolume()); + // Microphone volume level + outputReportBuffer[21] = Convert.ToByte(micAudio.getVolume()); + } } + + bool quitOutputThread = false; + lock (outputReport) { if (synchronous) { + outputRumble = false; outputReportBuffer.CopyTo(outputReport, 0); try { if (!writeOutput()) { Console.WriteLine(MacAddress.ToString() + " " + System.DateTime.UtcNow.ToString("o") + "> encountered synchronous write failure: " + Marshal.GetLastWin32Error()); - ds4Output.Abort(); - ds4Output.Join(); + quitOutputThread = true; } } catch @@ -587,18 +855,25 @@ namespace DS4Windows else { bool output = false; - for (int i = 0; !output && i < outputReport.Length; i++) + for (int i = 0, arlen = outputReport.Length; !output && i < arlen; i++) output = outputReport[i] != outputReportBuffer[i]; + if (output) { + outputRumble = true; outputReportBuffer.CopyTo(outputReport, 0); Monitor.Pulse(outputReport); } } } + + if (quitOutputThread) + { + StopOutputUpdate(); + } } - public bool DisconnectBT() + public bool DisconnectBT(bool callRemoval = false) { if (Mac != null) { @@ -610,41 +885,97 @@ namespace DS4Windows string[] sbytes = Mac.Split(':'); for (int i = 0; i < 6; i++) { - //parse hex byte in reverse order + // parse hex byte in reverse order btAddr[5 - i] = Convert.ToByte(sbytes[i], 16); } + long lbtAddr = BitConverter.ToInt64(btAddr, 0); - NativeMethods.BLUETOOTH_FIND_RADIO_PARAMS p = new NativeMethods.BLUETOOTH_FIND_RADIO_PARAMS(); - p.dwSize = Marshal.SizeOf(typeof(NativeMethods.BLUETOOTH_FIND_RADIO_PARAMS)); - IntPtr searchHandle = NativeMethods.BluetoothFindFirstRadio(ref p, ref btHandle); - int bytesReturned = 0; bool success = false; - while (!success && btHandle != IntPtr.Zero) + // Wait for output report to be written + lock (outputReport) { - success = NativeMethods.DeviceIoControl(btHandle, IOCTL_BTH_DISCONNECT_DEVICE, ref lbtAddr, 8, IntPtr.Zero, 0, ref bytesReturned, IntPtr.Zero); - NativeMethods.CloseHandle(btHandle); - if (!success) - if (!NativeMethods.BluetoothFindNextRadio(searchHandle, ref btHandle)) - btHandle = IntPtr.Zero; + NativeMethods.BLUETOOTH_FIND_RADIO_PARAMS p = new NativeMethods.BLUETOOTH_FIND_RADIO_PARAMS(); + p.dwSize = Marshal.SizeOf(typeof(NativeMethods.BLUETOOTH_FIND_RADIO_PARAMS)); + IntPtr searchHandle = NativeMethods.BluetoothFindFirstRadio(ref p, ref btHandle); + int bytesReturned = 0; + while (!success && btHandle != IntPtr.Zero) + { + success = NativeMethods.DeviceIoControl(btHandle, IOCTL_BTH_DISCONNECT_DEVICE, ref lbtAddr, 8, IntPtr.Zero, 0, ref bytesReturned, IntPtr.Zero); + NativeMethods.CloseHandle(btHandle); + if (!success) + { + if (!NativeMethods.BluetoothFindNextRadio(searchHandle, ref btHandle)) + btHandle = IntPtr.Zero; + } + } + + NativeMethods.BluetoothFindRadioClose(searchHandle); + Console.WriteLine("Disconnect successful: " + success); } - NativeMethods.BluetoothFindRadioClose(searchHandle); - Console.WriteLine("Disconnect successful: " + success); + success = true; // XXX return value indicates failure, but it still works? - if(success) + if (success) { IsDisconnecting = true; StopOutputUpdate(); - if (Removal != null) - Removal(this, EventArgs.Empty); + + if (callRemoval) + { + uiContext.Send(new SendOrPostCallback(delegate (object state) + { + Removal?.Invoke(this, EventArgs.Empty); + }), null); + + //Removal?.Invoke(this, EventArgs.Empty); + } } + return success; } + return false; } + public bool DisconnectDongle(bool remove = false) + { + bool result = false; + byte[] disconnectReport = new byte[65]; + disconnectReport[0] = 0xe2; + disconnectReport[1] = 0x02; + Array.Clear(disconnectReport, 2, 63); + + lock (outputReport) + { + result = hDevice.WriteFeatureReport(disconnectReport); + } + + if (result && remove) + { + isDisconnecting = true; + StopOutputUpdate(); + + uiContext.Send(new SendOrPostCallback(delegate (object state4) + { + Removal?.Invoke(this, EventArgs.Empty); + }), null); + + /* + if (Removal != null) + Removal(this, EventArgs.Empty); + */ + } + else if (result && !remove) + { + isRemoved = true; + } + + return result; + } + private DS4HapticState testRumble = new DS4HapticState(); + public void setRumble(byte rightLightFastMotor, byte leftHeavySlowMotor) { testRumble.RumbleMotorStrengthRightLightFast = rightLightFastMotor; @@ -675,8 +1006,8 @@ namespace DS4Windows public void getExposedState(DS4StateExposed expState, DS4State state) { cState.CopyTo(state); - expState.Accel = accel; - expState.Gyro = gyro; + expState.setAccel(accel); + expState.setGyro(gyro); } public void getCurrentState(DS4State state) @@ -720,26 +1051,30 @@ namespace DS4Windows // Use the "most recently set" haptic state for each of light bar/motor. private void setHapticState() { - int i = 0; DS4Color lightBarColor = LightBarColor; byte lightBarFlashDurationOn = LightBarOnDuration, lightBarFlashDurationOff = LightBarOffDuration; byte rumbleMotorStrengthLeftHeavySlow = LeftHeavySlowRumble, rumbleMotorStrengthRightLightFast = rightLightFastRumble; - foreach (DS4HapticState haptic in hapticState) + int hapticLen = hapticState.Length; + for (int i=0; i < hapticLen; i++) { - if (i++ == hapticStackIndex) + DS4HapticState haptic = hapticState[i]; + if (i == hapticStackIndex) break; // rest haven't been used this time + if (haptic.IsLightBarSet()) { lightBarColor = haptic.LightBarColor; lightBarFlashDurationOn = haptic.LightBarFlashDurationOn; lightBarFlashDurationOff = haptic.LightBarFlashDurationOff; } + if (haptic.IsRumbleSet()) { rumbleMotorStrengthLeftHeavySlow = haptic.RumbleMotorStrengthLeftHeavySlow; rumbleMotorStrengthRightLightFast = haptic.RumbleMotorStrengthRightLightFast; } } + LightBarColor = lightBarColor; LightBarOnDuration = lightBarFlashDurationOn; LightBarOffDuration = lightBarFlashDurationOff; @@ -749,12 +1084,14 @@ namespace DS4Windows public void pushHapticState(DS4HapticState hs) { - if (hapticStackIndex == hapticState.Length) + int hapsLen = hapticState.Length; + if (hapticStackIndex == hapsLen) { - DS4HapticState[] newHaptics = new DS4HapticState[hapticState.Length + 1]; - Array.Copy(hapticState, newHaptics, hapticState.Length); + DS4HapticState[] newHaptics = new DS4HapticState[hapsLen + 1]; + Array.Copy(hapticState, newHaptics, hapsLen); hapticState = newHaptics; } + hapticState[hapticStackIndex++] = hs; } @@ -763,5 +1100,15 @@ namespace DS4Windows { return Mac; } + + public void runRemoval() + { + Removal?.Invoke(this, EventArgs.Empty); + } + + public void removeReportHandlers() + { + this.Report = null; + } } } diff --git a/DS4Windows/DS4Library/DS4Devices.cs b/DS4Windows/DS4Library/DS4Devices.cs index 5e7be1b..33015da 100644 --- a/DS4Windows/DS4Library/DS4Devices.cs +++ b/DS4Windows/DS4Library/DS4Devices.cs @@ -23,10 +23,11 @@ namespace DS4Windows { deviceInstanceId = deviceInstanceId.Remove(deviceInstanceId.Length - 1); } + return deviceInstanceId; } - //enumerates ds4 controllers in the system + // enumerates ds4 controllers in the system public static void findControllers() { lock (Devices) @@ -36,10 +37,18 @@ namespace DS4Windows // Sort Bluetooth first in case USB is also connected on the same controller. hDevices = hDevices.OrderBy((HidDevice d) => { return DS4Device.HidConnectionType(d); }); - foreach (HidDevice hDevice in hDevices) + List tempList = hDevices.ToList(); + int devCount = tempList.Count(); + string devicePlural = "device" + (devCount == 0 || devCount > 1 ? "s" : ""); + //Log.LogToGui("Found " + devCount + " possible " + devicePlural + ". Examining " + devicePlural + ".", false); + + for (int i = 0; i < devCount; i++) + //foreach (HidDevice hDevice in hDevices) { + HidDevice hDevice = tempList[i]; if (DevicePaths.Contains(hDevice.DevicePath)) continue; // BT/USB endpoint already open once + if (!hDevice.IsOpen) { hDevice.OpenDevice(isExclusiveMode); @@ -59,6 +68,7 @@ namespace DS4Windows startInfo.Verb = "runas"; startInfo.Arguments = "re-enabledevice " + devicePathToInstanceId(hDevice.DevicePath); Process child = Process.Start(startInfo); + if (!child.WaitForExit(5000)) { child.Kill(); @@ -81,21 +91,22 @@ namespace DS4Windows if (isExclusiveMode && !hDevice.IsOpen) hDevice.OpenDevice(false); } + if (hDevice.IsOpen) { - if (Devices.ContainsKey(hDevice.readSerial())) + string serial = hDevice.readSerial(); + bool validSerial = !serial.Equals("00:00:00:00:00:00"); + if (Devices.ContainsKey(serial)) continue; // happens when the BT endpoint already is open and the USB is plugged into the same host else { DS4Device ds4Device = new DS4Device(hDevice); - ds4Device.Removal += On_Removal; + //ds4Device.Removal += On_Removal; Devices.Add(ds4Device.MacAddress, ds4Device); DevicePaths.Add(hDevice.DevicePath); - ds4Device.StartUpdate(); } } } - } } @@ -131,11 +142,15 @@ namespace DS4Windows lock (Devices) { IEnumerable devices = getDS4Controllers(); - foreach (DS4Device device in devices) + //foreach (DS4Device device in devices) + for (int i = 0, devCount = devices.Count(); i < devCount; i++) { + DS4Device device = devices.ElementAt(i); device.StopUpdate(); + //device.runRemoval(); device.HidDevice.CloseDevice(); } + Devices.Clear(); DevicePaths.Clear(); } @@ -188,6 +203,9 @@ namespace DS4Windows { throw new Exception("Error disabling device, error code = " + Marshal.GetLastWin32Error()); } + + System.Threading.Thread.Sleep(50); + propChangeParams.stateChange = NativeMethods.DICS_ENABLE; success = NativeMethods.SetupDiSetClassInstallParams(deviceInfoSet, ref deviceInfoData, ref propChangeParams, Marshal.SizeOf(propChangeParams)); if (!success) diff --git a/DS4Windows/DS4Library/DS4Sixaxis.cs b/DS4Windows/DS4Library/DS4Sixaxis.cs index 8777d34..bed25c0 100644 --- a/DS4Windows/DS4Library/DS4Sixaxis.cs +++ b/DS4Windows/DS4Library/DS4Sixaxis.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace DS4Windows { diff --git a/DS4Windows/DS4Library/DS4State.cs b/DS4Windows/DS4Library/DS4State.cs index 421fc2b..80a2994 100644 --- a/DS4Windows/DS4Library/DS4State.cs +++ b/DS4Windows/DS4Library/DS4State.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; namespace DS4Windows { @@ -17,6 +14,9 @@ namespace DS4Windows public byte FrameCounter; // 0, 1, 2...62, 63, 0.... public byte TouchPacketCounter; // we break these out automatically public byte Battery; // 0 for charging, 10/20/30/40/50/60/70/80/90/100 for percentage of full + public double LSAngle; // Calculated bearing of the LS X,Y coordinates + public double RSAngle; // Calculated bearing of the RS X,Y coordinates + public static readonly int DEFAULT_AXISDIR_VALUE = 127; public DS4State() { @@ -29,6 +29,8 @@ namespace DS4Windows FrameCounter = 255; // only actually has 6 bits, so this is a null indicator TouchPacketCounter = 255; // 8 bits, no great junk value Battery = 0; + LSAngle = 0.0; + RSAngle = 0.0; } public DS4State(DS4State state) @@ -65,6 +67,8 @@ namespace DS4Windows RY = state.RY; FrameCounter = state.FrameCounter; Battery = state.Battery; + LSAngle = state.LSAngle; + RSAngle = state.RSAngle; } public DS4State Clone() @@ -106,7 +110,19 @@ namespace DS4Windows state.RY = RY; state.FrameCounter = FrameCounter; state.Battery = Battery; + state.LSAngle = LSAngle; + state.RSAngle = RSAngle; } + public void calculateStickAngles() + { + double lsangle = Math.Atan2((LX - 127), -(LY - 127)); + lsangle = (lsangle >= 0 ? lsangle : (2 * Math.PI + lsangle)) * 180 / Math.PI; + LSAngle = lsangle; + + double rsangle = Math.Atan2((RX - 127), -(RY - 127)); + rsangle = (rsangle >= 0 ? rsangle : (2 * Math.PI + rsangle)) * 180 / Math.PI; + RSAngle = rsangle; + } } } diff --git a/DS4Windows/DS4Library/DS4StateExposed.cs b/DS4Windows/DS4Library/DS4StateExposed.cs index f69dedd..c51cf85 100644 --- a/DS4Windows/DS4Library/DS4StateExposed.cs +++ b/DS4Windows/DS4Library/DS4StateExposed.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - + namespace DS4Windows { public class DS4StateExposed @@ -48,8 +44,17 @@ namespace DS4Windows /// Holds raw DS4 input data from 14 to 19 public byte[] Accel { set { accel = value; } } + public void setAccel(byte[] value) + { + accel = value; + } + /// Holds raw DS4 input data from 20 to 25 public byte[] Gyro { set { gyro = value; } } + public void setGyro(byte[] value) + { + gyro = value; + } /// Yaw leftward/counter-clockwise/turn to port or larboard side /// Add double the previous result to this delta and divide by three. @@ -63,11 +68,28 @@ namespace DS4Windows /// R side of controller upward /// Add double the previous result to this delta and divide by three. public int GyroX { get { return (short)((ushort)(gyro[0] << 8) | gyro[1]) / 64; } } + + public int getGyroX() + { + return (short)((ushort)(gyro[0] << 8) | gyro[1]) / 64; + } + /// touchpad and button face side of controller upward /// Add double the previous result to this delta and divide by three. public int GyroY { get { return (short)((ushort)(gyro[2] << 8) | gyro[3]) / 64; } } + + public int getGyroY() + { + return (short)((ushort)(gyro[2] << 8) | gyro[3]) / 64; + } + /// Audio/expansion ports upward and light bar/shoulders/bumpers/USB port downward /// Add double the previous result to this delta and divide by three. - public int GyroZ { get { return (short)((ushort)(gyro[4] << 8) | gyro[5]) / 64; } } + public int GyroZ { get { return (short)((ushort)(gyro[4] << 8) | gyro[5]) / 64; } } + + public int getGyroZ() + { + return (short)((ushort)(gyro[4] << 8) | gyro[5]) / 64; + } } } diff --git a/DS4Windows/DS4Library/DS4Touchpad.cs b/DS4Windows/DS4Library/DS4Touchpad.cs index 104b3a4..b1b271a 100644 --- a/DS4Windows/DS4Library/DS4Touchpad.cs +++ b/DS4Windows/DS4Library/DS4Touchpad.cs @@ -1,8 +1,5 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Runtime.InteropServices; + namespace DS4Windows { public class TouchpadEventArgs : EventArgs diff --git a/DS4Windows/DS4Windows.csproj b/DS4Windows/DS4Windows.csproj index 1bc2b7e..07dfdc7 100644 --- a/DS4Windows/DS4Windows.csproj +++ b/DS4Windows/DS4Windows.csproj @@ -30,9 +30,12 @@ pdbonly true bin\Release\ - TRACE + + prompt 4 + false + false DS4Windows.Program @@ -52,7 +55,33 @@ app.manifest + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + + + bin\x64\Release\ + true + pdbonly + x64 + false + prompt + MinimumRecommendedRules.ruleset + + + ..\packages\TaskScheduler.2.5.23\lib\net40\JetBrains.Annotations.dll + True + + + ..\packages\TaskScheduler.2.5.23\lib\net40\Microsoft.Win32.TaskScheduler.dll + True + @@ -72,6 +101,7 @@ + @@ -98,6 +128,7 @@ X360Device.cs + @@ -1004,6 +1035,7 @@ + SettingsSingleFileGenerator Settings.Designer.cs @@ -1034,7 +1066,7 @@ - + @@ -1117,6 +1149,7 @@ + - -
- - -
All repositories
-
- - - - - - - - - - - - - - - - - - - - - - -
- -
-
- - - - -

- public - - - - - / - HidLibrary - - - Octocat-spinner-32 - - -

-
-
- -
- - -
- -
- - - - -
- - - - -
-

HTTPS clone URL

-
- - - -
-
- - - -
-

Subversion checkout URL

-
- - - -
-
- - -

You can clone with - HTTPS, - or Subversion. - - - - - -

- - - - - Clone in Desktop - - - - - Download ZIP - -
-
- -
- - - - - - - - - -
- - -
- - - branch: - master - - -
- -
-
- Switch branches/tags - -
- -
-
- -
-
- -
-
- -
- -
- - -
- - master -
-
- -
Nothing to show
-
- -
-
- - -
- - v3.2.23.0 -
-
- - v3.2.22.0 -
-
- - v3.2.20.0 -
-
- - v3.2.19.0 -
-
- - v3.2.18.0 -
-
- - v3.2.17.0 -
-
- - v3.2.16.0 -
-
- - v3.2.12.0 -
-
- - v3.2.11.0 -
-
- - v3.2.10.0 -
-
- - v3.2.9.0 -
-
- - v3.2.8.0 -
-
- - v3.2.7.0 -
-
- - v3.2.6.0 -
-
- - v3.2.5.0 -
-
- - v3.2.4.0 -
-
- - v3.2.3.0 -
-
- - v3.0.5 -
- -
- -
Nothing to show
-
- -
-
-
- - -
- - - -
- - - - - - - -
- -
-
-
-
- - file - 18 lines (15 sloc) - 1.094 kb -
- - -
-
- - - - - -
- 1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 - - -
Copyright (c) 2010 Ultraviolet Catastrophe

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
- -
-
- - - - -
- -
- -
-
- - - - -
- -
- - -
-
-
- -
-
-
-
-
-
- -
- - - -
- - - Something went wrong with that request. Please try again. -
- - - - diff --git a/DS4Windows/HidLibrary/NativeMethods.cs b/DS4Windows/HidLibrary/NativeMethods.cs index 7a9b25c..7af70cc 100644 --- a/DS4Windows/HidLibrary/NativeMethods.cs +++ b/DS4Windows/HidLibrary/NativeMethods.cs @@ -74,10 +74,10 @@ namespace DS4Windows static internal extern IntPtr CreateEvent(ref SECURITY_ATTRIBUTES securityAttributes, int bManualReset, int bInitialState, string lpName); [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] - static internal extern IntPtr CreateFile(string lpFileName, uint dwDesiredAccess, int dwShareMode, ref SECURITY_ATTRIBUTES lpSecurityAttributes, int dwCreationDisposition, int dwFlagsAndAttributes, int hTemplateFile); + static internal extern IntPtr CreateFile(string lpFileName, uint dwDesiredAccess, int dwShareMode, ref SECURITY_ATTRIBUTES lpSecurityAttributes, int dwCreationDisposition, uint dwFlagsAndAttributes, int hTemplateFile); [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] - internal static extern SafeFileHandle CreateFile(String lpFileName, UInt32 dwDesiredAccess, Int32 dwShareMode, IntPtr lpSecurityAttributes, Int32 dwCreationDisposition, Int32 dwFlagsAndAttributes, Int32 hTemplateFile); + internal static extern SafeFileHandle CreateFile(String lpFileName, UInt32 dwDesiredAccess, Int32 dwShareMode, IntPtr lpSecurityAttributes, Int32 dwCreationDisposition, UInt32 dwFlagsAndAttributes, Int32 hTemplateFile); [DllImport("kernel32.dll", SetLastError = true)] static internal extern bool ReadFile(IntPtr hFile, [Out] byte[] lpBuffer, uint nNumberOfBytesToRead, out uint lpNumberOfBytesRead, IntPtr lpOverlapped); diff --git a/DS4Windows/Program.cs b/DS4Windows/Program.cs index b03b573..f7df57a 100644 --- a/DS4Windows/Program.cs +++ b/DS4Windows/Program.cs @@ -5,6 +5,7 @@ using System.Runtime.InteropServices; using System.Diagnostics; using System.ComponentModel; using System.Globalization; +using Microsoft.Win32.TaskScheduler; namespace DS4Windows { @@ -32,7 +33,7 @@ namespace DS4Windows static void Main(string[] args) { //Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("he"); - for (int i = 0; i < args.Length; i++) + for (int i = 0, argsLen = args.Length; i < argsLen; i++) { string s = args[i]; if (s == "driverinstall" || s == "-driverinstall") @@ -58,8 +59,21 @@ namespace DS4Windows return; } } + else if (s == "runtask" || s == "-runtask") + { + TaskService ts = new TaskService(); + Task tasker = ts.FindTask("RunDS4Windows"); + if (tasker != null) + { + tasker.Run(""); + } + + Environment.ExitCode = 0; + return; + } } System.Runtime.GCSettings.LatencyMode = System.Runtime.GCLatencyMode.LowLatency; + try { Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.High; @@ -68,6 +82,7 @@ namespace DS4Windows { // Ignore problems raising the priority. } + try { // another instance is already running if OpenExsting succeeds. @@ -77,6 +92,7 @@ namespace DS4Windows return; // return immediatly. } catch { /* don't care about errors */ } + // Create the Event handle threadComEvent = new EventWaitHandle(false, EventResetMode.AutoReset, SingleAppComEventName); CreateInterAppComThread(); diff --git a/DS4Windows/Properties/AssemblyInfo.cs b/DS4Windows/Properties/AssemblyInfo.cs index 89532d7..e37bdcd 100644 --- a/DS4Windows/Properties/AssemblyInfo.cs +++ b/DS4Windows/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("DS4Windows")] -[assembly: AssemblyCopyright("Copyright © Scarlet.Crush Productions 2012, 2013; InhexSTER, HecticSeptic, electrobrains 2013, 2014; Jays2Kings 2013, 2014, 2015")] +[assembly: AssemblyCopyright("Copyright © Scarlet.Crush Productions 2012, 2013; InhexSTER, HecticSeptic, electrobrains 2013, 2014; Jays2Kings 2013, 2014, 2015, 2016; Ryochan7 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.4.52")] -[assembly: AssemblyFileVersion("1.4.52")] +[assembly: AssemblyVersion("1.4.69")] +[assembly: AssemblyFileVersion("1.4.69")] diff --git a/DS4Windows/Properties/Resources.Designer.cs b/DS4Windows/Properties/Resources.Designer.cs index 8c205c4..2f2b429 100644 --- a/DS4Windows/Properties/Resources.Designer.cs +++ b/DS4Windows/Properties/Resources.Designer.cs @@ -293,7 +293,7 @@ namespace DS4Windows.Properties { } /// - /// Looks up a localized string similar to Color by Battey %. + /// Looks up a localized string similar to Color by Battery %. /// internal static string ColorByBattery { get { @@ -412,7 +412,7 @@ namespace DS4Windows.Properties { } /// - /// Looks up a localized string similar to Dim by Battey %. + /// Looks up a localized string similar to Dim by Battery %. /// internal static string DimByBattery { get { @@ -1573,6 +1573,15 @@ namespace DS4Windows.Properties { } } + /// + /// Looks up a localized string similar to Tells Windows to start DS4Windows after login. + /// + internal static string RunAtStartup { + get { + return ResourceManager.GetString("RunAtStartup", resourceCulture); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -1945,6 +1954,15 @@ namespace DS4Windows.Properties { } } + /// + /// Looks up a localized string similar to You need to run DS4Windows as the Administrator in order to activate this mode.. + /// + internal static string UACTask { + get { + return ResourceManager.GetString("UACTask", resourceCulture); + } + } + /// /// Looks up a localized string similar to Unassigned. /// diff --git a/DS4Windows/Properties/Resources.resx b/DS4Windows/Properties/Resources.resx index 2cc05e5..537f0e0 100644 --- a/DS4Windows/Properties/Resources.resx +++ b/DS4Windows/Properties/Resources.resx @@ -263,7 +263,7 @@ Charging: *number*%
- Color by Battey % + Color by Battery % Connecting... @@ -296,7 +296,7 @@ Delete Profile? - Dim by Battey % + Dim by Battery % Disconnected @@ -775,4 +775,10 @@ Select a macro + + Tells Windows to start DS4Windows after login + + + You need to run DS4Windows as the Administrator in order to activate this mode. + \ No newline at end of file diff --git a/DS4Windows/Resources/360 fades.png b/DS4Windows/Resources/360 fades.png index 032d3f6..c48499f 100644 Binary files a/DS4Windows/Resources/360 fades.png and b/DS4Windows/Resources/360 fades.png differ diff --git a/DS4Windows/Resources/360 highlight.png b/DS4Windows/Resources/360 highlight.png index 6292511..1086194 100644 Binary files a/DS4Windows/Resources/360 highlight.png and b/DS4Windows/Resources/360 highlight.png differ diff --git a/DS4Windows/Resources/360 map.png b/DS4Windows/Resources/360 map.png index d3e5541..35dc214 100644 Binary files a/DS4Windows/Resources/360 map.png and b/DS4Windows/Resources/360 map.png differ diff --git a/DS4Windows/Resources/A.PNG b/DS4Windows/Resources/A.PNG index 466257a..832ad09 100644 Binary files a/DS4Windows/Resources/A.PNG and b/DS4Windows/Resources/A.PNG differ diff --git a/DS4Windows/Resources/B.png b/DS4Windows/Resources/B.png index 9399fdf..32b5131 100644 Binary files a/DS4Windows/Resources/B.png and b/DS4Windows/Resources/B.png differ diff --git a/DS4Windows/Resources/BACK.png b/DS4Windows/Resources/BACK.png index 16f6f7b..ef4032a 100644 Binary files a/DS4Windows/Resources/BACK.png and b/DS4Windows/Resources/BACK.png differ diff --git a/DS4Windows/Resources/BT.png b/DS4Windows/Resources/BT.png index f94a35d..13d127e 100644 Binary files a/DS4Windows/Resources/BT.png and b/DS4Windows/Resources/BT.png differ diff --git a/DS4Windows/Resources/Clock.png b/DS4Windows/Resources/Clock.png index bf09e33..33865ef 100644 Binary files a/DS4Windows/Resources/Clock.png and b/DS4Windows/Resources/Clock.png differ diff --git a/DS4Windows/Resources/DOWN.png b/DS4Windows/Resources/DOWN.png index 9240c46..070306f 100644 Binary files a/DS4Windows/Resources/DOWN.png and b/DS4Windows/Resources/DOWN.png differ diff --git a/DS4Windows/Resources/DS4 Config.png b/DS4Windows/Resources/DS4 Config.png index 807bee6..7a2eaa1 100644 Binary files a/DS4Windows/Resources/DS4 Config.png and b/DS4Windows/Resources/DS4 Config.png differ diff --git a/DS4Windows/Resources/DS4 Controller.png b/DS4Windows/Resources/DS4 Controller.png index 43af0ac..03f472b 100644 Binary files a/DS4Windows/Resources/DS4 Controller.png and b/DS4Windows/Resources/DS4 Controller.png differ diff --git a/DS4Windows/Resources/DS4 lightbar.png b/DS4Windows/Resources/DS4 lightbar.png index eac7853..ad9eb7c 100644 Binary files a/DS4Windows/Resources/DS4 lightbar.png and b/DS4Windows/Resources/DS4 lightbar.png differ diff --git a/DS4Windows/Resources/DS4 old.ico b/DS4Windows/Resources/DS4 old.ico index 6f5f022..0fe68b3 100644 Binary files a/DS4Windows/Resources/DS4 old.ico and b/DS4Windows/Resources/DS4 old.ico differ diff --git a/DS4Windows/Resources/DS4-Config_Circle.png b/DS4Windows/Resources/DS4-Config_Circle.png index f4913b6..03e5775 100644 Binary files a/DS4Windows/Resources/DS4-Config_Circle.png and b/DS4Windows/Resources/DS4-Config_Circle.png differ diff --git a/DS4Windows/Resources/DS4-Config_Cross.png b/DS4Windows/Resources/DS4-Config_Cross.png index 378ca40..98c876b 100644 Binary files a/DS4Windows/Resources/DS4-Config_Cross.png and b/DS4Windows/Resources/DS4-Config_Cross.png differ diff --git a/DS4Windows/Resources/DS4-Config_Down.png b/DS4Windows/Resources/DS4-Config_Down.png index 1ebe5de..884760c 100644 Binary files a/DS4Windows/Resources/DS4-Config_Down.png and b/DS4Windows/Resources/DS4-Config_Down.png differ diff --git a/DS4Windows/Resources/DS4-Config_L1.png b/DS4Windows/Resources/DS4-Config_L1.png index 58e4f91..f1e92b9 100644 Binary files a/DS4Windows/Resources/DS4-Config_L1.png and b/DS4Windows/Resources/DS4-Config_L1.png differ diff --git a/DS4Windows/Resources/DS4-Config_L2.png b/DS4Windows/Resources/DS4-Config_L2.png index 0576f1c..8120d59 100644 Binary files a/DS4Windows/Resources/DS4-Config_L2.png and b/DS4Windows/Resources/DS4-Config_L2.png differ diff --git a/DS4Windows/Resources/DS4-Config_LS.png b/DS4Windows/Resources/DS4-Config_LS.png index 7f493a0..fa2b462 100644 Binary files a/DS4Windows/Resources/DS4-Config_LS.png and b/DS4Windows/Resources/DS4-Config_LS.png differ diff --git a/DS4Windows/Resources/DS4-Config_Left.png b/DS4Windows/Resources/DS4-Config_Left.png index 1f0b30f..a902978 100644 Binary files a/DS4Windows/Resources/DS4-Config_Left.png and b/DS4Windows/Resources/DS4-Config_Left.png differ diff --git a/DS4Windows/Resources/DS4-Config_PS.png b/DS4Windows/Resources/DS4-Config_PS.png index 39b8529..b2ab33f 100644 Binary files a/DS4Windows/Resources/DS4-Config_PS.png and b/DS4Windows/Resources/DS4-Config_PS.png differ diff --git a/DS4Windows/Resources/DS4-Config_R1.png b/DS4Windows/Resources/DS4-Config_R1.png index 9ec47cb..084b72d 100644 Binary files a/DS4Windows/Resources/DS4-Config_R1.png and b/DS4Windows/Resources/DS4-Config_R1.png differ diff --git a/DS4Windows/Resources/DS4-Config_R2.png b/DS4Windows/Resources/DS4-Config_R2.png index fafec62..609b1fc 100644 Binary files a/DS4Windows/Resources/DS4-Config_R2.png and b/DS4Windows/Resources/DS4-Config_R2.png differ diff --git a/DS4Windows/Resources/DS4-Config_RS.png b/DS4Windows/Resources/DS4-Config_RS.png index 926ccd0..2bca24e 100644 Binary files a/DS4Windows/Resources/DS4-Config_RS.png and b/DS4Windows/Resources/DS4-Config_RS.png differ diff --git a/DS4Windows/Resources/DS4-Config_Right.png b/DS4Windows/Resources/DS4-Config_Right.png index 40d5307..5d33a9e 100644 Binary files a/DS4Windows/Resources/DS4-Config_Right.png and b/DS4Windows/Resources/DS4-Config_Right.png differ diff --git a/DS4Windows/Resources/DS4-Config_Share.png b/DS4Windows/Resources/DS4-Config_Share.png index 58f5d2f..0b2833c 100644 Binary files a/DS4Windows/Resources/DS4-Config_Share.png and b/DS4Windows/Resources/DS4-Config_Share.png differ diff --git a/DS4Windows/Resources/DS4-Config_Square.png b/DS4Windows/Resources/DS4-Config_Square.png index 0da65c5..14402c0 100644 Binary files a/DS4Windows/Resources/DS4-Config_Square.png and b/DS4Windows/Resources/DS4-Config_Square.png differ diff --git a/DS4Windows/Resources/DS4-Config_TouchLeft.png b/DS4Windows/Resources/DS4-Config_TouchLeft.png index bb34548..a058cb9 100644 Binary files a/DS4Windows/Resources/DS4-Config_TouchLeft.png and b/DS4Windows/Resources/DS4-Config_TouchLeft.png differ diff --git a/DS4Windows/Resources/DS4-Config_TouchMulti.png b/DS4Windows/Resources/DS4-Config_TouchMulti.png index 60467c9..f5ccc71 100644 Binary files a/DS4Windows/Resources/DS4-Config_TouchMulti.png and b/DS4Windows/Resources/DS4-Config_TouchMulti.png differ diff --git a/DS4Windows/Resources/DS4-Config_TouchRight.png b/DS4Windows/Resources/DS4-Config_TouchRight.png index ea321ce..e71ff10 100644 Binary files a/DS4Windows/Resources/DS4-Config_TouchRight.png and b/DS4Windows/Resources/DS4-Config_TouchRight.png differ diff --git a/DS4Windows/Resources/DS4-Config_TouchUpper.png b/DS4Windows/Resources/DS4-Config_TouchUpper.png index 7e3dd28..73555cf 100644 Binary files a/DS4Windows/Resources/DS4-Config_TouchUpper.png and b/DS4Windows/Resources/DS4-Config_TouchUpper.png differ diff --git a/DS4Windows/Resources/DS4-Config_Triangle.png b/DS4Windows/Resources/DS4-Config_Triangle.png index c730dcd..42d7c21 100644 Binary files a/DS4Windows/Resources/DS4-Config_Triangle.png and b/DS4Windows/Resources/DS4-Config_Triangle.png differ diff --git a/DS4Windows/Resources/DS4-Config_Up.png b/DS4Windows/Resources/DS4-Config_Up.png index 7d3dbde..d674491 100644 Binary files a/DS4Windows/Resources/DS4-Config_Up.png and b/DS4Windows/Resources/DS4-Config_Up.png differ diff --git a/DS4Windows/Resources/DS4-Config_ptionss.png b/DS4Windows/Resources/DS4-Config_ptionss.png index f847232..0b2833c 100644 Binary files a/DS4Windows/Resources/DS4-Config_ptionss.png and b/DS4Windows/Resources/DS4-Config_ptionss.png differ diff --git a/DS4Windows/Resources/DS4.ico b/DS4Windows/Resources/DS4.ico index 3c1b364..c681299 100644 Binary files a/DS4Windows/Resources/DS4.ico and b/DS4Windows/Resources/DS4.ico differ diff --git a/DS4Windows/Resources/DS4W - White.ico b/DS4Windows/Resources/DS4W - White.ico index c7dee8c..cf069c7 100644 Binary files a/DS4Windows/Resources/DS4W - White.ico and b/DS4Windows/Resources/DS4W - White.ico differ diff --git a/DS4Windows/Resources/DS4W.ico b/DS4Windows/Resources/DS4W.ico index f75e9aa..e7c64ba 100644 Binary files a/DS4Windows/Resources/DS4W.ico and b/DS4Windows/Resources/DS4W.ico differ diff --git a/DS4Windows/Resources/LB.png b/DS4Windows/Resources/LB.png index 7bb306a..f5b89fe 100644 Binary files a/DS4Windows/Resources/LB.png and b/DS4Windows/Resources/LB.png differ diff --git a/DS4Windows/Resources/LEFT.png b/DS4Windows/Resources/LEFT.png index 6b3af2a..9352692 100644 Binary files a/DS4Windows/Resources/LEFT.png and b/DS4Windows/Resources/LEFT.png differ diff --git a/DS4Windows/Resources/LS.png b/DS4Windows/Resources/LS.png index 19b2f70..c534516 100644 Binary files a/DS4Windows/Resources/LS.png and b/DS4Windows/Resources/LS.png differ diff --git a/DS4Windows/Resources/LSD.png b/DS4Windows/Resources/LSD.png index f0c9c0d..12d4020 100644 Binary files a/DS4Windows/Resources/LSD.png and b/DS4Windows/Resources/LSD.png differ diff --git a/DS4Windows/Resources/LSL.png b/DS4Windows/Resources/LSL.png index 50b7161..a42cd5e 100644 Binary files a/DS4Windows/Resources/LSL.png and b/DS4Windows/Resources/LSL.png differ diff --git a/DS4Windows/Resources/LSR.png b/DS4Windows/Resources/LSR.png index 8b6d4bf..61f1f77 100644 Binary files a/DS4Windows/Resources/LSR.png and b/DS4Windows/Resources/LSR.png differ diff --git a/DS4Windows/Resources/LSU.png b/DS4Windows/Resources/LSU.png index c664852..6c3ea44 100644 Binary files a/DS4Windows/Resources/LSU.png and b/DS4Windows/Resources/LSU.png differ diff --git a/DS4Windows/Resources/LT.png b/DS4Windows/Resources/LT.png index fa4acc3..c272289 100644 Binary files a/DS4Windows/Resources/LT.png and b/DS4Windows/Resources/LT.png differ diff --git a/DS4Windows/Resources/Pairmode.png b/DS4Windows/Resources/Pairmode.png index 8ff4eaa..2128c17 100644 Binary files a/DS4Windows/Resources/Pairmode.png and b/DS4Windows/Resources/Pairmode.png differ diff --git a/DS4Windows/Resources/RB.png b/DS4Windows/Resources/RB.png index 24cc39e..16a31ab 100644 Binary files a/DS4Windows/Resources/RB.png and b/DS4Windows/Resources/RB.png differ diff --git a/DS4Windows/Resources/RIGHT.png b/DS4Windows/Resources/RIGHT.png index 705f533..a916888 100644 Binary files a/DS4Windows/Resources/RIGHT.png and b/DS4Windows/Resources/RIGHT.png differ diff --git a/DS4Windows/Resources/RS.png b/DS4Windows/Resources/RS.png index 490b74b..215133a 100644 Binary files a/DS4Windows/Resources/RS.png and b/DS4Windows/Resources/RS.png differ diff --git a/DS4Windows/Resources/RSD.png b/DS4Windows/Resources/RSD.png index 3edfe29..9a477c7 100644 Binary files a/DS4Windows/Resources/RSD.png and b/DS4Windows/Resources/RSD.png differ diff --git a/DS4Windows/Resources/RSL.png b/DS4Windows/Resources/RSL.png index 5be6c39..b0e5d0e 100644 Binary files a/DS4Windows/Resources/RSL.png and b/DS4Windows/Resources/RSL.png differ diff --git a/DS4Windows/Resources/RSR.png b/DS4Windows/Resources/RSR.png index e178fba..1b9c8de 100644 Binary files a/DS4Windows/Resources/RSR.png and b/DS4Windows/Resources/RSR.png differ diff --git a/DS4Windows/Resources/RSU.png b/DS4Windows/Resources/RSU.png index 874c526..8a8f19a 100644 Binary files a/DS4Windows/Resources/RSU.png and b/DS4Windows/Resources/RSU.png differ diff --git a/DS4Windows/Resources/RT.png b/DS4Windows/Resources/RT.png index 115b05f..fff6cd6 100644 Binary files a/DS4Windows/Resources/RT.png and b/DS4Windows/Resources/RT.png differ diff --git a/DS4Windows/Resources/Red Circle.png b/DS4Windows/Resources/Red Circle.png index 84fc5e9..5ea845d 100644 Binary files a/DS4Windows/Resources/Red Circle.png and b/DS4Windows/Resources/Red Circle.png differ diff --git a/DS4Windows/Resources/START.png b/DS4Windows/Resources/START.png index c1820b4..ea5b53b 100644 Binary files a/DS4Windows/Resources/START.png and b/DS4Windows/Resources/START.png differ diff --git a/DS4Windows/Resources/Scp_All.ico b/DS4Windows/Resources/Scp_All.ico index b94efc8..7f1b3cb 100644 Binary files a/DS4Windows/Resources/Scp_All.ico and b/DS4Windows/Resources/Scp_All.ico differ diff --git a/DS4Windows/Resources/UP.png b/DS4Windows/Resources/UP.png index c77b541..32b588b 100644 Binary files a/DS4Windows/Resources/UP.png and b/DS4Windows/Resources/UP.png differ diff --git a/DS4Windows/Resources/USB.png b/DS4Windows/Resources/USB.png index b0c07bf..9c1fbfc 100644 Binary files a/DS4Windows/Resources/USB.png and b/DS4Windows/Resources/USB.png differ diff --git a/DS4Windows/Resources/UpperTouch.png b/DS4Windows/Resources/UpperTouch.png index 94ee8a2..bdad526 100644 Binary files a/DS4Windows/Resources/UpperTouch.png and b/DS4Windows/Resources/UpperTouch.png differ diff --git a/DS4Windows/Resources/X.png b/DS4Windows/Resources/X.png index dc92bc6..5455d28 100644 Binary files a/DS4Windows/Resources/X.png and b/DS4Windows/Resources/X.png differ diff --git a/DS4Windows/Resources/Y.png b/DS4Windows/Resources/Y.png index 76f1e0a..d271c49 100644 Binary files a/DS4Windows/Resources/Y.png and b/DS4Windows/Resources/Y.png differ diff --git a/DS4Windows/Resources/checked.png b/DS4Windows/Resources/checked.png index c059fc2..517ea21 100644 Binary files a/DS4Windows/Resources/checked.png and b/DS4Windows/Resources/checked.png differ diff --git a/DS4Windows/Resources/delete.png b/DS4Windows/Resources/delete.png index e2d2379..b58d0a9 100644 Binary files a/DS4Windows/Resources/delete.png and b/DS4Windows/Resources/delete.png differ diff --git a/DS4Windows/Resources/export.png b/DS4Windows/Resources/export.png index 6104cfb..66a3bf7 100644 Binary files a/DS4Windows/Resources/export.png and b/DS4Windows/Resources/export.png differ diff --git a/DS4Windows/Resources/imageres_import.png b/DS4Windows/Resources/imageres_import.png index 4245de1..a6e6520 100644 Binary files a/DS4Windows/Resources/imageres_import.png and b/DS4Windows/Resources/imageres_import.png differ diff --git a/DS4Windows/Resources/imageres_new.png b/DS4Windows/Resources/imageres_new.png index 7bc1970..b2a9f34 100644 Binary files a/DS4Windows/Resources/imageres_new.png and b/DS4Windows/Resources/imageres_new.png differ diff --git a/DS4Windows/Resources/left touch.png b/DS4Windows/Resources/left touch.png index 4c94c36..0aa8f8f 100644 Binary files a/DS4Windows/Resources/left touch.png and b/DS4Windows/Resources/left touch.png differ diff --git a/DS4Windows/Resources/mouse.png b/DS4Windows/Resources/mouse.png index 9b3a695..6aaf93d 100644 Binary files a/DS4Windows/Resources/mouse.png and b/DS4Windows/Resources/mouse.png differ diff --git a/DS4Windows/Resources/none.png b/DS4Windows/Resources/none.png index 9e67a44..6980501 100644 Binary files a/DS4Windows/Resources/none.png and b/DS4Windows/Resources/none.png differ diff --git a/DS4Windows/Resources/rainbow.png b/DS4Windows/Resources/rainbow.png index 5ede989..c2c0aa4 100644 Binary files a/DS4Windows/Resources/rainbow.png and b/DS4Windows/Resources/rainbow.png differ diff --git a/DS4Windows/Resources/rainbowC.png b/DS4Windows/Resources/rainbowC.png index 0a6f54d..94bab13 100644 Binary files a/DS4Windows/Resources/rainbowC.png and b/DS4Windows/Resources/rainbowC.png differ diff --git a/DS4Windows/Resources/right touch.png b/DS4Windows/Resources/right touch.png index 4e2ac3d..715732b 100644 Binary files a/DS4Windows/Resources/right touch.png and b/DS4Windows/Resources/right touch.png differ diff --git a/DS4Windows/Resources/saveprofile.png b/DS4Windows/Resources/saveprofile.png index 37e3d4b..6d74f1d 100644 Binary files a/DS4Windows/Resources/saveprofile.png and b/DS4Windows/Resources/saveprofile.png differ diff --git a/DS4Windows/Resources/shell32 delete.png b/DS4Windows/Resources/shell32 delete.png index 009eebc..e311aae 100644 Binary files a/DS4Windows/Resources/shell32 delete.png and b/DS4Windows/Resources/shell32 delete.png differ diff --git a/DS4Windows/Resources/shell32_copy.png b/DS4Windows/Resources/shell32_copy.png index 5669430..98d6c01 100644 Binary files a/DS4Windows/Resources/shell32_copy.png and b/DS4Windows/Resources/shell32_copy.png differ diff --git a/DS4Windows/Resources/shell32_export.png b/DS4Windows/Resources/shell32_export.png index 4bb2c2f..3ceb01e 100644 Binary files a/DS4Windows/Resources/shell32_export.png and b/DS4Windows/Resources/shell32_export.png differ diff --git a/DS4Windows/Resources/shell32_new.png b/DS4Windows/Resources/shell32_new.png index 38a838d..36c91bb 100644 Binary files a/DS4Windows/Resources/shell32_new.png and b/DS4Windows/Resources/shell32_new.png differ diff --git a/DS4Windows/Resources/size.png b/DS4Windows/Resources/size.png index 3694b39..e723a1e 100644 Binary files a/DS4Windows/Resources/size.png and b/DS4Windows/Resources/size.png differ diff --git a/DS4Windows/Resources/x360test.png b/DS4Windows/Resources/x360test.png index ac52792..74a5aea 100644 Binary files a/DS4Windows/Resources/x360test.png and b/DS4Windows/Resources/x360test.png differ diff --git a/DS4Windows/Resources/xbox_360_controller.png b/DS4Windows/Resources/xbox_360_controller.png index 8606491..cace0be 100644 Binary files a/DS4Windows/Resources/xbox_360_controller.png and b/DS4Windows/Resources/xbox_360_controller.png differ diff --git a/DS4Windows/packages.config b/DS4Windows/packages.config new file mode 100644 index 0000000..b296fe9 --- /dev/null +++ b/DS4Windows/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/README.md b/README.md index 1c72831..e252d22 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,19 @@ # DS4Windows + Like those other ds4tools, but sexier. DS4Windows is a portable program that allows you to get the best experience while using a DualShock 4 on your PC. By emulating a Xbox 360 controller, many more games are accessible. -You can find the latest and older versions [here](https://github.com/Jays2Kings/DS4Windows/releases) +You can find the latest and older versions [here](https://github.com/Jays2Kings/DS4Windows/releases). ## Requirements -[Microsoft .NET 4.5 or higher (needed to unzip the driver and for macros to work properly)](http://www.microsoft.com/en-us/download/details.aspx?id=42642) -DS4 Driver (Downloaded & Installed with DS4Windows) -Microsoft 360 Driver (link inside DS4Windows, already installed on Windows 7 SP1 and higher or if you've used a 360 controller before) -Sony DualShock 4 (This should be obvious) -Micro USB cable -(Optional)Bluetooth 2.1+, via adapter or built in pc [(My recommendation)](http://www.amazon.com/gp/product/B004LNXO28/ref=oh_aui_search_detailpage?ie=UTF8&psc=1) (Toshiba's bluetooth & Bluetooth adapters using CSR currently does not work) +- [Microsoft .NET 4.5 or higher (needed to unzip the driver and for macros to work properly)](http://www.microsoft.com/en-us/download/details.aspx?id=42642) +- DS4 Driver (Downloaded & Installed with DS4Windows) +- Microsoft 360 Driver (link inside DS4Windows, already installed on Windows 7 SP1 and higher or if you've used a 360 controller before) +- Sony DualShock 4 (This should be obvious) +- Micro USB cable +- (Optional)Bluetooth 2.1+, via adapter or built in pc [(My recommendation)](http://www.amazon.com/gp/product/B004LNXO28/ref=oh_aui_search_detailpage?ie=UTF8&psc=1) (Toshiba's bluetooth & Bluetooth adapters using CSR currently does not work) -Note: Hide DS4 currently doesn't work on Windows 10 without a workaround (disabling Network list service and restarting, but this causes serious issues with windows, use caution) -You can find more info out at [ds4windows.com](http://ds4windows.com) +Note: Hide DS4 currently doesn't work on Windows 10 without a workaround (disabling Network list service and restarting, but this causes serious issues with windows, use caution). +You can find more info out at [ds4windows.com](http://ds4windows.com).