diff --git a/.gitignore b/.gitignore index 1bc915c..6d113f2 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 @@ -154,3 +154,6 @@ $RECYCLE.BIN/ # Mac desktop service store files .DS_Store + +.vs/ + diff --git a/.vs/config/applicationhost.config b/.vs/config/applicationhost.config deleted file mode 100644 index c2abfb4..0000000 --- a/.vs/config/applicationhost.config +++ /dev/null @@ -1,1030 +0,0 @@ - - - - - - - - -
-
-
-
-
-
-
-
- - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
- -
-
-
-
-
-
- -
-
-
-
-
- -
-
-
- -
-
- -
-
- -
-
-
- - -
-
-
-
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DS4Windows.sln b/DS4Windows.sln index 916f340..24fbce3 100644 --- a/DS4Windows.sln +++ b/DS4Windows.sln @@ -9,18 +9,24 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection 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}.Debug|x86.ActiveCfg = Debug|x86 + {7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Debug|x86.Build.0 = Debug|x86 {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 + {7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Release|x86.ActiveCfg = Release|x86 + {7B9354BF-AF82-4CCB-A83D-4BEB1E9D8C96}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/DS4Windows/DS4Control/ControlSerivce.cs b/DS4Windows/DS4Control/ControlSerivce.cs deleted file mode 100644 index 28759a7..0000000 --- a/DS4Windows/DS4Control/ControlSerivce.cs +++ /dev/null @@ -1,851 +0,0 @@ -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]; - 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]; - 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(); - - 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; - x360Bus = new X360Device(); - AddtoDS4List(); - for (int i = 0; i < DS4Controllers.Length; i++) - { - processingData[i] = new X360Data(); - MappedState[i] = new DS4State(); - CurrentState[i] = new DS4State(); - PreviousState[i] = new DS4State(); - ExposedState[i] = new DS4StateExposed(CurrentState[i]); - } - } - - void AddtoDS4List() - { - dcs.Add(DS4Controls.Cross); - dcs.Add(DS4Controls.Cross); - dcs.Add(DS4Controls.Circle); - dcs.Add(DS4Controls.Square); - dcs.Add(DS4Controls.Triangle); - dcs.Add(DS4Controls.Options); - dcs.Add(DS4Controls.Share); - dcs.Add(DS4Controls.DpadUp); - dcs.Add(DS4Controls.DpadDown); - dcs.Add(DS4Controls.DpadLeft); - dcs.Add(DS4Controls.DpadRight); - dcs.Add(DS4Controls.PS); - dcs.Add(DS4Controls.L1); - dcs.Add(DS4Controls.R1); - dcs.Add(DS4Controls.L2); - dcs.Add(DS4Controls.R2); - dcs.Add(DS4Controls.L3); - dcs.Add(DS4Controls.R3); - dcs.Add(DS4Controls.LXPos); - dcs.Add(DS4Controls.LXNeg); - dcs.Add(DS4Controls.LYPos); - dcs.Add(DS4Controls.LYNeg); - dcs.Add(DS4Controls.RXPos); - dcs.Add(DS4Controls.RXNeg); - dcs.Add(DS4Controls.RYPos); - dcs.Add(DS4Controls.RYNeg); - dcs.Add(DS4Controls.SwipeUp); - dcs.Add(DS4Controls.SwipeDown); - dcs.Add(DS4Controls.SwipeLeft); - dcs.Add(DS4Controls.SwipeRight); - } - - private async void WarnExclusiveModeFailure(DS4Device device) - { - 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; - 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; - if (showlog) - { - LogDebug(Properties.Resources.SearchingController); - 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) - { - if (showlog) - LogDebug(Properties.Resources.FoundController + device.MacAddress + " (" + device.ConnectionType + ")"); - WarnExclusiveModeFailure(device); - DS4Controllers[ind] = 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")) - { - string prolog = Properties.Resources.UsingProfile.Replace("*number*", ind.ToString()).Replace("*Profile name*", ProfilePath[ind-1]); - LogDebug(prolog); - Log.LogToTray(prolog); - } - else - { - string prolog = Properties.Resources.NotUsingProfile.Replace("*number*", (ind).ToString()); - LogDebug(prolog); - Log.LogToTray(prolog); - } - if (ind >= 4) // out of Xinput devices! - break; - } - } - catch (Exception e) - { - LogDebug(e.Message); - Log.LogToTray(e.Message); - } - running = true; - - } - return true; - } - - public bool Stop(bool showlog = true) - { - if (running) - { - running = false; - if (showlog) - LogDebug(Properties.Resources.StoppingX360); - bool anyUnplugged = false; - for (int i = 0; i < DS4Controllers.Length; i++) - { - if (DS4Controllers[i] != null) - { - if (DCBTatStop && !DS4Controllers[i].Charging && showlog) - DS4Controllers[i].DisconnectBT(); - else - { - DS4LightBar.forcelight[i] = false; - DS4LightBar.forcedFlash[i] = 0; - DS4LightBar.defualtLight = true; - DS4LightBar.updateLightBar(DS4Controllers[i], i, CurrentState[i], ExposedState[i], touchPad[i]); - System.Threading.Thread.Sleep(50); - } - CurrentState[i].Battery = PreviousState[i].Battery = 0; // Reset for the next connection's initial status change. - x360Bus.Unplug(i); - anyUnplugged = true; - DS4Controllers[i] = null; - touchPad[i] = null; - } - } - 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); - } - return true; - } - - public bool HotPlug() - { - if (running) - { - DS4Devices.findControllers(); - IEnumerable devices = DS4Devices.getDS4Controllers(); - foreach (DS4Device device in devices) - { - if (device.IsDisconnecting) - continue; - if (((Func)delegate - { - for (Int32 Index = 0; Index < DS4Controllers.Length; Index++) - if (DS4Controllers[Index] != null && DS4Controllers[Index].MacAddress == device.MacAddress) - return true; - return false; - })()) - continue; - for (Int32 Index = 0; Index < DS4Controllers.Length; Index++) - if (DS4Controllers[Index] == null) - { - LogDebug(Properties.Resources.FoundController + device.MacAddress + " (" + device.ConnectionType + ")"); - WarnExclusiveModeFailure(device); - DS4Controllers[Index] = device; - 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.Report += this.On_Report; - if (!DinputOnly[Index]) - x360Bus.Plugin(Index); - TouchPadOn(Index, device); - //string filename = Path.GetFileName(ProfilePath[Index]); - if (System.IO.File.Exists(appdatapath + "\\Profiles\\" + ProfilePath[Index] + ".xml")) - { - string prolog = Properties.Resources.UsingProfile.Replace("*number*", (Index + 1).ToString()).Replace("*Profile name*", ProfilePath[Index]); - LogDebug(prolog); - Log.LogToTray(prolog); - } - else - { - string prolog = Properties.Resources.NotUsingProfile.Replace("*number*", (Index + 1).ToString()); - LogDebug(prolog); - Log.LogToTray(prolog); - } - - break; - } - } - } - return true; - } - - public void TouchPadOn(int ind, DS4Device device) - { - ITouchpadBehaviour tPad = touchPad[ind]; - device.Touchpad.TouchButtonDown += tPad.touchButtonDown; - device.Touchpad.TouchButtonUp += tPad.touchButtonUp; - device.Touchpad.TouchesBegan += tPad.touchesBegan; - device.Touchpad.TouchesMoved += tPad.touchesMoved; - device.Touchpad.TouchesEnded += tPad.touchesEnded; - device.Touchpad.TouchUnchanged += tPad.touchUnchanged; - 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); - } - } - - public string getDS4ControllerInfo(int index) - { - if (DS4Controllers[index] != 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) - { - if (d.Battery >= 100) - battery = Properties.Resources.Charged; - else - battery = Properties.Resources.Charging.Replace("*number*", d.Battery.ToString()); - } - else - { - battery = Properties.Resources.Battery.Replace("*number*", d.Battery.ToString()); - } - return d.MacAddress + " (" + d.ConnectionType + "), " + battery; - //return d.MacAddress + " (" + d.ConnectionType + "), Battery is " + battery + ", Touchpad in " + modeSwitcher[index].ToString(); - } - else - return String.Empty; - } - - public string getDS4MacAddress(int index) - { - if (DS4Controllers[index] != 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; - } - else - return String.Empty; - } - - public string getShortDS4ControllerInfo(int index) - { - if (DS4Controllers[index] != null) - { - DS4Device d = DS4Controllers[index]; - String battery; - if (!d.IsAlive()) - battery = "..."; - if (d.Charging) - { - if (d.Battery >= 100) - battery = Properties.Resources.Full; - else - battery = d.Battery + "%+"; - } - else - { - battery = d.Battery + "%"; - } - return (d.ConnectionType + " " + battery); - } - else - return Properties.Resources.NoneText; - } - - public string getDS4Battery(int index) - { - if (DS4Controllers[index] != null) - { - DS4Device d = DS4Controllers[index]; - String battery; - if (!d.IsAlive()) - battery = "..."; - if (d.Charging) - { - if (d.Battery >= 100) - battery = Properties.Resources.Full; - else - battery = d.Battery + "%+"; - } - else - { - battery = d.Battery + "%"; - } - return battery; - } - else - return Properties.Resources.NA; - } - - public string getDS4Status(int index) - { - if (DS4Controllers[index] != null) - { - DS4Device d = DS4Controllers[index]; - return d.ConnectionType+""; - } - 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) - 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); - } - } - public bool[] lag = { 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]) - ind = i; - - if (ind != -1) - { - if (FlushHIDQueue[ind]) - device.FlushHID(); - if (!string.IsNullOrEmpty(device.error)) - { - LogDebug(device.error); - } - if (DateTime.UtcNow - device.firstActive > TimeSpan.FromSeconds(5)) - { - if (device.Latency >= FlashWhenLateAt && !lag[ind]) - LagFlashWarning(ind, true); - else if (device.Latency < FlashWhenLateAt && lag[ind]) - LagFlashWarning(ind, false); - } - 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 (!recordingMacro && (!string.IsNullOrEmpty(tempprofilename[ind]) || - HasCustomAction(ind) || HasCustomExtras(ind) || ProfileActions[ind].Count > 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)) - { - 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]; - } - } - - public void LagFlashWarning(int ind, bool on) - { - if (on) - { - lag[ind] = true; - LogDebug(Properties.Resources.LatencyOverTen.Replace("*number*", (ind + 1).ToString()), true); - if (FlashWhenLate) - { - DS4Color color = new DS4Color { red = 50, green = 0, blue = 0 }; - DS4LightBar.forcedColor[ind] = color; - DS4LightBar.forcedFlash[ind] = 2; - DS4LightBar.forcelight[ind] = true; - } - } - else - { - lag[ind] = false; - LogDebug(Properties.Resources.LatencyNotOverTen.Replace("*number*", (ind + 1).ToString())); - DS4LightBar.forcelight[ind] = false; - 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]; - 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"; - } - - public DS4Controls GetInputkeysDS4(int ind) - { - DS4State cState = CurrentState[ind]; - DS4StateExposed eState = ExposedState[ind]; - Mouse tp = touchPad[ind]; - 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; - } - - 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) - { - if (!UseTPforControls[deviceID] && cState.Touch1 && pState.PS) - { - if (TouchSensitivity[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); - 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); - touchreleased[deviceID] = false; - } - } - else - touchreleased[deviceID] = true; - } - - public virtual void StartTPOff(int deviceID) - { - if (deviceID < 4) - { - oldtouchvalue[deviceID] = TouchSensitivity[deviceID]; - oldscrollvalue[deviceID] = ScrollSensitivity[deviceID]; - TouchSensitivity[deviceID] = 0; - ScrollSensitivity[deviceID] = 0; - } - } - - public virtual string TouchpadSlide(int ind) - { - DS4State cState = CurrentState[ind]; - string slidedir = "none"; - if (DS4Controllers[ind] != null && cState.Touch2 && !(touchPad[ind].dragging || touchPad[ind].dragging2)) - if (touchPad[ind].slideright && !touchslid[ind]) - { - slidedir = "right"; - touchslid[ind] = true; - } - else if (touchPad[ind].slideleft && !touchslid[ind]) - { - slidedir = "left"; - touchslid[ind] = true; - } - else if (!touchPad[ind].slideleft && !touchPad[ind].slideright) - { - slidedir = ""; - touchslid[ind] = false; - } - return slidedir; - } - public virtual void LogDebug(String Data, bool warning = false) - { - Console.WriteLine(System.DateTime.Now.ToString("G") + "> " + Data); - if (Debug != null) - { - DebugEventArgs args = new DebugEventArgs(Data, warning); - OnDebug(this, args); - } - } - - public virtual void OnDebug(object sender, DebugEventArgs args) - { - if (Debug != null) - Debug(this, args); - } - - //sets the rumble adjusted with rumble boost - public virtual void setRumble(byte heavyMotor, byte lightMotor, int deviceNum) - { - byte boost = RumbleBoost[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); - } - - public DS4State getDS4State(int ind) - { - return CurrentState[ind]; - } - public DS4State getDS4StateMapped(int ind) - { - return MappedState[ind]; - } - } -} diff --git a/DS4Windows/DS4Control/ControlService.cs b/DS4Windows/DS4Control/ControlService.cs new file mode 100644 index 0000000..3c4ff38 --- /dev/null +++ b/DS4Windows/DS4Control/ControlService.cs @@ -0,0 +1,1077 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; + +using System.Media; +using System.Threading.Tasks; +using static DS4Windows.Global; +using System.Threading; +using Registry = Microsoft.Win32.Registry; + +namespace DS4Windows +{ + public class ControlService + { + public X360Device x360Bus = null; + 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[DS4_CONTROLLER_COUNT]; + private DS4State[] CurrentState = new DS4State[DS4_CONTROLLER_COUNT]; + private DS4State[] PreviousState = new DS4State[DS4_CONTROLLER_COUNT]; + private DS4State[] TempState = new DS4State[DS4_CONTROLLER_COUNT]; + public DS4StateExposed[] ExposedState = new DS4StateExposed[DS4_CONTROLLER_COUNT]; + public bool recordingMacro = false; + public event EventHandler Debug = null; + bool[] buttonsdown = new bool[4] { false, false, false, false }; + bool[] held = new bool[DS4_CONTROLLER_COUNT]; + int[] oldmouse = new int[DS4_CONTROLLER_COUNT] { -1, -1, -1, -1 }; + Thread tempThread; + public List affectedDevs = new List() + { + @"HID\VID_054C&PID_05C4", + @"HID\VID_054C&PID_09CC&MI_03", + @"HID\VID_054C&PID_0BA0&MI_03", + @"HID\{00001124-0000-1000-8000-00805f9b34fb}_VID&0002054c_PID&05c4", + @"HID\{00001124-0000-1000-8000-00805f9b34fb}_VID&0002054c_PID&09cc", + }; + public bool suspending; + //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; + // Cause thread affinity to not be tied to main GUI thread + tempThread = new Thread(() => { x360Bus = new X360Device(); }); + tempThread.Priority = ThreadPriority.AboveNormal; + tempThread.IsBackground = true; + tempThread.Start(); + while (tempThread.IsAlive) + { + Thread.SpinWait(500); + } + + for (int i = 0, arlength = DS4Controllers.Length; i < arlength; i++) + { + processingData[i] = new X360Data(); + MappedState[i] = new DS4State(); + CurrentState[i] = new DS4State(); + TempState[i] = new DS4State(); + PreviousState[i] = new DS4State(); + ExposedState[i] = new DS4StateExposed(CurrentState[i]); + } + } + + private void WarnExclusiveModeFailure(DS4Device device) + { + if (DS4Devices.isExclusiveMode && !device.isExclusive()) + { + string message = Properties.Resources.CouldNotOpenDS4.Replace("*Mac address*", device.getMacAddress()) + " " + + Properties.Resources.QuitOtherPrograms; + LogDebug(message, true); + Log.LogToTray(message, true); + } + } + + public void createHidGuardKey() + { + try + { + Registry.LocalMachine.CreateSubKey(@"SYSTEM\CurrentControlSet\Services\HidGuardian\Parameters\Whitelist\" + System.Diagnostics.Process.GetCurrentProcess().Id); + } + catch { } + } + + public void removeHidGuardKey() + { + try + { + Registry.LocalMachine.DeleteSubKey(@"SYSTEM\CurrentControlSet\Services\HidGuardian\Parameters\Whitelist\" + System.Diagnostics.Process.GetCurrentProcess().Id); + } + catch { } + } + + public bool PlugXInputController(int index) + { + int xinputIndex = x360Bus.FirstController + index; + LogDebug("Plugging in X360 Controller #" + xinputIndex); + bool xinputResult = x360Bus.Plugin(index); + if (xinputResult) + { + useDInputOnly[index] = false; + LogDebug("X360 Controller # " + xinputIndex + " connected"); + } + else + { + useDInputOnly[index] = true; + LogDebug("X360 Controller # " + xinputIndex + " failed. Using DInput only mode"); + } + + return xinputResult; + } + + public bool UnplugXInputController(int index) + { + bool unplugResult = x360Bus.Unplug(index); + int xinputIndex = x360Bus.FirstController + index; + if (unplugResult) + { + useDInputOnly[index] = true; + LogDebug("X360 Controller # " + xinputIndex + " unplugged"); + } + else + { + LogDebug("X360 Controller # " + xinputIndex + " failed to unplug"); + } + + return unplugResult; + } + + public bool Start(object tempui, bool showlog = true) + { + if (x360Bus.Open() && x360Bus.Start()) + { + if (showlog) + 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); + } + + try + { + DS4Devices.findControllers(); + IEnumerable devices = DS4Devices.getDS4Controllers(); + //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.getMacAddress() + " (" + device.getConnectionType() + ")"); + + Task task = new Task(() => { Thread.Sleep(5); WarnExclusiveModeFailure(device); }); + task.Start(); + + DS4Controllers[i] = device; + device.setUiContext(tempui as SynchronizationContext); + device.Removal += this.On_DS4Removal; + device.Removal += DS4Devices.On_Removal; + device.SyncChange += this.On_SyncChange; + device.SyncChange += DS4Devices.UpdateSerial; + device.SerialChange += this.On_SerialChange; + if (device.isValidSerial() && containsLinkedProfile(device.getMacAddress())) + { + ProfilePath[i] = getLinkedProfile(device.getMacAddress()); + } + else + { + ProfilePath[i] = OlderProfilePath[i]; + } + LoadProfile(i, false, this, false, false); + touchPad[i] = new Mouse(i, device); + device.LightBarColor = getMainColor(i); + + if (!getDInputOnly(i) && device.isSynced()) + { + int xinputIndex = x360Bus.FirstController + i; + LogDebug("Plugging in X360 Controller #" + xinputIndex); + bool xinputResult = x360Bus.Plugin(i); + if (xinputResult) + { + useDInputOnly[i] = false; + LogDebug("X360 Controller # " + xinputIndex + " connected"); + } + else + { + useDInputOnly[i] = true; + LogDebug("X360 Controller # " + xinputIndex + " failed. Using DInput only mode"); + } + } + + int tempIdx = i; + device.Report += (sender, e) => + { + this.On_Report(sender, e, tempIdx); + }; + TouchPadOn(i, device); + CheckProfileOptions(i, device, true); + device.StartUpdate(); + //string filename = ProfilePath[ind]; + //ind++; + if (showlog) + { + if (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*", (i + 1).ToString()); + LogDebug(prolog); + Log.LogToTray(prolog); + } + } + + if (i >= 4) // out of Xinput devices! + break; + } + } + catch (Exception e) + { + LogDebug(e.Message); + Log.LogToTray(e.Message); + } + + 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); + } + + runHotPlug = true; + return true; + } + + public bool Stop(bool showlog = true) + { + if (running) + { + running = false; + runHotPlug = false; + + if (showlog) + LogDebug(Properties.Resources.StoppingX360); + + LogDebug("Closing connection to Scp Virtual Bus"); + + bool anyUnplugged = false; + for (int i = 0, arlength = DS4Controllers.Length; i < arlength; i++) + { + DS4Device tempDevice = DS4Controllers[i]; + if (tempDevice != null) + { + if ((DCBTatStop && !tempDevice.isCharging()) || suspending) + { + 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.defaultLight = true; + DS4LightBar.updateLightBar(DS4Controllers[i], i); + tempDevice.IsRemoved = true; + tempDevice.StopUpdate(); + DS4Devices.RemoveDevice(tempDevice); + Thread.Sleep(50); + } + + CurrentState[i].Battery = PreviousState[i].Battery = 0; // Reset for the next connection's initial status change. + x360Bus.Unplug(i); + useDInputOnly[i] = true; + anyUnplugged = true; + DS4Controllers[i] = null; + touchPad[i] = null; + lag[i] = false; + inWarnMonitor[i] = false; + } + } + + if (anyUnplugged) + Thread.Sleep(XINPUT_UNPLUG_SETTLE_TIME); + + x360Bus.UnplugAll(); + x360Bus.Stop(); + + if (showlog) + LogDebug(Properties.Resources.StoppingDS4); + + DS4Devices.stopControllers(); + if (showlog) + LogDebug(Properties.Resources.StoppedDS4Windows); + } + + runHotPlug = false; + return true; + } + + public bool HotPlug(SynchronizationContext uiContext) + { + if (running) + { + DS4Devices.findControllers(); + IEnumerable devices = DS4Devices.getDS4Controllers(); + //foreach (DS4Device device in devices) + for (int i = 0, devlen = devices.Count(); i < devlen; i++) + { + DS4Device device = devices.ElementAt(i); + + if (device.isDisconnectingStatus()) + continue; + + if (((Func)delegate + { + 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, arlength = DS4Controllers.Length; Index < arlength; Index++) + { + if (DS4Controllers[Index] == null) + { + LogDebug(Properties.Resources.FoundController + device.getMacAddress() + " (" + device.getConnectionType() + ")"); + Task task = new Task(() => { Thread.Sleep(5); WarnExclusiveModeFailure(device); }); + task.Start(); + DS4Controllers[Index] = device; + device.setUiContext(uiContext); + device.Removal += this.On_DS4Removal; + device.Removal += DS4Devices.On_Removal; + device.SyncChange += this.On_SyncChange; + device.SyncChange += DS4Devices.UpdateSerial; + device.SerialChange += this.On_SerialChange; + if (device.isValidSerial() && containsLinkedProfile(device.getMacAddress())) + { + ProfilePath[Index] = getLinkedProfile(device.getMacAddress()); + } + else + { + ProfilePath[Index] = OlderProfilePath[Index]; + } + + LoadProfile(Index, false, this, false, false); + touchPad[Index] = new Mouse(Index, device); + device.LightBarColor = getMainColor(Index); + + int tempIdx = Index; + device.Report += (sender, e) => + { + this.On_Report(sender, e, tempIdx); + }; + if (!getDInputOnly(Index) && device.isSynced()) + { + int xinputIndex = x360Bus.FirstController + Index; + LogDebug("Plugging in X360 Controller #" + xinputIndex); + bool xinputResult = x360Bus.Plugin(Index); + if (xinputResult) + { + useDInputOnly[Index] = false; + LogDebug("X360 Controller # " + xinputIndex + " connected"); + } + else + { + useDInputOnly[Index] = true; + LogDebug("X360 Controller # " + xinputIndex + " failed. Using DInput only mode"); + } + } + + TouchPadOn(Index, device); + CheckProfileOptions(Index, device); + device.StartUpdate(); + + //string filename = Path.GetFileName(ProfilePath[Index]); + if (File.Exists(appdatapath + "\\Profiles\\" + ProfilePath[Index] + ".xml")) + { + string prolog = Properties.Resources.UsingProfile.Replace("*number*", (Index + 1).ToString()).Replace("*Profile name*", ProfilePath[Index]); + LogDebug(prolog); + Log.LogToTray(prolog); + } + else + { + string prolog = Properties.Resources.NotUsingProfile.Replace("*number*", (Index + 1).ToString()); + LogDebug(prolog); + Log.LogToTray(prolog); + } + + break; + } + } + } + } + + return true; + } + + private void CheckProfileOptions(int ind, DS4Device device, bool startUp=false) + { + device.setIdleTimeout(getIdleDisconnectTimeout(ind)); + device.setBTPollRate(getBTPollRate(ind)); + touchPad[ind].ResetTrackAccel(getTrackballFriction(ind)); + + if (!startUp) + { + CheckLauchProfileOption(ind, device); + } + } + + private void CheckLauchProfileOption(int ind, DS4Device device) + { + string programPath = LaunchProgram[ind]; + if (programPath != string.Empty) + { + 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(() => + { + Thread.Sleep(5000); + 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(); + } + } + } + + public void TouchPadOn(int ind, DS4Device device) + { + ITouchpadBehaviour tPad = touchPad[ind]; + device.Touchpad.TouchButtonDown += tPad.touchButtonDown; + device.Touchpad.TouchButtonUp += tPad.touchButtonUp; + device.Touchpad.TouchesBegan += tPad.touchesBegan; + device.Touchpad.TouchesMoved += tPad.touchesMoved; + device.Touchpad.TouchesEnded += tPad.touchesEnded; + device.Touchpad.TouchUnchanged += tPad.touchUnchanged; + //device.Touchpad.PreTouchProcess += delegate { touchPad[ind].populatePriorButtonStates(); }; + device.Touchpad.PreTouchProcess += (sender, args) => { touchPad[ind].populatePriorButtonStates(); }; + 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()); + } + + public string getDS4ControllerInfo(int index) + { + DS4Device d = DS4Controllers[index]; + if (d != null) + { + if (!d.IsAlive()) + { + return Properties.Resources.Connecting; + } + + string battery; + if (d.isCharging()) + { + if (d.getBattery() >= 100) + battery = Properties.Resources.Charged; + else + battery = Properties.Resources.Charging.Replace("*number*", d.getBattery().ToString()); + } + else + { + battery = Properties.Resources.Battery.Replace("*number*", d.getBattery().ToString()); + } + + return d.getMacAddress() + " (" + d.getConnectionType() + "), " + battery; + //return d.MacAddress + " (" + d.ConnectionType + "), Battery is " + battery + ", Touchpad in " + modeSwitcher[index].ToString(); + } + else + return string.Empty; + } + + public string getDS4MacAddress(int index) + { + DS4Device d = DS4Controllers[index]; + if (d != null) + { + if (!d.IsAlive()) + { + return Properties.Resources.Connecting; + } + + return d.getMacAddress(); + } + else + return string.Empty; + } + + public string getShortDS4ControllerInfo(int index) + { + DS4Device d = DS4Controllers[index]; + if (d != null) + { + string battery; + if (!d.IsAlive()) + battery = "..."; + + if (d.isCharging()) + { + if (d.getBattery() >= 100) + battery = Properties.Resources.Full; + else + battery = d.getBattery() + "%+"; + } + else + { + battery = d.getBattery() + "%"; + } + + return (d.getConnectionType() + " " + battery); + } + else + return Properties.Resources.NoneText; + } + + public string getDS4Battery(int index) + { + DS4Device d = DS4Controllers[index]; + if (d != null) + { + string battery; + if (!d.IsAlive()) + battery = "..."; + + if (d.isCharging()) + { + if (d.getBattery() >= 100) + battery = Properties.Resources.Full; + else + battery = d.getBattery() + "%+"; + } + else + { + battery = d.getBattery() + "%"; + } + + return battery; + } + else + return Properties.Resources.NA; + } + + public string getDS4Status(int index) + { + DS4Device d = DS4Controllers[index]; + if (d != null) + { + return d.getConnectionType() + ""; + } + else + return Properties.Resources.NoneText; + } + + protected void On_SerialChange(object sender, EventArgs e) + { + DS4Device device = (DS4Device)sender; + int ind = -1; + 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 >= 0) + { + OnDeviceSerialChange(this, ind, device.getMacAddress()); + } + } + + protected void On_SyncChange(object sender, EventArgs e) + { + DS4Device device = (DS4Device)sender; + int ind = -1; + 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 >= 0) + { + bool synced = device.isSynced(); + + if (!synced) + { + if (!useDInputOnly[ind]) + { + bool unplugResult = x360Bus.Unplug(ind); + int xinputIndex = x360Bus.FirstController + ind; + if (unplugResult) + { + useDInputOnly[ind] = true; + LogDebug("X360 Controller # " + xinputIndex + " unplugged"); + } + else + { + LogDebug("X360 Controller # " + xinputIndex + " failed to unplug"); + } + } + } + else + { + if (!getDInputOnly(ind)) + { + int xinputIndex = x360Bus.FirstController + ind; + LogDebug("Plugging in X360 Controller #" + xinputIndex); + bool xinputResult = x360Bus.Plugin(ind); + if (xinputResult) + { + useDInputOnly[ind] = false; + LogDebug("X360 Controller # " + xinputIndex + " connected"); + } + else + { + useDInputOnly[ind] = true; + LogDebug("X360 Controller # " + xinputIndex + " failed. Using DInput only mode"); + } + } + } + } + } + + //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, arlength = DS4Controllers.Length; ind == -1 && i < arlength; i++) + { + if (DS4Controllers[i] != null && device.getMacAddress() == DS4Controllers[i].getMacAddress()) + ind = i; + } + + if (ind != -1) + { + 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. + if (!useDInputOnly[ind]) + { + bool unplugResult = x360Bus.Unplug(ind); + int xinputIndex = x360Bus.FirstController + ind; + LogDebug("X360 Controller # " + xinputIndex + " unplugged"); + } + + 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); + /*Stopwatch sw = new Stopwatch(); + sw.Start(); + while (sw.ElapsedMilliseconds < XINPUT_UNPLUG_SETTLE_TIME) + { + // Use SpinWait to keep control of current thread. Using Sleep could potentially + // cause other events to get run out of order + System.Threading.Thread.SpinWait(500); + } + sw.Stop(); + */ + + device.IsRemoved = true; + device.Synced = false; + DS4Controllers[ind] = null; + touchPad[ind] = null; + lag[ind] = false; + inWarnMonitor[ind] = false; + useDInputOnly[ind] = true; + OnControllerRemoved(this, ind); + Thread.Sleep(XINPUT_UNPLUG_SETTLE_TIME); + } + } + } + + public bool[] lag = new bool[4] { false, false, false, false }; + public bool[] inWarnMonitor = new bool[4] { false, false, false, false }; + private byte[] currentBattery = new byte[4] { 0, 0, 0, 0 }; + private bool[] charging = new bool[4] { false, false, false, false }; + private string[] tempStrings = new string[4] { string.Empty, string.Empty, string.Empty, string.Empty }; + + // Called every time a new input report has arrived + protected virtual void On_Report(object sender, EventArgs e, int ind) + { + DS4Device device = (DS4Device)sender; + + if (ind != -1) + { + if (getFlushHIDQueue(ind)) + device.FlushHID(); + + string devError = tempStrings[ind] = device.error; + if (!string.IsNullOrEmpty(devError)) + { + device.getUiContext()?.Post(new SendOrPostCallback(delegate (object state) + { + LogDebug(devError); + }), null); + } + + if (inWarnMonitor[ind]) + { + int flashWhenLateAt = getFlashWhenLateAt(); + if (!lag[ind] && device.Latency >= flashWhenLateAt) + { + lag[ind] = true; + device.getUiContext()?.Post(new SendOrPostCallback(delegate (object state) + { + LagFlashWarning(ind, true); + }), null); + } + else if (lag[ind] && device.Latency < flashWhenLateAt) + { + lag[ind] = false; + device.getUiContext()?.Post(new SendOrPostCallback(delegate (object state) + { + LagFlashWarning(ind, false); + }), null); + } + } + else + { + if (DateTime.UtcNow - device.firstActive > TimeSpan.FromSeconds(5)) + { + inWarnMonitor[ind] = true; + } + } + + device.getCurrentState(CurrentState[ind]); + DS4State cState = CurrentState[ind]; + DS4State pState = device.getPreviousStateRef(); + //device.getPreviousState(PreviousState[ind]); + //DS4State pState = PreviousState[ind]; + + if (device.firstReport && device.IsAlive()) + { + device.firstReport = false; + device.getUiContext()?.Post(new SendOrPostCallback(delegate (object state) + { + OnDeviceStatusChanged(this, ind); + }), null); + } + else if (pState.Battery != cState.Battery || device.oldCharging != device.isCharging()) + { + byte tempBattery = currentBattery[ind] = cState.Battery; + bool tempCharging = charging[ind] = device.isCharging(); + device.getUiContext()?.Post(new SendOrPostCallback(delegate (object state) + { + OnBatteryStatusChange(this, ind, tempBattery, tempCharging); + }), null); + } + + if (getEnableTouchToggle(ind)) + CheckForTouchToggle(ind, cState, pState); + + cState = Mapping.SetCurveAndDeadzone(ind, cState, TempState[ind]); + + if (!recordingMacro && (!string.IsNullOrEmpty(tempprofilename[ind]) || + containsCustomAction(ind) || containsCustomExtras(ind) || + getProfileActionCount(ind) > 0)) + { + Mapping.MapCustom(ind, cState, MappedState[ind], ExposedState[ind], touchPad[ind], this); + cState = MappedState[ind]; + } + + if (!useDInputOnly[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)) + { + byte Big = processingData[ind].Rumble[3]; + byte Small = processingData[ind].Rumble[4]; + + if (processingData[ind].Rumble[1] == 0x08) + { + setRumble(Big, Small, ind); + } + } + } + + // Output any synthetic events. + Mapping.Commit(ind); + + // Update the GUI/whatever. + DS4LightBar.updateLightBar(device, ind); + } + } + + public void LagFlashWarning(int ind, bool on) + { + if (on) + { + lag[ind] = true; + LogDebug(Properties.Resources.LatencyOverTen.Replace("*number*", (ind + 1).ToString()), true); + if (getFlashWhenLate()) + { + DS4Color color = new DS4Color { red = 50, green = 0, blue = 0 }; + DS4LightBar.forcedColor[ind] = color; + DS4LightBar.forcedFlash[ind] = 2; + DS4LightBar.forcelight[ind] = true; + } + } + else + { + lag[ind] = false; + LogDebug(Properties.Resources.LatencyNotOverTen.Replace("*number*", (ind + 1).ToString())); + DS4LightBar.forcelight[ind] = false; + DS4LightBar.forcedFlash[ind] = 0; + } + } + + public DS4Controls GetActiveInputControl(int ind) + { + DS4State cState = CurrentState[ind]; + DS4StateExposed eState = ExposedState[ind]; + Mouse tp = touchPad[ind]; + DS4Controls result = DS4Controls.None; + + if (DS4Controllers[ind] != null) + { + 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 = new bool[4] { true, true, true, true }, + touchslid = new bool[4] { false, false, false, false }; + + public byte[] oldtouchvalue = new byte[4] { 0, 0, 0, 0 }; + public int[] oldscrollvalue = new int[4] { 0, 0, 0, 0 }; + + protected virtual void CheckForTouchToggle(int deviceID, DS4State cState, DS4State pState) + { + if (!getUseTPforControls(deviceID) && cState.Touch1 && pState.PS) + { + if (getTouchSensitivity(deviceID) > 0 && touchreleased[deviceID]) + { + oldtouchvalue[deviceID] = getTouchSensitivity(deviceID); + oldscrollvalue[deviceID] = getScrollSensitivity(deviceID); + getTouchSensitivity()[deviceID] = 0; + getScrollSensitivity()[deviceID] = 0; + LogDebug(Properties.Resources.TouchpadMovementOff); + Log.LogToTray(Properties.Resources.TouchpadMovementOff); + touchreleased[deviceID] = false; + } + else if (touchreleased[deviceID]) + { + getTouchSensitivity()[deviceID] = oldtouchvalue[deviceID]; + getScrollSensitivity()[deviceID] = oldscrollvalue[deviceID]; + LogDebug(Properties.Resources.TouchpadMovementOn); + Log.LogToTray(Properties.Resources.TouchpadMovementOn); + touchreleased[deviceID] = false; + } + } + else + touchreleased[deviceID] = true; + } + + public virtual void StartTPOff(int deviceID) + { + if (deviceID < 4) + { + oldtouchvalue[deviceID] = getTouchSensitivity(deviceID); + oldscrollvalue[deviceID] = getScrollSensitivity(deviceID); + TouchSensitivity[deviceID] = 0; + ScrollSensitivity[deviceID] = 0; + } + } + + public virtual string TouchpadSlide(int ind) + { + DS4State cState = CurrentState[ind]; + string slidedir = "none"; + if (DS4Controllers[ind] != null && cState.Touch2 && + !(touchPad[ind].dragging || touchPad[ind].dragging2)) + { + if (touchPad[ind].slideright && !touchslid[ind]) + { + slidedir = "right"; + touchslid[ind] = true; + } + else if (touchPad[ind].slideleft && !touchslid[ind]) + { + slidedir = "left"; + touchslid[ind] = true; + } + else if (!touchPad[ind].slideleft && !touchPad[ind].slideright) + { + slidedir = ""; + touchslid[ind] = false; + } + } + + return slidedir; + } + + public virtual void LogDebug(String Data, bool warning = false) + { + //Console.WriteLine(System.DateTime.Now.ToString("G") + "> " + Data); + if (Debug != null) + { + DebugEventArgs args = new DebugEventArgs(Data, warning); + OnDebug(this, args); + } + } + + public virtual void OnDebug(object sender, DebugEventArgs args) + { + if (Debug != null) + Debug(this, args); + } + + //sets the rumble adjusted with rumble boost + public virtual void setRumble(byte heavyMotor, byte lightMotor, int 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) + { + 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..d06b91c 100644 --- a/DS4Windows/DS4Control/DS4LightBar.cs +++ b/DS4Windows/DS4Control/DS4LightBar.cs @@ -1,10 +1,9 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Drawing; using static System.Math; using static DS4Windows.Global; +using System.Diagnostics; + namespace DS4Windows { public class DS4LightBar @@ -19,128 +18,222 @@ namespace DS4Windows { 140, 140 }, { 168, 112 }, { 196, 84 }, - { 224, 56}, // on 80% of the time at 80, etc. + { 224, 56 }, // on 80% of the time at 80, etc. { 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[4] + { 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 = new DateTime[4] + { 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) + internal const int PULSE_FLASH_DURATION = 2000; + internal const double PULSE_FLASH_SEGMENTS = PULSE_FLASH_DURATION / 40; + internal const int PULSE_CHARGING_DURATION = 4000; + internal const double PULSE_CHARGING_SEGMENTS = (PULSE_CHARGING_DURATION / 40) - 2; + + public static void updateLightBar(DS4Device device, int deviceNum) { DS4Color color; - if (!defualtLight && !forcelight[deviceNum]) + if (!defaultLight && !forcelight[deviceNum]) { - if (UseCustomLed[deviceNum]) + if (getUseCustomLed(deviceNum)) { - if (LedAsBatteryIndicator[deviceNum]) + if (getLedAsBatteryIndicator(deviceNum)) { - DS4Color fullColor = CustomColor[deviceNum]; - DS4Color lowColor = LowColor[deviceNum]; - - color = getTransitionedColor(lowColor, fullColor, device.Battery); + DS4Color fullColor = getCustomColor(deviceNum); + DS4Color lowColor = getLowColor(deviceNum); + color = getTransitionedColor(lowColor, fullColor, device.getBattery()); } 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)(device.getBattery() * 2.55)); 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]; - - color = getTransitionedColor(lowColor, fullColor, (uint)device.Battery); - } + DS4Color fullColor = getMainColor(deviceNum); + DS4Color lowColor = getLowColor(deviceNum); + color = getTransitionedColor(lowColor, fullColor, 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) + { + elapsed = elapsed / 40; + ratio = 100.0 * (elapsed / PULSE_FLASH_SEGMENTS); + } + else + { + ratio = 100.0; + fadewatches[deviceNum].Stop(); + } + } + else + { + if (elapsed < PULSE_FLASH_DURATION) + { + elapsed = elapsed / 40; + ratio = (0 - 100.0) * (elapsed / PULSE_FLASH_SEGMENTS) + 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) - 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); + double topratio = TimeSpan.FromSeconds(idleDisconnectTimeout).TotalMilliseconds; + double ratio = 100.0 * (botratio / topratio), elapsed = ratio; + if (ratio >= 50.0 && ratio < 100.0) + { + color = getTransitionedColor(color, new DS4Color(0, 0, 0), + (uint)(-100.0 * (elapsed = 0.02 * (ratio - 50.0)) * (elapsed - 2.0))); + } + 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) + { + elapsed = elapsed / 40; + if (elapsed > PULSE_CHARGING_SEGMENTS) + elapsed = (long)PULSE_CHARGING_SEGMENTS; + ratio = 100.0 * (elapsed / PULSE_CHARGING_SEGMENTS); + } + else + { + ratio = 100.0; + fadewatches[deviceNum].Stop(); + } + } + else + { + if (elapsed < PULSE_CHARGING_DURATION) + { + elapsed = elapsed / 40; + if (elapsed > PULSE_CHARGING_SEGMENTS) + elapsed = (long)PULSE_CHARGING_SEGMENTS; + ratio = (0 - 100.0) * (elapsed / PULSE_CHARGING_SEGMENTS) + 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 +243,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 +274,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 +299,15 @@ 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); - device.pushHapticState(haptics); + + device.pushHapticState(ref 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..2eb3daa --- /dev/null +++ b/DS4Windows/DS4Control/DS4StateFieldMapping.cs @@ -0,0 +1,155 @@ + +namespace DS4Windows +{ + public class DS4StateFieldMapping + { + public enum ControlType: int { 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 = new ControlType[38] { 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() + { + } + + public DS4StateFieldMapping(DS4State cState, DS4StateExposed exposeState, Mouse tp, bool priorMouse=false) + { + populateFieldMapping(cState, exposeState, tp, priorMouse); + } + + public void populateFieldMapping(DS4State cState, DS4StateExposed exposeState, Mouse tp, bool priorMouse = false) + { + 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 ? (!priorMouse ? tp.leftDown : tp.priorLeftDown) : false; + buttons[(int)DS4Controls.TouchRight] = tp != null ? (!priorMouse ? tp.rightDown : tp.priorRightDown) : false; + buttons[(int)DS4Controls.TouchUpper] = tp != null ? (!priorMouse ? tp.upperDown : tp.priorUpperDown) : false; + buttons[(int)DS4Controls.TouchMulti] = tp != null ? (!priorMouse ? tp.multiDown : tp.priorMultiDown) : false; + + int sixAxisX = -exposeState.getOutputAccelX(); + gryodirs[(int)DS4Controls.GyroXPos] = sixAxisX > 0 ? sixAxisX : 0; + gryodirs[(int)DS4Controls.GyroXNeg] = sixAxisX < 0 ? sixAxisX : 0; + + int sixAxisZ = exposeState.getOutputAccelZ(); + gryodirs[(int)DS4Controls.GyroZPos] = sixAxisZ > 0 ? sixAxisZ : 0; + gryodirs[(int)DS4Controls.GyroZNeg] = sixAxisZ < 0 ? sixAxisZ : 0; + + swipedirs[(int)DS4Controls.SwipeLeft] = tp != null ? (!priorMouse ? tp.swipeLeftB : tp.priorSwipeLeftB) : (byte)0; + swipedirs[(int)DS4Controls.SwipeRight] = tp != null ? (!priorMouse ? tp.swipeRightB : tp.priorSwipeRightB) : (byte)0; + swipedirs[(int)DS4Controls.SwipeUp] = tp != null ? (!priorMouse ? tp.swipeUpB : tp.priorSwipeUpB) : (byte)0; + swipedirs[(int)DS4Controls.SwipeDown] = tp != null ? (!priorMouse ? tp.swipeDownB : tp.priorSwipeDownB) : (byte)0; + + swipedirbools[(int)DS4Controls.SwipeLeft] = tp != null ? (!priorMouse ? tp.swipeLeft : tp.priorSwipeLeft) : false; + swipedirbools[(int)DS4Controls.SwipeRight] = tp != null ? (!priorMouse ? tp.swipeRight : tp.priorSwipeRight) : false; + swipedirbools[(int)DS4Controls.SwipeUp] = tp != null ? (!priorMouse ? tp.swipeUp : tp.priorSwipeUp) : false; + swipedirbools[(int)DS4Controls.SwipeDown] = tp != null ? (!priorMouse ? tp.swipeDown : tp.priorSwipeDown) : 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/ITouchpadBehaviour.cs b/DS4Windows/DS4Control/ITouchpadBehaviour.cs index 24a5ee7..d175391 100644 --- a/DS4Windows/DS4Control/ITouchpadBehaviour.cs +++ b/DS4Windows/DS4Control/ITouchpadBehaviour.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; namespace DS4Windows { diff --git a/DS4Windows/DS4Control/InputMethods.cs b/DS4Windows/DS4Control/InputMethods.cs index 278f86e..c90516c 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,71 @@ 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: + case VK_VOLUME_MUTE: + case VK_VOLUME_DOWN: + case VK_VOLUME_UP: + case VK_MEDIA_NEXT_TRACK: + case VK_MEDIA_PREV_TRACK: + case VK_LAUNCH_MEDIA_SELECT: + case VK_BROWSER_HOME: + case VK_LAUNCH_MAIL: + case VK_LAUNCH_APP1: + case VK_LAUNCH_APP2: + case VK_APPS: + { + 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 +276,14 @@ 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_APPS = 0x5D, + VK_DIVIDE = 0x6F, VK_NUMLOCK = 0x90, VK_RCONTROL = 0xA3, VK_RMENU = 0xA5, VK_BROWSER_HOME = 0xAC, + VK_VOLUME_MUTE = 0xAD, VK_VOLUME_DOWN = 0xAE, VK_VOLUME_UP = 0xAF, + VK_MEDIA_NEXT_TRACK = 0xB0, VK_MEDIA_PREV_TRACK = 0xB1, VK_MEDIA_STOP = 0xB2, VK_MEDIA_PLAY_PAUSE = 0xB3, + VK_LAUNCH_MAIL = 0xB4, VK_LAUNCH_MEDIA_SELECT = 0xB5, VK_LAUNCH_APP1 = 0xB6, VK_LAUNCH_APP2 = 0xB7; [DllImport("user32.dll", SetLastError = true)] private static extern uint SendInput(uint numberOfInputs, INPUT[] inputs, int sizeOfInputs); @@ -285,6 +291,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 +308,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..2c6c94d 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) { @@ -56,7 +59,24 @@ namespace DS4Windows } public static SyntheticState globalState = new SyntheticState(); - public static SyntheticState[] deviceState = { new SyntheticState(), new SyntheticState(), new SyntheticState(), new SyntheticState() }; + public static SyntheticState[] deviceState = new SyntheticState[4] + { new SyntheticState(), new SyntheticState(), new SyntheticState(), + new SyntheticState() }; + + public static DS4StateFieldMapping[] fieldMappings = new DS4StateFieldMapping[4] { + new DS4StateFieldMapping(), new DS4StateFieldMapping(), new DS4StateFieldMapping(), + new DS4StateFieldMapping() + }; + public static DS4StateFieldMapping[] outputFieldMappings = new DS4StateFieldMapping[4] + { + new DS4StateFieldMapping(), new DS4StateFieldMapping(), new DS4StateFieldMapping(), + new DS4StateFieldMapping() + }; + public static DS4StateFieldMapping[] previousFieldMappings = new DS4StateFieldMapping[4] + { + new DS4StateFieldMapping(), new DS4StateFieldMapping(), new DS4StateFieldMapping(), + new DS4StateFieldMapping() + }; // TODO When we disconnect, process a null/dead state to release any keys or buttons. public static DateTime oldnow = DateTime.UtcNow; @@ -64,33 +84,89 @@ namespace DS4Windows private static int wheel = 0, keyshelddown = 0; //mapcustom - public static bool[] pressedonce = new bool[261], macrodone = new bool[34]; + public static bool[] pressedonce = new bool[261], macrodone = new bool[38]; static bool[] macroControl = new bool[25]; + static uint macroCount = 0; //actions - public static int[] fadetimer = { 0, 0, 0, 0 }; - public static int[] prevFadetimer = { 0, 0, 0, 0 }; + public static int[] fadetimer = new int[4] { 0, 0, 0, 0 }; + public static int[] prevFadetimer = new int[4] { 0, 0, 0, 0 }; public static DS4Color[] lastColor = new DS4Color[4]; public static List actionDone = new List(); - //public static List[] actionDone = { new List(), new List(), new List(), new List() }; - //public static bool[,] actionDone = new bool[4, 50]; public static SpecialAction[] untriggeraction = new SpecialAction[4]; public static DateTime[] nowAction = { DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue }; public static DateTime[] oldnowAction = { DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue }; - public static int[] untriggerindex = { -1, -1, -1, -1 }; - 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; + public static int[] untriggerindex = new int[4] { -1, -1, -1, -1 }; + public static DateTime[] oldnowKeyAct = new DateTime[4] { DateTime.MinValue, + DateTime.MinValue, DateTime.MinValue, DateTime.MinValue }; - //special macros + private static DS4Controls[] shiftTriggerMapping = new DS4Controls[26] { 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 = new int[38] { 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 + 34, // DS4Controls.SwipeLeft + 35, // DS4Controls.SwipeRight + 36, // DS4Controls.SwipeUp + 37 // DS4Controls.SwipeDown + }; + + // Define here to save some time processing. + // It is enough to feel a difference during gameplay. + private static int[] rsOutCurveModeArray = new int[4] { 0, 0, 0, 0 }; + private static int[] lsOutCurveModeArray = new int[4] { 0, 0, 0, 0 }; + static bool tempBool = false; + private static double[] tempDoubleArray = new double[4] { 0.0, 0.0, 0.0, 0.0 }; + private static int[] tempIntArray = new int[4] { 0, 0, 0, 0 }; + + // Special macros static bool altTabDone = true; - static DateTime altTabNow = DateTime.UtcNow, oldAltTabNow = DateTime.UtcNow - TimeSpan.FromSeconds(1); + static DateTime altTabNow = DateTime.UtcNow, + oldAltTabNow = DateTime.UtcNow - TimeSpan.FromSeconds(1); - //mouse + // Mouse public static int mcounter = 34; public static int mouseaccel = 0; public static int prevmouseaccel = 0; private static double horizontalRemainder = 0.0, verticalRemainder = 0.0; + private const int MOUSESPEEDFACTOR = 48; + private const double MOUSESTICKOFFSET = 0.032; public static void Commit(int device) { @@ -163,18 +239,18 @@ namespace DS4Windows if (globalState.currentClicks.wUpCount != 0 && globalState.previousClicks.wUpCount == 0) { - InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_WHEEL, 100); + InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_WHEEL, 120); oldnow = DateTime.UtcNow; - wheel = 100; + wheel = 120; } else if (globalState.currentClicks.wUpCount == 0 && globalState.previousClicks.wUpCount != 0) wheel = 0; if (globalState.currentClicks.wDownCount != 0 && globalState.previousClicks.wDownCount == 0) { - InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_WHEEL, -100); + InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_WHEEL, -120); oldnow = DateTime.UtcNow; - wheel = -100; + wheel = -120; } if (globalState.currentClicks.wDownCount == 0 && globalState.previousClicks.wDownCount != 0) wheel = 0; @@ -193,58 +269,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 +339,7 @@ namespace DS4Windows if (now >= oldnow + TimeSpan.FromMilliseconds(25) && pressagain) { oldnow = now; - InputMethods.performSCKeyPress(kvp.Key); + InputMethods.performSCKeyPress(kvpKey); } } else if (pressagain) @@ -267,7 +348,7 @@ namespace DS4Windows if (now >= oldnow + TimeSpan.FromMilliseconds(25) && pressagain) { oldnow = now; - InputMethods.performKeyPress(kvp.Key); + InputMethods.performKeyPress(kvpKey); } } } @@ -276,12 +357,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; } } @@ -290,6 +371,7 @@ namespace DS4Windows } state.SavePrevious(true); } + public enum Click { None, Left, Middle, Right, Fourth, Fifth, WUP, WDOWN }; public static void MapClick(int device, Click mouseClick) { @@ -316,48 +398,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.SwipeDown) { - 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,37 +418,44 @@ namespace DS4Windows percent /= 100f; return value1 * percent + value2 * (1 - percent); } - static double Clamp(double min, double value, double max) + + private static int ClampInt(int min, int value, int max) { - if (value > max) - return max; - else if (value < min) - return min; - else - return value; + return (value < min) ? min : (value > max) ? max : value; } - public static DS4State SetCurveAndDeadzone(int device, DS4State cState) + public static DS4State SetCurveAndDeadzone(int device, DS4State cState, DS4State dState) { - DS4State dState = new DS4State(cState); + double rotation = tempDoubleArray[device] = getLSRotation(device); + if (rotation > 0.0 || rotation < 0.0) + cState.rotateLSCoordinates(rotation); + + double rotationRS = tempDoubleArray[device] = getRSRotation(device); + if (rotationRS > 0.0 || rotationRS < 0.0) + cState.rotateRSCoordinates(rotationRS); + + cState.CopyTo(dState); + //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)) { curvex = (x > 127.5f ? Math.Min(x, (x / max) * multimax) : Math.Max(x, (x / max) * multimin)); curvey = (y > 127.5f ? Math.Min(y, (y / max) * multimax) : Math.Max(y, (y / max) * multimin)); - //btnLSTrack.Location = new Point((int)(dpix * curvex / 2.09 + lbLSTrack.Location.X), (int)(dpiy * curvey / 2.09 + lbLSTrack.Location.Y)); } else { @@ -410,17 +470,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,94 +505,556 @@ 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.5), (dState.LX - 127.5)); + 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.5) + 127.5; + double maxZoneXPosValue = (ratio * 127.5) + 127.5; + double maxZoneYNegValue = maxZoneXNegValue; + double maxZoneYPosValue = maxZoneXPosValue; + double maxZoneX = dState.LX >= 127.5 ? (maxZoneXPosValue - 127.5) : (maxZoneXNegValue - 127.5); + double maxZoneY = dState.LY >= 127.5 ? (maxZoneYPosValue - 127.5) : (maxZoneYNegValue - 127.5); + + 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 = Global.Clamp(maxZoneXNegValue, dState.LX, maxZoneXPosValue); + double currentY = Global.Clamp(maxZoneYNegValue, dState.LY, maxZoneYPosValue); + tempOutputX = ((currentX - 127.5 - tempLsXDead) / (maxZoneX - tempLsXDead)); + tempOutputY = ((currentY - 127.5 - tempLsYDead) / (maxZoneY - tempLsYDead)); + } + } + else + { + double currentX = Global.Clamp(maxZoneXNegValue, dState.LX, maxZoneXPosValue); + double currentY = Global.Clamp(maxZoneYNegValue, dState.LY, maxZoneYPosValue); + tempOutputX = (currentX - 127.5) / maxZoneX; + tempOutputY = (currentY - 127.5) / 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.5); + } + else + { + dState.LX = 127; + } + + if (tempOutputY > 0.0) + { + dState.LY = (byte)((((1.0 - tempLsYAntiDeadPercent) * tempOutputY + tempLsYAntiDeadPercent)) * maxYValue + 127.5); + } + 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.5, 2) + Math.Pow(cState.RY - 127.5, 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.5), (dState.RX - 127.5)); + 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.5) + 127.5; + double maxZoneXPosValue = (ratio * 127.5) + 127.5; + double maxZoneYNegValue = maxZoneXNegValue; + double maxZoneYPosValue = maxZoneXPosValue; + double maxZoneX = dState.RX >= 127.5 ? (maxZoneXPosValue - 127.5) : (maxZoneXNegValue - 127.5); + double maxZoneY = dState.RY >= 127.5 ? (maxZoneYPosValue - 127.5) : (maxZoneYNegValue - 127.5); + + 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 = Global.Clamp(maxZoneXNegValue, dState.RX, maxZoneXPosValue); + double currentY = Global.Clamp(maxZoneYNegValue, dState.RY, maxZoneYPosValue); + + tempOutputX = ((currentX - 127.5 - tempRsXDead) / (maxZoneX - tempRsXDead)); + tempOutputY = ((currentY - 127.5 - tempRsYDead) / (maxZoneY - tempRsYDead)); + } + } + else + { + double currentX = Global.Clamp(maxZoneXNegValue, dState.RX, maxZoneXPosValue); + double currentY = Global.Clamp(maxZoneYNegValue, dState.RY, maxZoneYPosValue); + + tempOutputX = (currentX - 127.5) / maxZoneX; + tempOutputY = (currentY - 127.5) / maxZoneY; + } + + 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.5); + } + else + { + dState.RX = 127; + } + + if (tempOutputY > 0.0) + { + dState.RY = (byte)((((1.0 - tempRsYAntiDeadPercent) * tempOutputY + tempRsYAntiDeadPercent)) * maxYValue + 127.5); + } + 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.0 * ratio; + + if (l2Deadzone > 0) + { + if (cState.L2 > l2Deadzone) + { + double current = Global.Clamp(0, dState.L2, maxValue); + tempL2Output = (current - l2Deadzone) / (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.0); + } + 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 = Global.Clamp(0, dState.R2, maxValue); + tempR2Output = (current - r2Deadzone) / (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.0); + } + 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)Global.Clamp(0, lsSens * (dState.LX - 127.5) + 127.5, 255); + dState.LY = (byte)Global.Clamp(0, lsSens * (dState.LY - 127.5) + 127.5, 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)Global.Clamp(0, rsSens * (dState.RX - 127.5) + 127.5, 255); + dState.RY = (byte)Global.Clamp(0, rsSens * (dState.RY - 127.5) + 127.5, 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)Global.Clamp(0, l2Sens * dState.L2, 255); + + double r2Sens = getR2Sens(device); + if (r2Sens != 1.0) + dState.R2 = (byte)Global.Clamp(0, r2Sens * dState.R2, 255); + + int lsOutCurveMode = lsOutCurveModeArray[device] = getLsOutCurveMode(device); + if (lsOutCurveMode > 0) + { + double tempX = (dState.LX - 127.5) / 127.5; + double tempY = (dState.LY - 127.5) / 127.5; + double signX = tempX >= 0.0 ? 1.0 : -1.0; + double signY = tempY >= 0.0 ? 1.0 : -1.0; + + if (lsOutCurveMode == 1) + { + double absX = Math.Abs(tempX); + double absY = Math.Abs(tempY); + double outputX = 0.0; + double outputY = 0.0; + + if (absX <= 0.4) + { + outputX = 0.43 * absX; + } + else if (absX <= 0.75) + { + outputX = absX - 0.228; + } + else if (absX > 0.75) + { + outputX = (absX * 1.912) - 0.912; + } + + if (absY <= 0.4) + { + outputY = 0.43 * absY; + } + else if (absY <= 0.75) + { + outputY = absY - 0.228; + } + else if (absY > 0.75) + { + outputY = (absY * 1.912) - 0.912; + } + + dState.LX = (byte)(outputX * signX * 127.5 + 127.5); + dState.LY = (byte)(outputY * signY * 127.5 + 127.5); + } + else if (lsOutCurveMode == 2) + { + double outputX = tempX * tempX; + double outputY = tempY * tempY; + dState.LX = (byte)(outputX * signX * 127.5 + 127.5); + dState.LY = (byte)(outputY * signY * 127.5 + 127.5); + } + else if (lsOutCurveMode == 3) + { + double outputX = tempX * tempX * tempX; + double outputY = tempY * tempY * tempY; + dState.LX = (byte)(outputX * 127.5 + 127.5); + dState.LY = (byte)(outputY * 127.5 + 127.5); + } + } + + int rsOutCurveMode = rsOutCurveModeArray[device] = getRsOutCurveMode(device); + if (rsOutCurveMode > 0) + { + double tempX = (dState.RX - 127.5) / 127.5; + double tempY = (dState.RY - 127.5) / 127.5; + double signX = tempX >= 0.0 ? 1.0 : -1.0; + double signY = tempY >= 0.0 ? 1.0 : -1.0; + + if (rsOutCurveMode == 1) + { + double absX = Math.Abs(tempX); + double absY = Math.Abs(tempY); + double outputX = 0.0; + double outputY = 0.0; + + if (absX <= 0.4) + { + outputX = 0.414 * absX; + } + else if (absX <= 0.75) + { + outputX = absX - 0.24; + } + else if (absX > 0.75) + { + outputX = (absX * 1.9376) - 0.9376; + } + + if (absY <= 0.4) + { + outputY = 0.414 * absY; + } + else if (absY <= 0.75) + { + outputY = absY - 0.24; + } + else if (absY > 0.75) + { + outputY = (absY * 1.9376) - 0.9376; + } + + dState.RX = (byte)(outputX * signX * 127.5 + 127.5); + dState.RY = (byte)(outputY * signY * 127.5 + 127.5); + } + else if (rsOutCurveMode == 2) + { + double outputX = tempX * tempX; + double outputY = tempY * tempY; + dState.RX = (byte)(outputX * signX * 127.5 + 127.5); + dState.RY = (byte)(outputY * signY * 127.5 + 127.5); + } + else if (rsOutCurveMode == 3) + { + double outputX = tempX * tempX * tempX; + double outputY = tempY * tempY * tempY; + dState.RX = (byte)(outputX * 127.5 + 127.5); + dState.RY = (byte)(outputY * 127.5 + 127.5); + } + } + + int l2OutCurveMode = tempIntArray[device] = getL2OutCurveMode(device); + if (l2OutCurveMode > 0) + { + double temp = dState.L2 / 255.0; + if (l2OutCurveMode == 1) + { + double output = temp * temp; + dState.L2 = (byte)(output * 255.0); + } + else if (l2OutCurveMode == 2) + { + double output = temp * temp * temp; + dState.L2 = (byte)(output * 255.0); + } + } + + int r2OutCurveMode = tempIntArray[device] = getR2OutCurveMode(device); + if (r2OutCurveMode > 0) + { + double temp = dState.R2 / 255.0; + if (r2OutCurveMode == 1) + { + double output = temp * temp; + dState.R2 = (byte)(output * 255.0); + } + else if (r2OutCurveMode == 2) + { + double output = temp * temp * temp; + dState.R2 = (byte)(output * 255.0); + } + } + + bool sOff = tempBool = isUsingSAforMouse(device); + if (sOff == false) + { + int SXD = (int)(128d * getSXDeadzone(device)); + int SZD = (int)(128d * getSZDeadzone(device)); + double SXMax = getSXMaxzone(device); + double SZMax = getSZMaxzone(device); + double sxAntiDead = getSXAntiDeadzone(device); + double szAntiDead = getSZAntiDeadzone(device); + double sxsens = getSXSens(device); + double szsens = getSZSens(device); + int result = 0; + + int gyroX = cState.Motion.accelX, gyroZ = cState.Motion.accelZ; + int absx = Math.Abs(gyroX), absz = Math.Abs(gyroZ); + + if (SXD > 0 || SXMax < 1.0 || sxAntiDead > 0) + { + int maxValue = (int)(SXMax * 128d); + if (absx > SXD) + { + double ratioX = absx < maxValue ? (absx - SXD) / (double)(maxValue - SXD) : 1.0; + dState.Motion.outputAccelX = Math.Sign(gyroX) * + (int)Math.Min(128d, sxsens * 128d * ((1.0 - sxAntiDead) * ratioX + sxAntiDead)); + } + else + { + dState.Motion.outputAccelX = 0; + } + } + else + { + dState.Motion.outputAccelX = Math.Sign(gyroX) * + (int)Math.Min(128d, sxsens * 128d * (absx / 128d)); + } + + if (SZD > 0 || SZMax < 1.0 || szAntiDead > 0) + { + int maxValue = (int)(SZMax * 128d); + if (absz > SZD) + { + double ratioZ = absz < maxValue ? (absz - SZD) / (double)(maxValue - SZD) : 1.0; + dState.Motion.outputAccelZ = Math.Sign(gyroZ) * + (int)Math.Min(128d, szsens * 128d * ((1.0 - szAntiDead) * ratioZ + szAntiDead)); + } + else + { + dState.Motion.outputAccelZ = 0; + } + } + else + { + dState.Motion.outputAccelZ = Math.Sign(gyroZ) * + (int)Math.Min(128d, szsens * 128d * (absz / 128d)); + } + + int sxOutCurveMode = tempIntArray[device] = getSXOutCurveMode(device); + if (sxOutCurveMode > 0) + { + double temp = dState.Motion.outputAccelX / 128.0; + double sign = Math.Sign(temp); + if (sxOutCurveMode == 1) + { + double output = temp * temp; + result = (int)(output * sign * 128.0); + dState.Motion.outputAccelX = result; + } + else if (sxOutCurveMode == 2) + { + double output = temp * temp * temp; + result = (int)(output * 128.0); + dState.Motion.outputAccelX = result; + } + } + + int szOutCurveMode = tempIntArray[device] = getSZOutCurveMode(device); + if (szOutCurveMode > 0) + { + double temp = dState.Motion.outputAccelZ / 128.0; + double sign = Math.Sign(temp); + if (szOutCurveMode == 1) + { + double output = temp * temp; + result = (int)(output * sign * 128.0); + dState.Motion.outputAccelZ = result; + } + else if (szOutCurveMode == 2) + { + double output = temp * temp * temp; + result = (int)(output * 128.0); + dState.Motion.outputAccelZ = result; + } + } + } + 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 if (trigger < 26) + { + DS4Controls ds = shiftTriggerMapping[trigger]; + result = getBoolMapping2(device, ds, cState, eState, tp, fieldMapping); + } + else if (trigger == 26) + { + result = cState.Touch1Finger; + } + + return result; + } + private static X360Controls getX360ControlsByName(string key) { X360Controls x3c; if (Enum.TryParse(key, true, out x3c)) return x3c; + switch (key) { case "Back": return X360Controls.Back; @@ -572,8 +1098,9 @@ namespace DS4Windows case "Mouse Left": return X360Controls.MouseLeft; case "Mouse Right": return X360Controls.MouseRight; case "Unbound": return X360Controls.Unbound; - + default: break; } + return X360Controls.Unbound; } @@ -582,55 +1109,46 @@ 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 = fieldMappings[device]; + fieldMapping.populateFieldMapping(cState, eState, tp); + DS4StateFieldMapping outputfieldMapping = outputFieldMappings[device]; + outputfieldMapping.populateFieldMapping(cState, eState, tp); + //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,178 +1160,12 @@ namespace DS4Windows actionType = dcs.actionType; keyType = dcs.keyType; } - if (action != null) - { - if (actionType == DS4ControlSettings.ActionType.Macro) - { - if (getBoolMapping(device, dcs.control, cState, eState, tp)) - { - resetToDefaultValue(dcs.control, MappedState); - PlayMacro(device, macroControl, string.Join("/", (int[])action), dcs.control, keyType); - } - else if (!getBoolMapping(device, dcs.control, cState, eState, tp)) - { - 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)) - { - resetToDefaultValue(dcs.control, MappedState); - 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]) - { - kp.current.toggle = !kp.current.toggle; - pressedonce[value] = true; - } - kp.current.toggleCount++; - } - kp.current.repeatCount++; - } - else - pressedonce[value] = false; - } - 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())) - { - 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; - } - if (keyType.HasFlag(DS4KeyType.Toggle)) - { - if (getBoolMapping(device, dcs.control, cState, eState, tp)) - { - resetToDefaultValue(dcs.control, MappedState); - if (!pressedonce[keyvalue]) - { - deviceState.currentClicks.toggle = !deviceState.currentClicks.toggle; - pressedonce[keyvalue] = true; - } - deviceState.currentClicks.toggleCount++; - } - else - { - pressedonce[keyvalue] = false; - } - } - resetToDefaultValue(dcs.control, MappedState); // 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) && ShiftTrigger2(dcs.shiftTrigger, device, cState, eState, tp, fieldMapping); + bool regE = !string.IsNullOrEmpty(dcs.extras); + if ((regE || shiftE) && getBoolActionMapping2(device, dcs.control, cState, eState, tp, fieldMapping)) { usingExtra = dcs.control; string p; @@ -821,19 +1173,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 +1197,7 @@ namespace DS4Windows DS4LightBar.forcedFlash[device] = (byte)extras[6]; DS4LightBar.forcelight[device] = true; } + if (extras[7] == 1) { if (oldmouse[device] == -1) @@ -854,197 +1211,505 @@ namespace DS4Windows { DS4LightBar.forcelight[device] = false; DS4LightBar.forcedFlash[device] = 0; - ButtonMouseSensitivity[device] = oldmouse[device]; - oldmouse[device] = -1; + if (oldmouse[device] != -1) + { + ButtonMouseSensitivity[device] = oldmouse[device]; + oldmouse[device] = -1; + } + ctrl.setRumble(0, 0, device); held[device] = false; usingExtra = DS4Controls.None; } } - } - if (macroControl[00]) MappedState.Cross = true; - if (macroControl[01]) MappedState.Circle = true; - if (macroControl[02]) MappedState.Square = true; - if (macroControl[03]) MappedState.Triangle = true; - if (macroControl[04]) MappedState.Options = true; - if (macroControl[05]) MappedState.Share = true; - if (macroControl[06]) MappedState.DpadUp = true; - if (macroControl[07]) MappedState.DpadDown = true; - if (macroControl[08]) MappedState.DpadLeft = true; - if (macroControl[09]) MappedState.DpadRight = true; - if (macroControl[10]) MappedState.PS = true; - if (macroControl[11]) MappedState.L1 = true; - if (macroControl[12]) MappedState.R1 = true; - if (macroControl[13]) MappedState.L2 = 255; - if (macroControl[14]) MappedState.R2 = 255; - if (macroControl[15]) MappedState.L3 = true; - if (macroControl[16]) MappedState.R3 = true; - if (macroControl[17]) MappedState.LX = 255; - if (macroControl[18]) MappedState.LX = 0; - if (macroControl[19]) MappedState.LY = 255; - if (macroControl[20]) MappedState.LY = 0; - if (macroControl[21]) MappedState.RX = 255; - 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, ShiftTrigger(GetDS4STrigger(device, DS4Controls.LYNeg.ToString()), device, cState, eState, tp), DS4Controls.LYNeg)) - LYN.Add(DS4Controls.LYNeg); - - if (IfAxisIsNotModified(device, ShiftTrigger(GetDS4STrigger(device, DS4Controls.LYPos.ToString()), device, cState, eState, tp), DS4Controls.LYPos)) - LYP.Add(DS4Controls.LYPos); - - if (IfAxisIsNotModified(device, ShiftTrigger(GetDS4STrigger(device, DS4Controls.RXNeg.ToString()), device, cState, eState, tp), DS4Controls.RXNeg)) - RXN.Add(DS4Controls.RXNeg); - - if (IfAxisIsNotModified(device, ShiftTrigger(GetDS4STrigger(device, DS4Controls.RXPos.ToString()), device, cState, eState, tp), DS4Controls.RXPos)) - RXP.Add(DS4Controls.RXPos); - - if (IfAxisIsNotModified(device, ShiftTrigger(GetDS4STrigger(device, DS4Controls.RYNeg.ToString()), device, cState, eState, tp), DS4Controls.RYNeg)) - RYN.Add(DS4Controls.RYNeg); - - if (IfAxisIsNotModified(device, ShiftTrigger(GetDS4STrigger(device, DS4Controls.RYPos.ToString()), device, cState, eState, tp), DS4Controls.RYPos)) - RYP.Add(DS4Controls.RYPos); - - if (Math.Abs(MappedState.LX - 127) < 10) - if (LXN.Count > 0 || LXP.Count > 0) + if (action != null) { - 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 (actionType == DS4ControlSettings.ActionType.Macro) + { + bool active = getBoolMapping2(device, dcs.control, cState, eState, tp, fieldMapping); + if (active) + { + PlayMacro(device, macroControl, string.Join("/", (int[])action), dcs.control, keyType); + } + else + { + EndMacro(device, macroControl, string.Join("/", (int[])action), dcs.control); + } + + // erase default mappings for things that are remapped + resetToDefaultValue2(dcs.control, MappedState, outputfieldMapping); + } + else if (actionType == DS4ControlSettings.ActionType.Key) + { + ushort value = Convert.ToUInt16(action); + if (getBoolActionMapping2(device, dcs.control, cState, eState, tp, fieldMapping)) + { + 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]) + { + kp.current.toggle = !kp.current.toggle; + pressedonce[value] = true; + } + kp.current.toggleCount++; + } + kp.current.repeatCount++; + } + else + pressedonce[value] = false; + + // erase default mappings for things that are remapped + resetToDefaultValue2(dcs.control, MappedState, outputfieldMapping); + } + else if (actionType == DS4ControlSettings.ActionType.Button) + { + int keyvalue = 0; + bool isAnalog = false; + + if (dcs.control >= DS4Controls.LXNeg && dcs.control <= DS4Controls.RYPos) + { + 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, ctrl); + tempMouseDeltaY = -Math.Abs((tempMouseDeltaY == -2147483648 ? 0 : tempMouseDeltaY)); + } + + break; + } + case X360Controls.MouseDown: + { + if (tempMouseDeltaY == 0) + { + tempMouseDeltaY = getMouseMapping(device, dcs.control, cState, eState, fieldMapping, 1, ctrl); + tempMouseDeltaY = Math.Abs((tempMouseDeltaY == -2147483648 ? 0 : tempMouseDeltaY)); + } + + break; + } + case X360Controls.MouseLeft: + { + if (tempMouseDeltaX == 0) + { + tempMouseDeltaX = getMouseMapping(device, dcs.control, cState, eState, fieldMapping, 2, ctrl); + tempMouseDeltaX = -Math.Abs((tempMouseDeltaX == -2147483648 ? 0 : tempMouseDeltaX)); + } + + break; + } + case X360Controls.MouseRight: + { + if (tempMouseDeltaX == 0) + { + tempMouseDeltaX = getMouseMapping(device, dcs.control, cState, eState, fieldMapping, 3, ctrl); + tempMouseDeltaX = Math.Abs((tempMouseDeltaX == -2147483648 ? 0 : tempMouseDeltaX)); + } + + break; + } + + default: break; + } + } + + if (keyType.HasFlag(DS4KeyType.Toggle)) + { + if (getBoolActionMapping2(device, dcs.control, cState, eState, tp, fieldMapping)) + { + resetToDefaultValue2(dcs.control, MappedState, outputfieldMapping); + if (!pressedonce[keyvalue]) + { + deviceState.currentClicks.toggle = !deviceState.currentClicks.toggle; + pressedonce[keyvalue] = true; + } + deviceState.currentClicks.toggleCount++; + } + else + { + pressedonce[keyvalue] = false; + } + } + + // erase default mappings for things that are remapped + resetToDefaultValue2(dcs.control, MappedState, outputfieldMapping); + } } - //else - //MappedState.LX = cState.LX; - if (Math.Abs(MappedState.LY - 127) < 10) - if (LYN.Count > 0 || LYP.Count > 0) + } + + outputfieldMapping.populateState(MappedState); + + if (macroCount > 0) + { + if (macroControl[00]) MappedState.Cross = true; + if (macroControl[01]) MappedState.Circle = true; + if (macroControl[02]) MappedState.Square = true; + if (macroControl[03]) MappedState.Triangle = true; + if (macroControl[04]) MappedState.Options = true; + if (macroControl[05]) MappedState.Share = true; + if (macroControl[06]) MappedState.DpadUp = true; + if (macroControl[07]) MappedState.DpadDown = true; + if (macroControl[08]) MappedState.DpadLeft = true; + if (macroControl[09]) MappedState.DpadRight = true; + if (macroControl[10]) MappedState.PS = true; + if (macroControl[11]) MappedState.L1 = true; + if (macroControl[12]) MappedState.R1 = true; + if (macroControl[13]) MappedState.L2 = 255; + if (macroControl[14]) MappedState.R2 = 255; + if (macroControl[15]) MappedState.L3 = true; + if (macroControl[16]) MappedState.R3 = true; + if (macroControl[17]) MappedState.LX = 255; + if (macroControl[18]) MappedState.LX = 0; + if (macroControl[19]) MappedState.LY = 255; + if (macroControl[20]) MappedState.LY = 0; + if (macroControl[21]) MappedState.RX = 255; + if (macroControl[22]) MappedState.RX = 0; + if (macroControl[23]) MappedState.RY = 255; + if (macroControl[24]) MappedState.RY = 0; + } + + if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.LXNeg), device, cState, eState, tp, fieldMapping), DS4Controls.LXNeg)) + tempControlDict[DS4Controls.LXNeg] = DS4Controls.LXNeg; + + if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.LXPos), device, cState, eState, tp, fieldMapping), DS4Controls.LXPos)) + tempControlDict[DS4Controls.LXPos] = DS4Controls.LXPos; + + if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.LYNeg), device, cState, eState, tp, fieldMapping), DS4Controls.LYNeg)) + tempControlDict[DS4Controls.LYNeg] = DS4Controls.LYNeg; + + if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.LYPos), device, cState, eState, tp, fieldMapping), DS4Controls.LYPos)) + tempControlDict[DS4Controls.LYPos] = DS4Controls.LYPos; + + if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.RXNeg), device, cState, eState, tp, fieldMapping), DS4Controls.RXNeg)) + tempControlDict[DS4Controls.RXNeg] = DS4Controls.RXNeg; + + if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.RXPos), device, cState, eState, tp, fieldMapping), DS4Controls.RXPos)) + tempControlDict[DS4Controls.RXPos] = DS4Controls.RXPos; + + if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.RYNeg), device, cState, eState, tp, fieldMapping), DS4Controls.RYNeg)) + tempControlDict[DS4Controls.RYNeg] = DS4Controls.RYNeg; + + if (IfAxisIsNotModified(device, ShiftTrigger2(GetDS4STrigger(device, DS4Controls.RYPos), device, cState, eState, tp, fieldMapping), DS4Controls.RYPos)) + tempControlDict[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 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); + 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.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 +1729,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 +1748,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 +1769,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 +1799,368 @@ 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]; + bool synced = tempBool = d.isSynced(); + if (synced && !d.isCharging()) + { + ConnectionType deviceConn = d.getConnectionType(); + bool exclusive = tempBool = d.isExclusive(); + if (deviceConn == ConnectionType.BT) + { + d.DisconnectBT(); + } + else if (deviceConn == ConnectionType.SONYWA && exclusive) + { + d.DisconnectDongle(); + } + + //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; + + bool tappedOnce = action.tappedOnce, firstTouch = action.firstTouch, + secondtouchbegin = action.secondtouchbegin; + //DateTime pastTime = action.pastTime, firstTap = action.firstTap, + // TimeofEnd = action.TimeofEnd; + + /*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.getPreviousStateRef(); + // Only create one instance of previous DS4StateFieldMapping in case more than one multi-action + // button is assigned + if (previousFieldMapping == null) + { + previousFieldMapping = previousFieldMappings[device]; + previousFieldMapping.populateFieldMapping(tempPrevState, eState, tp, true); + //previousFieldMapping = new DS4StateFieldMapping(tempPrevState, eState, tp, true); + } + + 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 + action.pastTime = DateTime.UtcNow; + if (action.pastTime <= (action.firstTap + TimeSpan.FromMilliseconds(100))) + { + action.tappedOnce = tappedOnce = false; + action.secondtouchbegin = secondtouchbegin = true; + //tappedOnce = false; + //secondtouchbegin = true; + } + else + action.firstTouch = firstTouch = true; + //firstTouch = true; + } + else if (!activeCur && activePrev) + { + // released + if (secondtouchbegin) + { + action.firstTouch = firstTouch = false; + action.secondtouchbegin = secondtouchbegin = false; + //firstTouch = false; + //secondtouchbegin = false; + } + else if (firstTouch) + { + action.firstTouch = firstTouch = false; + //firstTouch = false; + if (DateTime.UtcNow <= (action.pastTime + TimeSpan.FromMilliseconds(150)) && !tappedOnce) + { + action.tappedOnce = tappedOnce = true; + //tappedOnce = true; + action.firstTap = DateTime.UtcNow; + action.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 - action.TimeofEnd) > TimeSpan.FromMilliseconds(150)) + { + if (macro != "") + PlayMacro(device, macroControl, macro, DS4Controls.None, DS4KeyType.None); + + tappedOnce = false; + action.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 - action.pastTime) > TimeSpan.FromMilliseconds(500)) //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; + action.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; + action.secondtouchbegin = false; + } + } + else + { + actionDone[index].dev[device] = false; + } + } } } } @@ -1401,25 +2171,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 +2202,21 @@ 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; + } } } @@ -1516,31 +2295,31 @@ namespace DS4Windows else if (i == 258) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_MIDDLEDOWN); else if (i == 259) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_XBUTTONDOWN, 1); else if (i == 260) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_XBUTTONDOWN, 2); - else if (i == 261) macroControl[0] = true; - else if (i == 262) macroControl[1] = true; - else if (i == 263) macroControl[2] = true; - else if (i == 264) macroControl[3] = true; - else if (i == 265) macroControl[4] = true; - else if (i == 266) macroControl[5] = true; - else if (i == 267) macroControl[6] = true; - else if (i == 268) macroControl[7] = true; - else if (i == 269) macroControl[8] = true; - else if (i == 270) macroControl[9] = true; - else if (i == 271) macroControl[10] = true; - else if (i == 272) macroControl[11] = true; - else if (i == 273) macroControl[12] = true; - else if (i == 274) macroControl[13] = true; - else if (i == 275) macroControl[14] = true; - else if (i == 276) macroControl[15] = true; - else if (i == 277) macroControl[16] = true; - else if (i == 278) macroControl[17] = true; - else if (i == 279) macroControl[18] = true; - else if (i == 280) macroControl[19] = true; - else if (i == 281) macroControl[20] = true; - else if (i == 282) macroControl[21] = true; - else if (i == 283) macroControl[22] = true; - else if (i == 284) macroControl[23] = true; - else if (i == 285) macroControl[24] = true; + else if (i == 261) { macroControl[0] = true; macroCount++; } + else if (i == 262) { macroControl[1] = true; macroCount++; } + else if (i == 263) { macroControl[2] = true; macroCount++; } + else if (i == 264) { macroControl[3] = true; macroCount++; } + else if (i == 265) { macroControl[4] = true; macroCount++; } + else if (i == 266) { macroControl[5] = true; macroCount++; } + else if (i == 267) { macroControl[6] = true; macroCount++; } + else if (i == 268) { macroControl[7] = true; macroCount++; } + else if (i == 269) { macroControl[8] = true; macroCount++; } + else if (i == 270) { macroControl[9] = true; macroCount++; } + else if (i == 271) { macroControl[10] = true; macroCount++; } + else if (i == 272) { macroControl[11] = true; macroCount++; } + else if (i == 273) { macroControl[12] = true; macroCount++; } + else if (i == 274) { macroControl[13] = true; macroCount++; } + else if (i == 275) { macroControl[14] = true; macroCount++; } + else if (i == 276) { macroControl[15] = true; macroCount++; } + else if (i == 277) { macroControl[16] = true; macroCount++; } + else if (i == 278) { macroControl[17] = true; macroCount++; } + else if (i == 279) { macroControl[18] = true; macroCount++; } + else if (i == 280) { macroControl[19] = true; macroCount++; } + else if (i == 281) { macroControl[20] = true; macroCount++; } + else if (i == 282) { macroControl[21] = true; macroCount++; } + else if (i == 283) { macroControl[22] = true; macroCount++; } + else if (i == 284) { macroControl[23] = true;macroCount++; } + else if (i == 285) { macroControl[24] = true; macroCount++; } else if (keyType.HasFlag(DS4KeyType.ScanCode)) InputMethods.performSCKeyPress((ushort)i); else @@ -1554,31 +2333,31 @@ namespace DS4Windows else if (i == 258) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_MIDDLEUP); else if (i == 259) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_XBUTTONUP, 1); else if (i == 260) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_XBUTTONUP, 2); - else if (i == 261) macroControl[0] = false; - else if (i == 262) macroControl[1] = false; - else if (i == 263) macroControl[2] = false; - else if (i == 264) macroControl[3] = false; - else if (i == 265) macroControl[4] = false; - else if (i == 266) macroControl[5] = false; - else if (i == 267) macroControl[6] = false; - else if (i == 268) macroControl[7] = false; - else if (i == 269) macroControl[8] = false; - else if (i == 270) macroControl[9] = false; - else if (i == 271) macroControl[10] = false; - else if (i == 272) macroControl[11] = false; - else if (i == 273) macroControl[12] = false; - else if (i == 274) macroControl[13] = false; - else if (i == 275) macroControl[14] = false; - else if (i == 276) macroControl[15] = false; - else if (i == 277) macroControl[16] = false; - else if (i == 278) macroControl[17] = false; - else if (i == 279) macroControl[18] = false; - else if (i == 280) macroControl[19] = false; - else if (i == 281) macroControl[20] = false; - else if (i == 282) macroControl[21] = false; - else if (i == 283) macroControl[22] = false; - else if (i == 284) macroControl[23] = false; - else if (i == 285) macroControl[24] = false; + else if (i == 261) { macroControl[0] = false; if (macroCount > 0) macroCount--; } + else if (i == 262) { macroControl[1] = false; if (macroCount > 0) macroCount--; } + else if (i == 263) { macroControl[2] = false; if (macroCount > 0) macroCount--; } + else if (i == 264) { macroControl[3] = false; if (macroCount > 0) macroCount--; } + else if (i == 265) { macroControl[4] = false; if (macroCount > 0) macroCount--; } + else if (i == 266) { macroControl[5] = false; if (macroCount > 0) macroCount--; } + else if (i == 267) { macroControl[6] = false; if (macroCount > 0) macroCount--; } + else if (i == 268) { macroControl[7] = false; if (macroCount > 0) macroCount--; } + else if (i == 269) { macroControl[8] = false; if (macroCount > 0) macroCount--; } + else if (i == 270) { macroControl[9] = false; if (macroCount > 0) macroCount--; } + else if (i == 271) { macroControl[10] = false; if (macroCount > 0) macroCount--; } + else if (i == 272) { macroControl[11] = false; if (macroCount > 0) macroCount--; } + else if (i == 273) { macroControl[12] = false; if (macroCount > 0) macroCount--; } + else if (i == 274) { macroControl[13] = false; if (macroCount > 0) macroCount--; } + else if (i == 275) { macroControl[14] = false; if (macroCount > 0) macroCount--; } + else if (i == 276) { macroControl[15] = false; if (macroCount > 0) macroCount--; } + else if (i == 277) { macroControl[16] = false; if (macroCount > 0) macroCount--; } + else if (i == 278) { macroControl[17] = false; if (macroCount > 0) macroCount--; } + else if (i == 279) { macroControl[18] = false; if (macroCount > 0) macroCount--; } + else if (i == 280) { macroControl[19] = false; if (macroCount > 0) macroCount--; } + else if (i == 281) { macroControl[20] = false; if (macroCount > 0) macroCount--; } + else if (i == 282) { macroControl[21] = false; if (macroCount > 0) macroCount--; } + else if (i == 283) { macroControl[22] = false; if (macroCount > 0) macroCount--; } + else if (i == 284) { macroControl[23] = false; if (macroCount > 0) macroCount--; } + else if (i == 285) { macroControl[24] = false; if (macroCount > 0) macroCount--; } else if (keyType.HasFlag(DS4KeyType.ScanCode)) InputMethods.performSCKeyRelease((ushort)i); else @@ -1586,44 +2365,47 @@ 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); else if (i == 259) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_XBUTTONUP, 1); else if (i == 260) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_XBUTTONUP, 2); - else if (i == 261) macroControl[0] = false; - else if (i == 262) macroControl[1] = false; - else if (i == 263) macroControl[2] = false; - else if (i == 264) macroControl[3] = false; - else if (i == 265) macroControl[4] = false; - else if (i == 266) macroControl[5] = false; - else if (i == 267) macroControl[6] = false; - else if (i == 268) macroControl[7] = false; - else if (i == 269) macroControl[8] = false; - else if (i == 270) macroControl[9] = false; - else if (i == 271) macroControl[10] = false; - else if (i == 272) macroControl[11] = false; - else if (i == 273) macroControl[12] = false; - else if (i == 274) macroControl[13] = false; - else if (i == 275) macroControl[14] = false; - else if (i == 276) macroControl[15] = false; - else if (i == 277) macroControl[16] = false; - else if (i == 278) macroControl[17] = false; - else if (i == 279) macroControl[18] = false; - else if (i == 280) macroControl[19] = false; - else if (i == 281) macroControl[20] = false; - else if (i == 282) macroControl[21] = false; - else if (i == 283) macroControl[22] = false; - else if (i == 284) macroControl[23] = false; - else if (i == 285) macroControl[24] = false; + else if (i == 261) { macroControl[0] = false; if (macroCount > 0) macroCount--; } + else if (i == 262) { macroControl[1] = false; if (macroCount > 0) macroCount--; } + else if (i == 263) { macroControl[2] = false; if (macroCount > 0) macroCount--; } + else if (i == 264) { macroControl[3] = false; if (macroCount > 0) macroCount--; } + else if (i == 265) { macroControl[4] = false; if (macroCount > 0) macroCount--; } + else if (i == 266) { macroControl[5] = false; if (macroCount > 0) macroCount--; } + else if (i == 267) { macroControl[6] = false; if (macroCount > 0) macroCount--; } + else if (i == 268) { macroControl[7] = false; if (macroCount > 0) macroCount--; } + else if (i == 269) { macroControl[8] = false; if (macroCount > 0) macroCount--; } + else if (i == 270) { macroControl[9] = false; if (macroCount > 0) macroCount--; } + else if (i == 271) { macroControl[10] = false; if (macroCount > 0) macroCount--; } + else if (i == 272) { macroControl[11] = false; if (macroCount > 0) macroCount--; } + else if (i == 273) { macroControl[12] = false; if (macroCount > 0) macroCount--; } + else if (i == 274) { macroControl[13] = false; if (macroCount > 0) macroCount--; } + else if (i == 275) { macroControl[14] = false; if (macroCount > 0) macroCount--; } + else if (i == 276) { macroControl[15] = false; if (macroCount > 0) macroCount--; } + else if (i == 277) { macroControl[16] = false; if (macroCount > 0) macroCount--; } + else if (i == 278) { macroControl[17] = false; if (macroCount > 0) macroCount--; } + else if (i == 279) { macroControl[18] = false; if (macroCount > 0) macroCount--; } + else if (i == 280) { macroControl[19] = false; if (macroCount > 0) macroCount--; } + else if (i == 281) { macroControl[20] = false; if (macroCount > 0) macroCount--; } + else if (i == 282) { macroControl[21] = false; if (macroCount > 0) macroCount--; } + else if (i == 283) { macroControl[22] = false; if (macroCount > 0) macroCount--; } + else if (i == 284) { macroControl[23] = false; if (macroCount > 0) macroCount--; } + else if (i == 285) { macroControl[24] = false; if (macroCount > 0) macroCount--; } 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 +2423,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 +2459,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 +2470,1307 @@ 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, ControlService ctrl) { int controlnum = DS4ControltoInt(control); - double SXD = SXDeadzone[device]; - double SZD = SZDeadzone[device]; - int deadzoneL = 3; - int deadzoneR = 3; - if (LSDeadzone[device] >= 3) - deadzoneL = 0; - if (RSDeadzone[device] >= 3) - deadzoneR = 0; - double value = 0; - int speed = ButtonMouseSensitivity[device] + 15; + + int deadzoneL = 0; + int deadzoneR = 0; + if (getLSDeadzone(device) == 0) + deadzoneL = 3; + if (getRSDeadzone(device) == 0) + deadzoneR = 3; + + double value = 0.0; + int speed = ButtonMouseSensitivity[device]; double root = 1.002; double divide = 10000d; //DateTime now = mousenow[mnum]; - switch (control) + + int controlNum = (int)control; + DS4StateFieldMapping.ControlType controlType = DS4StateFieldMapping.mappedType[controlNum]; + //long timeElapsed = ctrl.DS4Controllers[device].getLastTimeElapsed(); + double timeElapsed = ctrl.DS4Controllers[device].lastTimeElapsedDouble; + //double mouseOffset = 0.025; + double tempMouseOffsetX = 0.0, tempMouseOffsetY = 0.0; + + 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) + { + double diff = -(cState.LX - 127 - deadzoneL) / (double)(0 - 127 - deadzoneL); + //tempMouseOffsetX = Math.Abs(Math.Cos(cState.LSAngleRad)) * MOUSESTICKOFFSET; + //tempMouseOffsetX = MOUSESTICKOFFSET; + tempMouseOffsetX = cState.LXUnit * MOUSESTICKOFFSET; + value = ((speed * MOUSESPEEDFACTOR * (timeElapsed * 0.001)) - tempMouseOffsetX) * diff + (tempMouseOffsetX * -1.0); + //value = diff * MOUSESPEEDFACTOR * (timeElapsed * 0.001) * speed; + //value = -(cState.LX - 127 - deadzoneL) / 2550d * speed; + } + + break; + } + case DS4Controls.LXPos: + { + if (cState.LX > 127 + deadzoneL) + { + double diff = (cState.LX - 127 + deadzoneL) / (double)(255 - 127 + deadzoneL); + tempMouseOffsetX = cState.LXUnit * MOUSESTICKOFFSET; + //tempMouseOffsetX = Math.Abs(Math.Cos(cState.LSAngleRad)) * MOUSESTICKOFFSET; + //tempMouseOffsetX = MOUSESTICKOFFSET; + value = ((speed * MOUSESPEEDFACTOR * (timeElapsed * 0.001)) - tempMouseOffsetX) * diff + tempMouseOffsetX; + //value = diff * MOUSESPEEDFACTOR * (timeElapsed * 0.001) * speed; + //value = (cState.LX - 127 + deadzoneL) / 2550d * speed; + } + + break; + } + case DS4Controls.RXNeg: + { + if (cState.RX < 127 - deadzoneR) + { + double diff = -(cState.RX - 127 - deadzoneR) / (double)(0 - 127 - deadzoneR); + tempMouseOffsetX = cState.RXUnit * MOUSESTICKOFFSET; + //tempMouseOffsetX = MOUSESTICKOFFSET; + //tempMouseOffsetX = Math.Abs(Math.Cos(cState.RSAngleRad)) * MOUSESTICKOFFSET; + value = ((speed * MOUSESPEEDFACTOR * (timeElapsed * 0.001)) - tempMouseOffsetX) * diff + (tempMouseOffsetX * -1.0); + //value = diff * MOUSESPEEDFACTOR * (timeElapsed * 0.001) * speed; + //value = -(cState.RX - 127 - deadzoneR) / 2550d * speed; + } + + break; + } + case DS4Controls.RXPos: + { + if (cState.RX > 127 + deadzoneR) + { + double diff = (cState.RX - 127 + deadzoneR) / (double)(255 - 127 + deadzoneR); + tempMouseOffsetX = cState.RXUnit * MOUSESTICKOFFSET; + //tempMouseOffsetX = MOUSESTICKOFFSET; + //tempMouseOffsetX = Math.Abs(Math.Cos(cState.RSAngleRad)) * MOUSESTICKOFFSET; + value = ((speed * MOUSESPEEDFACTOR * (timeElapsed * 0.001)) - tempMouseOffsetX) * diff + tempMouseOffsetX; + //value = diff * MOUSESPEEDFACTOR * (timeElapsed * 0.001) * speed; + //value = (cState.RX - 127 + deadzoneR) / 2550d * speed; + } + + break; + } + case DS4Controls.LYNeg: + { + if (cState.LY < 127 - deadzoneL) + { + double diff = -(cState.LY - 127 - deadzoneL) / (double)(0 - 127 - deadzoneL); + tempMouseOffsetY = cState.LYUnit * MOUSESTICKOFFSET; + //tempMouseOffsetY = MOUSESTICKOFFSET; + //tempMouseOffsetY = Math.Abs(Math.Sin(cState.LSAngleRad)) * MOUSESTICKOFFSET; + value = ((speed * MOUSESPEEDFACTOR * (timeElapsed * 0.001)) - tempMouseOffsetY) * diff + (tempMouseOffsetY * -1.0); + //value = diff * MOUSESPEEDFACTOR * (timeElapsed * 0.001) * speed; + //value = -(cState.LY - 127 - deadzoneL) / 2550d * speed; + } + + break; + } + case DS4Controls.LYPos: + { + if (cState.LY > 127 + deadzoneL) + { + double diff = (cState.LY - 127 + deadzoneL) / (double)(255 - 127 + deadzoneL); + tempMouseOffsetY = cState.LYUnit * MOUSESTICKOFFSET; + //tempMouseOffsetY = MOUSESTICKOFFSET; + //tempMouseOffsetY = Math.Abs(Math.Sin(cState.LSAngleRad)) * MOUSESTICKOFFSET; + value = ((speed * MOUSESPEEDFACTOR * (timeElapsed * 0.001)) - tempMouseOffsetY) * diff + tempMouseOffsetY; + //value = diff * MOUSESPEEDFACTOR * (timeElapsed * 0.001) * speed; + //value = (cState.LY - 127 + deadzoneL) / 2550d * speed; + } + + break; + } + case DS4Controls.RYNeg: + { + if (cState.RY < 127 - deadzoneR) + { + double diff = -(cState.RY - 127 - deadzoneR) / (double)(0 - 127 - deadzoneR); + tempMouseOffsetY = cState.RYUnit * MOUSESTICKOFFSET; + //tempMouseOffsetY = MOUSESTICKOFFSET; + //tempMouseOffsetY = Math.Abs(Math.Sin(cState.RSAngleRad)) * MOUSESTICKOFFSET; + value = ((speed * MOUSESPEEDFACTOR * (timeElapsed * 0.001)) - tempMouseOffsetY) * diff + (tempMouseOffsetY * -1.0); + //value = diff * MOUSESPEEDFACTOR * (timeElapsed * 0.001) * speed; + //value = -(cState.RY - 127 - deadzoneR) / 2550d * speed; + } + + break; + } + case DS4Controls.RYPos: + { + if (cState.RY > 127 + deadzoneR) + { + double diff = (cState.RY - 127 + deadzoneR) / (double)(255 - 127 + deadzoneR); + tempMouseOffsetY = cState.RYUnit * MOUSESTICKOFFSET; + //tempMouseOffsetY = MOUSESTICKOFFSET; + //tempMouseOffsetY = Math.Abs(Math.Sin(cState.RSAngleRad)) * MOUSESTICKOFFSET; + value = ((speed * MOUSESPEEDFACTOR * (timeElapsed * 0.001)) - tempMouseOffsetY) * diff + tempMouseOffsetY; + //value = diff * MOUSESPEEDFACTOR * (timeElapsed * 0.001) * speed; + //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 > 0 ? Math.Pow(root + speed / divide, gyroX) : 0); + break; + } + case DS4Controls.GyroXNeg: + { + int gyroX = fieldMapping.gryodirs[controlNum]; + value = (byte)(gyroX < 0 ? Math.Pow(root + speed / divide, -gyroX) : 0); + break; + } + case DS4Controls.GyroZPos: + { + int gyroZ = fieldMapping.gryodirs[controlNum]; + value = (byte)(gyroZ > 0 ? Math.Pow(root + speed / divide, gyroZ) : 0); + break; + } + case DS4Controls.GyroZNeg: + { + int gyroZ = fieldMapping.gryodirs[controlNum]; + value = (byte)(gyroZ < 0 ? 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; + + value *= 1 + 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; + + //double mouseXTemp = rawMouseX - (Math.IEEERemainder(rawMouseX * 1000.0, 1.0) / 1000.0); + double mouseXTemp = rawMouseX - (remainderCutoff(rawMouseX * 1000.0, 1.0) / 1000.0); + //double mouseXTemp = rawMouseX - (rawMouseX * 1000.0 - (1.0 * (int)(rawMouseX * 1000.0 / 1.0))); + mouseX = (int)mouseXTemp; + horizontalRemainder = mouseXTemp - mouseX; + //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; + } + + //double mouseYTemp = rawMouseY - (Math.IEEERemainder(rawMouseY * 1000.0, 1.0) / 1000.0); + double mouseYTemp = rawMouseY - (remainderCutoff(rawMouseY * 1000.0, 1.0) / 1000.0); + mouseY = (int)mouseYTemp; + verticalRemainder = mouseYTemp - mouseY; + //mouseY = (int)rawMouseY; + //verticalRemainder = rawMouseY - mouseY; + } + + private static double remainderCutoff(double dividend, double divisor) + { + return dividend - (divisor * (int)(dividend / divisor)); } 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) + { + bool sOff = isUsingSAforMouse(device); + + switch (control) + { + case DS4Controls.GyroXPos: + { + int gyroX = fieldMap.gryodirs[controlNum]; + result = (byte)(sOff == false ? Math.Min(255, gyroX * 2) : 0); + break; + } + case DS4Controls.GyroXNeg: + { + int gyroX = fieldMap.gryodirs[controlNum]; + result = (byte)(sOff == false ? Math.Min(255, -gyroX * 2) : 0); + break; + } + case DS4Controls.GyroZPos: + { + int gyroZ = fieldMap.gryodirs[controlNum]; + result = (byte)(sOff == false ? Math.Min(255, gyroZ * 2) : 0); + break; + } + case DS4Controls.GyroZNeg: + { + int gyroZ = fieldMap.gryodirs[controlNum]; + result = (byte)(sOff == false ? Math.Min(255, -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.AccelX; + result = (byte)(!sOff && sxsens * gyroX > SXD * 10 ? Math.Min(255, sxsens * gyroX * 2) : 0); + break; + } + case DS4Controls.GyroXNeg: + { + int gyroX = -eState.AccelX; + result = (byte)(!sOff && sxsens * gyroX < -SXD * 10 ? Math.Min(255, sxsens * -gyroX * 2) : 0); + break; + } + case DS4Controls.GyroZPos: + { + int gyroZ = eState.AccelZ; + result = (byte)(!sOff && szsens * gyroZ > SZD * 10 ? Math.Min(255, szsens * gyroZ * 2) : 0); + break; + } + case DS4Controls.GyroZNeg: + { + int gyroZ = eState.AccelZ; + 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.AccelX > 67 : false; break; + case DS4Controls.GyroXNeg: result = !sOff ? SXSens[device] * -eState.AccelX < -67 : false; break; + case DS4Controls.GyroZPos: result = !sOff ? SZSens[device] * eState.AccelZ > 67 : false; break; + case DS4Controls.GyroZNeg: result = !sOff ? SZSens[device] * eState.AccelZ < -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 = fieldMap.gryodirs[controlNum] > 0; break; + case DS4Controls.GyroXNeg: safeTest = fieldMap.gryodirs[controlNum] < -0; break; + case DS4Controls.GyroZPos: safeTest = fieldMap.gryodirs[controlNum] > 0; break; + case DS4Controls.GyroZNeg: safeTest = fieldMap.gryodirs[controlNum] < -0; break; + default: break; + } + + result = sOff == false ? 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: + { + double angle = cState.LSAngle; + result = cState.LX < 127 && (angle >= 112.5 && angle <= 247.5); + break; + } + case DS4Controls.LYNeg: + { + double angle = cState.LSAngle; + result = cState.LY < 127 && (angle >= 22.5 && angle <= 157.5); + break; + } + case DS4Controls.RXNeg: + { + double angle = cState.RSAngle; + result = cState.RX < 127 && (angle >= 112.5 && angle <= 247.5); + break; + } + case DS4Controls.RYNeg: + { + double angle = cState.RSAngle; + result = cState.RY < 127 && (angle >= 22.5 && angle <= 157.5); + break; + } + case DS4Controls.LXPos: + { + double angle = cState.LSAngle; + result = cState.LX > 127 && (angle <= 67.5 || angle >= 292.5); + break; + } + case DS4Controls.LYPos: + { + double angle = cState.LSAngle; + result = cState.LY > 127 && (angle >= 202.5 && angle <= 337.5); + break; + } + case DS4Controls.RXPos: + { + double angle = cState.RSAngle; + result = cState.RX > 127 && (angle <= 67.5 || angle >= 292.5); + break; + } + case DS4Controls.RYPos: + { + double angle = cState.RSAngle; + result = cState.RY > 127 && (angle >= 202.5 && angle <= 337.5); + 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 = fieldMap.gryodirs[controlNum] > 0; break; + case DS4Controls.GyroXNeg: safeTest = fieldMap.gryodirs[controlNum] < 0; break; + case DS4Controls.GyroZPos: safeTest = fieldMap.gryodirs[controlNum] > 0; break; + case DS4Controls.GyroZNeg: safeTest = fieldMap.gryodirs[controlNum] < 0; break; + default: break; + } + + result = sOff == false ? 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 >= 112.5 && angle <= 247.5); + } + else + { + result = cState.LX < 127; + } + + break; + } + case DS4Controls.LYNeg: + { + if (!analog) + { + double angle = cState.LSAngle; + result = cState.LY < 127 && (angle >= 22.5 && angle <= 157.5); + } + else + { + result = cState.LY < 127; + } + + break; + } + case DS4Controls.RXNeg: + { + if (!analog) + { + double angle = cState.RSAngle; + result = cState.RX < 127 && (angle >= 112.5 && angle <= 247.5); + } + else + { + result = cState.RX < 127; + } + + break; + } + case DS4Controls.RYNeg: + { + if (!analog) + { + double angle = cState.RSAngle; + result = cState.RY < 127 && (angle >= 22.5 && angle <= 157.5); + } + else + { + result = cState.RY < 127; + } + + break; + } + case DS4Controls.LXPos: + { + if (!analog) + { + double angle = cState.LSAngle; + result = cState.LX > 127 && (angle <= 67.5 || angle >= 292.5); + } + else + { + result = cState.LX > 127; + } + + break; + } + case DS4Controls.LYPos: + { + if (!analog) + { + double angle = cState.LSAngle; + result = cState.LY > 127 && (angle >= 202.5 && angle <= 337.5); + } + else + { + result = cState.LY > 127; + } + + break; + } + case DS4Controls.RXPos: + { + if (!analog) + { + double angle = cState.RSAngle; + result = cState.RX > 127 && (angle <= 67.5 || angle >= 292.5); + } + else + { + result = cState.RX > 127; + } + + break; + } + case DS4Controls.RYPos: + { + if (!analog) + { + double angle = cState.RSAngle; + result = cState.RY > 127 && (angle >= 202.5 && angle <= 337.5); + } + 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.AccelX > 67 : false; break; + case DS4Controls.GyroXNeg: result = !sOff ? SXSens[device] * eState.AccelX < -67 : false; break; + case DS4Controls.GyroZPos: result = !sOff ? SZSens[device] * eState.AccelZ > 67 : false; break; + case DS4Controls.GyroZNeg: result = !sOff ? SZSens[device] * eState.AccelZ < -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 = 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 = 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) + { + bool sOff = isUsingSAforMouse(device); + + switch (control) + { + case DS4Controls.GyroXPos: + { + if (sOff == false && fieldMap.gryodirs[controlNum] > 0) + { + if (alt) result = (byte)Math.Min(255, 127 + fieldMap.gryodirs[controlNum]); else result = (byte)Math.Max(0, 127 - fieldMap.gryodirs[controlNum]); + } + else result = falseVal; + break; + } + case DS4Controls.GyroXNeg: + { + if (sOff == false && fieldMap.gryodirs[controlNum] < 0) + { + if (alt) result = (byte)Math.Min(255, 127 + -fieldMap.gryodirs[controlNum]); else result = (byte)Math.Max(0, 127 - -fieldMap.gryodirs[controlNum]); + } + else result = falseVal; + break; + } + case DS4Controls.GyroZPos: + { + if (sOff == false && fieldMap.gryodirs[controlNum] > 0) + { + if (alt) result = (byte)Math.Min(255, 127 + fieldMap.gryodirs[controlNum]); else result = (byte)Math.Max(0, 127 - fieldMap.gryodirs[controlNum]); + } + else return falseVal; + break; + } + case DS4Controls.GyroZNeg: + { + if (sOff == false && fieldMap.gryodirs[controlNum] < 0) + { + if (alt) result = (byte)Math.Min(255, 127 + -fieldMap.gryodirs[controlNum]); else result = (byte)Math.Max(0, 127 - -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.AccelX > SXD * 10) + { + if (alt) result = (byte)Math.Min(255, 127 + SXSens[device] * -eState.AccelX); else result = (byte)Math.Max(0, 127 - SXSens[device] * -eState.AccelX); + } + else result = falseVal; + break; + } + case DS4Controls.GyroXNeg: + { + if (!sOff && -eState.AccelX < -SXD * 10) + { + if (alt) result = (byte)Math.Min(255, 127 + SXSens[device] * eState.AccelX); else result = (byte)Math.Max(0, 127 - SXSens[device] * eState.AccelX); + } + else result = falseVal; + break; + } + case DS4Controls.GyroZPos: + { + if (!sOff && eState.AccelZ > SZD * 10) + { + if (alt) result = (byte)Math.Min(255, 127 + SZSens[device] * eState.AccelZ); else result = (byte)Math.Max(0, 127 - SZSens[device] * eState.AccelZ); + } + else return falseVal; + break; + } + case DS4Controls.GyroZNeg: + { + if (!sOff && eState.AccelZ < -SZD * 10) + { + if (alt) result = (byte)Math.Min(255, 127 + SZSens[device] * -eState.AccelZ); else result = (byte)Math.Max(0, 127 - SZSens[device] * -eState.AccelZ); + } + 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; + int controlRelation = (controlNum % 2 == 0 ? controlNum - 1 : controlNum + 1); + fieldMap.axisdirs[controlRelation] = 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..126eeb5 100644 --- a/DS4Windows/DS4Control/Mouse.cs +++ b/DS4Windows/DS4Control/Mouse.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Runtime.InteropServices; namespace DS4Windows { @@ -17,35 +13,83 @@ namespace DS4Windows private readonly MouseWheel wheel; private bool tappedOnce = false, secondtouchbegin = false; public bool swipeLeft, swipeRight, swipeUp, swipeDown; + public bool priorSwipeLeft, priorSwipeRight, priorSwipeUp, priorSwipeDown; public byte swipeLeftB, swipeRightB, swipeUpB, swipeDownB, swipedB; + public byte priorSwipeLeftB, priorSwipeRightB, priorSwipeUpB, priorSwipeDownB, priorSwipedB; public bool slideleft, slideright; + public bool priorSlideLeft, priorSlideright; // touch area stuff public bool leftDown, rightDown, upperDown, multiDown; + public bool priorLeftDown, priorRightDown, priorUpperDown, priorMultiDown; protected DS4Controls pushed = DS4Controls.None; protected Mapping.Click clicked = Mapping.Click.None; + internal const int TRACKBALL_INIT_FICTION = 10; + internal const int TRACKBALL_MASS = 45; + internal const double TRACKBALL_RADIUS = 0.0245; + + private double TRACKBALL_INERTIA = 2.0 * (TRACKBALL_MASS * TRACKBALL_RADIUS * TRACKBALL_RADIUS) / 5.0; + private double TRACKBALL_SCALE = 0.004; + private const int TRACKBALL_BUFFER_LEN = 8; + private double[] trackballXBuffer = new double[TRACKBALL_BUFFER_LEN]; + private double[] trackballYBuffer = new double[TRACKBALL_BUFFER_LEN]; + private int trackballBufferTail = 0; + private int trackballBufferHead = 0; + private double trackballAccel = 0.0; + private double trackballXVel = 0.0; + private double trackballYVel = 0.0; + private bool trackballActive = false; + private double trackballDXRemain = 0.0; + private double trackballDYRemain = 0.0; + public Mouse(int deviceID, DS4Device d) { deviceNum = deviceID; dev = d; cursor = new MouseCursor(deviceNum); wheel = new MouseWheel(deviceNum); + trackballAccel = TRACKBALL_RADIUS * TRACKBALL_INIT_FICTION / TRACKBALL_INERTIA; + firstTouch = new Touch(0, 0, 0, null); } + public void ResetTrackAccel(double friction) + { + trackballAccel = TRACKBALL_RADIUS * friction / TRACKBALL_INERTIA; + } + + bool triggeractivated = false; + bool useReverseRatchet = false; + public virtual void sixaxisMoved(object sender, SixAxisEventArgs arg) { - if (Global.UseSAforMouse[deviceNum] && Global.GyroSensitivity[deviceNum] > 0) + if (Global.isUsingSAforMouse(deviceNum) && Global.getGyroSensitivity(deviceNum) > 0) { - bool triggeractivated = true; + s = dev.getCurrentStateRef(); + + triggeractivated = true; + useReverseRatchet = Global.getGyroTriggerTurns(deviceNum); int i = 0; - string[] ss = Global.SATriggers[deviceNum].Split(','); + string[] ss = Global.getSATriggers(deviceNum).Split(','); if (!string.IsNullOrEmpty(ss[0])) - foreach (string s in ss) + { + string s = string.Empty; + for (int index = 0, arlen = ss.Length; + triggeractivated && index < arlen; index++) + { + s = ss[index]; if (!(int.TryParse(s, out i) && getDS4ControlsByName(i))) + { triggeractivated = false; - if (triggeractivated) + } + } + } + + if (useReverseRatchet && triggeractivated) cursor.sixaxisMoved(arg); - dev.getCurrentState(s); + else if (!useReverseRatchet && !triggeractivated) + cursor.sixaxisMoved(arg); + else + cursor.mouseRemainderReset(); } } @@ -68,20 +112,43 @@ namespace DS4Windows case 11: return s.DpadRight; case 12: return s.L3; case 13: return s.R3; - case 14: return s.Touch1; - case 15: return s.Touch2; + case 14: return s.Touch1Finger; + case 15: return s.Touch2Fingers; case 16: return s.Options; case 17: return s.Share; case 18: return s.PS; + default: break; } + return false; } + private bool tempBool = false; public virtual void touchesMoved(object sender, TouchpadEventArgs arg) { - if (!Global.UseTPforControls[deviceNum]) + s = dev.getCurrentStateRef(); + + if (Global.getUseTPforControls(deviceNum) == false) { - cursor.touchesMoved(arg, dragging || dragging2); + int[] disArray = Global.getTouchDisInvertTriggers(deviceNum); + tempBool = true; + for (int i = 0, arlen = disArray.Length; tempBool && i < arlen; i++) + { + if (getDS4ControlsByName(disArray[i]) == false) + tempBool = false; + } + + if (Global.getTrackballMode(deviceNum)) + { + int iIndex = trackballBufferTail; + trackballXBuffer[iIndex] = (arg.touches[0].deltaX * TRACKBALL_SCALE) / dev.getCurrentStateRef().elapsedTime; + trackballYBuffer[iIndex] = (arg.touches[0].deltaY * TRACKBALL_SCALE) / dev.getCurrentStateRef().elapsedTime; + trackballBufferTail = (iIndex + 1) % TRACKBALL_BUFFER_LEN; + if (trackballBufferHead == trackballBufferTail) + trackballBufferHead = (trackballBufferHead + 1) % TRACKBALL_BUFFER_LEN; + } + + cursor.touchesMoved(arg, dragging || dragging2, tempBool); wheel.touchesMoved(arg, dragging || dragging2); } else @@ -93,54 +160,78 @@ namespace DS4Windows if (arg.touches[0].hwY - firstTouch.hwY > 300) swipeDown = true; if (arg.touches[0].hwY - firstTouch.hwY < -300) swipeUp = true; } + swipeUpB = (byte)Math.Min(255, Math.Max(0, (firstTouch.hwY - arg.touches[0].hwY) * 1.5f)); swipeDownB = (byte)Math.Min(255, Math.Max(0, (arg.touches[0].hwY - firstTouch.hwY) * 1.5f)); 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(); } + public virtual void touchesBegan(object sender, TouchpadEventArgs arg) { if (!Global.UseTPforControls[deviceNum]) { + Array.Clear(trackballXBuffer, 0, TRACKBALL_BUFFER_LEN); + Array.Clear(trackballXBuffer, 0, TRACKBALL_BUFFER_LEN); + trackballXVel = 0.0; + trackballYVel = 0.0; + trackballActive = false; + trackballBufferTail = 0; + trackballBufferHead = 0; + trackballDXRemain = 0.0; + trackballDYRemain = 0.0; + cursor.touchesBegan(arg); wheel.touchesBegan(arg); } + pastTime = arg.timeStamp; - firstTouch = arg.touches[0]; - if (Global.DoubleTap[deviceNum]) + firstTouch.populate(arg.touches[0].hwX, arg.touches[0].hwY, arg.touches[0].touchID, + arg.touches[0].previousTouch); + + if (Global.getDoubleTap(deviceNum)) { DateTime test = arg.timeStamp; if (test <= (firstTap + TimeSpan.FromMilliseconds((double)Global.TapSensitivity[deviceNum] * 1.5)) && !arg.touchButtonPressed) secondtouchbegin = true; } - dev.getCurrentState(s); + + s = dev.getCurrentStateRef(); synthesizeMouseButtons(); } + public virtual void touchesEnded(object sender, TouchpadEventArgs arg) { + s = dev.getCurrentStateRef(); slideright = slideleft = false; swipeUp = swipeDown = swipeLeft = swipeRight = false; swipeUpB = swipeDownB = swipeLeftB = swipeRightB = 0; - if (Global.TapSensitivity[deviceNum] != 0 && !Global.UseTPforControls[deviceNum]) + byte tapSensitivity = Global.getTapSensitivity(deviceNum); + if (tapSensitivity != 0 && !Global.getUseTPforControls(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]) + { + if (Global.getDoubleTap(deviceNum)) { tappedOnce = true; firstTap = arg.timeStamp; @@ -148,8 +239,97 @@ namespace DS4Windows } else Mapping.MapClick(deviceNum, Mapping.Click.Left); //this way no delay if disabled + } + } } - dev.getCurrentState(s); + else + { + if (Global.getUseTPforControls(deviceNum) == false) + { + int[] disArray = Global.getTouchDisInvertTriggers(deviceNum); + tempBool = true; + for (int i = 0, arlen = disArray.Length; tempBool && i < arlen; i++) + { + if (getDS4ControlsByName(disArray[i]) == false) + tempBool = false; + } + + if (Global.getTrackballMode(deviceNum)) + { + if (!trackballActive) + { + double currentWeight = 1.0; + double finalWeight = 0.0; + double x_out = 0.0, y_out = 0.0; + int idx = -1; + for (int i = 0; i < TRACKBALL_BUFFER_LEN && idx != trackballBufferHead; i++) + { + idx = (trackballBufferTail - i - 1 + TRACKBALL_BUFFER_LEN) % TRACKBALL_BUFFER_LEN; + x_out += trackballXBuffer[idx] * currentWeight; + y_out += trackballYBuffer[idx] * currentWeight; + finalWeight += currentWeight; + currentWeight *= 1.0; + } + + x_out /= finalWeight; + trackballXVel = x_out; + y_out /= finalWeight; + trackballYVel = y_out; + + trackballActive = true; + } + + double tempAngle = Math.Atan2(-trackballYVel, trackballXVel); + double normX = Math.Abs(Math.Cos(tempAngle)); + double normY = Math.Abs(Math.Sin(tempAngle)); + int signX = Math.Sign(trackballXVel); + int signY = Math.Sign(trackballYVel); + + double trackXvDecay = Math.Min(Math.Abs(trackballXVel), trackballAccel * s.elapsedTime * normX); + double trackYvDecay = Math.Min(Math.Abs(trackballYVel), trackballAccel * s.elapsedTime * normY); + double xVNew = trackballXVel - (trackXvDecay * signX); + double yVNew = trackballYVel - (trackYvDecay * signY); + double xMotion = (xVNew * s.elapsedTime) / TRACKBALL_SCALE; + double yMotion = (yVNew * s.elapsedTime) / TRACKBALL_SCALE; + if (xMotion != 0.0) + { + xMotion += trackballDXRemain; + } + else + { + trackballDXRemain = 0.0; + } + + int dx = (int)xMotion; + trackballDXRemain = xMotion - dx; + + if (yMotion != 0.0) + { + yMotion += trackballDYRemain; + } + else + { + trackballDYRemain = 0.0; + } + + int dy = (int)yMotion; + trackballDYRemain = yMotion - dy; + + trackballXVel = xVNew; + trackballYVel = yVNew; + + if (dx == 0 && dy == 0) + { + trackballActive = false; + } + else + { + cursor.TouchMoveCursor(dx, dy, tempBool); + } + } + } + } + synthesizeMouseButtons(); } @@ -165,28 +345,95 @@ namespace DS4Windows public virtual void touchUnchanged(object sender, EventArgs unused) { - dev.getCurrentState(s); - //if (s.Touch1 || s.Touch2 || s.TouchButton) - synthesizeMouseButtons(); + s = dev.getCurrentStateRef(); + + if (trackballActive) + { + if (Global.getUseTPforControls(deviceNum) == false) + { + int[] disArray = Global.getTouchDisInvertTriggers(deviceNum); + tempBool = true; + for (int i = 0, arlen = disArray.Length; tempBool && i < arlen; i++) + { + if (getDS4ControlsByName(disArray[i]) == false) + tempBool = false; + } + + double tempAngle = Math.Atan2(-trackballYVel, trackballXVel); + double normX = Math.Abs(Math.Cos(tempAngle)); + double normY = Math.Abs(Math.Sin(tempAngle)); + int signX = Math.Sign(trackballXVel); + int signY = Math.Sign(trackballYVel); + double trackXvDecay = Math.Min(Math.Abs(trackballXVel), trackballAccel * s.elapsedTime * normX); + double trackYvDecay = Math.Min(Math.Abs(trackballYVel), trackballAccel * s.elapsedTime * normY); + double xVNew = trackballXVel - (trackXvDecay * signX); + double yVNew = trackballYVel - (trackYvDecay * signY); + double xMotion = (xVNew * s.elapsedTime) / TRACKBALL_SCALE; + double yMotion = (yVNew * s.elapsedTime) / TRACKBALL_SCALE; + if (xMotion != 0.0) + { + xMotion += trackballDXRemain; + } + else + { + trackballDXRemain = 0.0; + } + + int dx = (int)xMotion; + trackballDXRemain = xMotion - dx; + + if (yMotion != 0.0) + { + yMotion += trackballDYRemain; + } + else + { + trackballDYRemain = 0.0; + } + + int dy = (int)yMotion; + trackballDYRemain = yMotion - dy; + + trackballXVel = xVNew; + trackballYVel = yVNew; + + if (dx == 0 && dy == 0) + { + trackballActive = false; + } + else + { + cursor.TouchMoveCursor(dx, dy, tempBool); + } + } + } + + if (s.TouchButton) + synthesizeMouseButtons(); } - private DS4State remapped = new DS4State(); 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,10 +452,10 @@ namespace DS4Windows dragging = true; } else + { dragging = false; + } } - s = remapped; - //remapped.CopyTo(s); } public virtual void touchButtonUp(object sender, TouchpadEventArgs arg) @@ -216,7 +463,7 @@ namespace DS4Windows pushed = DS4Controls.None; upperDown = leftDown = rightDown = multiDown = false; dev.setRumble(0, 0); - dev.getCurrentState(s); + s = dev.getCurrentStateRef(); if (s.Touch1 || s.Touch2) synthesizeMouseButtons(); } @@ -231,15 +478,30 @@ 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); + + s = dev.getCurrentStateRef(); synthesizeMouseButtons(); } + public void populatePriorButtonStates() + { + priorUpperDown = upperDown; + priorLeftDown = leftDown; + priorRightDown = rightDown; + priorMultiDown = multiDown; + + priorSwipeLeft = swipeLeft; priorSwipeRight = swipeRight; + priorSwipeUp = swipeUp; priorSwipeDown = swipeDown; + priorSwipeLeftB = swipeLeftB; priorSwipeRightB = swipeRightB; priorSwipeUpB = swipeUpB; + priorSwipeDownB = swipeDownB; priorSwipedB = swipedB; + } + public DS4State getDS4State() { return s; diff --git a/DS4Windows/DS4Control/MouseCursor.cs b/DS4Windows/DS4Control/MouseCursor.cs index 0a5870d..e437403 100644 --- a/DS4Windows/DS4Control/MouseCursor.cs +++ b/DS4Windows/DS4Control/MouseCursor.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - namespace DS4Windows { @@ -20,32 +16,164 @@ namespace DS4Windows /** Indicate x/y direction for doing jitter compensation, etc. */ public enum Direction { Negative, Neutral, Positive } // Track direction vector separately and very trivially for now. - private Direction horizontalDirection = Direction.Neutral, verticalDirection = Direction.Neutral; + private Direction horizontalDirection = Direction.Neutral, + verticalDirection = Direction.Neutral; private Direction hDirection = Direction.Neutral, vDirection = Direction.Neutral; + private const double GYRO_MOUSE_COEFFICIENT = 0.0095; + private const int GYRO_MOUSE_DEADZONE = 10; + private const double GYRO_MOUSE_OFFSET = 0.1463; + private const double GYRO_SMOOTH_MOUSE_OFFSET = 0.14698; + private const double TOUCHPAD_MOUSE_OFFSET = 0.015; + + private const int SMOOTH_BUFFER_LEN = 3; + private double[] xSmoothBuffer = new double[SMOOTH_BUFFER_LEN]; + private double[] ySmoothBuffer = new double[SMOOTH_BUFFER_LEN]; + private int smoothBufferTail = 0; + + + + double coefficient = 0.0; + double verticalScale = 0.0; + bool gyroSmooth = false; + + int tempInt = 0; + double tempDouble = 0.0; + bool tempBool = false; + public virtual void sixaxisMoved(SixAxisEventArgs arg) { int deltaX = 0, deltaY = 0; - deltaX = -arg.sixAxis.accelX; - deltaY = -arg.sixAxis.accelY; - //Console.WriteLine(arg.sixAxis.deltaX); + deltaX = Global.getGyroMouseHorizontalAxis(deviceNumber) == 0 ? arg.sixAxis.gyroYawFull : + arg.sixAxis.gyroRollFull; + deltaY = -arg.sixAxis.gyroPitchFull; + //tempDouble = arg.sixAxis.elapsed * 0.001 * 200.0; // Base default speed on 5 ms + tempDouble = arg.sixAxis.elapsed * 200.0; // Base default speed on 5 ms - double coefficient = Global.GyroSensitivity[deviceNumber] / 100f; - //Collect rounding errors instead of losing motion. - double xMotion = coefficient * deltaX; - xMotion += hRemainder; - int xAction = (int)xMotion; - hRemainder += xMotion - xAction; - hRemainder -= (int)hRemainder; - double yMotion = coefficient * deltaY; - yMotion += vRemainder; - int yAction = (int)yMotion; - vRemainder += yMotion - yAction; - vRemainder -= (int)vRemainder; - if (Global.GyroInvert[deviceNumber] == 2 || Global.GyroInvert[deviceNumber] == 3) + gyroSmooth = Global.getGyroSmoothing(deviceNumber); + double gyroSmoothWeight = 0.0; + + coefficient = (Global.getGyroSensitivity(deviceNumber) * 0.01) * GYRO_MOUSE_COEFFICIENT; + double offset = GYRO_MOUSE_OFFSET; + if (gyroSmooth) + { + gyroSmoothWeight = Global.getGyroSmoothingWeight(deviceNumber); + if (gyroSmoothWeight > 0.0) + { + offset = GYRO_SMOOTH_MOUSE_OFFSET; + } + } + + double tempAngle = Math.Atan2(-deltaY, deltaX); + double normX = Math.Abs(Math.Cos(tempAngle)); + double normY = Math.Abs(Math.Sin(tempAngle)); + int signX = Math.Sign(deltaX); + int signY = Math.Sign(deltaY); + + if (deltaX == 0 || (hRemainder > 0 != deltaX > 0)) + { + hRemainder = 0.0; + } + + if (deltaY == 0 || (vRemainder > 0 != deltaY > 0)) + { + vRemainder = 0.0; + } + + int deadzoneX = (int)Math.Abs(normX * GYRO_MOUSE_DEADZONE); + int deadzoneY = (int)Math.Abs(normY * GYRO_MOUSE_DEADZONE); + + if (Math.Abs(deltaX) > deadzoneX) + { + deltaX -= signX * deadzoneX; + } + else + { + deltaX = 0; + } + + if (Math.Abs(deltaY) > deadzoneY) + { + deltaY -= signY * deadzoneY; + } + else + { + deltaY = 0; + } + + double xMotion = deltaX != 0 ? coefficient * (deltaX * tempDouble) + + (normX * (offset * signX)) : 0; + + int xAction = 0; + if (xMotion != 0.0) + { + xMotion += hRemainder; + } + else + { + hRemainder = 0.0; + } + + verticalScale = Global.getGyroSensVerticalScale(deviceNumber) * 0.01; + double yMotion = deltaY != 0 ? (coefficient * verticalScale) * (deltaY * tempDouble) + + (normY * (offset * signY)) : 0; + + int yAction = 0; + if (yMotion != 0.0) + { + yMotion += vRemainder; + } + else + { + vRemainder = 0.0; + } + + if (gyroSmooth) + { + int iIndex = smoothBufferTail % SMOOTH_BUFFER_LEN; + xSmoothBuffer[iIndex] = xMotion; + ySmoothBuffer[iIndex] = yMotion; + smoothBufferTail = iIndex + 1; + + double currentWeight = 1.0; + double finalWeight = 0.0; + double x_out = 0.0, y_out = 0.0; + int idx = 0; + for (int i = 0; i < SMOOTH_BUFFER_LEN; i++) + { + idx = (smoothBufferTail - i - 1 + SMOOTH_BUFFER_LEN) % SMOOTH_BUFFER_LEN; + x_out += xSmoothBuffer[idx] * currentWeight; + y_out += ySmoothBuffer[idx] * currentWeight; + finalWeight += currentWeight; + currentWeight *= gyroSmoothWeight; + } + + x_out /= finalWeight; + xMotion = x_out; + y_out /= finalWeight; + yMotion = y_out; + } + + hRemainder = vRemainder = 0.0; + if (xMotion != 0.0) + { + xAction = (int)xMotion; + hRemainder = xMotion - xAction; + } + + if (yMotion != 0.0) + { + yAction = (int)yMotion; + vRemainder = yMotion - yAction; + } + + int gyroInvert = Global.getGyroInvert(deviceNumber); + if ((gyroInvert & 0x02) == 2) xAction *= -1; - if (Global.GyroInvert[deviceNumber] == 1 || Global.GyroInvert[deviceNumber] == 3) + + if ((gyroInvert & 0x01) == 1) yAction *= -1; + if (yAction != 0 || xAction != 0) InputMethods.MoveCursorBy(xAction, yAction); @@ -53,21 +181,33 @@ namespace DS4Windows vDirection = yMotion > 0.0 ? Direction.Positive : yMotion < 0.0 ? Direction.Negative : Direction.Neutral; } + public void mouseRemainderReset() + { + hRemainder = vRemainder = 0.0; + int iIndex = smoothBufferTail % SMOOTH_BUFFER_LEN; + xSmoothBuffer[iIndex] = 0.0; + ySmoothBuffer[iIndex] = 0.0; + smoothBufferTail = iIndex + 1; + } + public void touchesBegan(TouchpadEventArgs arg) { if (arg.touches.Length == 1) { horizontalRemainder = verticalRemainder = 0.0; horizontalDirection = verticalDirection = Direction.Neutral; + } } private byte lastTouchID; - public void touchesMoved(TouchpadEventArgs arg, bool dragging) + public void touchesMoved(TouchpadEventArgs arg, bool dragging, bool disableInvert = false) { - 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; + + int deltaX = 0, deltaY = 0; if (arg.touches[0].touchID != lastTouchID) { deltaX = deltaY = 0; @@ -75,59 +215,9 @@ namespace DS4Windows horizontalDirection = verticalDirection = Direction.Neutral; lastTouchID = arg.touches[0].touchID; } - 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) - { - deltaX = arg.touches[1].deltaX; - deltaY = arg.touches[1].deltaY; - } - else - { - 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) - { - if (horizontalDirection != Direction.Negative) - { - deltaX = -1; - horizontalRemainder = 0.0; - } - } - else if (deltaX >= 1) - { - if (horizontalDirection != Direction.Positive) - { - deltaX = 1; - horizontalRemainder = 0.0; - } - } - - if (deltaY <= -1) - { - if (verticalDirection != Direction.Negative) - { - deltaY = -1; - verticalRemainder = 0.0; - } - } - else if (deltaY >= 1) - { - if (verticalDirection != Direction.Positive) - { - deltaY = 1; - verticalRemainder = 0.0; - } - } - } else { - if (dragging && arg.touches.Length > 1) + if (dragging && touchesLen > 1) { deltaX = arg.touches[1].deltaX; deltaY = arg.touches[1].deltaY; @@ -139,36 +229,73 @@ namespace DS4Windows } } - double coefficient = Global.TouchSensitivity[deviceNumber] / 100.0; - // Collect rounding errors instead of losing motion. - double xMotion = coefficient * deltaX; - if (xMotion > 0.0) + TouchMoveCursor(deltaX, deltaY, disableInvert); + } + + public void TouchMoveCursor(int dx, int dy, bool disableInvert = false) + { + double tempAngle = Math.Atan2(-dy, dx); + double normX = Math.Abs(Math.Cos(tempAngle)); + double normY = Math.Abs(Math.Sin(tempAngle)); + int signX = Math.Sign(dx); + int signY = Math.Sign(dy); + double coefficient = Global.getTouchSensitivity(deviceNumber) * 0.01; + bool jitterCompenstation = Global.getTouchpadJitterCompensation(deviceNumber); + + double xMotion = dx != 0 ? + coefficient * dx + (normX * (TOUCHPAD_MOUSE_OFFSET * signX)) : 0.0; + + double yMotion = dy != 0 ? + coefficient * dy + (normY * (TOUCHPAD_MOUSE_OFFSET * signY)) : 0.0; + + if (jitterCompenstation) { - if (horizontalRemainder > 0.0) - xMotion += horizontalRemainder; + double absX = Math.Abs(xMotion); + if (absX <= normX * 0.15) + { + xMotion = signX * Math.Pow(absX / 0.15f, 1.408) * 0.15; + } + + double absY = Math.Abs(yMotion); + if (absY <= normY * 0.15) + { + yMotion = signY * Math.Pow(absY / 0.15f, 1.408) * 0.15; + } } - else if (xMotion < 0.0) + + // Collect rounding errors instead of losing motion. + if (xMotion > 0.0 && horizontalRemainder > 0.0) { - if (horizontalRemainder < 0.0) - xMotion += horizontalRemainder; + xMotion += horizontalRemainder; + } + else if (xMotion < 0.0 && horizontalRemainder < 0.0) + { + xMotion += horizontalRemainder; } int xAction = (int)xMotion; horizontalRemainder = xMotion - xAction; - double yMotion = coefficient * deltaY; - if (yMotion > 0.0) + if (yMotion > 0.0 && verticalRemainder > 0.0) { - if (verticalRemainder > 0.0) - yMotion += verticalRemainder; + yMotion += verticalRemainder; } - else if (yMotion < 0.0) + else if (yMotion < 0.0 && verticalRemainder < 0.0) { - if (verticalRemainder < 0.0) - yMotion += verticalRemainder; + yMotion += verticalRemainder; } int yAction = (int)yMotion; verticalRemainder = yMotion - yAction; + if (disableInvert == false) + { + int touchpadInvert = tempInt = Global.getTouchpadInvert(deviceNumber); + if ((touchpadInvert & 0x02) == 2) + xAction *= -1; + + if ((touchpadInvert & 0x01) == 1) + yAction *= -1; + } + if (yAction != 0 || xAction != 0) InputMethods.MoveCursorBy(xAction, yAction); diff --git a/DS4Windows/DS4Control/MouseWheel.cs b/DS4Windows/DS4Control/MouseWheel.cs index d237731..e17ba13 100644 --- a/DS4Windows/DS4Control/MouseWheel.cs +++ b/DS4Windows/DS4Control/MouseWheel.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - namespace DS4Windows { @@ -27,6 +23,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..91d917e 100644 --- a/DS4Windows/DS4Control/ScpUtil.cs +++ b/DS4Windows/DS4Control/ScpUtil.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using System.Text; +using System.Linq; using System.IO; using System.Reflection; @@ -8,10 +8,14 @@ using System.Xml; using System.Drawing; using System.Security.Principal; +using System.Threading; +using System.Threading.Tasks; +using System.Globalization; + namespace DS4Windows { [Flags] - public enum DS4KeyType : byte { None = 0, ScanCode = 1, Toggle = 2, Unbound = 4, Macro = 8, HoldMacro = 16, RepeatMacro = 32 }; //Increment by exponents of 2*, starting at 2^0 + public enum DS4KeyType : byte { None = 0, ScanCode = 1, Toggle = 2, Unbound = 4, Macro = 8, HoldMacro = 16, RepeatMacro = 32 }; // Increment by exponents of 2*, starting at 2^0 public enum Ds3PadId : byte { None = 0xFF, One = 0x00, Two = 0x01, Three = 0x02, Four = 0x03, All = 0x04 }; public enum DS4Controls : byte { None, LXNeg, LXPos, LYNeg, LYPos, RXNeg, RXPos, RYNeg, RYPos, L1, L2, L3, R1, R2, R3, Square, Triangle, Circle, Cross, DpadUp, DpadRight, DpadDown, DpadLeft, PS, TouchLeft, TouchUpper, TouchMulti, TouchRight, Share, Options, GyroXPos, GyroXNeg, GyroZPos, GyroZNeg, SwipeLeft, SwipeRight, SwipeUp, SwipeDown }; public enum X360Controls : byte { None, LXNeg, LXPos, LYNeg, LYPos, RXNeg, RXPos, RYNeg, RYPos, LB, LT, LS, RB, RT, RS, X, Y, B, A, DpadUp, DpadRight, DpadDown, DpadLeft, Guide, Back, Start, LeftMouse, RightMouse, MiddleMouse, FourthMouse, FifthMouse, WUP, WDOWN, MouseUp, MouseDown, MouseLeft, MouseRight, Unbound }; @@ -19,7 +23,7 @@ namespace DS4Windows public class DS4ControlSettings { public DS4Controls control; - 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 +31,7 @@ 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 = null; public DS4KeyType shiftKeyType = DS4KeyType.None; public DS4ControlSettings(DS4Controls ctrl) @@ -37,17 +41,17 @@ namespace DS4Windows public void Reset() { - 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 = null; shiftKeyType = DS4KeyType.None; } - + internal void UpdateSettings(bool shift, object act, string exts, DS4KeyType kt, int trigger = 0) { if (!shift) @@ -60,6 +64,7 @@ namespace DS4Windows actionType = ActionType.Macro; else actionType = ActionType.Default; + action = act; extras = exts; keyType = kt; @@ -74,6 +79,7 @@ namespace DS4Windows shiftActionType = ActionType.Macro; else shiftActionType = ActionType.Default; + shiftAction = act; shiftExtras = exts; shiftKeyType = kt; @@ -85,16 +91,16 @@ namespace DS4Windows public class DebugEventArgs : EventArgs { protected DateTime m_Time = DateTime.Now; - protected String m_Data = String.Empty; + protected string m_Data = string.Empty; protected bool warning = false; - public DebugEventArgs(String Data, bool warn) + public DebugEventArgs(string Data, bool warn) { m_Data = Data; warning = warn; } public DateTime Time => m_Time; - public String Data => m_Data; + public string Data => m_Data; public bool Warning => warning; } @@ -113,7 +119,7 @@ namespace DS4Windows public class ReportEventArgs : EventArgs { protected Ds3PadId m_Pad = Ds3PadId.None; - protected Byte[] m_Report = new Byte[64]; + protected byte[] m_Report = new byte[64]; public ReportEventArgs() { @@ -136,20 +142,138 @@ namespace DS4Windows } } + public class BatteryReportArgs : EventArgs + { + private int index; + private int level; + private bool charging; + + public BatteryReportArgs(int index, int level, bool charging) + { + this.index = index; + this.level = level; + this.charging = charging; + } + + public int getIndex() + { + return index; + } + + public int getLevel() + { + return level; + } + + public bool isCharging() + { + return charging; + } + } + + 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 SerialChangeArgs : EventArgs + { + private int index; + private string serial; + + public SerialChangeArgs(int index, string serial) + { + this.index = index; + this.serial = serial; + } + + public int getIndex() + { + return index; + } + + public string getSerial() + { + return serial; + } + } + 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 exepath = Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName; public static string appdatapath; + public static bool firstRun = false; + public static bool multisavespots = false; + public static bool oldappdatafail = false; + public static string appDataPpath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\DS4Windows"; + public static string oldappdatapath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\DS4Tool"; + 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] { true, true, true, true, true }; + public static bool[] linkedProfileCheck = new bool[4] { true, true, true, true }; + + 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 + }; + + // Create mapping array at runtime + 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) { appdatapath = path; m_Config.m_Profile = appdatapath + "\\Profiles.xml"; m_Config.m_Actions = appdatapath + "\\Actions.xml"; + m_Config.m_linkedProfiles = Global.appdatapath + "\\LinkedProfiles.xml"; } + /// /// Check if Admin Rights are needed to write in Appliplation Directory /// @@ -175,6 +299,83 @@ namespace DS4Windows return principal.IsInRole(WindowsBuiltInRole.Administrator); } + public static bool IsScpVBusInstalled() + { + bool result = false; + Guid sysGuid = Guid.Parse("{4d36e97d-e325-11ce-bfc1-08002be10318}"); + NativeMethods.SP_DEVINFO_DATA deviceInfoData = new NativeMethods.SP_DEVINFO_DATA(); + deviceInfoData.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(deviceInfoData); + var dataBuffer = new byte[4096]; + ulong propertyType = 0; + var requiredSize = 0; + IntPtr deviceInfoSet = NativeMethods.SetupDiGetClassDevs(ref sysGuid, null, 0, 0); + for (int i = 0; !result && NativeMethods.SetupDiEnumDeviceInfo(deviceInfoSet, i, ref deviceInfoData); i++) + { + if (NativeMethods.SetupDiGetDeviceProperty(deviceInfoSet, ref deviceInfoData, ref NativeMethods.DEVPKEY_Device_HardwareIds, ref propertyType, + dataBuffer, dataBuffer.Length, ref requiredSize, 0)) + { + string hardwareId = dataBuffer.ToUTF16String(); + //if (hardwareIds.Contains("Scp Virtual Bus Driver")) + // result = true; + if (hardwareId.Equals(@"root\ScpVBus")) + result = true; + } + } + + if (deviceInfoSet.ToInt64() != NativeMethods.INVALID_HANDLE_VALUE) + { + NativeMethods.SetupDiDestroyDeviceInfoList(deviceInfoSet); + } + + return result; + } + + public static void FindConfigLocation() + { + if (File.Exists(exepath + "\\Auto Profiles.xml") + && File.Exists(appDataPpath + "\\Auto Profiles.xml")) + { + Global.firstRun = true; + Global.multisavespots = true; + } + else if (File.Exists(exepath + "\\Auto Profiles.xml")) + SaveWhere(exepath); + else if (File.Exists(appDataPpath + "\\Auto Profiles.xml")) + SaveWhere(appDataPpath); + else if (File.Exists(oldappdatapath + "\\Auto Profiles.xml")) + { + try + { + if (Directory.Exists(appDataPpath)) + Directory.Move(appDataPpath, Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\DS4Windows Old"); + Directory.Move(oldappdatapath, appDataPpath); + SaveWhere(appDataPpath); + } + catch + { + Global.oldappdatafail = true; + } + } + else if (!File.Exists(exepath + "\\Auto Profiles.xml") + && !File.Exists(appDataPpath + "\\Auto Profiles.xml")) + { + Global.firstRun = true; + Global.multisavespots = false; + } + } + + public static void SetCulture(string culture) + { + try + { + Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(culture); + CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.GetCultureInfo(culture); + } + catch { /* Skip setting culture that we cannot set */ } + } + + + public static event EventHandler ControllerStatusChange; // called when a controller is added/removed/battery or touchpad mode changes/etc. public static void ControllerStatusChanged(object sender) { @@ -182,13 +383,58 @@ namespace DS4Windows ControllerStatusChange(sender, EventArgs.Empty); } - //general values + public static event EventHandler BatteryStatusChange; + public static void OnBatteryStatusChange(object sender, int index, int level, bool charging) + { + if (BatteryStatusChange != null) + { + BatteryReportArgs args = new BatteryReportArgs(index, level, charging); + 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); + } + } + + public static event EventHandler DeviceSerialChange; + public static void OnDeviceSerialChange(object sender, int index, string serial) + { + if (DeviceSerialChange != null) + { + SerialChangeArgs args = new SerialChangeArgs(index, serial); + DeviceSerialChange(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 { set { m_Config.lastChecked = value; } @@ -200,146 +446,630 @@ namespace DS4Windows set { m_Config.CheckWhen = value; } get { return m_Config.CheckWhen; } } + public static int Notifications { set { m_Config.notifications = value; } get { return m_Config.notifications; } } + public static bool DCBTatStop { set { m_Config.disconnectBTAtStop = value; } get { return m_Config.disconnectBTAtStop; } } + public static bool SwipeProfiles { set { m_Config.swipeProfiles = value; } get { return m_Config.swipeProfiles; } } + public static bool DS4Mapping { set { m_Config.ds4Mapping = value; } get { return m_Config.ds4Mapping; } } + public static bool QuickCharge { 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; } get { return m_Config.firstXinputPort; } } + public static bool CloseMini { set { m_Config.closeMini = value; } get { return m_Config.closeMini; } } + public static bool StartMinimized { set { m_Config.startMinimized = value; } get { return m_Config.startMinimized; } } + + public static bool MinToTaskbar + { + set { m_Config.minToTaskbar = value; } + get { return m_Config.minToTaskbar; } + } + public static int FormWidth { set { m_Config.formWidth = value; } - get { return m_Config.formWidth;} + get { return m_Config.formWidth; } } + public static int FormHeight { set { m_Config.formHeight = value; } get { return m_Config.formHeight; } } + + public static int FormLocationX + { + set { m_Config.formLocationX = value; } + get { return m_Config.formLocationX; } + } + + public static int FormLocationY + { + set { m_Config.formLocationY = value; } + get { return m_Config.formLocationY; } + } + + public static string UseLang + { + set { m_Config.useLang = value; } + get { return m_Config.useLang; } + } + public static bool DownloadLang { set { m_Config.downloadLang = value; } get { return m_Config.downloadLang; } } + public static bool FlashWhenLate { 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 bool[] DinputOnly => m_Config.dinputOnly; - public static bool[] StartTouchpadOff => m_Config.startTouchpadOff; + 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 string getSATriggers(int index) + { + return m_Config.sATriggers[index]; + } + + public static int[][] TouchDisInvertTriggers => m_Config.touchDisInvertTriggers; + public static int[] getTouchDisInvertTriggers(int index) + { + return m_Config.touchDisInvertTriggers[index]; + } + public static int[] GyroSensitivity => m_Config.gyroSensitivity; + public static int getGyroSensitivity(int index) + { + return m_Config.gyroSensitivity[index]; + } + + public static int[] GyroSensVerticalScale => m_Config.gyroSensVerticalScale; + public static int getGyroSensVerticalScale(int index) + { + return m_Config.gyroSensVerticalScale[index]; + } + public static int[] GyroInvert => m_Config.gyroInvert; - public static DS4Color[] MainColor => m_Config.m_Leds; + public static int getGyroInvert(int index) + { + return m_Config.gyroInvert[index]; + } + + public static bool[] GyroTriggerTurns => m_Config.gyroTriggerTurns; + public static bool getGyroTriggerTurns(int index) + { + return m_Config.gyroTriggerTurns[index]; + } + + public static bool[] GyroSmoothing => m_Config.gyroSmoothing; + public static bool getGyroSmoothing(int index) + { + return m_Config.gyroSmoothing[index]; + } + + public static double[] GyroSmoothingWeight => m_Config.gyroSmoothWeight; + public static double getGyroSmoothingWeight(int index) + { + return m_Config.gyroSmoothWeight[index]; + } + + public static int[] GyroMouseHorizontalAxis => m_Config.gyroMouseHorizontalAxis; + public static int getGyroMouseHorizontalAxis(int index) + { + return m_Config.gyroMouseHorizontalAxis[index]; + } + + 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 getFlashColor(int index) + { + return m_Config.m_FlashLeds[index]; + } - public static DS4Color[] FlashColor => m_Config.m_FlashLeds; public static byte[] TapSensitivity => m_Config.tapSensitivity; - public static bool[] DoubleTap => m_Config.doubleTap; - public static int[] ScrollSensitivity => m_Config.scrollSensitivity; - public static bool[] LowerRCOn => m_Config.lowerRCOn; - public static bool[] TouchpadJitterCompensation => m_Config.touchpadJitterCompensation; + public static byte getTapSensitivity(int index) + { + return m_Config.tapSensitivity[index]; + } + + public static bool[] DoubleTap => m_Config.doubleTap; + public static bool getDoubleTap(int index) + { + return m_Config.doubleTap[index]; + } + + 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 bool getTouchpadJitterCompensation(int index) + { + return m_Config.touchpadJitterCompensation[index]; + } + + public static int[] TouchpadInvert => m_Config.touchpadInvert; + public static int getTouchpadInvert(int index) + { + return m_Config.touchpadInvert[index]; + } + + public static byte[] L2Deadzone => m_Config.l2Deadzone; + public static byte getL2Deadzone(int index) + { + return m_Config.l2Deadzone[index]; + } - public static byte[] L2Deadzone => m_Config.l2Deadzone; 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 double[] SXAntiDeadzone => m_Config.SXAntiDeadzone; + public static double getSXAntiDeadzone(int index) + { + return m_Config.SXAntiDeadzone[index]; + } + + public static double[] SZAntiDeadzone => m_Config.SZAntiDeadzone; + public static double getSZAntiDeadzone(int index) + { + return m_Config.SZAntiDeadzone[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 double[] SXMaxzone => m_Config.SXMaxzone; + public static double getSXMaxzone(int index) + { + return m_Config.SXMaxzone[index]; + } + + public static double[] SZMaxzone => m_Config.SZMaxzone; + public static double getSZMaxzone(int index) + { + return m_Config.SZMaxzone[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[] LSRotation => m_Config.LSRotation; + public static double getLSRotation(int index) + { + return m_Config.LSRotation[index]; + } + + public static double[] RSRotation => m_Config.RSRotation; + public static double getRSRotation(int index) + { + return m_Config.RSRotation[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 int[] BTPollRate => m_Config.btPollRate; + public static int getBTPollRate(int index) + { + return m_Config.btPollRate[index]; + } + + public static int[] lsOutCurveMode => m_Config.lsOutCurveMode; + public static int getLsOutCurveMode(int index) + { + return m_Config.lsOutCurveMode[index]; + } + + public static int[] rsOutCurveMode => m_Config.rsOutCurveMode; + public static int getRsOutCurveMode(int index) + { + return m_Config.rsOutCurveMode[index]; + } + + public static int[] l2OutCurveMode => m_Config.l2OutCurveMode; + public static int getL2OutCurveMode(int index) + { + return m_Config.l2OutCurveMode[index]; + } + + public static int[] r2OutCurveMode => m_Config.r2OutCurveMode; + public static int getR2OutCurveMode(int index) + { + return m_Config.r2OutCurveMode[index]; + } + + public static int[] sxOutCurveMode => m_Config.sxOutCurveMode; + public static int getSXOutCurveMode(int index) + { + return m_Config.sxOutCurveMode[index]; + } + + public static int[] szOutCurveMode => m_Config.szOutCurveMode; + public static int getSZOutCurveMode(int index) + { + return m_Config.szOutCurveMode[index]; + } + + public static bool[] TrackballMode => m_Config.trackballMode; + public static bool getTrackballMode(int index) + { + return m_Config.trackballMode[index]; + } + + public static double[] TrackballFriction => m_Config.trackballFriction; + public static double getTrackballFriction(int index) + { + return m_Config.trackballFriction[index]; + } + public static string[] LaunchProgram => m_Config.launchProgram; public static string[] ProfilePath => m_Config.profilePath; + public static string[] OlderProfilePath => m_Config.olderProfilePath; + 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 void SaveAction(string name, string controls, int mode, string details, bool edit, string extras = "") + 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 = "") { m_Config.SaveAction(name, controls, mode, details, edit, extras); Mapping.actionDone.Add(new Mapping.ActionState()); @@ -356,66 +1086,129 @@ 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) + //foreach (SpecialAction sA in m_Config.actions) + for (int i=0, actionCount = m_Config.actions.Count; i < actionCount; i++) + { + SpecialAction sA = m_Config.actions[i]; if (sA.name == name) return sA; + } + return new SpecialAction("null", "null", "null", "null"); } - - /*public static X360Controls getCustomButton(int device, DS4Controls controlName) => m_Config.GetCustomButton(device, controlName); - - public static ushort getCustomKey(int device, DS4Controls controlName) => m_Config.GetCustomKey(device, controlName); - - public static string getCustomMacro(int device, DS4Controls controlName) => m_Config.GetCustomMacro(device, controlName); - - public static string getCustomExtras(int device, DS4Controls controlName) => m_Config.GetCustomExtras(device, controlName); - - public static DS4KeyType getCustomKeyType(int device, DS4Controls controlName) => m_Config.GetCustomKeyType(device, controlName); - - public static bool getHasCustomKeysorButtons(int device) => m_Config.customMapButtons[device].Count > 0 - || m_Config.customMapKeys[device].Count > 0; - - public static bool getHasCustomExtras(int device) => m_Config.customMapExtras[device].Count > 0; - public static Dictionary getCustomButtons(int device) => m_Config.customMapButtons[device]; - public static Dictionary getCustomKeys(int device) => m_Config.customMapKeys[device]; - public static Dictionary getCustomMacros(int device) => m_Config.customMapMacros[device]; - public static Dictionary getCustomExtras(int device) => m_Config.customMapExtras[device]; - public static Dictionary getCustomKeyTypes(int device) => m_Config.customMapKeyTypes[device]; - - public static X360Controls getShiftCustomButton(int device, DS4Controls controlName) => m_Config.GetShiftCustomButton(device, controlName); - public static ushort getShiftCustomKey(int device, DS4Controls controlName) => m_Config.GetShiftCustomKey(device, controlName); - public static string getShiftCustomMacro(int device, DS4Controls controlName) => m_Config.GetShiftCustomMacro(device, controlName); - public static string getShiftCustomExtras(int device, DS4Controls controlName) => m_Config.GetShiftCustomExtras(device, controlName); - public static DS4KeyType getShiftCustomKeyType(int device, DS4Controls controlName) => m_Config.GetShiftCustomKeyType(device, controlName); - public static bool getHasShiftCustomKeysorButtons(int device) => m_Config.shiftCustomMapButtons[device].Count > 0 - || m_Config.shiftCustomMapKeys[device].Count > 0; - public static bool getHasShiftCustomExtras(int device) => m_Config.shiftCustomMapExtras[device].Count > 0; - public static Dictionary getShiftCustomButtons(int device) => m_Config.shiftCustomMapButtons[device]; - 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 bool Load() => m_Config.Load(); - - public static void LoadProfile(int device, bool launchprogram, ControlService control) + public static SpecialAction GetProfileAction(int device, string name) { - m_Config.LoadProfile(device, launchprogram, control); - tempprofilename[device] = string.Empty; + SpecialAction sA = null; + m_Config.profileActionDict[device].TryGetValue(name, out sA); + return sA; } - public static void LoadTempProfile(int device, string name, bool launchprogram, ControlService control) + 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][actionname] = GetAction(actionname); + m_Config.profileActionIndexDict[device][actionname] = 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 bool containsLinkedProfile(string serial) + { + string tempSerial = serial.Replace(":", string.Empty); + return m_Config.linkedProfiles.ContainsKey(tempSerial); + } + + public static string getLinkedProfile(string serial) + { + string temp = string.Empty; + string tempSerial = serial.Replace(":", string.Empty); + if (m_Config.linkedProfiles.ContainsKey(tempSerial)) + { + temp = m_Config.linkedProfiles[tempSerial]; + } + + return temp; + } + + public static void changeLinkedProfile(string serial, string profile) + { + string tempSerial = serial.Replace(":", string.Empty); + m_Config.linkedProfiles[tempSerial] = profile; + } + + public static void removeLinkedProfile(string serial) + { + string tempSerial = serial.Replace(":", string.Empty); + if (m_Config.linkedProfiles.ContainsKey(tempSerial)) + { + m_Config.linkedProfiles.Remove(tempSerial); + } + } + + public static bool Load() => m_Config.Load(); + + public static void LoadProfile(int device, bool launchprogram, ControlService control, + bool xinputChange = true, bool postLoad = true) + { + m_Config.LoadProfile(device, launchprogram, control, "", xinputChange, postLoad); + tempprofilename[device] = string.Empty; + tempprofileDistance[device] = false; + } + + 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() @@ -428,17 +1221,29 @@ namespace DS4Windows m_Config.SaveProfile(device, propath); } + public static bool SaveLinkedProfiles() + { + return m_Config.SaveLinkedProfiles(); + } + + public static bool LoadLinkedProfiles() + { + return m_Config.LoadLinkedProfiles(); + } + 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 +1268,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,68 +1279,114 @@ 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 static double Clamp(double min, double value, double max) + { + return (value < min) ? min : (value > max) ? max : value; + } + + private static int ClampInt(int min, int value, int max) + { + return (value < min) ? min : (value > max) ? max : value; + } } - - public class BackingStore { //public String m_Profile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\DS4Tool" + "\\Profiles.xml"; public String m_Profile = Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName + "\\Profiles.xml"; public String m_Actions = Global.appdatapath + "\\Actions.xml"; + public string m_linkedProfiles = Global.appdatapath + "\\LinkedProfiles.xml"; protected XmlDocument m_Xdoc = new XmlDocument(); - //fifth value used to for options, not fifth controller - public int[] buttonMouseSensitivity = { 25, 25, 25, 25, 25 }; + // fifth value used for options, not fifth controller + public int[] buttonMouseSensitivity = new int[5] { 25, 25, 25, 25, 25 }; - public bool[] flushHIDQueue = { 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 }; - 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 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 }; - public double[] SXSens = { 1, 1, 1, 1, 1 }, SZSens = { 1, 1, 1, 1, 1 }; - public Byte[] tapSensitivity = { 0, 0, 0, 0, 0 }; - public bool[] doubleTap = { false, false, false, false, false }; - public int[] scrollSensitivity = { 0, 0, 0, 0, 0 }; - public double[] rainbow = { 0, 0, 0, 0, 0 }; - public int[] flashAt = { 0, 0, 0, 0, 0 }; - public bool[] mouseAccel = { true, true, true, true, true }; - public DS4Color[] m_LowLeds = new DS4Color[] + public bool[] flushHIDQueue = new bool[5] { false, false, false, false, false }; + public bool[] enableTouchToggle = new bool[5] { true, true, true, true, true }; + public int[] idleDisconnectTimeout = new int[5] { 0, 0, 0, 0, 0 }; + public bool[] touchpadJitterCompensation = new bool[5] { true, true, true, true, true }; + public bool[] lowerRCOn = new bool[5] { false, false, false, false, false }; + public bool[] ledAsBattery = new bool[5] { false, false, false, false, false }; + public byte[] flashType = new byte[5] { 0, 0, 0, 0, 0 }; + public string[] profilePath = new string[5] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty }; + public string[] olderProfilePath = new string[5] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty }; + public Dictionary linkedProfiles = new Dictionary(); + // Cache properties instead of performing a string comparison every frame + public bool[] distanceProfiles = new bool[5] { false, false, false, false, false }; + public Byte[] rumble = new Byte[5] { 100, 100, 100, 100, 100 }; + public Byte[] touchSensitivity = new Byte[5] { 100, 100, 100, 100, 100 }; + public Byte[] l2Deadzone = new Byte[5] { 0, 0, 0, 0, 0 }, r2Deadzone = new Byte[5] { 0, 0, 0, 0, 0 }; + public int[] LSDeadzone = new int[5] { 0, 0, 0, 0, 0 }, RSDeadzone = new int[5] { 0, 0, 0, 0, 0 }; + public int[] LSAntiDeadzone = new int[5] { 0, 0, 0, 0, 0 }, RSAntiDeadzone = new int[5] { 0, 0, 0, 0, 0 }; + public int[] LSMaxzone = new int[5] { 100, 100, 100, 100, 100 }, RSMaxzone = new int[5] { 100, 100, 100, 100, 100 }; + public int[] l2AntiDeadzone = new int[5] { 0, 0, 0, 0, 0 }, r2AntiDeadzone = new int[5] { 0, 0, 0, 0, 0 }; + public int[] l2Maxzone = new int[5] { 100, 100, 100, 100, 100 }, r2Maxzone = new int[5] { 100, 100, 100, 100, 100 }; + public double[] LSRotation = new double[5] { 0.0, 0.0, 0.0, 0.0, 0.0 }, RSRotation = new double[5] { 0.0, 0.0, 0.0, 0.0, 0.0 }; + public double[] SXDeadzone = new double[5] { 0.02, 0.02, 0.02, 0.02, 0.02 }, SZDeadzone = new double[5] { 0.02, 0.02, 0.02, 0.02, 0.02 }; + public double[] SXMaxzone = new double[5] { 1.0, 1.0, 1.0, 1.0, 1.0 }, + SZMaxzone = new double[5] { 1.0, 1.0, 1.0, 1.0, 1.0 }; + public double[] SXAntiDeadzone = new double[5] { 0.0, 0.0, 0.0, 0.0, 0.0 }, + SZAntiDeadzone = new double[5] { 0.0, 0.0, 0.0, 0.0, 0.0 }; + public double[] l2Sens = new double[5] { 1.0, 1.0, 1.0, 1.0, 1.0 }, r2Sens = new double[5] { 1.0, 1.0, 1.0, 1.0, 1.0 }; + public double[] LSSens = new double[5] { 1.0, 1.0, 1.0, 1.0, 1.0 }, RSSens = new double[5] { 1.0, 1.0, 1.0, 1.0, 1.0 }; + public double[] SXSens = new double[5] { 1.0, 1.0, 1.0, 1.0, 1.0 }, SZSens = new double[5] { 1.0, 1.0, 1.0, 1.0, 1.0 }; + public Byte[] tapSensitivity = new Byte[5] { 0, 0, 0, 0, 0 }; + public bool[] doubleTap = new bool[5] { false, false, false, false, false }; + public int[] scrollSensitivity = new int[5] { 0, 0, 0, 0, 0 }; + public int[] touchpadInvert = new int[5] { 0, 0, 0, 0, 0 }; + public double[] rainbow = new double[5] { 0.0, 0.0, 0.0, 0.0, 0.0 }; + public int[] flashAt = new int[5] { 0, 0, 0, 0, 0 }; + public bool[] mouseAccel = new bool[5] { true, true, true, true, true }; + public int[] btPollRate = new int[5] { 4, 4, 4, 4, 4 }; + public int[] lsOutCurveMode = new int[5] { 0, 0, 0, 0, 0 }; + public int[] rsOutCurveMode = new int[5] { 0, 0, 0, 0, 0 }; + public int[] l2OutCurveMode = new int[5] { 0, 0, 0, 0, 0 }; + public int[] r2OutCurveMode = new int[5] { 0, 0, 0, 0, 0 }; + public int[] sxOutCurveMode = new int[5] { 0, 0, 0, 0, 0 }; + public int[] szOutCurveMode = new int[5] { 0, 0, 0, 0, 0 }; + + public DS4Color[] m_LowLeds = new DS4Color[5] { - new DS4Color(Color.Black), + new DS4Color(Color.Black), new DS4Color(Color.Black), new DS4Color(Color.Black), new DS4Color(Color.Black), new DS4Color(Color.Black) }; - public DS4Color[] m_Leds = new DS4Color[] + public DS4Color[] m_Leds = new DS4Color[5] { new DS4Color(Color.Blue), new DS4Color(Color.Red), @@ -542,43 +1394,50 @@ namespace DS4Windows new DS4Color(Color.Pink), new DS4Color(Color.White) }; - public DS4Color[] m_ChargingLeds = new DS4Color[] + public DS4Color[] m_ChargingLeds = new DS4Color[5] { - new DS4Color(Color.Black), + new DS4Color(Color.Black), new DS4Color(Color.Black), new DS4Color(Color.Black), new DS4Color(Color.Black), new DS4Color(Color.Black) }; - public DS4Color[] m_FlashLeds = new DS4Color[] + public DS4Color[] m_FlashLeds = new DS4Color[5] { - new DS4Color(Color.Black), + new DS4Color(Color.Black), new DS4Color(Color.Black), new DS4Color(Color.Black), new DS4Color(Color.Black), new DS4Color(Color.Black) }; - public bool[] useCustomLeds = new bool[] { false, false, false, false }; - public DS4Color[] m_CustomLeds = new DS4Color[] + public bool[] useCustomLeds = new bool[5] { false, false, false, false, false }; + public DS4Color[] m_CustomLeds = new DS4Color[5] { - new DS4Color(Color.Black), - new DS4Color(Color.Black), - new DS4Color(Color.Black), - new DS4Color(Color.Black) + new DS4Color(Color.Blue), + new DS4Color(Color.Blue), + new DS4Color(Color.Blue), + new DS4Color(Color.Blue), + new DS4Color(Color.Blue) }; - public int[] chargingType = { 0, 0, 0, 0, 0 }; - public string[] launchProgram = { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty }; - public bool[] dinputOnly = { false, false, false, false, false }; - public bool[] startTouchpadOff = { false, false, false, false, false }; - public bool[] useTPforControls = { false, false, false, false, false }; - public bool[] useSAforMouse = { false, false, false, false, false }; - public string[] sATriggers = { "", "", "", "", "" }; - public int[] lsCurve = { 0, 0, 0, 0, 0 }; - public int[] rsCurve = { 0, 0, 0, 0, 0 }; + + public int[] chargingType = new int[5] { 0, 0, 0, 0, 0 }; + public string[] launchProgram = new string[5] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty }; + public bool[] dinputOnly = new bool[5] { false, false, false, false, false }; + public bool[] startTouchpadOff = new bool[5] { false, false, false, false, false }; + public bool[] useTPforControls = new bool[5] { false, false, false, false, false }; + public bool[] useSAforMouse = new bool[5] { false, false, false, false, false }; + public string[] sATriggers = new string[5] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty }; + public int[][] touchDisInvertTriggers = new int[5][] { new int[1] { -1 }, new int[1] { -1 }, new int[1] { -1 }, + new int[1] { -1 }, new int[1] { -1 } }; + public int[] lsCurve = new int[5] { 0, 0, 0, 0, 0 }; + public int[] rsCurve = new int[5] { 0, 0, 0, 0, 0 }; public Boolean useExclusiveMode = false; public Int32 formWidth = 782; public Int32 formHeight = 550; + public int formLocationX = 0; + public int formLocationY = 0; public Boolean startMinimized = false; + public Boolean minToTaskbar = false; public DateTime lastChecked; public int CheckWhen = 1; public int notifications = 2; @@ -589,118 +1448,116 @@ namespace DS4Windows public int firstXinputPort = 1; public bool closeMini = false; public List actions = new List(); - public List[] ds4settings = { new List(), new List(), new List(), new List(), new List() }; - /*public Dictionary[] customMapKeyTypes = { null, null, null, null, null }; - public Dictionary[] customMapKeys = { null, null, null, null, null }; - public Dictionary[] customMapMacros = { null, null, null, null, null }; - public Dictionary[] customMapButtons = { null, null, null, null, null }; - public Dictionary[] customMapExtras = { null, null, null, null, null }; + public List[] ds4settings = new List[5] + { new List(), new List(), new List(), + new List(), new List() }; - public Dictionary[] shiftCustomMapKeyTypes = { null, null, null, null, null }; - public Dictionary[] shiftCustomMapKeys = { null, null, null, null, null }; - public Dictionary[] shiftCustomMapMacros = { null, null, null, null, null }; - 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 List[] profileActions = new List[5] { null, null, null, null, null }; + public int[] profileActionCount = new int[5] { 0, 0, 0, 0, 0 }; + public Dictionary[] profileActionDict = new Dictionary[5] + { new Dictionary(), new Dictionary(), new Dictionary(), + new Dictionary(), new Dictionary() }; + + public Dictionary[] profileActionIndexDict = new Dictionary[5] + { new Dictionary(), new Dictionary(), new Dictionary(), + new Dictionary(), new Dictionary() }; + + public string useLang = ""; public bool downloadLang = true; public bool useWhiteIcon; public bool flashWhenLate = true; - public int flashWhenLateAt = 10; - public int[] gyroSensitivity = { 100, 100, 100, 100, 100 }; - public int[] gyroInvert = { 0, 0, 0, 0, 0 }; + public int flashWhenLateAt = 20; + // Cache whether profile has custom action + public bool[] containsCustomAction = new bool[5] { false, false, false, false, false }; + + // Cache whether profile has custom extras + public bool[] containsCustomExtras = new bool[5] { false, false, false, false, false }; + + public int[] gyroSensitivity = new int[5] { 100, 100, 100, 100, 100 }; + public int[] gyroSensVerticalScale = new int[5] { 100, 100, 100, 100, 100 }; + public int[] gyroInvert = new int[5] { 0, 0, 0, 0, 0 }; + public bool[] gyroTriggerTurns = new bool[5] { true, true, true, true, true }; + public bool[] gyroSmoothing = new bool[5] { false, false, false, false, false }; + public double[] gyroSmoothWeight = new double[5] { 0.5, 0.5, 0.5, 0.5, 0.5 }; + public int[] gyroMouseHorizontalAxis = new int[5] { 0, 0, 0, 0, 0 }; + public bool[] trackballMode = new bool[5] { false, false, false, false, false }; + public double[] trackballFriction = new double[5] { 10.0, 10.0, 10.0, 10.0, 10.0 }; + + bool tempBool = false; public BackingStore() { 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(); - customMapButtons[i] = new Dictionary(); - customMapExtras[i] = new Dictionary(); + } - shiftCustomMapKeyTypes[i] = new Dictionary(); - shiftCustomMapKeys[i] = new Dictionary(); - 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; } } - /*public X360Controls GetCustomButton(int device, DS4Controls controlName) + private string stickOutputCurveString(int id) { - if (customMapButtons[device].ContainsKey(controlName)) - return customMapButtons[device][controlName]; - else return X360Controls.None; - } - public UInt16 GetCustomKey(int device, DS4Controls controlName) - { - if (customMapKeys[device].ContainsKey(controlName)) - return customMapKeys[device][controlName]; - else return 0; - } - public string GetCustomMacro(int device, DS4Controls controlName) - { - if (customMapMacros[device].ContainsKey(controlName)) - return customMapMacros[device][controlName]; - else return "0"; - } - public string GetCustomExtras(int device, DS4Controls controlName) - { - if (customMapExtras[device].ContainsKey(controlName)) - return customMapExtras[device][controlName]; - else return "0"; - } - public DS4KeyType GetCustomKeyType(int device, DS4Controls controlName) - { - try + string result = "linear"; + switch (id) { - if (customMapKeyTypes[device].ContainsKey(controlName)) - return customMapKeyTypes[device][controlName]; - else return 0; + case 0: break; + case 1: result = "enhanced-precision"; break; + case 2: result = "quadratic"; break; + case 3: result = "cubic"; break; + default: break; } - catch { return 0; } + + return result; } - public X360Controls GetShiftCustomButton(int device, DS4Controls controlName) + private int stickOutputCurveId(string name) { - if (shiftCustomMapButtons[device].ContainsKey(controlName)) - return shiftCustomMapButtons[device][controlName]; - else return X360Controls.None; - } - public UInt16 GetShiftCustomKey(int device, DS4Controls controlName) - { - if (shiftCustomMapKeys[device].ContainsKey(controlName)) - return shiftCustomMapKeys[device][controlName]; - else return 0; - } - public string GetShiftCustomMacro(int device, DS4Controls controlName) - { - if (shiftCustomMapMacros[device].ContainsKey(controlName)) - return shiftCustomMapMacros[device][controlName]; - else return "0"; - } - public string GetShiftCustomExtras(int device, DS4Controls controlName) - { - if (customMapExtras[device].ContainsKey(controlName)) - return customMapExtras[device][controlName]; - else return "0"; - } - public DS4KeyType GetShiftCustomKeyType(int device, DS4Controls controlName) - { - try + int id = 0; + switch (name) { - if (shiftCustomMapKeyTypes[device].ContainsKey(controlName)) - return shiftCustomMapKeyTypes[device][controlName]; - else return 0; + case "linear": id = 0; break; + case "enhanced-precision": id = 1; break; + case "quadratic": id = 2; break; + case "cubic": id = 3; break; + default: break; } - catch { return 0; } - }*/ + + return id; + } + + private string axisOutputCurveString(int id) + { + string result = "linear"; + switch (id) + { + case 0: break; + case 1: result = "quadratic"; break; + case 2: result = "cubic"; break; + default: break; + } + + return result; + } + + private int axisOutputCurveId(string name) + { + int id = 0; + switch (name) + { + case "linear": id = 0; break; + case "quadratic": id = 1; break; + case "cubic": id = 2; break; + default: break; + } + + return id; + } public bool SaveProfile(int device, string propath) { @@ -725,6 +1582,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,13 +1608,31 @@ 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 xmlTouchpadInvert = m_Xdoc.CreateNode(XmlNodeType.Element, "TouchpadInvert", null); xmlTouchpadInvert.InnerText = touchpadInvert[device].ToString(); Node.AppendChild(xmlTouchpadInvert); + 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 xmlLSRotation = m_Xdoc.CreateNode(XmlNodeType.Element, "LSRotation", null); xmlLSRotation.InnerText = Convert.ToInt32(LSRotation[device] * 180.0 / Math.PI).ToString(); Node.AppendChild(xmlLSRotation); + XmlNode xmlRSRotation = m_Xdoc.CreateNode(XmlNodeType.Element, "RSRotation", null); xmlRSRotation.InnerText = Convert.ToInt32(RSRotation[device] * 180.0 / Math.PI).ToString(); Node.AppendChild(xmlRSRotation); + 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); + XmlNode xmlSXMaxzone = m_Xdoc.CreateNode(XmlNodeType.Element, "SXMaxZone", null); xmlSXMaxzone.InnerText = Convert.ToInt32(SXMaxzone[device] * 100.0).ToString(); Node.AppendChild(xmlSXMaxzone); + XmlNode xmlSZMaxzone = m_Xdoc.CreateNode(XmlNodeType.Element, "SZMaxZone", null); xmlSZMaxzone.InnerText = Convert.ToInt32(SZMaxzone[device] * 100.0).ToString(); Node.AppendChild(xmlSZMaxzone); + + XmlNode xmlSXAntiDeadzone = m_Xdoc.CreateNode(XmlNodeType.Element, "SXAntiDeadZone", null); xmlSXAntiDeadzone.InnerText = Convert.ToInt32(SXAntiDeadzone[device] * 100.0).ToString(); Node.AppendChild(xmlSXAntiDeadzone); + XmlNode xmlSZAntiDeadzone = m_Xdoc.CreateNode(XmlNodeType.Element, "SZAntiDeadZone", null); xmlSZAntiDeadzone.InnerText = Convert.ToInt32(SZAntiDeadzone[device] * 100.0).ToString(); Node.AppendChild(xmlSZAntiDeadzone); + XmlNode xmlSens = m_Xdoc.CreateNode(XmlNodeType.Element, "Sensitivity", null); xmlSens.InnerText = $"{LSSens[device]}|{RSSens[device]}|{l2Sens[device]}|{r2Sens[device]}|{SXSens[device]}|{SZSens[device]}"; Node.AppendChild(xmlSens); @@ -770,11 +1646,34 @@ namespace DS4Windows XmlNode xmlUseTPforControls = m_Xdoc.CreateNode(XmlNodeType.Element, "UseTPforControls", null); xmlUseTPforControls.InnerText = useTPforControls[device].ToString(); Node.AppendChild(xmlUseTPforControls); XmlNode xmlUseSAforMouse = m_Xdoc.CreateNode(XmlNodeType.Element, "UseSAforMouse", null); xmlUseSAforMouse.InnerText = useSAforMouse[device].ToString(); Node.AppendChild(xmlUseSAforMouse); XmlNode xmlSATriggers = m_Xdoc.CreateNode(XmlNodeType.Element, "SATriggers", null); xmlSATriggers.InnerText = sATriggers[device].ToString(); Node.AppendChild(xmlSATriggers); + + XmlNode xmlTouchDisInvTriggers = m_Xdoc.CreateNode(XmlNodeType.Element, "TouchDisInvTriggers", null); + string tempTouchDisInv = string.Join(",", touchDisInvertTriggers[device]); + xmlTouchDisInvTriggers.InnerText = tempTouchDisInv; + Node.AppendChild(xmlTouchDisInvTriggers); + XmlNode xmlGyroSensitivity = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroSensitivity", null); xmlGyroSensitivity.InnerText = gyroSensitivity[device].ToString(); Node.AppendChild(xmlGyroSensitivity); + XmlNode xmlGyroSensVerticalScale = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroSensVerticalScale", null); xmlGyroSensVerticalScale.InnerText = gyroSensVerticalScale[device].ToString(); Node.AppendChild(xmlGyroSensVerticalScale); XmlNode xmlGyroInvert = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroInvert", null); xmlGyroInvert.InnerText = gyroInvert[device].ToString(); Node.AppendChild(xmlGyroInvert); + XmlNode xmlGyroTriggerTurns = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroTriggerTurns", null); xmlGyroTriggerTurns.InnerText = gyroTriggerTurns[device].ToString(); Node.AppendChild(xmlGyroTriggerTurns); + XmlNode xmlGyroSmoothWeight = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroSmoothingWeight", null); xmlGyroSmoothWeight.InnerText = Convert.ToInt32(gyroSmoothWeight[device] * 100).ToString(); Node.AppendChild(xmlGyroSmoothWeight); + XmlNode xmlGyroSmoothing = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroSmoothing", null); xmlGyroSmoothing.InnerText = gyroSmoothing[device].ToString(); Node.AppendChild(xmlGyroSmoothing); + XmlNode xmlGyroMouseHAxis = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroMouseHAxis", null); xmlGyroMouseHAxis.InnerText = gyroMouseHorizontalAxis[device].ToString(); Node.AppendChild(xmlGyroMouseHAxis); XmlNode xmlLSC = m_Xdoc.CreateNode(XmlNodeType.Element, "LSCurve", null); xmlLSC.InnerText = lsCurve[device].ToString(); Node.AppendChild(xmlLSC); XmlNode xmlRSC = m_Xdoc.CreateNode(XmlNodeType.Element, "RSCurve", null); xmlRSC.InnerText = rsCurve[device].ToString(); Node.AppendChild(xmlRSC); XmlNode xmlProfileActions = m_Xdoc.CreateNode(XmlNodeType.Element, "ProfileActions", null); xmlProfileActions.InnerText = string.Join("/", profileActions[device]); Node.AppendChild(xmlProfileActions); + XmlNode xmlBTPollRate = m_Xdoc.CreateNode(XmlNodeType.Element, "BTPollRate", null); xmlBTPollRate.InnerText = btPollRate[device].ToString(); Node.AppendChild(xmlBTPollRate); + XmlNode xmlLsOutputCurveMode = m_Xdoc.CreateNode(XmlNodeType.Element, "LSOutputCurveMode", null); xmlLsOutputCurveMode.InnerText = stickOutputCurveString(lsOutCurveMode[device]); Node.AppendChild(xmlLsOutputCurveMode); + XmlNode xmlRsOutputCurveMode = m_Xdoc.CreateNode(XmlNodeType.Element, "RSOutputCurveMode", null); xmlRsOutputCurveMode.InnerText = stickOutputCurveString(rsOutCurveMode[device]); Node.AppendChild(xmlRsOutputCurveMode); + + XmlNode xmlL2OutputCurveMode = m_Xdoc.CreateNode(XmlNodeType.Element, "L2OutputCurveMode", null); xmlL2OutputCurveMode.InnerText = axisOutputCurveString(l2OutCurveMode[device]); Node.AppendChild(xmlL2OutputCurveMode); + XmlNode xmlR2OutputCurveMode = m_Xdoc.CreateNode(XmlNodeType.Element, "R2OutputCurveMode", null); xmlR2OutputCurveMode.InnerText = axisOutputCurveString(r2OutCurveMode[device]); Node.AppendChild(xmlR2OutputCurveMode); + + XmlNode xmlSXOutputCurveMode = m_Xdoc.CreateNode(XmlNodeType.Element, "SXOutputCurveMode", null); xmlSXOutputCurveMode.InnerText = axisOutputCurveString(sxOutCurveMode[device]); Node.AppendChild(xmlSXOutputCurveMode); + XmlNode xmlSZOutputCurveMode = m_Xdoc.CreateNode(XmlNodeType.Element, "SZOutputCurveMode", null); xmlSZOutputCurveMode.InnerText = axisOutputCurveString(szOutCurveMode[device]); Node.AppendChild(xmlSZOutputCurveMode); + + XmlNode xmlTrackBallMode = m_Xdoc.CreateNode(XmlNodeType.Element, "TrackballMode", null); xmlTrackBallMode.InnerText = trackballMode[device].ToString(); Node.AppendChild(xmlTrackBallMode); + XmlNode xmlTrackBallFriction = m_Xdoc.CreateNode(XmlNodeType.Element, "TrackballFriction", null); xmlTrackBallFriction.InnerText = trackballFriction[device].ToString(); Node.AppendChild(xmlTrackBallFriction); XmlNode NodeControl = m_Xdoc.CreateNode(XmlNodeType.Element, "Control", null); XmlNode Key = m_Xdoc.CreateNode(XmlNodeType.Element, "Key", null); @@ -799,16 +1698,21 @@ namespace DS4Windows string keyType = string.Empty; if (dcs.action is string) + { if (dcs.action.ToString() == "Unbound") 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; if (dcs.keyType.HasFlag(DS4KeyType.ScanCode)) keyType += DS4KeyType.ScanCode; + if (keyType != string.Empty) { buttonNode = m_Xdoc.CreateNode(XmlNodeType.Element, dcs.control.ToString(), null); @@ -828,21 +1732,31 @@ 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; if (!string.IsNullOrEmpty(dcs.extras)) + { foreach (string s in dcs.extras.Split(',')) + { if (s != "0") { hasvalue = true; break; } + } + } + if (hasvalue) { XmlNode extraNode = m_Xdoc.CreateNode(XmlNodeType.Element, dcs.control.ToString(), null); @@ -856,8 +1770,11 @@ namespace DS4Windows string keyType = string.Empty; if (dcs.shiftAction is string) + { if (dcs.shiftAction.ToString() == "Unbound") keyType += DS4KeyType.Unbound; + } + if (dcs.shiftKeyType.HasFlag(DS4KeyType.HoldMacro)) keyType += DS4KeyType.HoldMacro; if (dcs.shiftKeyType.HasFlag(DS4KeyType.Macro)) @@ -866,6 +1783,7 @@ namespace DS4Windows keyType += DS4KeyType.Toggle; if (dcs.shiftKeyType.HasFlag(DS4KeyType.ScanCode)) keyType += DS4KeyType.ScanCode; + if (keyType != string.Empty) { buttonNode = m_Xdoc.CreateElement(dcs.control.ToString()); @@ -892,14 +1810,20 @@ namespace DS4Windows ShiftButton.AppendChild(buttonNode); } } + hasvalue = false; if (!string.IsNullOrEmpty(dcs.shiftExtras)) + { foreach (string s in dcs.shiftExtras.Split(',')) + { if (s != "0") { hasvalue = true; break; } + } + } + if (hasvalue) { XmlNode extraNode = m_Xdoc.CreateNode(XmlNodeType.Element, dcs.control.ToString(), null); @@ -907,6 +1831,7 @@ namespace DS4Windows ShiftExtras.AppendChild(extraNode); } } + Node.AppendChild(NodeControl); if (Button.HasChildNodes) NodeControl.AppendChild(Button); @@ -932,104 +1857,7 @@ namespace DS4Windows NodeShiftControl.AppendChild(ShiftKeyType); if (ShiftExtras.HasChildNodes) NodeShiftControl.AppendChild(ShiftExtras); - /*else if (xmlControls != null) - { - Node.AppendChild(xmlControls); - }*/ - /*if (shiftModifier[device] > 0) - { - XmlNode NodeShiftControl = m_Xdoc.CreateNode(XmlNodeType.Element, "ShiftControl", null); - - XmlNode ShiftKey = m_Xdoc.CreateNode(XmlNodeType.Element, "Key", null); - XmlNode ShiftMacro = m_Xdoc.CreateNode(XmlNodeType.Element, "Macro", null); - XmlNode ShiftKeyType = m_Xdoc.CreateNode(XmlNodeType.Element, "KeyType", null); - XmlNode ShiftButton = m_Xdoc.CreateNode(XmlNodeType.Element, "Button", null); - XmlNode ShiftExtras = m_Xdoc.CreateNode(XmlNodeType.Element, "Extras", null); - if (shiftbuttons != null) - { - foreach (var button in shiftbuttons) - { - // Save even if string (for xbox controller buttons) - if (button.Tag != null) - { - XmlNode buttonNode; - string keyType = String.Empty; - if (button.Tag is KeyValuePair) - if (((KeyValuePair)button.Tag).Key == "Unbound") - keyType += DS4KeyType.Unbound; - - if (button.Font.Strikeout) - keyType += DS4KeyType.HoldMacro; - if (button.Font.Underline) - keyType += DS4KeyType.Macro; - if (button.Font.Italic) - keyType += DS4KeyType.Toggle; - if (button.Font.Bold) - keyType += DS4KeyType.ScanCode; - if (keyType != String.Empty) - { - buttonNode = m_Xdoc.CreateNode(XmlNodeType.Element, button.Name, null); - buttonNode.InnerText = keyType; - ShiftKeyType.AppendChild(buttonNode); - } - - string[] extras; - buttonNode = m_Xdoc.CreateNode(XmlNodeType.Element, button.Name, null); - if (button.Tag is KeyValuePair, string> || button.Tag is KeyValuePair || button.Tag is KeyValuePair) - { - KeyValuePair tag = (KeyValuePair)button.Tag; - int[] ii = tag.Key; - buttonNode.InnerText = string.Join("/", ii); - ShiftMacro.AppendChild(buttonNode); - extras = tag.Value.Split(','); - } - else if (button.Tag is KeyValuePair || button.Tag is KeyValuePair || button.Tag is KeyValuePair) - { - KeyValuePair tag = (KeyValuePair)button.Tag; - buttonNode.InnerText = tag.Key.ToString(); - ShiftKey.AppendChild(buttonNode); - extras = tag.Value.Split(','); - } - else if (button.Tag is KeyValuePair) - { - KeyValuePair tag = (KeyValuePair)button.Tag; - buttonNode.InnerText = tag.Key; - ShiftButton.AppendChild(buttonNode); - extras = tag.Value.Split(','); - } - else - { - KeyValuePair tag = (KeyValuePair)button.Tag; - extras = tag.Value.Split(','); - } - bool hasvalue = false; - foreach (string s in extras) - if (s != "0") - { - hasvalue = true; - break; - } - if (hasvalue && !string.IsNullOrEmpty(String.Join(",", extras))) - { - XmlNode extraNode = m_Xdoc.CreateNode(XmlNodeType.Element, button.Name, null); - extraNode.InnerText = String.Join(",", extras); - ShiftExtras.AppendChild(extraNode); - } - } - } - Node.AppendChild(NodeShiftControl); - if (ShiftButton.HasChildNodes) - NodeShiftControl.AppendChild(ShiftButton); - if (ShiftMacro.HasChildNodes) - NodeShiftControl.AppendChild(ShiftMacro); - if (ShiftKey.HasChildNodes) - NodeShiftControl.AppendChild(ShiftKey); - if (ShiftKeyType.HasChildNodes) - NodeShiftControl.AppendChild(ShiftKeyType); - } - else if (xmlShiftControls != null) - Node.AppendChild(xmlShiftControls); - }*/ + m_Xdoc.AppendChild(Node); m_Xdoc.Save(path); } @@ -1037,11 +1865,11 @@ namespace DS4Windows return Saved; } - private DS4Controls getDS4ControlsByName(string key) + public DS4Controls getDS4ControlsByName(string key) { - if (!key.StartsWith("bn")) return (DS4Controls)Enum.Parse(typeof(DS4Controls), key, true); + switch (key) { case "bnShare": return DS4Controls.Share; @@ -1170,14 +1998,16 @@ namespace DS4Windows case "bnShiftSwipeLeft": return DS4Controls.SwipeLeft; case "bnShiftSwipeRight": return DS4Controls.SwipeRight; } + return 0; } - private X360Controls getX360ControlsByName(string key) + public X360Controls getX360ControlsByName(string key) { X360Controls x3c; if (Enum.TryParse(key, true, out x3c)) return x3c; + switch (key) { case "Back": return X360Controls.Back; @@ -1221,14 +2051,65 @@ namespace DS4Windows case "Mouse Left": return X360Controls.MouseLeft; case "Mouse Right": return X360Controls.MouseRight; case "Unbound": return X360Controls.Unbound; - } + return X360Controls.Unbound; } - public Boolean LoadProfile(int device, bool launchprogram, ControlService control, string propath = "") + public string getX360ControlString(X360Controls key) { - Boolean Loaded = true; + 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 bool LoadProfile(int device, bool launchprogram, ControlService control, + string propath = "", bool xinputChange = true, bool postLoad = true) + { + bool Loaded = true; Dictionary customMapKeyTypes = new Dictionary(); Dictionary customMapKeys = new Dictionary(); Dictionary customMapButtons = new Dictionary(); @@ -1240,12 +2121,16 @@ namespace DS4Windows Dictionary shiftCustomMapMacros = new Dictionary(); Dictionary shiftCustomMapExtras = new Dictionary(); string rootname = "DS4Windows"; - Boolean missingSetting = false; + bool missingSetting = false; string profilepath; if (propath == "") profilepath = Global.appdatapath + @"\Profiles\" + profilePath[device] + ".xml"; else profilepath = propath; + + bool xinputPlug = false; + bool xinputStatus = false; + if (File.Exists(profilepath)) { XmlNode Item; @@ -1256,14 +2141,22 @@ namespace DS4Windows rootname = "ScpControl"; missingSetting = true; } + if (device < 4) { DS4LightBar.forcelight[device] = false; DS4LightBar.forcedFlash[device] = 0; } + + // Make sure to reset currently set profile values before parsing + ResetProfile(device); + 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 @@ -1275,11 +2168,13 @@ namespace DS4Windows colors = Item.InnerText.Split(','); else colors = new string[0]; + m_Leds[device].red = byte.Parse(colors[0]); m_Leds[device].green = byte.Parse(colors[1]); m_Leds[device].blue = byte.Parse(colors[2]); } catch { missingSetting = true; } + if (m_Xdoc.SelectSingleNode("/" + rootname + "/Color") == null) { //Old method of color saving @@ -1291,6 +2186,7 @@ namespace DS4Windows try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/Blue"); Byte.TryParse(Item.InnerText, out m_Leds[device].blue); } catch { missingSetting = true; } } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/RumbleBoost"); Byte.TryParse(Item.InnerText, out rumble[device]); } catch { missingSetting = true; } @@ -1305,6 +2201,7 @@ namespace DS4Windows try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/touchSensitivity"); Byte.TryParse(Item.InnerText, out touchSensitivity[device]); } catch { missingSetting = true; } + //New method for saving color try { @@ -1314,21 +2211,24 @@ namespace DS4Windows colors = Item.InnerText.Split(','); else colors = new string[0]; + m_LowLeds[device].red = byte.Parse(colors[0]); m_LowLeds[device].green = byte.Parse(colors[1]); m_LowLeds[device].blue = byte.Parse(colors[2]); } catch { missingSetting = true; } + if (m_Xdoc.SelectSingleNode("/" + rootname + "/LowColor") == null) { //Old method of color saving - try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LowRed"); Byte.TryParse(Item.InnerText, out m_LowLeds[device].red); } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LowRed"); byte.TryParse(Item.InnerText, out m_LowLeds[device].red); } catch { missingSetting = true; } - try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LowGreen"); Byte.TryParse(Item.InnerText, out m_LowLeds[device].green); } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LowGreen"); byte.TryParse(Item.InnerText, out m_LowLeds[device].green); } catch { missingSetting = true; } - try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LowBlue"); Byte.TryParse(Item.InnerText, out m_LowLeds[device].blue); } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LowBlue"); byte.TryParse(Item.InnerText, out m_LowLeds[device].blue); } catch { missingSetting = true; } } + //New method for saving color try { @@ -1344,6 +2244,7 @@ namespace DS4Windows m_ChargingLeds[device].blue = byte.Parse(colors[2]); } catch { missingSetting = true; } + if (m_Xdoc.SelectSingleNode("/" + rootname + "/ChargingColor") == null) { try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/ChargingRed"); Byte.TryParse(Item.InnerText, out m_ChargingLeds[device].red); } @@ -1353,6 +2254,7 @@ namespace DS4Windows try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/ChargingBlue"); Byte.TryParse(Item.InnerText, out m_ChargingLeds[device].blue); } catch { missingSetting = true; } } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/FlashColor"); @@ -1366,6 +2268,7 @@ namespace DS4Windows m_FlashLeds[device].blue = byte.Parse(colors[2]); } catch { missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/touchpadJitterCompensation"); bool.TryParse(Item.InnerText, out touchpadJitterCompensation[device]); } catch { missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/lowerRCOn"); bool.TryParse(Item.InnerText, out lowerRCOn[device]); } @@ -1376,22 +2279,113 @@ namespace DS4Windows catch { missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/scrollSensitivity"); int.TryParse(Item.InnerText, out scrollSensitivity[device]); } catch { missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/TouchpadInvert"); int temp = 0; int.TryParse(Item.InnerText, out temp); touchpadInvert[device] = Math.Min(Math.Max(temp, 0), 3); } + catch { touchpadInvert[device] = 0; missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LeftTriggerMiddle"); byte.TryParse(Item.InnerText, out l2Deadzone[device]); } 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 { l2AntiDeadzone[device] = 0; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/R2AntiDeadZone"); int.TryParse(Item.InnerText, out r2AntiDeadzone[device]); } + catch { r2AntiDeadzone[device] = 0; 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 { l2Maxzone[device] = 100; 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 { r2Maxzone[device] = 100; missingSetting = true; } + + try + { + Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LSRotation"); int temp = 0; + int.TryParse(Item.InnerText, out temp); + temp = Math.Min(Math.Max(temp, -180), 180); + LSRotation[device] = temp * Math.PI / 180.0; + } + catch { LSRotation[device] = 0.0; missingSetting = true; } + + try + { + Item = m_Xdoc.SelectSingleNode("/" + rootname + "/RSRotation"); int temp = 0; + int.TryParse(Item.InnerText, out temp); + temp = Math.Min(Math.Max(temp, -180), 180); + RSRotation[device] = temp * Math.PI / 180.0; + } + catch { RSRotation[device] = 0.0; 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]); } catch { rainbow[device] = 0; missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LSDeadZone"); int.TryParse(Item.InnerText, out LSDeadzone[device]); } - catch { missingSetting = true; } + catch { LSDeadzone[device] = 0; missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/RSDeadZone"); int.TryParse(Item.InnerText, out RSDeadzone[device]); } - catch { missingSetting = true; } + catch { RSDeadzone[device] = 0; missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LSAntiDeadZone"); int.TryParse(Item.InnerText, out LSAntiDeadzone[device]); } + catch { LSAntiDeadzone[device] = 0; missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/RSAntiDeadZone"); int.TryParse(Item.InnerText, out RSAntiDeadzone[device]); } + catch { RSAntiDeadzone[device] = 0; 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 { LSMaxzone[device] = 100; 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 { RSMaxzone[device] = 100; missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SXDeadZone"); double.TryParse(Item.InnerText, out SXDeadzone[device]); } - catch { missingSetting = true; } + catch { SXDeadzone[device] = 0.02; missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SZDeadZone"); double.TryParse(Item.InnerText, out SZDeadzone[device]); } - catch { missingSetting = true; } + catch { SZDeadzone[device] = 0.02; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SXMaxZone"); + int temp = 0; + int.TryParse(Item.InnerText, out temp); + SXMaxzone[device] = Math.Min(Math.Max(temp * 0.01, 0.0), 1.0); + } + catch { SXMaxzone[device] = 1.0; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SZMaxZone"); + int temp = 0; + int.TryParse(Item.InnerText, out temp); + SZMaxzone[device] = Math.Min(Math.Max(temp * 0.01, 0.0), 1.0); + } + catch { SZMaxzone[device] = 1.0; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SXAntiDeadZone"); + int temp = 0; + int.TryParse(Item.InnerText, out temp); + SXAntiDeadzone[device] = Math.Min(Math.Max(temp * 0.01, 0.0), 1.0); + } + catch { SXAntiDeadzone[device] = 0.0; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SZAntiDeadZone"); + int temp = 0; + int.TryParse(Item.InnerText, out temp); + SZAntiDeadzone[device] = Math.Min(Math.Max(temp * 0.01, 0.0), 1.0); + } + catch { SZAntiDeadzone[device] = 0.0; missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/Sensitivity"); @@ -1402,9 +2396,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; @@ -1412,82 +2406,250 @@ namespace DS4Windows SZSens[device] = 1; } catch { missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/ChargingType"); int.TryParse(Item.InnerText, out chargingType[device]); } catch { missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/MouseAcceleration"); bool.TryParse(Item.InnerText, out mouseAccel[device]); } catch { missingSetting = true; } + 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(() => + { + Thread.Sleep(5000); + 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]); + bool.TryParse(Item.InnerText, out dinputOnly[device]); + } + catch { dinputOnly[device] = false; missingSetting = true; } + + bool oldUseDInputOnly = Global.useDInputOnly[device]; + Global.useDInputOnly[device] = dinputOnly[device]; + + // Only change xinput devices under certain conditions. Avoid + // performing this upon program startup before loading devices. + if (xinputChange) + { 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 changed = false; + DS4Device tempDevice = control.DS4Controllers[device]; + bool exists = tempBool = (tempDevice != null); + bool synced = tempBool = exists ? tempDevice.isSynced() : false; + bool isAlive = tempBool = exists ? tempDevice.IsAlive() : false; + if (dinputOnly[device] != oldUseDInputOnly) + { + if (dinputOnly[device] == true) + { + Global.useDInputOnly[device] = true; + xinputPlug = false; + xinputStatus = true; + + //changed = true; + } + else if (synced && isAlive) + { + Global.useDInputOnly[device] = false; + xinputPlug = true; + xinputStatus = true; + + //changed = true; + } + + /*if (changed) + { + System.Threading.Thread.Sleep(Global.XINPUT_UNPLUG_SETTLE_TIME); + } + */ + } } } - catch { missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/StartTouchpadOff"); - Boolean.TryParse(Item.InnerText, out startTouchpadOff[device]); + bool.TryParse(Item.InnerText, out startTouchpadOff[device]); if (startTouchpadOff[device] == true) control.StartTPOff(device); } catch { startTouchpadOff[device] = false; missingSetting = true; } - try - { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/UseTPforControls"); Boolean.TryParse(Item.InnerText, out useTPforControls[device]); } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/UseTPforControls"); bool.TryParse(Item.InnerText, out useTPforControls[device]); } catch { useTPforControls[device] = false; missingSetting = true; } - try - { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/UseSAforMouse"); Boolean.TryParse(Item.InnerText, out useSAforMouse[device]); } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/UseSAforMouse"); bool.TryParse(Item.InnerText, out useSAforMouse[device]); } catch { useSAforMouse[device] = false; missingSetting = true; } - try - { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SATriggers"); sATriggers[device] = Item.InnerText; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SATriggers"); sATriggers[device] = Item.InnerText; } catch { sATriggers[device] = ""; missingSetting = true; } - try - { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroSensitivity"); int.TryParse(Item.InnerText, out gyroSensitivity[device]); } + + try { + Item = m_Xdoc.SelectSingleNode("/" + rootname + "/TouchDisInvTriggers"); + string[] triggers = Item.InnerText.Split(','); + int temp = -1; + List tempIntList = new List(); + for (int i = 0, arlen = triggers.Length; i < arlen; i++) + { + if (int.TryParse(triggers[i], out temp)) + tempIntList.Add(temp); + } + + touchDisInvertTriggers[device] = tempIntList.ToArray(); + } + catch { touchDisInvertTriggers[device] = new int[1] { -1 }; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroSensitivity"); int.TryParse(Item.InnerText, out gyroSensitivity[device]); } catch { gyroSensitivity[device] = 100; missingSetting = true; } - try - { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroInvert"); int.TryParse(Item.InnerText, out gyroInvert[device]); } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroSensVerticalScale"); int.TryParse(Item.InnerText, out gyroSensVerticalScale[device]); } + catch { gyroSensVerticalScale[device] = 100; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroInvert"); int.TryParse(Item.InnerText, out gyroInvert[device]); } catch { gyroInvert[device] = 0; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroTriggerTurns"); bool.TryParse(Item.InnerText, out gyroTriggerTurns[device]); } + catch { gyroTriggerTurns[device] = true; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroSmoothing"); bool.TryParse(Item.InnerText, out gyroSmoothing[device]); } + catch { gyroSmoothing[device] = false; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroSmoothingWeight"); int temp = 0; int.TryParse(Item.InnerText, out temp); gyroSmoothWeight[device] = Math.Min(Math.Max(0.0, Convert.ToDouble(temp * 0.01)), 1.0); } + catch { gyroSmoothWeight[device] = 0.5; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroMouseHAxis"); int temp = 0; int.TryParse(Item.InnerText, out temp); gyroMouseHorizontalAxis[device] = Math.Min(Math.Max(0, temp), 1); } + catch { gyroMouseHorizontalAxis[device] = 0; missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LSCurve"); int.TryParse(Item.InnerText, out lsCurve[device]); } - catch { missingSetting = true; } + catch { lsCurve[device] = 0; missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/RSCurve"); int.TryParse(Item.InnerText, out rsCurve[device]); } - catch { missingSetting = true; } + catch { rsCurve[device] = 0; missingSetting = true; } + + try { + Item = m_Xdoc.SelectSingleNode("/" + rootname + "/BTPollRate"); + int temp = 0; + int.TryParse(Item.InnerText, out temp); + btPollRate[device] = (temp >= 0 && temp <= 16) ? temp : 0; + } + catch { btPollRate[device] = 4; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LSOutputCurveMode"); lsOutCurveMode[device] = stickOutputCurveId(Item.InnerText); } + catch { lsOutCurveMode[device] = 0; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/RSOutputCurveMode"); rsOutCurveMode[device] = stickOutputCurveId(Item.InnerText); } + catch { rsOutCurveMode[device] = 0; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/L2OutputCurveMode"); l2OutCurveMode[device] = axisOutputCurveId(Item.InnerText); } + catch { l2OutCurveMode[device] = 0; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/R2OutputCurveMode"); r2OutCurveMode[device] = axisOutputCurveId(Item.InnerText); } + catch { r2OutCurveMode[device] = 0; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SXOutputCurveMode"); sxOutCurveMode[device] = axisOutputCurveId(Item.InnerText); } + catch { sxOutCurveMode[device] = 0; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SZOutputCurveMode"); szOutCurveMode[device] = axisOutputCurveId(Item.InnerText); } + catch { szOutCurveMode[device] = 0; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/TrackballMode"); bool.TryParse(Item.InnerText, out trackballMode[device]); } + catch { trackballMode[device] = false; missingSetting = true; } + + try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/TrackballFriction"); double.TryParse(Item.InnerText, out trackballFriction[device]); } + catch { trackballFriction[device] = 10.0; missingSetting = true; } + try { 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; { XmlNode ParentItem = m_Xdoc.SelectSingleNode("/" + rootname + "/Control/Button"); if (ParentItem != null) + { foreach (XmlNode item in ParentItem.ChildNodes) { UpdateDS4CSetting(device, item.Name, false, getX360ControlsByName(item.InnerText), "", DS4KeyType.None, 0); customMapButtons.Add(getDS4ControlsByName(item.Name), getX360ControlsByName(item.InnerText)); } + } + ParentItem = m_Xdoc.SelectSingleNode("/" + rootname + "/Control/Macro"); if (ParentItem != null) + { foreach (XmlNode item in ParentItem.ChildNodes) { customMapMacros.Add(getDS4ControlsByName(item.Name), item.InnerText); @@ -1503,21 +2665,32 @@ namespace DS4Windows skeys = new string[0]; keys = new int[0]; } - for (int i = 0; i < keys.Length; i++) + + for (int i = 0, keylen = keys.Length; i < keylen; i++) keys[i] = int.Parse(skeys[i]); + UpdateDS4CSetting(device, item.Name, false, keys, "", DS4KeyType.None, 0); } + } + ParentItem = m_Xdoc.SelectSingleNode("/" + rootname + "/Control/Key"); if (ParentItem != null) + { foreach (XmlNode item in ParentItem.ChildNodes) + { if (ushort.TryParse(item.InnerText, out wvk)) { UpdateDS4CSetting(device, item.Name, false, wvk, "", DS4KeyType.None, 0); customMapKeys.Add(getDS4ControlsByName(item.Name), wvk); } + } + } + ParentItem = m_Xdoc.SelectSingleNode("/" + rootname + "/Control/Extras"); if (ParentItem != null) + { foreach (XmlNode item in ParentItem.ChildNodes) + { if (item.InnerText != string.Empty) { UpdateDS4CExtra(device, item.Name, false, item.InnerText); @@ -1525,9 +2698,14 @@ namespace DS4Windows } else ParentItem.RemoveChild(item); + } + } + ParentItem = m_Xdoc.SelectSingleNode("/" + rootname + "/Control/KeyType"); if (ParentItem != null) + { foreach (XmlNode item in ParentItem.ChildNodes) + { if (item != null) { keyType = DS4KeyType.None; @@ -1547,9 +2725,12 @@ namespace DS4Windows customMapKeyTypes.Add(getDS4ControlsByName(item.Name), keyType); } } + } + } ParentItem = m_Xdoc.SelectSingleNode("/" + rootname + "/ShiftControl/Button"); if (ParentItem != null) + { foreach (XmlElement item in ParentItem.ChildNodes) { int shiftT = shiftM; @@ -1558,8 +2739,11 @@ namespace DS4Windows UpdateDS4CSetting(device, item.Name, true, getX360ControlsByName(item.InnerText), "", DS4KeyType.None, shiftT); shiftCustomMapButtons.Add(getDS4ControlsByName(item.Name), getX360ControlsByName(item.InnerText)); } + } + ParentItem = m_Xdoc.SelectSingleNode("/" + rootname + "/ShiftControl/Macro"); if (ParentItem != null) + { foreach (XmlElement item in ParentItem.ChildNodes) { shiftCustomMapMacros.Add(getDS4ControlsByName(item.Name), item.InnerText); @@ -1575,16 +2759,22 @@ namespace DS4Windows skeys = new string[0]; keys = new int[0]; } - for (int i = 0; i < keys.Length; i++) + + for (int i = 0, keylen = keys.Length; i < keylen; i++) keys[i] = int.Parse(skeys[i]); + int shiftT = shiftM; if (item.HasAttribute("Trigger")) int.TryParse(item.Attributes["Trigger"].Value, out shiftT); UpdateDS4CSetting(device, item.Name, true, keys, "", DS4KeyType.None, shiftT); } + } + ParentItem = m_Xdoc.SelectSingleNode("/" + rootname + "/ShiftControl/Key"); if (ParentItem != null) + { foreach (XmlElement item in ParentItem.ChildNodes) + { if (ushort.TryParse(item.InnerText, out wvk)) { int shiftT = shiftM; @@ -1593,9 +2783,14 @@ namespace DS4Windows UpdateDS4CSetting(device, item.Name, true, wvk, "", DS4KeyType.None, shiftT); shiftCustomMapKeys.Add(getDS4ControlsByName(item.Name), wvk); } + } + } + ParentItem = m_Xdoc.SelectSingleNode("/" + rootname + "/ShiftControl/Extras"); if (ParentItem != null) + { foreach (XmlElement item in ParentItem.ChildNodes) + { if (item.InnerText != string.Empty) { UpdateDS4CExtra(device, item.Name, true, item.InnerText); @@ -1603,9 +2798,14 @@ namespace DS4Windows } else ParentItem.RemoveChild(item); + } + } + ParentItem = m_Xdoc.SelectSingleNode("/" + rootname + "/ShiftControl/KeyType"); if (ParentItem != null) + { foreach (XmlElement item in ParentItem.ChildNodes) + { if (item != null) { keyType = DS4KeyType.None; @@ -1625,148 +2825,73 @@ namespace DS4Windows shiftCustomMapKeyTypes.Add(getDS4ControlsByName(item.Name), keyType); } } - //LoadButtons(buttons, "Control", customMapKeyTypes, customMapKeys, customMapButtons, customMapMacros, customMapExtras); - //LoadButtons(shiftbuttons, "ShiftControl", shiftCustomMapKeyTypes, shiftCustomMapKeys, shiftCustomMapButtons, shiftCustomMapMacros, shiftCustomMapExtras); + } + } } } - //catch { Loaded = false; } - /*if (Loaded) - { - this.customMapButtons[device] = customMapButtons; - this.customMapKeys[device] = customMapKeys; - this.customMapKeyTypes[device] = customMapKeyTypes; - this.customMapMacros[device] = customMapMacros; - this.customMapExtras[device] = customMapExtras; - this.shiftCustomMapButtons[device] = shiftCustomMapButtons; - this.shiftCustomMapKeys[device] = shiftCustomMapKeys; - this.shiftCustomMapKeyTypes[device] = shiftCustomMapKeyTypes; - this.shiftCustomMapMacros[device] = shiftCustomMapMacros; - this.shiftCustomMapExtras[device] = shiftCustomMapExtras; - }*/ // Only add missing settings if the actual load was graceful if (missingSetting && Loaded)// && buttons != null) SaveProfile(device, profilepath); + containsCustomAction[device] = HasCustomActions(device); + containsCustomExtras[device] = HasCustomExtras(device); + + // If a device exists, make sure to transfer relevant profile device + // options to device instance + if (postLoad && device < 4) + { + DS4Device tempDev = control.DS4Controllers[device]; + if (tempDev != null && tempDev.isSynced()) + { + tempDev.queueEvent(() => + { + tempDev.setIdleTimeout(idleDisconnectTimeout[device]); + tempDev.setBTPollRate(btPollRate[device]); + if (xinputStatus && xinputPlug) + { + bool xinputResult = control.x360Bus.Plugin(device); + int xinputIndex = control.x360Bus.FirstController + device; + if (xinputResult) + { + dinputOnly[device] = false; + Log.LogToGui("X360 Controller # " + xinputIndex + " connected", false); + } + else + { + dinputOnly[device] = true; + Log.LogToGui("X360 Controller # " + xinputIndex + " failed. Using DInput only mode", true); + } + } + else if (xinputStatus && !xinputPlug) + { + bool xinputResult = control.x360Bus.Unplug(device); + int xinputIndex = control.x360Bus.FirstController + device; + if (xinputResult) + { + dinputOnly[device] = true; + Log.LogToGui("X360 Controller # " + xinputIndex + " unplugged", false); + } + else + { + Log.LogToGui("X360 Controller # " + xinputIndex + " failed to unplug", true); + } + } + + tempDev.setRumble(0, 0); + }); + + Program.rootHub.touchPad[device]?.ResetTrackAccel(trackballFriction[device]); + } + } + return Loaded; } - public void LoadButtons(System.Windows.Forms.Control[] buttons, string control, Dictionary customMapKeyTypes, - Dictionary customMapKeys, Dictionary customMapButtons, Dictionary customMapMacros, Dictionary customMapExtras) - { - XmlNode Item; - DS4KeyType keyType; - UInt16 wvk; - string rootname = "DS4Windows"; - foreach (var button in buttons) - try - { - if (m_Xdoc.SelectSingleNode(rootname) == null) - { - rootname = "ScpControl"; - } - //bool foundBinding = false; - button.Font = new Font(button.Font, FontStyle.Regular); - Item = m_Xdoc.SelectSingleNode(String.Format("/" + rootname + "/" + control + "/KeyType/{0}", button.Name)); - if (Item != null) - { - //foundBinding = true; - keyType = DS4KeyType.None; - if (Item.InnerText.Contains(DS4KeyType.Unbound.ToString())) - { - keyType = DS4KeyType.Unbound; - button.Tag = "Unbound"; - button.Text = "Unbound"; - } - else - { - bool SC = Item.InnerText.Contains(DS4KeyType.ScanCode.ToString()); - bool TG = Item.InnerText.Contains(DS4KeyType.Toggle.ToString()); - bool MC = Item.InnerText.Contains(DS4KeyType.Macro.ToString()); - bool MR = Item.InnerText.Contains(DS4KeyType.HoldMacro.ToString()); - button.Font = new Font(button.Font, - (SC ? FontStyle.Bold : FontStyle.Regular) | (TG ? FontStyle.Italic : FontStyle.Regular) | - (MC ? FontStyle.Underline : FontStyle.Regular) | (MR ? FontStyle.Strikeout : FontStyle.Regular)); - if (Item.InnerText.Contains(DS4KeyType.ScanCode.ToString())) - keyType |= DS4KeyType.ScanCode; - if (Item.InnerText.Contains(DS4KeyType.Toggle.ToString())) - keyType |= DS4KeyType.Toggle; - if (Item.InnerText.Contains(DS4KeyType.Macro.ToString())) - keyType |= DS4KeyType.Macro; - } - if (keyType != DS4KeyType.None) - customMapKeyTypes.Add(getDS4ControlsByName(Item.Name), keyType); - } - string extras; - Item = m_Xdoc.SelectSingleNode(String.Format("/" + rootname + "/" + control + "/Extras/{0}", button.Name)); - if (Item != null) - { - if (Item.InnerText != string.Empty) - { - extras = Item.InnerText; - customMapExtras.Add(getDS4ControlsByName(button.Name), Item.InnerText); - } - else - { - m_Xdoc.RemoveChild(Item); - extras = "0,0,0,0,0,0,0,0"; - } - } - else - extras = "0,0,0,0,0,0,0,0"; - Item = m_Xdoc.SelectSingleNode(String.Format("/" + rootname + "/" + control + "/Macro/{0}", button.Name)); - if (Item != null) - { - string[] splitter = Item.InnerText.Split('/'); - int[] keys = new int[splitter.Length]; - for (int i = 0; i < keys.Length; i++) - { - keys[i] = int.Parse(splitter[i]); - if (keys[i] < 255) splitter[i] = ((System.Windows.Forms.Keys)keys[i]).ToString(); - else if (keys[i] == 256) splitter[i] = "Left Mouse Button"; - else if (keys[i] == 257) splitter[i] = "Right Mouse Button"; - else if (keys[i] == 258) splitter[i] = "Middle Mouse Button"; - else if (keys[i] == 259) splitter[i] = "4th Mouse Button"; - else if (keys[i] == 260) splitter[i] = "5th Mouse Button"; - else if (keys[i] > 300) splitter[i] = "Wait " + (keys[i] - 300) + "ms"; - } - button.Text = "Macro"; - button.Tag = new KeyValuePair(keys, extras); - customMapMacros.Add(getDS4ControlsByName(button.Name), Item.InnerText); - } - else if (m_Xdoc.SelectSingleNode(String.Format("/" + rootname + "/" + control + "/Key/{0}", button.Name)) != null) - { - Item = m_Xdoc.SelectSingleNode(String.Format("/" + rootname + "/" + control + "/Key/{0}", button.Name)); - if (UInt16.TryParse(Item.InnerText, out wvk)) - { - //foundBinding = true; - customMapKeys.Add(getDS4ControlsByName(Item.Name), wvk); - button.Tag = new KeyValuePair(wvk, extras); - button.Text = ((System.Windows.Forms.Keys)wvk).ToString(); - } - } - else if (m_Xdoc.SelectSingleNode(String.Format("/" + rootname + "/" + control + "/Button/{0}", button.Name)) != null) - { - Item = m_Xdoc.SelectSingleNode(String.Format("/" + rootname + "/" + control + "/Button/{0}", button.Name)); - //foundBinding = true; - button.Tag = new KeyValuePair(Item.InnerText, extras); - button.Text = Item.InnerText; - customMapButtons.Add(getDS4ControlsByName(button.Name), getX360ControlsByName(Item.InnerText)); - } - else - { - button.Tag = new KeyValuePair(null, extras); - } - } - catch - { - - } - } public bool Load() { - Boolean Loaded = true; - Boolean missingSetting = false; + bool Loaded = true; + bool missingSetting = false; try { @@ -1780,22 +2905,72 @@ namespace DS4Windows catch { missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/Profile/startMinimized"); Boolean.TryParse(Item.InnerText, out startMinimized); } catch { missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/Profile/minimizeToTaskbar"); Boolean.TryParse(Item.InnerText, out minToTaskbar); } + catch { missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/Profile/formWidth"); Int32.TryParse(Item.InnerText, out formWidth); } 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 { + int temp = 0; + Item = m_Xdoc.SelectSingleNode("/Profile/formLocationX"); Int32.TryParse(Item.InnerText, out temp); + formLocationX = Math.Max(temp, 0); + } catch { missingSetting = true; } - try { Item = m_Xdoc.SelectSingleNode("/Profile/Controller2"); profilePath[1] = Item.InnerText; } - catch { missingSetting = true; } - try { Item = m_Xdoc.SelectSingleNode("/Profile/Controller3"); profilePath[2] = Item.InnerText; } - catch { missingSetting = true; } - try { Item = m_Xdoc.SelectSingleNode("/Profile/Controller4"); profilePath[3] = Item.InnerText; } + + try { + int temp = 0; + Item = m_Xdoc.SelectSingleNode("/Profile/formLocationY"); Int32.TryParse(Item.InnerText, out temp); + formLocationY = Math.Max(temp, 0); + } catch { missingSetting = true; } + + try { + Item = m_Xdoc.SelectSingleNode("/Profile/Controller1"); profilePath[0] = Item.InnerText; + if (profilePath[0].ToLower().Contains("distance")) + { + distanceProfiles[0] = true; + } + + olderProfilePath[0] = profilePath[0]; + } + catch { profilePath[0] = olderProfilePath[0] = string.Empty; distanceProfiles[0] = false; missingSetting = true; } + try { + Item = m_Xdoc.SelectSingleNode("/Profile/Controller2"); profilePath[1] = Item.InnerText; + if (profilePath[1].ToLower().Contains("distance")) + { + distanceProfiles[1] = true; + } + + olderProfilePath[1] = profilePath[1]; + } + catch { profilePath[1] = olderProfilePath[1] = string.Empty; distanceProfiles[1] = false; missingSetting = true; } + try { + Item = m_Xdoc.SelectSingleNode("/Profile/Controller3"); profilePath[2] = Item.InnerText; + if (profilePath[2].ToLower().Contains("distance")) + { + distanceProfiles[2] = true; + } + + olderProfilePath[2] = profilePath[2]; + } + catch { profilePath[2] = olderProfilePath[2] = string.Empty; distanceProfiles[2] = false; missingSetting = true; } + try { + Item = m_Xdoc.SelectSingleNode("/Profile/Controller4"); profilePath[3] = Item.InnerText; + if (profilePath[3].ToLower().Contains("distance")) + { + distanceProfiles[3] = true; + } + + olderProfilePath[3] = profilePath[3]; + } + catch { profilePath[3] = olderProfilePath[3] = string.Empty; distanceProfiles[3] = false; missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/Profile/LastChecked"); DateTime.TryParse(Item.InnerText, out lastChecked); } catch { missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/Profile/CheckWhen"); Int32.TryParse(Item.InnerText, out CheckWhen); } catch { missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/Profile/Notifications"); @@ -1803,6 +2978,7 @@ namespace DS4Windows notifications = (Boolean.Parse(Item.InnerText) ? 2 : 0); } catch { missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/Profile/DisconnectBTAtStop"); Boolean.TryParse(Item.InnerText, out disconnectBTAtStop); } catch { missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/Profile/SwipeProfiles"); Boolean.TryParse(Item.InnerText, out swipeProfiles); } @@ -1815,6 +2991,8 @@ namespace DS4Windows catch { missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/Profile/CloseMinimizes"); Boolean.TryParse(Item.InnerText, out closeMini); } catch { missingSetting = true; } + try { Item = m_Xdoc.SelectSingleNode("/Profile/UseLang"); useLang = Item.InnerText; } + catch { missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/Profile/DownloadLang"); Boolean.TryParse(Item.InnerText, out downloadLang); } catch { missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/Profile/FlashWhenLate"); Boolean.TryParse(Item.InnerText, out flashWhenLate); } @@ -1823,6 +3001,7 @@ namespace DS4Windows catch { missingSetting = true; } try { Item = m_Xdoc.SelectSingleNode("/Profile/WhiteIcon"); Boolean.TryParse(Item.InnerText, out useWhiteIcon); } catch { missingSetting = true; } + for (int i = 0; i < 4; i++) { try @@ -1832,18 +3011,21 @@ namespace DS4Windows bool.TryParse(ss[0], out useCustomLeds[i]); DS4Color.TryParse(ss[1], ref m_CustomLeds[i]); } - catch { missingSetting = true; } + catch { useCustomLeds[i] = false; m_CustomLeds[i] = new DS4Color(Color.Blue); missingSetting = true; } } } } catch { } + if (missingSetting) Save(); + return Loaded; } + public bool Save() { - Boolean Saved = true; + bool Saved = true; XmlNode Node; @@ -1860,16 +3042,18 @@ namespace DS4Windows Node = m_Xdoc.CreateNode(XmlNodeType.Element, "Profile", null); - XmlNode xmlUseExclNode = m_Xdoc.CreateNode(XmlNodeType.Element, "useExclusiveMode", null); xmlUseExclNode.InnerText = useExclusiveMode.ToString(); Node.AppendChild(xmlUseExclNode); XmlNode xmlStartMinimized = m_Xdoc.CreateNode(XmlNodeType.Element, "startMinimized", null); xmlStartMinimized.InnerText = startMinimized.ToString(); Node.AppendChild(xmlStartMinimized); + XmlNode xmlminToTaskbar = m_Xdoc.CreateNode(XmlNodeType.Element, "minimizeToTaskbar", null); xmlminToTaskbar.InnerText = minToTaskbar.ToString(); Node.AppendChild(xmlminToTaskbar); XmlNode xmlFormWidth = m_Xdoc.CreateNode(XmlNodeType.Element, "formWidth", null); xmlFormWidth.InnerText = formWidth.ToString(); Node.AppendChild(xmlFormWidth); XmlNode xmlFormHeight = m_Xdoc.CreateNode(XmlNodeType.Element, "formHeight", null); xmlFormHeight.InnerText = formHeight.ToString(); Node.AppendChild(xmlFormHeight); + XmlNode xmlFormLocationX = m_Xdoc.CreateNode(XmlNodeType.Element, "formLocationX", null); xmlFormLocationX.InnerText = formLocationX.ToString(); Node.AppendChild(xmlFormLocationX); + XmlNode xmlFormLocationY = m_Xdoc.CreateNode(XmlNodeType.Element, "formLocationY", null); xmlFormLocationY.InnerText = formLocationY.ToString(); Node.AppendChild(xmlFormLocationY); - XmlNode xmlController1 = m_Xdoc.CreateNode(XmlNodeType.Element, "Controller1", null); xmlController1.InnerText = profilePath[0]; Node.AppendChild(xmlController1); - XmlNode xmlController2 = m_Xdoc.CreateNode(XmlNodeType.Element, "Controller2", null); xmlController2.InnerText = profilePath[1]; Node.AppendChild(xmlController2); - XmlNode xmlController3 = m_Xdoc.CreateNode(XmlNodeType.Element, "Controller3", null); xmlController3.InnerText = profilePath[2]; Node.AppendChild(xmlController3); - XmlNode xmlController4 = m_Xdoc.CreateNode(XmlNodeType.Element, "Controller4", null); xmlController4.InnerText = profilePath[3]; Node.AppendChild(xmlController4); + XmlNode xmlController1 = m_Xdoc.CreateNode(XmlNodeType.Element, "Controller1", null); xmlController1.InnerText = !Global.linkedProfileCheck[0] ? profilePath[0] : olderProfilePath[0]; Node.AppendChild(xmlController1); + XmlNode xmlController2 = m_Xdoc.CreateNode(XmlNodeType.Element, "Controller2", null); xmlController2.InnerText = !Global.linkedProfileCheck[1] ? profilePath[1] : olderProfilePath[1]; Node.AppendChild(xmlController2); + XmlNode xmlController3 = m_Xdoc.CreateNode(XmlNodeType.Element, "Controller3", null); xmlController3.InnerText = !Global.linkedProfileCheck[2] ? profilePath[2] : olderProfilePath[2]; Node.AppendChild(xmlController3); + XmlNode xmlController4 = m_Xdoc.CreateNode(XmlNodeType.Element, "Controller4", null); xmlController4.InnerText = !Global.linkedProfileCheck[3] ? profilePath[3] : olderProfilePath[3]; Node.AppendChild(xmlController4); XmlNode xmlLastChecked = m_Xdoc.CreateNode(XmlNodeType.Element, "LastChecked", null); xmlLastChecked.InnerText = lastChecked.ToString(); Node.AppendChild(xmlLastChecked); XmlNode xmlCheckWhen = m_Xdoc.CreateNode(XmlNodeType.Element, "CheckWhen", null); xmlCheckWhen.InnerText = CheckWhen.ToString(); Node.AppendChild(xmlCheckWhen); @@ -1880,6 +3064,7 @@ namespace DS4Windows XmlNode xmlQuickCharge = m_Xdoc.CreateNode(XmlNodeType.Element, "QuickCharge", null); xmlQuickCharge.InnerText = quickCharge.ToString(); Node.AppendChild(xmlQuickCharge); XmlNode xmlFirstXinputPort = m_Xdoc.CreateNode(XmlNodeType.Element, "FirstXinputPort", null); xmlFirstXinputPort.InnerText = firstXinputPort.ToString(); Node.AppendChild(xmlFirstXinputPort); XmlNode xmlCloseMini = m_Xdoc.CreateNode(XmlNodeType.Element, "CloseMinimizes", null); xmlCloseMini.InnerText = closeMini.ToString(); Node.AppendChild(xmlCloseMini); + XmlNode xmlUseLang = m_Xdoc.CreateNode(XmlNodeType.Element, "UseLang", null); xmlUseLang.InnerText = useLang.ToString(); Node.AppendChild(xmlUseLang); XmlNode xmlDownloadLang = m_Xdoc.CreateNode(XmlNodeType.Element, "DownloadLang", null); xmlDownloadLang.InnerText = downloadLang.ToString(); Node.AppendChild(xmlDownloadLang); XmlNode xmlFlashWhenLate = m_Xdoc.CreateNode(XmlNodeType.Element, "FlashWhenLate", null); xmlFlashWhenLate.InnerText = flashWhenLate.ToString(); Node.AppendChild(xmlFlashWhenLate); XmlNode xmlFlashWhenLateAt = m_Xdoc.CreateNode(XmlNodeType.Element, "FlashWhenLateAt", null); xmlFlashWhenLateAt.InnerText = flashWhenLateAt.ToString(); Node.AppendChild(xmlFlashWhenLateAt); @@ -1888,12 +3073,9 @@ namespace DS4Windows for (int i = 0; i < 4; i++) { XmlNode xmlCustomLed = m_Xdoc.CreateNode(XmlNodeType.Element, "CustomLed" + (1 + i), null); - xmlCustomLed.InnerText = useCustomLeds[i] + ":" + m_CustomLeds[i].red + ","+ m_CustomLeds[i].green + "," + m_CustomLeds[i].blue; + xmlCustomLed.InnerText = useCustomLeds[i] + ":" + m_CustomLeds[i].red + "," + m_CustomLeds[i].green + "," + m_CustomLeds[i].blue; Node.AppendChild(xmlCustomLed); } - /* XmlNode xmlCustomLed2 = m_Xdoc.CreateNode(XmlNodeType.Element, "CustomLed2", null); xmlCustomLed2.InnerText = profilePath[1]; Node.AppendChild(xmlCustomLed2); - XmlNode xmlCustomLed3 = m_Xdoc.CreateNode(XmlNodeType.Element, "CustomLed3", null); xmlCustomLed3.InnerText = profilePath[2]; Node.AppendChild(xmlCustomLed3); - XmlNode xmlCustomLed4 = m_Xdoc.CreateNode(XmlNodeType.Element, "CustomLed4", null); xmlCustomLed4.InnerText = profilePath[3]; Node.AppendChild(xmlCustomLed4);*/ m_Xdoc.AppendChild(Node); @@ -1902,8 +3084,6 @@ namespace DS4Windows return Saved; } - - private void CreateAction() { XmlDocument m_Xdoc = new XmlDocument(); @@ -1981,12 +3161,14 @@ namespace DS4Windows el.AppendChild(m_Xdoc.CreateElement("Details")).InnerText = details; break; } + if (edit) { XmlNode oldxmlprocess = m_Xdoc.SelectSingleNode("/Actions/Action[@Name=\"" + name + "\"]"); Node.ReplaceChild(el, oldxmlprocess); } else { Node.AppendChild(el); } + m_Xdoc.AppendChild(Node); try { m_Xdoc.Save(m_Actions); } catch { saved = false; } @@ -2001,6 +3183,7 @@ namespace DS4Windows XmlNode Item = m_Xdoc.SelectSingleNode("/Actions/Action[@Name=\"" + name + "\"]"); if (Item != null) Node.RemoveChild(Item); + m_Xdoc.AppendChild(Node); m_Xdoc.Save(m_Actions); LoadActions(); @@ -2014,6 +3197,7 @@ namespace DS4Windows SaveAction("Disconnect Controller", "PS/Options", 5, "0", false); saved = false; } + try { actions.Clear(); @@ -2100,7 +3284,105 @@ namespace DS4Windows catch { saved = false; } return saved; } - + + public bool createLinkedProfiles() + { + bool saved = true; + XmlDocument m_Xdoc = new XmlDocument(); + XmlNode Node; + + Node = m_Xdoc.CreateXmlDeclaration("1.0", "utf-8", string.Empty); + m_Xdoc.AppendChild(Node); + + Node = m_Xdoc.CreateComment(string.Format(" Mac Address and Profile Linking Data. {0} ", DateTime.Now)); + m_Xdoc.AppendChild(Node); + + Node = m_Xdoc.CreateWhitespace("\r\n"); + m_Xdoc.AppendChild(Node); + + Node = m_Xdoc.CreateNode(XmlNodeType.Element, "LinkedControllers", ""); + m_Xdoc.AppendChild(Node); + + try { m_Xdoc.Save(m_linkedProfiles); } + catch (UnauthorizedAccessException) { Log.LogToGui("Unauthorized Access - Save failed to path: " + m_linkedProfiles, false); saved = false; } + + return saved; + } + + public bool LoadLinkedProfiles() + { + bool loaded = true; + if (File.Exists(m_linkedProfiles)) + { + XmlDocument linkedXdoc = new XmlDocument(); + XmlNode Node; + linkedXdoc.Load(m_linkedProfiles); + linkedProfiles.Clear(); + + try + { + Node = linkedXdoc.SelectSingleNode("/LinkedControllers"); + XmlNodeList links = Node.ChildNodes; + for (int i = 0, listLen = links.Count; i < listLen; i++) + { + XmlNode current = links[i]; + string serial = current.Name.Replace("MAC", string.Empty); + string profile = current.InnerText; + linkedProfiles[serial] = profile; + } + } + catch { loaded = false; } + } + else + { + Log.LogToGui("LinkedProfiles.xml can't be found.", false); + loaded = false; + } + + return loaded; + } + + public bool SaveLinkedProfiles() + { + bool saved = true; + if (File.Exists(m_linkedProfiles)) + { + XmlDocument linkedXdoc = new XmlDocument(); + XmlNode Node; + + Node = linkedXdoc.CreateXmlDeclaration("1.0", "utf-8", string.Empty); + linkedXdoc.AppendChild(Node); + + Node = linkedXdoc.CreateComment(string.Format(" Mac Address and Profile Linking Data. {0} ", DateTime.Now)); + linkedXdoc.AppendChild(Node); + + Node = linkedXdoc.CreateWhitespace("\r\n"); + linkedXdoc.AppendChild(Node); + + Node = linkedXdoc.CreateNode(XmlNodeType.Element, "LinkedControllers", ""); + linkedXdoc.AppendChild(Node); + + Dictionary.KeyCollection serials = linkedProfiles.Keys; + for (int i = 0, itemCount = linkedProfiles.Count; i < itemCount; i++) + { + string serial = serials.ElementAt(i); + string profile = linkedProfiles[serial]; + XmlElement link = linkedXdoc.CreateElement("MAC" + serial); + link.InnerText = profile; + Node.AppendChild(link); + } + + try { linkedXdoc.Save(m_linkedProfiles); } + catch (UnauthorizedAccessException) { Log.LogToGui("Unauthorized Access - Save failed to path: " + m_linkedProfiles, false); saved = false; } + } + else + { + saved = createLinkedProfiles(); + saved = saved && SaveLinkedProfiles(); + } + + return saved; + } public void UpdateDS4CSetting(int deviceNum, string buttonName, bool shift, object action, string exts, DS4KeyType kt, int trigger = 0) { @@ -2109,12 +3391,17 @@ namespace DS4Windows dc = getDS4ControlsByName(buttonName); else dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true); - 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 +3411,21 @@ namespace DS4Windows dc = getDS4ControlsByName(buttonName); else dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true); - 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 +3435,21 @@ namespace DS4Windows dc = getDS4ControlsByName(buttonName); else dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true); - 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 +3459,11 @@ namespace DS4Windows dc = getDS4ControlsByName(buttonName); else dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true); - 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 +3471,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 +3503,11 @@ namespace DS4Windows dc = getDS4ControlsByName(buttonName); else dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true); - 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 +3515,8 @@ namespace DS4Windows else return dcs.extras; } + } + return null; } @@ -2196,7 +3527,11 @@ namespace DS4Windows dc = getDS4ControlsByName(buttonName); else dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true); - 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 +3539,8 @@ namespace DS4Windows else return dcs.keyType; } + } + return DS4KeyType.None; } @@ -2214,9 +3551,28 @@ namespace DS4Windows dc = getDS4ControlsByName(buttonName); else dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true); - 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 +3583,146 @@ namespace DS4Windows dc = getDS4ControlsByName(buttonName); else dc = (DS4Controls)Enum.Parse(typeof(DS4Controls), buttonName, true); - 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]) + 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]) + 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; } + + private void ResetProfile(int device) + { + buttonMouseSensitivity[device] = 25; + flushHIDQueue[device] = false; + enableTouchToggle[device] = false; + idleDisconnectTimeout[device] = 0; + touchpadJitterCompensation[device] = true; + lowerRCOn[device] = false; + ledAsBattery[device] = false; + flashType[device] = 0; + rumble[device] = 100; + touchSensitivity[device] = 100; + l2Deadzone[device] = r2Deadzone[device] = 0; + LSDeadzone[device] = RSDeadzone[device] = 0; + LSAntiDeadzone[device] = RSAntiDeadzone[device] = 0; + LSMaxzone[device] = RSMaxzone[device] = 100; + l2AntiDeadzone[device] = r2AntiDeadzone[device] = 0; + l2Maxzone[device] = r2Maxzone[device] = 100; + LSRotation[device] = 0.0; + RSRotation[device] = 0.0; + SXDeadzone[device] = SZDeadzone[device] = 0.02; + SXMaxzone[device] = SZMaxzone[device] = 1.0; + SXAntiDeadzone[device] = SZAntiDeadzone[device] = 0.0; + l2Sens[device] = r2Sens[device] = 1; + LSSens[device] = RSSens[device] = 1; + SXSens[device] = SZSens[device] = 1; + tapSensitivity[device] = 0; + doubleTap[device] = false; + scrollSensitivity[device] = 0; + touchpadInvert[device] = 0; + rainbow[device] = 0; + flashAt[device] = 0; + mouseAccel[device] = true; + btPollRate[device] = 4; + + m_LowLeds[device] = new DS4Color(Color.Black); + + Color tempColor = Color.Blue; + switch(device) + { + case 0: tempColor = Color.Blue; break; + case 1: tempColor = Color.Red; break; + case 2: tempColor = Color.Green; break; + case 3: tempColor = Color.Pink; break; + case 4: tempColor = Color.White; break; + default: tempColor = Color.Blue; break; + } + + m_Leds[device] = new DS4Color(tempColor); + m_ChargingLeds[device] = new DS4Color(Color.Black); + m_FlashLeds[device] = new DS4Color(Color.Black); + useCustomLeds[device] = false; + m_CustomLeds[device] = new DS4Color(Color.Blue); + + chargingType[device] = 0; + launchProgram[device] = string.Empty; + dinputOnly[device] = false; + startTouchpadOff[device] = false; + useTPforControls[device] = false; + useSAforMouse[device] = false; + sATriggers[device] = string.Empty; + touchDisInvertTriggers[device] = new int[1] { -1 }; + lsCurve[device] = rsCurve[device] = 0; + gyroSensitivity[device] = 100; + gyroSensVerticalScale[device] = 100; + gyroInvert[device] = 0; + gyroTriggerTurns[device] = true; + gyroSmoothing[device] = false; + gyroSmoothWeight[device] = 0.5; + gyroMouseHorizontalAxis[device] = 0; + lsOutCurveMode[device] = 0; + rsOutCurveMode[device] = 0; + l2OutCurveMode[device] = 0; + r2OutCurveMode[device] = 0; + sxOutCurveMode[device] = szOutCurveMode[device] = 0; + trackballMode[device] = false; + trackballFriction[device] = 10.0; + } } 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; @@ -2265,29 +3732,27 @@ namespace DS4Windows public string extra; public bool pressRelease = false; public DS4KeyType keyType; + public bool tappedOnce = false; + public bool firstTouch = false; + public bool secondtouchbegin = false; + public DateTime pastTime; + public DateTime firstTap; + public DateTime TimeofEnd; + public SpecialAction(string name, string controls, string type, string details, double delay = 0, string extras = "") { 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 +3768,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 = ""; @@ -2391,6 +3895,7 @@ namespace DS4Windows case "Tilt Left": return DS4Controls.GyroXPos; case "Tilt Right": return DS4Controls.GyroXNeg; } + return 0; } } 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..dc4ce78 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(); @@ -160,7 +160,7 @@ namespace DS4Windows if (Byte.TryParse(WindowsEnumerator.WindowText(EditWindows[3].hWnd), out red)) if (Byte.TryParse(WindowsEnumerator.WindowText(EditWindows[4].hWnd), out green)) if (Byte.TryParse(WindowsEnumerator.WindowText(EditWindows[5].hWnd), out blue)) - OnUpdateColor(Color.FromArgb(red, green, blue), EventArgs.Empty); + OnUpdateColor?.Invoke(Color.FromArgb(red, green, blue), EventArgs.Empty); } } // Always call the base class hook procedure. diff --git a/DS4Windows/DS4Forms/Alreadyrunning.Designer.cs b/DS4Windows/DS4Forms/Alreadyrunning.Designer.cs deleted file mode 100644 index 28ebf6e..0000000 --- a/DS4Windows/DS4Forms/Alreadyrunning.Designer.cs +++ /dev/null @@ -1,48 +0,0 @@ -namespace DS4Windows -{ - partial class Alreadyrunning - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.SuspendLayout(); - // - // Alreadyrunning - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(226, 43); - this.Name = "Alreadyrunning"; - this.ShowInTaskbar = false; - this.Text = "Alreadyrunning"; - this.ResumeLayout(false); - - } - - #endregion - - } -} \ No newline at end of file diff --git a/DS4Windows/DS4Forms/Alreadyrunning.cs b/DS4Windows/DS4Forms/Alreadyrunning.cs deleted file mode 100644 index 195af0a..0000000 --- a/DS4Windows/DS4Forms/Alreadyrunning.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Diagnostics; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace DS4Windows -{ - public partial class Alreadyrunning : Form - { - Stopwatch sw; - - public Alreadyrunning() - { - InitializeComponent(); - this.WindowState = FormWindowState.Minimized; - Hide(); - Timer t = new Timer(); - t.Start(); - t.Tick += t_Tick; - sw = new Stopwatch(); - sw.Start(); - } - - void t_Tick(object sender, EventArgs e) - { - if (sw.ElapsedMilliseconds >= 10) - this.Close(); - } - } -} diff --git a/DS4Windows/DS4Forms/DS4Form.Designer.cs b/DS4Windows/DS4Forms/DS4Form.Designer.cs index 7135a85..7696707 100644 --- a/DS4Windows/DS4Forms/DS4Form.Designer.cs +++ b/DS4Windows/DS4Forms/DS4Form.Designer.cs @@ -33,28 +33,32 @@ this.lvDebug = new System.Windows.Forms.ListView(); this.chTime = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.chData = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.tmrUpdate = new System.Windows.Forms.Timer(this.components); this.pnlButton = new System.Windows.Forms.Panel(); this.llbHelp = new System.Windows.Forms.LinkLabel(); this.lbTest = new System.Windows.Forms.Label(); this.btnStartStop = new System.Windows.Forms.Button(); this.lbLastMessage = new System.Windows.Forms.Label(); - this.btnClear = new System.Windows.Forms.Button(); this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components); this.cMTaskbar = new System.Windows.Forms.ContextMenuStrip(this.components); this.editProfileForController1ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.editProfileForController2ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.editProfileForController3ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.editProfileForController4ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); + this.disconToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.discon1toolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.discon2ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.discon3ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.discon4ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.startToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openProgramFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.openProfiles = new System.Windows.Forms.OpenFileDialog(); this.tabMain = new System.Windows.Forms.TabControl(); this.tabControllers = new System.Windows.Forms.TabPage(); - this.btnConnectDS4Win10 = new System.Windows.Forms.Button(); this.tLPControllers = new System.Windows.Forms.TableLayoutPanel(); this.bnLight3 = new System.Windows.Forms.Button(); this.pBStatus1 = new System.Windows.Forms.PictureBox(); @@ -84,6 +88,11 @@ this.bnLight1 = new System.Windows.Forms.Button(); this.bnLight2 = new System.Windows.Forms.Button(); this.bnLight4 = new System.Windows.Forms.Button(); + this.lbLinkProfile = new System.Windows.Forms.Label(); + this.linkCB1 = new System.Windows.Forms.CheckBox(); + this.linkCB2 = new System.Windows.Forms.CheckBox(); + this.linkCB3 = new System.Windows.Forms.CheckBox(); + this.linkCB4 = new System.Windows.Forms.CheckBox(); this.lbNoControllers = new System.Windows.Forms.Label(); this.tabProfiles = new System.Windows.Forms.TabPage(); this.lBProfiles = new System.Windows.Forms.ListBox(); @@ -118,7 +127,11 @@ this.hideDS4CheckBox = new System.Windows.Forms.CheckBox(); this.cBSwipeProfiles = new System.Windows.Forms.CheckBox(); this.StartWindowsCheckBox = new System.Windows.Forms.CheckBox(); - this.startMinimizedCheckBox = 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.panel1 = new System.Windows.Forms.Panel(); this.lbNotifications = new System.Windows.Forms.Label(); this.cBoxNotifications = new System.Windows.Forms.ComboBox(); @@ -127,9 +140,11 @@ this.nUDLatency = new System.Windows.Forms.NumericUpDown(); this.lbMsLatency = new System.Windows.Forms.Label(); this.cBFlashWhenLate = new System.Windows.Forms.CheckBox(); + this.startMinimizedCheckBox = new System.Windows.Forms.CheckBox(); + this.mintoTaskCheckBox = new System.Windows.Forms.CheckBox(); this.cBCloseMini = new System.Windows.Forms.CheckBox(); this.cBQuickCharge = new System.Windows.Forms.CheckBox(); - this.cBDownloadLangauge = new System.Windows.Forms.CheckBox(); + this.cBUseWhiteIcon = new System.Windows.Forms.CheckBox(); this.cBUpdate = new System.Windows.Forms.CheckBox(); this.pNUpdate = new System.Windows.Forms.Panel(); this.cBUpdateTime = new System.Windows.Forms.ComboBox(); @@ -139,14 +154,21 @@ 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.languagePackComboBox1 = new DS4Windows.DS4Forms.LanguagePackComboBox(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.linkProfiles = new System.Windows.Forms.LinkLabel(); this.lnkControllers = new System.Windows.Forms.LinkLabel(); this.linkUninstall = new System.Windows.Forms.LinkLabel(); this.linkSetup = new System.Windows.Forms.LinkLabel(); this.lLBUpdate = new System.Windows.Forms.LinkLabel(); + this.linkSplitLabel = new System.Windows.Forms.Label(); + this.hidGuardWhiteList = new System.Windows.Forms.LinkLabel(); + this.clrHidGuardWlistLinkLabel = new System.Windows.Forms.LinkLabel(); + this.hidGuardRegLinkLabel = new System.Windows.Forms.LinkLabel(); this.tabLog = new System.Windows.Forms.TabPage(); + this.panel3 = new System.Windows.Forms.Panel(); + this.exportLogTxtBtn = new System.Windows.Forms.Button(); + this.btnClear = new System.Windows.Forms.Button(); this.saveProfiles = new System.Windows.Forms.SaveFileDialog(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.cMCustomLed = new System.Windows.Forms.ContextMenuStrip(this.components); @@ -168,6 +190,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(); @@ -177,6 +201,7 @@ ((System.ComponentModel.ISupportInitialize)(this.nUDXIPorts)).BeginInit(); this.flowLayoutPanel1.SuspendLayout(); this.tabLog.SuspendLayout(); + this.panel3.SuspendLayout(); this.cMCustomLed.SuspendLayout(); this.SuspendLayout(); // @@ -200,11 +225,6 @@ // resources.ApplyResources(this.chData, "chData"); // - // tmrUpdate - // - this.tmrUpdate.Interval = 1; - this.tmrUpdate.Tick += new System.EventHandler(this.ControllerStatusChange); - // // pnlButton // this.pnlButton.BackColor = System.Drawing.SystemColors.Control; @@ -233,7 +253,7 @@ resources.ApplyResources(this.btnStartStop, "btnStartStop"); this.btnStartStop.Name = "btnStartStop"; this.btnStartStop.UseVisualStyleBackColor = true; - this.btnStartStop.Click += new System.EventHandler(this.btnStartStop_Click); + this.btnStartStop.Click += new System.EventHandler(this.BtnStartStop_Click); // // lbLastMessage // @@ -242,13 +262,6 @@ this.lbLastMessage.Name = "lbLastMessage"; this.lbLastMessage.MouseHover += new System.EventHandler(this.lbLastMessage_MouseHover); // - // btnClear - // - resources.ApplyResources(this.btnClear, "btnClear"); - this.btnClear.Name = "btnClear"; - this.btnClear.UseVisualStyleBackColor = true; - this.btnClear.Click += new System.EventHandler(this.btnClear_Click); - // // notifyIcon1 // this.notifyIcon1.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info; @@ -266,9 +279,12 @@ this.editProfileForController2ToolStripMenuItem, this.editProfileForController3ToolStripMenuItem, this.editProfileForController4ToolStripMenuItem, + this.toolStripSeparator4, + this.disconToolStripMenuItem, this.toolStripSeparator1, this.startToolStripMenuItem, this.openToolStripMenuItem, + this.openProgramFolderToolStripMenuItem, this.exitToolStripMenuItem}); this.cMTaskbar.Name = "cMTaskbar"; resources.ApplyResources(this.cMTaskbar, "cMTaskbar"); @@ -302,6 +318,49 @@ this.editProfileForController4ToolStripMenuItem.Tag = "4"; this.editProfileForController4ToolStripMenuItem.Click += new System.EventHandler(this.editMenu_Click); // + // toolStripSeparator4 + // + this.toolStripSeparator4.Name = "toolStripSeparator4"; + resources.ApplyResources(this.toolStripSeparator4, "toolStripSeparator4"); + // + // disconToolStripMenuItem + // + this.disconToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.discon1toolStripMenuItem, + this.discon2ToolStripMenuItem, + this.discon3ToolStripMenuItem, + this.discon4ToolStripMenuItem}); + this.disconToolStripMenuItem.Name = "disconToolStripMenuItem"; + resources.ApplyResources(this.disconToolStripMenuItem, "disconToolStripMenuItem"); + // + // discon1toolStripMenuItem + // + this.discon1toolStripMenuItem.Name = "discon1toolStripMenuItem"; + resources.ApplyResources(this.discon1toolStripMenuItem, "discon1toolStripMenuItem"); + this.discon1toolStripMenuItem.Tag = "0"; + this.discon1toolStripMenuItem.Click += new System.EventHandler(this.DiscontoolStripMenuItem_Click); + // + // discon2ToolStripMenuItem + // + this.discon2ToolStripMenuItem.Name = "discon2ToolStripMenuItem"; + resources.ApplyResources(this.discon2ToolStripMenuItem, "discon2ToolStripMenuItem"); + this.discon2ToolStripMenuItem.Tag = "1"; + this.discon2ToolStripMenuItem.Click += new System.EventHandler(this.DiscontoolStripMenuItem_Click); + // + // discon3ToolStripMenuItem + // + this.discon3ToolStripMenuItem.Name = "discon3ToolStripMenuItem"; + resources.ApplyResources(this.discon3ToolStripMenuItem, "discon3ToolStripMenuItem"); + this.discon3ToolStripMenuItem.Tag = "2"; + this.discon3ToolStripMenuItem.Click += new System.EventHandler(this.DiscontoolStripMenuItem_Click); + // + // discon4ToolStripMenuItem + // + this.discon4ToolStripMenuItem.Name = "discon4ToolStripMenuItem"; + resources.ApplyResources(this.discon4ToolStripMenuItem, "discon4ToolStripMenuItem"); + this.discon4ToolStripMenuItem.Tag = "3"; + this.discon4ToolStripMenuItem.Click += new System.EventHandler(this.DiscontoolStripMenuItem_Click); + // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; @@ -319,6 +378,12 @@ this.openToolStripMenuItem.Name = "openToolStripMenuItem"; this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); // + // openProgramFolderToolStripMenuItem + // + this.openProgramFolderToolStripMenuItem.Name = "openProgramFolderToolStripMenuItem"; + resources.ApplyResources(this.openProgramFolderToolStripMenuItem, "openProgramFolderToolStripMenuItem"); + this.openProgramFolderToolStripMenuItem.Click += new System.EventHandler(this.OpenProgramFolderToolStripMenuItem_Click); + // // exitToolStripMenuItem // this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; @@ -349,38 +414,30 @@ // // tabControllers // - this.tabControllers.Controls.Add(this.btnConnectDS4Win10); this.tabControllers.Controls.Add(this.tLPControllers); this.tabControllers.Controls.Add(this.lbNoControllers); resources.ApplyResources(this.tabControllers, "tabControllers"); this.tabControllers.Name = "tabControllers"; this.tabControllers.UseVisualStyleBackColor = true; // - // btnConnectDS4Win10 - // - resources.ApplyResources(this.btnConnectDS4Win10, "btnConnectDS4Win10"); - this.btnConnectDS4Win10.Name = "btnConnectDS4Win10"; - this.btnConnectDS4Win10.UseVisualStyleBackColor = true; - this.btnConnectDS4Win10.Click += new System.EventHandler(this.btnConnectDS4Win10_Click); - // // tLPControllers // resources.ApplyResources(this.tLPControllers, "tLPControllers"); - this.tLPControllers.Controls.Add(this.bnLight3, 5, 3); + this.tLPControllers.Controls.Add(this.bnLight3, 6, 3); this.tLPControllers.Controls.Add(this.pBStatus1, 1, 1); this.tLPControllers.Controls.Add(this.lbPad1, 0, 1); this.tLPControllers.Controls.Add(this.lbPad2, 0, 2); - this.tLPControllers.Controls.Add(this.bnEditC3, 4, 3); - this.tLPControllers.Controls.Add(this.bnEditC4, 4, 4); + this.tLPControllers.Controls.Add(this.bnEditC3, 5, 3); + this.tLPControllers.Controls.Add(this.bnEditC4, 5, 4); this.tLPControllers.Controls.Add(this.lbPad3, 0, 3); this.tLPControllers.Controls.Add(this.lbPad4, 0, 4); - this.tLPControllers.Controls.Add(this.cBController1, 3, 1); - this.tLPControllers.Controls.Add(this.bnEditC2, 4, 2); - this.tLPControllers.Controls.Add(this.cBController2, 3, 2); - this.tLPControllers.Controls.Add(this.cBController3, 3, 3); - this.tLPControllers.Controls.Add(this.bnEditC1, 4, 1); - this.tLPControllers.Controls.Add(this.cBController4, 3, 4); - this.tLPControllers.Controls.Add(this.lbSelectedProfile, 3, 0); + this.tLPControllers.Controls.Add(this.cBController1, 4, 1); + this.tLPControllers.Controls.Add(this.bnEditC2, 5, 2); + this.tLPControllers.Controls.Add(this.cBController2, 4, 2); + this.tLPControllers.Controls.Add(this.cBController3, 4, 3); + this.tLPControllers.Controls.Add(this.bnEditC1, 5, 1); + this.tLPControllers.Controls.Add(this.cBController4, 4, 4); + this.tLPControllers.Controls.Add(this.lbSelectedProfile, 4, 0); this.tLPControllers.Controls.Add(this.lbID, 0, 0); this.tLPControllers.Controls.Add(this.lbStatus, 1, 0); this.tLPControllers.Controls.Add(this.lbBattery, 2, 0); @@ -391,9 +448,14 @@ this.tLPControllers.Controls.Add(this.pBStatus2, 1, 2); this.tLPControllers.Controls.Add(this.pBStatus3, 1, 3); this.tLPControllers.Controls.Add(this.pBStatus4, 1, 4); - this.tLPControllers.Controls.Add(this.bnLight1, 5, 1); - this.tLPControllers.Controls.Add(this.bnLight2, 5, 2); - this.tLPControllers.Controls.Add(this.bnLight4, 5, 4); + this.tLPControllers.Controls.Add(this.bnLight1, 6, 1); + this.tLPControllers.Controls.Add(this.bnLight2, 6, 2); + this.tLPControllers.Controls.Add(this.bnLight4, 6, 4); + this.tLPControllers.Controls.Add(this.lbLinkProfile, 3, 0); + this.tLPControllers.Controls.Add(this.linkCB1, 3, 1); + this.tLPControllers.Controls.Add(this.linkCB2, 3, 2); + this.tLPControllers.Controls.Add(this.linkCB3, 3, 3); + this.tLPControllers.Controls.Add(this.linkCB4, 3, 4); this.tLPControllers.Name = "tLPControllers"; // // bnLight3 @@ -435,7 +497,7 @@ // resources.ApplyResources(this.bnEditC3, "bnEditC3"); this.bnEditC3.Name = "bnEditC3"; - this.bnEditC3.Tag = "2"; + this.bnEditC3.Tag = ""; this.bnEditC3.UseVisualStyleBackColor = true; this.bnEditC3.Click += new System.EventHandler(this.editButtons_Click); // @@ -443,7 +505,7 @@ // resources.ApplyResources(this.bnEditC4, "bnEditC4"); this.bnEditC4.Name = "bnEditC4"; - this.bnEditC4.Tag = "3"; + this.bnEditC4.Tag = ""; this.bnEditC4.UseVisualStyleBackColor = true; this.bnEditC4.Click += new System.EventHandler(this.editButtons_Click); // @@ -476,7 +538,7 @@ // resources.ApplyResources(this.bnEditC2, "bnEditC2"); this.bnEditC2.Name = "bnEditC2"; - this.bnEditC2.Tag = "1"; + this.bnEditC2.Tag = ""; this.bnEditC2.UseVisualStyleBackColor = true; this.bnEditC2.Click += new System.EventHandler(this.editButtons_Click); // @@ -502,7 +564,7 @@ // resources.ApplyResources(this.bnEditC1, "bnEditC1"); this.bnEditC1.Name = "bnEditC1"; - this.bnEditC1.Tag = "0"; + this.bnEditC1.Tag = ""; this.bnEditC1.UseVisualStyleBackColor = true; this.bnEditC1.Click += new System.EventHandler(this.editButtons_Click); // @@ -612,6 +674,43 @@ this.bnLight4.UseVisualStyleBackColor = false; this.bnLight4.Click += new System.EventHandler(this.EditCustomLed); // + // lbLinkProfile + // + resources.ApplyResources(this.lbLinkProfile, "lbLinkProfile"); + this.lbLinkProfile.Name = "lbLinkProfile"; + // + // linkCB1 + // + resources.ApplyResources(this.linkCB1, "linkCB1"); + this.linkCB1.Name = "linkCB1"; + this.linkCB1.Tag = "0"; + this.linkCB1.UseVisualStyleBackColor = true; + this.linkCB1.CheckedChanged += new System.EventHandler(this.linkCB_CheckedChanged); + // + // linkCB2 + // + resources.ApplyResources(this.linkCB2, "linkCB2"); + this.linkCB2.Name = "linkCB2"; + this.linkCB2.Tag = "1"; + this.linkCB2.UseVisualStyleBackColor = true; + this.linkCB2.CheckedChanged += new System.EventHandler(this.linkCB_CheckedChanged); + // + // linkCB3 + // + resources.ApplyResources(this.linkCB3, "linkCB3"); + this.linkCB3.Name = "linkCB3"; + this.linkCB3.Tag = "2"; + this.linkCB3.UseVisualStyleBackColor = true; + this.linkCB3.CheckedChanged += new System.EventHandler(this.linkCB_CheckedChanged); + // + // linkCB4 + // + resources.ApplyResources(this.linkCB4, "linkCB4"); + this.linkCB4.Name = "linkCB4"; + this.linkCB4.Tag = "3"; + this.linkCB4.UseVisualStyleBackColor = true; + this.linkCB4.CheckedChanged += new System.EventHandler(this.linkCB_CheckedChanged); + // // lbNoControllers // resources.ApplyResources(this.lbNoControllers, "lbNoControllers"); @@ -632,8 +731,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,22 +894,22 @@ // // 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); // @@ -823,8 +922,8 @@ // // 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,17 +946,19 @@ this.fLPSettings.Controls.Add(this.hideDS4CheckBox); this.fLPSettings.Controls.Add(this.cBSwipeProfiles); this.fLPSettings.Controls.Add(this.StartWindowsCheckBox); - this.fLPSettings.Controls.Add(this.startMinimizedCheckBox); + this.fLPSettings.Controls.Add(this.runStartupPanel); this.fLPSettings.Controls.Add(this.panel1); this.fLPSettings.Controls.Add(this.cBDisconnectBT); this.fLPSettings.Controls.Add(this.panel2); + this.fLPSettings.Controls.Add(this.startMinimizedCheckBox); + this.fLPSettings.Controls.Add(this.mintoTaskCheckBox); this.fLPSettings.Controls.Add(this.cBCloseMini); this.fLPSettings.Controls.Add(this.cBQuickCharge); this.fLPSettings.Controls.Add(this.cBUseWhiteIcon); - this.fLPSettings.Controls.Add(this.cBDownloadLangauge); this.fLPSettings.Controls.Add(this.cBUpdate); this.fLPSettings.Controls.Add(this.pNUpdate); this.fLPSettings.Controls.Add(this.pnlXIPorts); + this.fLPSettings.Controls.Add(this.languagePackComboBox1); this.fLPSettings.Controls.Add(this.flowLayoutPanel1); this.fLPSettings.Name = "fLPSettings"; // @@ -865,7 +966,7 @@ // resources.ApplyResources(this.hideDS4CheckBox, "hideDS4CheckBox"); this.hideDS4CheckBox.Name = "hideDS4CheckBox"; - this.hideDS4CheckBox.UseVisualStyleBackColor = true; + this.hideDS4CheckBox.UseVisualStyleBackColor = false; this.hideDS4CheckBox.CheckedChanged += new System.EventHandler(this.hideDS4CheckBox_CheckedChanged); // // cBSwipeProfiles @@ -874,7 +975,7 @@ this.cBSwipeProfiles.Checked = true; this.cBSwipeProfiles.CheckState = System.Windows.Forms.CheckState.Checked; this.cBSwipeProfiles.Name = "cBSwipeProfiles"; - this.cBSwipeProfiles.UseVisualStyleBackColor = true; + this.cBSwipeProfiles.UseVisualStyleBackColor = false; this.cBSwipeProfiles.CheckedChanged += new System.EventHandler(this.cBSwipeProfiles_CheckedChanged); // // StartWindowsCheckBox @@ -884,12 +985,43 @@ this.StartWindowsCheckBox.UseVisualStyleBackColor = true; this.StartWindowsCheckBox.CheckedChanged += new System.EventHandler(this.StartWindowsCheckBox_CheckedChanged); // - // startMinimizedCheckBox + // runStartupPanel // - resources.ApplyResources(this.startMinimizedCheckBox, "startMinimizedCheckBox"); - this.startMinimizedCheckBox.Name = "startMinimizedCheckBox"; - this.startMinimizedCheckBox.UseVisualStyleBackColor = true; - this.startMinimizedCheckBox.CheckedChanged += new System.EventHandler(this.startMinimizedCheckBox_CheckedChanged); + 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 = false; + 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 = false; + this.runStartProgRadio.Click += new System.EventHandler(this.runStartProgRadio_Click); // // panel1 // @@ -940,7 +1072,7 @@ 0}); this.nUDLatency.Name = "nUDLatency"; this.nUDLatency.Value = new decimal(new int[] { - 10, + 20, 0, 0, 0}); @@ -957,9 +1089,22 @@ this.cBFlashWhenLate.Checked = true; this.cBFlashWhenLate.CheckState = System.Windows.Forms.CheckState.Checked; this.cBFlashWhenLate.Name = "cBFlashWhenLate"; - this.cBFlashWhenLate.UseVisualStyleBackColor = true; + this.cBFlashWhenLate.UseVisualStyleBackColor = false; this.cBFlashWhenLate.CheckedChanged += new System.EventHandler(this.cBFlashWhenLate_CheckedChanged); // + // startMinimizedCheckBox + // + resources.ApplyResources(this.startMinimizedCheckBox, "startMinimizedCheckBox"); + this.startMinimizedCheckBox.Name = "startMinimizedCheckBox"; + this.startMinimizedCheckBox.UseVisualStyleBackColor = true; + this.startMinimizedCheckBox.CheckedChanged += new System.EventHandler(this.startMinimizedCheckBox_CheckedChanged); + // + // mintoTaskCheckBox + // + resources.ApplyResources(this.mintoTaskCheckBox, "mintoTaskCheckBox"); + this.mintoTaskCheckBox.Name = "mintoTaskCheckBox"; + this.mintoTaskCheckBox.UseVisualStyleBackColor = true; + // // cBCloseMini // resources.ApplyResources(this.cBCloseMini, "cBCloseMini"); @@ -974,20 +1119,18 @@ this.cBQuickCharge.UseVisualStyleBackColor = true; this.cBQuickCharge.CheckedChanged += new System.EventHandler(this.cBQuickCharge_CheckedChanged); // - // cBDownloadLangauge + // cBUseWhiteIcon // - resources.ApplyResources(this.cBDownloadLangauge, "cBDownloadLangauge"); - this.cBDownloadLangauge.Checked = true; - this.cBDownloadLangauge.CheckState = System.Windows.Forms.CheckState.Checked; - this.cBDownloadLangauge.Name = "cBDownloadLangauge"; - this.cBDownloadLangauge.UseVisualStyleBackColor = true; - this.cBDownloadLangauge.CheckedChanged += new System.EventHandler(this.cBDownloadLangauge_CheckedChanged); + resources.ApplyResources(this.cBUseWhiteIcon, "cBUseWhiteIcon"); + this.cBUseWhiteIcon.Name = "cBUseWhiteIcon"; + this.cBUseWhiteIcon.UseVisualStyleBackColor = true; + this.cBUseWhiteIcon.CheckedChanged += new System.EventHandler(this.cBUseWhiteIcon_CheckedChanged); // // cBUpdate // resources.ApplyResources(this.cBUpdate, "cBUpdate"); this.cBUpdate.Name = "cBUpdate"; - this.cBUpdate.UseVisualStyleBackColor = true; + this.cBUpdate.UseVisualStyleBackColor = false; this.cBUpdate.CheckedChanged += new System.EventHandler(this.cBUpdate_CheckedChanged); // // pNUpdate @@ -1032,8 +1175,6 @@ this.pnlXIPorts.Controls.Add(this.lbLastXIPort); resources.ApplyResources(this.pnlXIPorts, "pnlXIPorts"); this.pnlXIPorts.Name = "pnlXIPorts"; - this.pnlXIPorts.MouseEnter += new System.EventHandler(this.pnlXIPorts_MouseEnter); - this.pnlXIPorts.MouseLeave += new System.EventHandler(this.pnlXIPorts_MouseLeave); // // lbUseXIPorts // @@ -1068,21 +1209,26 @@ resources.ApplyResources(this.lbLastXIPort, "lbLastXIPort"); this.lbLastXIPort.Name = "lbLastXIPort"; // - // cBUseWhiteIcon + // languagePackComboBox1 // - resources.ApplyResources(this.cBUseWhiteIcon, "cBUseWhiteIcon"); - this.cBUseWhiteIcon.Name = "cBUseWhiteIcon"; - this.cBUseWhiteIcon.UseVisualStyleBackColor = true; - this.cBUseWhiteIcon.CheckedChanged += new System.EventHandler(this.cBUseWhiteIcon_CheckedChanged); + resources.ApplyResources(this.languagePackComboBox1, "languagePackComboBox1"); + this.languagePackComboBox1.Name = "languagePackComboBox1"; + this.languagePackComboBox1.SelectedValueChanged += new System.EventHandler(this.languagePackComboBox1_SelectedValueChanged); // // flowLayoutPanel1 // resources.ApplyResources(this.flowLayoutPanel1, "flowLayoutPanel1"); + this.flowLayoutPanel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.flowLayoutPanel1.Controls.Add(this.linkProfiles); this.flowLayoutPanel1.Controls.Add(this.lnkControllers); this.flowLayoutPanel1.Controls.Add(this.linkUninstall); this.flowLayoutPanel1.Controls.Add(this.linkSetup); this.flowLayoutPanel1.Controls.Add(this.lLBUpdate); + this.flowLayoutPanel1.Controls.Add(this.linkSplitLabel); + this.flowLayoutPanel1.Controls.Add(this.hidGuardWhiteList); + this.flowLayoutPanel1.Controls.Add(this.clrHidGuardWlistLinkLabel); + this.flowLayoutPanel1.Controls.Add(this.hidGuardRegLinkLabel); + this.flowLayoutPanel1.ForeColor = System.Drawing.SystemColors.ControlText; this.flowLayoutPanel1.Name = "flowLayoutPanel1"; // // linkProfiles @@ -1120,14 +1266,64 @@ this.lLBUpdate.TabStop = true; this.lLBUpdate.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lLBUpdate_LinkClicked); // + // linkSplitLabel + // + resources.ApplyResources(this.linkSplitLabel, "linkSplitLabel"); + this.linkSplitLabel.BackColor = System.Drawing.SystemColors.ActiveBorder; + this.linkSplitLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.linkSplitLabel.ForeColor = System.Drawing.SystemColors.ControlText; + this.linkSplitLabel.Name = "linkSplitLabel"; + // + // hidGuardWhiteList + // + resources.ApplyResources(this.hidGuardWhiteList, "hidGuardWhiteList"); + this.hidGuardWhiteList.Name = "hidGuardWhiteList"; + this.hidGuardWhiteList.TabStop = true; + this.hidGuardWhiteList.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.HidGuardWhiteList_LinkClicked); + // + // clrHidGuardWlistLinkLabel + // + resources.ApplyResources(this.clrHidGuardWlistLinkLabel, "clrHidGuardWlistLinkLabel"); + this.clrHidGuardWlistLinkLabel.Name = "clrHidGuardWlistLinkLabel"; + this.clrHidGuardWlistLinkLabel.TabStop = true; + this.clrHidGuardWlistLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.ClrHidGuardWlistLinkLabel_LinkClicked); + // + // hidGuardRegLinkLabel + // + resources.ApplyResources(this.hidGuardRegLinkLabel, "hidGuardRegLinkLabel"); + this.hidGuardRegLinkLabel.Name = "hidGuardRegLinkLabel"; + this.hidGuardRegLinkLabel.TabStop = true; + this.hidGuardRegLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.HidGuardRegLinkLabel_LinkClicked); + // // tabLog // this.tabLog.Controls.Add(this.lvDebug); - this.tabLog.Controls.Add(this.btnClear); + this.tabLog.Controls.Add(this.panel3); resources.ApplyResources(this.tabLog, "tabLog"); this.tabLog.Name = "tabLog"; this.tabLog.UseVisualStyleBackColor = true; // + // panel3 + // + this.panel3.Controls.Add(this.exportLogTxtBtn); + this.panel3.Controls.Add(this.btnClear); + resources.ApplyResources(this.panel3, "panel3"); + this.panel3.Name = "panel3"; + // + // exportLogTxtBtn + // + resources.ApplyResources(this.exportLogTxtBtn, "exportLogTxtBtn"); + this.exportLogTxtBtn.Name = "exportLogTxtBtn"; + this.exportLogTxtBtn.UseVisualStyleBackColor = true; + this.exportLogTxtBtn.Click += new System.EventHandler(this.exportLogTxtBtn_Click); + // + // btnClear + // + resources.ApplyResources(this.btnClear, "btnClear"); + this.btnClear.Name = "btnClear"; + this.btnClear.UseVisualStyleBackColor = true; + this.btnClear.Click += new System.EventHandler(this.BtnClear_Click); + // // saveProfiles // resources.ApplyResources(this.saveProfiles, "saveProfiles"); @@ -1157,16 +1353,12 @@ 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; resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.BackColor = System.Drawing.Color.White; + this.BackColor = System.Drawing.SystemColors.Window; this.Controls.Add(this.tabMain); this.Controls.Add(this.pnlButton); this.Name = "DS4Form"; @@ -1179,7 +1371,6 @@ this.cMTaskbar.ResumeLayout(false); this.tabMain.ResumeLayout(false); this.tabControllers.ResumeLayout(false); - this.tabControllers.PerformLayout(); this.tLPControllers.ResumeLayout(false); this.tLPControllers.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pBStatus1)).EndInit(); @@ -1196,6 +1387,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); @@ -1210,6 +1404,7 @@ this.flowLayoutPanel1.ResumeLayout(false); this.flowLayoutPanel1.PerformLayout(); this.tabLog.ResumeLayout(false); + this.panel3.ResumeLayout(false); this.cMCustomLed.ResumeLayout(false); this.ResumeLayout(false); @@ -1220,10 +1415,8 @@ private System.Windows.Forms.ListView lvDebug; private System.Windows.Forms.ColumnHeader chTime; private System.Windows.Forms.ColumnHeader chData; - private System.Windows.Forms.Timer tmrUpdate; private System.Windows.Forms.Panel pnlButton; private System.Windows.Forms.Button btnStartStop; - private System.Windows.Forms.Button btnClear; private System.Windows.Forms.NotifyIcon notifyIcon1; private System.Windows.Forms.ContextMenuStrip cMTaskbar; private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; @@ -1264,7 +1457,6 @@ private System.Windows.Forms.Label lbSelectedProfile; private System.Windows.Forms.Label lbID; private System.Windows.Forms.Label lbStatus; - private System.Windows.Forms.Label lbBattery; private System.Windows.Forms.Label lbBatt1; private System.Windows.Forms.Label lbBatt2; private System.Windows.Forms.Label lbBatt3; @@ -1322,7 +1514,6 @@ private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; private System.Windows.Forms.Label lbNoControllers; private System.Windows.Forms.ToolTip toolTip1; - private System.Windows.Forms.CheckBox cBDownloadLangauge; private System.Windows.Forms.CheckBox cBFlashWhenLate; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Label lbNotifications; @@ -1330,7 +1521,6 @@ private System.Windows.Forms.Panel panel2; private System.Windows.Forms.NumericUpDown nUDLatency; private System.Windows.Forms.Label lbMsLatency; - private System.Windows.Forms.Button btnConnectDS4Win10; private System.Windows.Forms.Button bnLight3; private System.Windows.Forms.Button bnLight1; private System.Windows.Forms.Button bnLight2; @@ -1340,6 +1530,33 @@ 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.Label lbBattery; + private System.Windows.Forms.Label lbLinkProfile; + private System.Windows.Forms.CheckBox linkCB1; + private System.Windows.Forms.CheckBox linkCB2; + private System.Windows.Forms.CheckBox linkCB3; + private System.Windows.Forms.CheckBox linkCB4; + private System.Windows.Forms.Panel panel3; + private System.Windows.Forms.Button exportLogTxtBtn; + private System.Windows.Forms.Button btnClear; + private DS4Forms.LanguagePackComboBox languagePackComboBox1; + private System.Windows.Forms.LinkLabel hidGuardWhiteList; + private System.Windows.Forms.LinkLabel clrHidGuardWlistLinkLabel; + private System.Windows.Forms.LinkLabel hidGuardRegLinkLabel; + private System.Windows.Forms.Label linkSplitLabel; + private System.Windows.Forms.ToolStripMenuItem openProgramFolderToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; + private System.Windows.Forms.ToolStripMenuItem disconToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem discon1toolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem discon2ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem discon3ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem discon4ToolStripMenuItem; + private System.Windows.Forms.CheckBox mintoTaskCheckBox; //private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2; } } diff --git a/DS4Windows/DS4Forms/DS4Form.ar.resx b/DS4Windows/DS4Forms/DS4Form.ar.resx index 6728b01..c4cc7be 100644 --- a/DS4Windows/DS4Forms/DS4Form.ar.resx +++ b/DS4Windows/DS4Forms/DS4Form.ar.resx @@ -196,9 +196,6 @@ الأيادي - - وصل اليد بشكل حصري (تجريبي) - 1046, 94 diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index c3f63a2..3d5d824 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -5,54 +5,65 @@ using System.IO; using System.Reflection; using System.Collections.Generic; using System.Net; -using System.Management; using System.Drawing; using Microsoft.Win32; using System.Diagnostics; using System.Xml; using System.Text; -using System.Globalization; -using System.Threading.Tasks; -using System.ServiceProcess; +using Microsoft.Win32.TaskScheduler; +using System.Security.Principal; +using System.Threading; +using System.Drawing.Drawing2D; +using TaskRunner = System.Threading.Tasks.Task; +using NonFormTimer = System.Timers.Timer; using static DS4Windows.Global; + namespace DS4Windows { public partial class DS4Form : Form { - public string[] arguements; + public string[] cmdArguments; delegate void LogDebugDelegate(DateTime Time, String Data, bool warning); - protected Label[] Pads, Batteries; - protected ComboBox[] cbs; - protected Button[] ebns; - protected Button[] lights; - protected PictureBox[] statPB; - protected ToolStripMenuItem[] shortcuts; + delegate void NotificationDelegate(object sender, DebugEventArgs args); + delegate void DeviceStatusChangedDelegate(object sender, DeviceStatusChangeEventArgs args); + delegate void DeviceSerialChangedDelegate(object sender, SerialChangeArgs args); + private Label[] Pads, Batteries; + private ComboBox[] cbs; + private Button[] ebns; + private Button[] lights; + private PictureBox[] statPB; + private ToolStripMenuItem[] shortcuts; + private ToolStripMenuItem[] disconnectShortcuts; + protected CheckBox[] linkedProfileCB; WebClient wc = new WebClient(); - Timer test = new Timer(), hotkeysTimer = 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"; - string tempProfileProgram = "null"; - float dpix, dpiy; + NonFormTimer hotkeysTimer = new NonFormTimer(); + NonFormTimer autoProfilesTimer = new NonFormTimer(); + string tempProfileProgram = string.Empty; + double dpix, dpiy; List profilenames = new List(); List programpaths = new List(); List[] proprofiles; List turnOffTempProfiles; - private static int WM_QUERYENDSESSION = 0x11; - private static bool systemShutdown = false; + + private bool systemShutdown = false; private bool wasrunning = false; - delegate void ControllerStatusChangedDelegate(object sender, EventArgs e); - delegate void HotKeysDelegate(object sender, EventArgs e); Options opt; - public System.Drawing.Size oldsize; - WinProgs WP; + private bool optPop; + public Size oldsize; public bool mAllowVisible; bool contextclose; - string logFile = appdatapath + @"\DS4Service.log"; - StreamWriter logWriter; bool turnOffTemp; bool runningBat; - //bool outputlog = false; + private bool changingService; + Dictionary hoverTextDict = new Dictionary(); + // 0 index is used for application version text. 1 - 4 indices are used for controller status + string[] notifyText = new string[5] + { "DS4Windows v" + FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion, + string.Empty, string.Empty, string.Empty, string.Empty }; + + internal const string UPDATER_VERSION = "1.2.8.0"; + internal static int WM_QUERYENDSESSION = 0x11; + internal string updaterExe = Environment.Is64BitProcess ? "DS4Updater.exe" : "DS4Updater_x86.exe"; [DllImport("user32.dll")] private static extern IntPtr GetForegroundWindow(); @@ -66,19 +77,41 @@ namespace DS4Windows [DllImport("kernel32.dll")] private static extern bool CloseHandle(IntPtr handle); - [DllImport("psapi.dll")] - private static extern uint GetModuleBaseName(IntPtr hWnd, IntPtr hModule, StringBuilder lpFileName, int nSize); - [DllImport("psapi.dll")] private static extern uint GetModuleFileNameEx(IntPtr hWnd, IntPtr hModule, StringBuilder lpFileName, int nSize); public DS4Form(string[] args) { + Global.FindConfigLocation(); + + if (Global.firstRun) + { + new SaveWhere(Global.multisavespots).ShowDialog(); + } + else if (Global.oldappdatafail) + { + MessageBox.Show(Properties.Resources.CannotMoveFiles, "DS4Windows"); + Process.Start("explorer.exe", @"/select, " + appDataPpath); + Close(); + return; + } + + Global.Load(); + Global.SetCulture(UseLang); + InitializeComponent(); + + bnEditC1.Tag = 0; + bnEditC2.Tag = 1; + bnEditC3.Tag = 2; + bnEditC4.Tag = 3; + + StartWindowsCheckBox.CheckedChanged -= StartWindowsCheckBox_CheckedChanged; + saveProfiles.Filter = Properties.Resources.XMLFiles + "|*.xml"; openProfiles.Filter = Properties.Resources.XMLFiles + "|*.xml"; - arguements = args; - ThemeUtil.SetTheme(lvDebug); + cmdArguments = args; + Pads = new Label[4] { lbPad1, lbPad2, lbPad3, lbPad4 }; Batteries = new Label[4] { lbBatt1, lbBatt2, lbBatt3, lbBatt4 }; cbs = new ComboBox[4] { cBController1, cBController2, cBController3, cBController4 }; @@ -89,57 +122,26 @@ namespace DS4Windows (ToolStripMenuItem)notifyIcon1.ContextMenuStrip.Items[1], (ToolStripMenuItem)notifyIcon1.ContextMenuStrip.Items[2], (ToolStripMenuItem)notifyIcon1.ContextMenuStrip.Items[3] }; + disconnectShortcuts = new ToolStripMenuItem[4] + { + discon1toolStripMenuItem, discon2ToolStripMenuItem, + discon3ToolStripMenuItem, discon4ToolStripMenuItem + }; + + linkedProfileCB = new CheckBox[4] { linkCB1, linkCB2, linkCB3, linkCB4 }; + SystemEvents.PowerModeChanged += OnPowerChange; tSOptions.Visible = false; - bool firstrun = false; - if (File.Exists(exepath + "\\Auto Profiles.xml") - && File.Exists(appDataPpath + "\\Auto Profiles.xml")) - { - firstrun = true; - new SaveWhere(true).ShowDialog(); - } - else if (File.Exists(exepath + "\\Auto Profiles.xml")) - SaveWhere(exepath); - else if (File.Exists(appDataPpath + "\\Auto Profiles.xml")) - SaveWhere(appDataPpath); - else if (File.Exists(oldappdatapath + "\\Auto Profiles.xml")) - { - try - { - if (Directory.Exists(appDataPpath)) - Directory.Move(appDataPpath, Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\DS4Windows Old"); - Directory.Move(oldappdatapath, appDataPpath); - SaveWhere(appDataPpath); - } - catch - { - MessageBox.Show(Properties.Resources.CannotMoveFiles, "DS4Windows"); - Process.Start("explorer.exe", @"/select, " + appDataPpath); - Close(); - return; - } - } - else if (!File.Exists(exepath + "\\Auto Profiles.xml") - && !File.Exists(appDataPpath + "\\Auto Profiles.xml")) - { - firstrun = true; - new SaveWhere(false).ShowDialog(); - } - if (firstrun) - CheckDrivers(); - else - { - var AppCollectionThread = new System.Threading.Thread(() => CheckDrivers()); - AppCollectionThread.IsBackground = true; - AppCollectionThread.Start(); - } - if (String.IsNullOrEmpty(appdatapath)) + TaskRunner.Run(() => CheckDrivers()); + + if (string.IsNullOrEmpty(appdatapath)) { Close(); return; } - Graphics g = this.CreateGraphics(); + + Graphics g = CreateGraphics(); try { dpix = g.DpiX / 100f * 1.041666666667f; @@ -149,19 +151,19 @@ namespace DS4Windows { g.Dispose(); } + + blankControllerTab(); + Program.rootHub.Debug += On_Debug; Log.GuiLog += On_Debug; - logFile = appdatapath + "\\DS4Windows.log"; - //logWriter = File.AppendText(logFile); Log.TrayIconLog += ShowNotification; - // tmrUpdate.Enabled = true; TODO remove tmrUpdate and leave tick() 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) + MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { try { @@ -187,23 +189,18 @@ 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; - if (Environment.OSVersion.Version.Major >= 10 && Environment.OSVersion.Version.Build < 10586) - { - toolTip1.SetToolTip(hideDS4CheckBox, "For Windows 10, use button on the main tab to connect exclusivly"); - btnConnectDS4Win10.Visible = hideDS4CheckBox.Checked; - toolTip1.SetToolTip(btnConnectDS4Win10, "This will temporarily kill the taskbar until you connect a controller"); - } - else - btnConnectDS4Win10.Visible = false; + cBDisconnectBT.Checked = DCBTatStop; cBQuickCharge.Checked = QuickCharge; nUDXIPorts.Value = FirstXinputPort; @@ -211,14 +208,16 @@ namespace DS4Windows // New settings this.Width = FormWidth; this.Height = FormHeight; + Location = new Point(FormLocationX, FormLocationY); startMinimizedCheckBox.CheckedChanged -= startMinimizedCheckBox_CheckedChanged; startMinimizedCheckBox.Checked = StartMinimized; startMinimizedCheckBox.CheckedChanged += startMinimizedCheckBox_CheckedChanged; + + mintoTaskCheckBox.Checked = Global.MinToTaskbar; + mintoTaskCheckBox.CheckedChanged += MintoTaskCheckBox_CheckedChanged; + cBCloseMini.Checked = CloseMini; - string lang = CultureInfo.CurrentCulture.ToString(); - if (lang.StartsWith("en")) - cBDownloadLangauge.Visible = false; - cBDownloadLangauge.Checked = DownloadLang; + cBFlashWhenLate.Checked = FlashWhenLate; nUDLatency.Value = FlashWhenLateAt; @@ -228,16 +227,22 @@ namespace DS4Windows try { string[] profiles = Directory.GetFiles(appdatapath + @"\Profiles\"); - foreach (String s in profiles) + string s = string.Empty; + //foreach (string s in profiles) + for (int i = 0, proflen = profiles.Length; i < proflen; i++) + { + s = profiles[i]; if (Path.GetExtension(s) == ".xml") { xDoc.Load(s); - XmlNode el = xDoc.SelectSingleNode("DS4Windows/ProfileActions"); //.CreateElement("Action"); + XmlNode el = xDoc.SelectSingleNode("DS4Windows/ProfileActions"); if (el != null) + { if (string.IsNullOrEmpty(el.InnerText)) el.InnerText = "Disconnect Controller"; else el.InnerText += "/Disconnect Controller"; + } else { XmlNode Node = xDoc.SelectSingleNode("DS4Windows"); @@ -245,59 +250,75 @@ namespace DS4Windows el.InnerText = "Disconnect Controller"; Node.AppendChild(el); } + xDoc.Save(s); LoadActions(); } + } } catch { } } + bool start = true; bool mini = false; - for (int i = 0; i < arguements.Length; i++) + for (int i = 0, argslen = cmdArguments.Length; i < argslen; i++) { - if (arguements[i] == "-stop") + if (cmdArguments[i] == "-stop") start = false; - if (arguements[i] == "-m") + else if (cmdArguments[i] == "-m") mini = true; + if (mini && start) break; } + if (!(startMinimizedCheckBox.Checked || mini)) { mAllowVisible = true; Show(); } + Form_Resize(null, null); RefreshProfiles(); - opt = new Options(this); - //opt.Text = "Options for Controller " + (devID + 1); + /*opt = new Options(this); opt.Icon = this.Icon; opt.TopLevel = false; - opt.Dock = DockStyle.Fill; - opt.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - tabProfiles.Controls.Add(opt); - NewVersion(); - for (int i = 0; i < 4; i++) - { - LoadProfile(i, true, Program.rootHub); - if (UseCustomLed[i]) - lights[i].BackColor = CustomColor[i].ToColorA; - else - lights[i].BackColor = MainColor[i].ToColorA; - } + opt.Dock = DockStyle.None; + opt.FormBorderStyle = FormBorderStyle.None; + */ + //tabProfiles.Controls.Add(opt); + + autoProfilesTimer.Elapsed += CheckAutoProfiles; + autoProfilesTimer.Interval = 1000; + + FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location); + string version = fvi.FileVersion; + Log.LogToGui("DS4Windows version " + version, false); + LoadP(); - Global.ControllerStatusChange += ControllerStatusChange; + LoadLinkedProfiles(); + + Global.BatteryStatusChange += BatteryStatusUpdate; + Global.ControllerRemoved += ControllerRemovedChange; + Global.DeviceStatusChange += DeviceStatusChanged; + Global.DeviceSerialChange += DeviceSerialChanged; + Enable_Controls(0, false); Enable_Controls(1, false); Enable_Controls(2, false); Enable_Controls(3, false); btnStartStop.Text = Properties.Resources.StartText; + + hotkeysTimer.Elapsed += Hotkeys; + if (SwipeProfiles) + { + hotkeysTimer.Start(); + } + if (btnStartStop.Enabled && start) - btnStartStop_Clicked(); + BtnStartStop_Clicked(); + startToolStripMenuItem.Text = btnStartStop.Text; - if (!tLPControllers.Visible) - tabMain.SelectedIndex = 1; - //cBNotifications.Checked = Notifications; cBoxNotifications.SelectedIndex = Notifications; cBSwipeProfiles.Checked = SwipeProfiles; int checkwhen = CheckWhen; @@ -312,116 +333,164 @@ 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.239.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)) { wc.DownloadFileAsync(url, appdatapath + "\\version.txt"); - wc.DownloadFileCompleted += Check_Version; + wc.DownloadFileCompleted += (sender, e) => { TaskRunner.Run(() => Check_Version(sender, e)); }; LastChecked = DateTime.Now; } if (File.Exists(exepath + "\\Updater.exe")) { - System.Threading.Thread.Sleep(2000); + 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 = 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; + hidGuardWhiteList.Visible = false; + clrHidGuardWlistLinkLabel.Visible = false; + hidGuardRegLinkLabel.Visible = false; + linkSplitLabel.Visible = 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(); + + TaskRunner.Run(() => { UpdateTheUpdater(); }); + + StartWindowsCheckBox.CheckedChanged += new EventHandler(StartWindowsCheckBox_CheckedChanged); + new ToolTip().SetToolTip(StartWindowsCheckBox, Properties.Resources.RunAtStartup); + + populateHoverTextDict(); + + cBController1.KeyPress += CBController_KeyPress; + cBController2.KeyPress += CBController_KeyPress; + cBController3.KeyPress += CBController_KeyPress; + cBController4.KeyPress += CBController_KeyPress; + + foreach (Control control in fLPSettings.Controls) + { + if (control.HasChildren) + { + foreach (Control ctrl in control.Controls) + ctrl.MouseHover += Items_MouseHover; + } + + control.MouseHover += Items_MouseHover; + } } - private async void UpdateTheUpdater() + 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 void AddUACShieldToImage(Image image) + { + Bitmap shield = SystemIcons.Shield.ToBitmap(); + shield.MakeTransparent(); + + Graphics g = Graphics.FromImage(image); + g.CompositingMode = 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)); + } + + private void blankControllerTab() + { + for (int Index = 0, PadsLen = Pads.Length; + Index < PadsLen; Index++) + { + if (Index < ControlService.DS4_CONTROLLER_COUNT) + { + 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 = true; + tLPControllers.Visible = false; + } + + private void UpdateTheUpdater() { if (File.Exists(exepath + "\\Update Files\\DS4Updater.exe")) { Process[] processes = Process.GetProcessesByName("DS4Updater"); while (processes.Length > 0) { - await Task.Delay(500); + Thread.Sleep(500); } + File.Delete(exepath + "\\DS4Updater.exe"); File.Move(exepath + "\\Update Files\\DS4Updater.exe", exepath + "\\DS4Updater.exe"); Directory.Delete(exepath + "\\Update Files"); } } - void NewVersion() - { - if (File.Exists(exepath + "\\1.4.22.ds4w")) - { - bool dcexists = false; - foreach (SpecialAction action in GetActions()) - { - if (action.type == "DisconnectBT") - { - dcexists = true; - break; - } - } - if (!dcexists) - { - try - { - XmlDocument xDoc = new XmlDocument(); - SaveAction("Disconnect Controller", "PS/Options", 5, "0", false); - string[] profiles = Directory.GetFiles(appdatapath + @"\Profiles\"); - foreach (String s in profiles) - if (Path.GetExtension(s) == ".xml") - { - xDoc.Load(s); - XmlNode el = xDoc.SelectSingleNode("DS4Windows/ProfileActions"); - if (el != null) - if (string.IsNullOrEmpty(el.InnerText)) - el.InnerText = "Disconnect Controller"; - else - el.InnerText += "/Disconnect Controller"; - else - { - XmlNode Node = xDoc.SelectSingleNode("DS4Windows"); - el = xDoc.CreateElement("ProfileActions"); - el.InnerText = "Disconnect Controller"; - Node.AppendChild(el); - } - xDoc.Save(s); - LoadActions(); - } - } - catch { } - } - File.Delete(exepath + "\\1.4.22.ds4w"); - } - } - protected override void SetVisibleCore(bool value) { if (!mAllowVisible) { value = false; - if (!this.IsHandleCreated) CreateHandle(); + if (!IsHandleCreated) CreateHandle(); } - base.SetVisibleCore(value); - } - private void showToolStripMenuItem_Click(object sender, EventArgs e) - { - mAllowVisible = true; - Show(); + base.SetVisibleCore(value); } public static string GetTopWindowName() @@ -445,103 +514,142 @@ namespace DS4Windows switch (e.Mode) { case PowerModes.Resume: + { if (btnStartStop.Text == Properties.Resources.StartText && wasrunning) { DS4LightBar.shuttingdown = false; wasrunning = false; - btnStartStop_Clicked(); + Program.rootHub.suspending = false; + BtnStartStop_Clicked(); } break; + } case PowerModes.Suspend: + { if (btnStartStop.Text == Properties.Resources.StopText) { DS4LightBar.shuttingdown = true; - btnStartStop_Clicked(); + Program.rootHub.suspending = true; + BtnStartStop_Clicked(); 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)); } - - //Check for process for auto profiles - if (tempProfileProgram == "null") - for (int i = 0; i < programpaths.Count; i++) - { - string name = programpaths[i].ToLower().Replace('/', '\\'); - if (name == GetTopWindowName().ToLower().Replace('/', '\\')) - { - 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; - if (btnStartStop.Text == Properties.Resources.StopText) - { - btnStartStop_Clicked(); - hotkeysTimer.Start(); - btnStartStop.Text = Properties.Resources.StartText; - } - } - tempProfileProgram = name; - break; - } - } - else - { - if (tempProfileProgram != GetTopWindowName().ToLower().Replace('/', '\\')) - { - tempProfileProgram = "null"; - for (int j = 0; j < 4; j++) - LoadProfile(j, false, Program.rootHub); - if (turnOffTemp) - { - turnOffTemp = false; - if (btnStartStop.Text == Properties.Resources.StartText) - { - btnStartStop_Clicked(); - btnStartStop.Text = Properties.Resources.StopText; - } - } - } } + if (bat != null && bat.HasExited && runningBat) { Process.Start("explorer.exe"); bat = null; runningBat = false; } + } - GC.Collect(); + private void CheckAutoProfiles(object sender, EventArgs e) + { + //Check for process for auto profiles + if (string.IsNullOrEmpty(tempProfileProgram)) + { + string windowName = GetTopWindowName().ToLower().Replace('/', '\\'); + for (int i = 0, pathsLen = programpaths.Count; i < pathsLen; i++) + { + string name = programpaths[i].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; + if (btnStartStop.Text == Properties.Resources.StopText) + { + autoProfilesTimer.Stop(); + hotkeysTimer.Stop(); + + this.Invoke((System.Action)(() => { + this.changingService = true; + BtnStartStop_Clicked(); + })); + + while (this.changingService) + { + Thread.SpinWait(500); + } + + this.Invoke((System.Action)(() => + { + hotkeysTimer.Start(); + autoProfilesTimer.Start(); + })); + } + } + + tempProfileProgram = name; + break; + } + } + } + else + { + string windowName = GetTopWindowName().ToLower().Replace('/', '\\'); + if (tempProfileProgram != windowName) + { + tempProfileProgram = string.Empty; + for (int j = 0; j < 4; j++) + LoadProfile(j, false, Program.rootHub); + + if (turnOffTemp) + { + turnOffTemp = false; + if (btnStartStop.Text == Properties.Resources.StartText) + { + this.BeginInvoke((System.Action)(() => + { + BtnStartStop_Clicked(); + })); + } + } + } + } + + //GC.Collect(); } public void LoadP() @@ -553,10 +661,12 @@ namespace DS4Windows programpaths.Clear(); if (!File.Exists(appdatapath + "\\Auto Profiles.xml")) return; + doc.Load(appdatapath + "\\Auto Profiles.xml"); XmlNodeList programslist = doc.SelectNodes("Programs/Program"); foreach (XmlNode x in programslist) programpaths.Add(x.Attributes["path"].Value); + foreach (string s in programpaths) { for (int i = 0; i < 4; i++) @@ -564,6 +674,7 @@ namespace DS4Windows proprofiles[i].Add(doc.SelectSingleNode("/Programs/Program[@path=\"" + s + "\"]" + "/Controller" + (i + 1)).InnerText); } + XmlNode item = doc.SelectSingleNode("/Programs/Program[@path=\"" + s + "\"]" + "/TurnOff"); bool turnOff; @@ -572,46 +683,33 @@ 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() { originalsettingstext = tabSettings.Text; bool deriverinstalled = false; - try + deriverinstalled = Global.IsScpVBusInstalled(); + if (!deriverinstalled) { - ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_PnPSignedDriver"); - - foreach (ManagementObject obj in searcher.Get()) - { - try - { - if (obj.GetPropertyValue("DeviceName").ToString() == "Scp Virtual Bus Driver") - { - deriverinstalled = true; - break; - } - } - catch { } - } - - if (!deriverinstalled) - { - Process p = new Process(); - p.StartInfo.FileName = Assembly.GetExecutingAssembly().Location; - p.StartInfo.Arguments = "driverinstall"; - p.StartInfo.Verb = "runas"; - try { p.Start(); } - catch { } - } - } - catch - { - if (!File.Exists(exepath + "\\Auto Profiles.xml") && !File.Exists(appDataPpath + "\\Auto Profiles.xml")) - { - linkSetup.LinkColor = Color.Green; - tabSettings.Text += " (" + Properties.Resources.InstallDriver + ")"; - } + Process p = new Process(); + p.StartInfo.FileName = Assembly.GetExecutingAssembly().Location; + p.StartInfo.Arguments = "driverinstall"; + p.StartInfo.Verb = "runas"; + try { p.Start(); } + catch { } } } @@ -619,34 +717,39 @@ namespace DS4Windows { FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location); string version = fvi.FileVersion; - string newversion = File.ReadAllText(appdatapath + "\\version.txt"); - if (version.Replace(',', '.').CompareTo(newversion) == -1)//CompareVersions(); - if (MessageBox.Show(Properties.Resources.DownloadVersion.Replace("*number*", newversion), Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) + string newversion = File.ReadAllText(appdatapath + "\\version.txt").Trim(); + if (version.Replace(',', '.').CompareTo(newversion) == -1) + { + if ((DialogResult)this.Invoke(new Func(() => { + return MessageBox.Show(Properties.Resources.DownloadVersion.Replace("*number*", newversion), +Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question); })) == DialogResult.Yes) { 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/{updaterExe}"); 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"); + this.BeginInvoke((System.Action)(() => MessageBox.Show(Properties.Resources.PleaseDownloadUpdater))); + Process.Start($"http://23.239.26.40/ds4windows/files/{updaterExe}"); } } + Process p = new Process(); p.StartInfo.FileName = exepath + "\\DS4Updater.exe"; - if (!cBDownloadLangauge.Checked) - p.StartInfo.Arguments = "-skipLang"; + p.StartInfo.Arguments = "-autolaunch"; if (AdminNeeded()) p.StartInfo.Verb = "runas"; + try { p.Start(); Close(); } catch { } } else File.Delete(appdatapath + "\\version.txt"); + } else File.Delete(appdatapath + "\\version.txt"); } @@ -657,15 +760,18 @@ namespace DS4Windows { profilenames.Clear(); string[] profiles = Directory.GetFiles(appdatapath + @"\Profiles\"); - foreach (String s in profiles) + foreach (string s in profiles) + { if (s.EndsWith(".xml")) profilenames.Add(Path.GetFileNameWithoutExtension(s)); + } + lBProfiles.Items.Clear(); lBProfiles.Items.AddRange(profilenames.ToArray()); if (lBProfiles.Items.Count == 0) { SaveProfile(0, "Default"); - ProfilePath[0] = "Default"; + ProfilePath[0] = OlderProfilePath[0] = "Default"; RefreshProfiles(); return; } @@ -676,12 +782,14 @@ namespace DS4Windows cbs[i].Items.AddRange(profilenames.ToArray()); foreach (string s in profilenames) shortcuts[i].DropDownItems.Add(s); - for (int j = 0; j < cbs[i].Items.Count; j++) + + for (int j = 0, itemCount = cbs[i].Items.Count; j < itemCount; j++) + { if (cbs[i].Items[j].ToString() == Path.GetFileNameWithoutExtension(ProfilePath[i])) { cbs[i].SelectedIndex = j; ((ToolStripMenuItem)shortcuts[i].DropDownItems[j]).Checked = true; - ProfilePath[i] = cbs[i].Text; + ProfilePath[i] = OlderProfilePath[i] = cbs[i].Text; shortcuts[i].Text = Properties.Resources.ContextEdit.Replace("*number*", (i + 1).ToString()); ebns[i].Text = Properties.Resources.EditProfile; break; @@ -692,13 +800,14 @@ namespace DS4Windows shortcuts[i].Text = Properties.Resources.ContextNew.Replace("*number*", (i + 1).ToString()); ebns[i].Text = Properties.Resources.New; } + } } } catch (DirectoryNotFoundException) { Directory.CreateDirectory(appdatapath + @"\Profiles\"); SaveProfile(0, "Default"); - ProfilePath[0] = "Default"; + ProfilePath[0] = OlderProfilePath[0] = "Default"; RefreshProfiles(); return; } @@ -721,21 +830,24 @@ namespace DS4Windows public void RefreshAutoProfilesPage() { tabAutoProfiles.Controls.Clear(); - WP = new WinProgs(profilenames.ToArray(), this); + WinProgs WP = new WinProgs(profilenames.ToArray(), this); WP.TopLevel = false; - WP.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + WP.FormBorderStyle = FormBorderStyle.None; WP.Visible = true; WP.Dock = DockStyle.Fill; tabAutoProfiles.Controls.Add(WP); } + protected void LogDebug(DateTime Time, String Data, bool warning) { - if (lvDebug.InvokeRequired) + if (this.InvokeRequired) { 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 +856,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 +864,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); + } } } @@ -772,60 +898,119 @@ namespace DS4Windows protected void Form_Resize(object sender, EventArgs e) { - if (FormWindowState.Minimized == this.WindowState) + if (FormWindowState.Minimized == WindowState && !MinToTaskbar) { - this.Hide(); - this.ShowInTaskbar = false; - this.FormBorderStyle = FormBorderStyle.None; + Hide(); + ShowInTaskbar = false; + FormBorderStyle = FormBorderStyle.None; } - else if (FormWindowState.Normal == this.WindowState) + else if (FormWindowState.Normal == WindowState && !MinToTaskbar) { //mAllowVisible = true; - this.Show(); - this.ShowInTaskbar = true; - this.FormBorderStyle = FormBorderStyle.Sizable; + Show(); + ShowInTaskbar = true; + FormBorderStyle = FormBorderStyle.Sizable; } + chData.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize); } - protected void btnStartStop_Click(object sender, EventArgs e) + private void BtnStartStop_Click(object sender, EventArgs e) { - btnStartStop_Clicked(); + BtnStartStop_Clicked(); } - public void btnStartStop_Clicked(bool log = true) + + private void ServiceStartup(bool log) + { + var uiContext = SynchronizationContext.Current; + changingService = true; + TaskRunner.Run(() => + { + //Thread.CurrentThread.Priority = ThreadPriority.AboveNormal; + Program.rootHub.Start(uiContext, log); + Invoke((System.Action)(() => { ServiceStartupFinish(); })); + changingService = false; + }); + } + + private void ServiceStartupFinish() + { + if (SwipeProfiles && !hotkeysTimer.Enabled) + { + hotkeysTimer.Start(); + } + + if (programpaths.Count > 0 && !autoProfilesTimer.Enabled) + { + autoProfilesTimer.Start(); + } + + startToolStripMenuItem.Text = btnStartStop.Text = Properties.Resources.StopText; + } + + private void ServiceShutdown(bool log) + { + changingService = true; + TaskRunner.Run(() => + { + Program.rootHub.Stop(log); + Invoke((System.Action)(() => { ServiceShutdownFinish(); })); + changingService = false; + }); + } + + private void ServiceShutdownFinish() + { + hotkeysTimer.Stop(); + autoProfilesTimer.Stop(); + startToolStripMenuItem.Text = btnStartStop.Text = Properties.Resources.StartText; + blankControllerTab(); + populateFullNotifyText(); + } + + public void BtnStartStop_Clicked(bool log = true) { if (btnStartStop.Text == Properties.Resources.StartText) { - Program.rootHub.Start(log); - hotkeysTimer.Start(); - btnStartStop.Text = Properties.Resources.StopText; + ServiceStartup(log); } - else if (btnStartStop.Text == Properties.Resources.StopText) { - Program.rootHub.Stop(log); - hotkeysTimer.Stop(); - btnStartStop.Text = Properties.Resources.StartText; + blankControllerTab(); + ServiceShutdown(log); } - startToolStripMenuItem.Text = btnStartStop.Text; } - protected void btnClear_Click(object sender, EventArgs e) + + protected void BtnClear_Click(object sender, EventArgs e) { lvDebug.Items.Clear(); lbLastMessage.Text = string.Empty; } + private bool inHotPlug = false; + private int hotplugCounter = 0; + private object hotplugCounterLock = new object(); 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(); + lock (hotplugCounterLock) + { + hotplugCounter++; + } + + var uiContext = SynchronizationContext.Current; + if (!inHotPlug) + { + inHotPlug = true; + TaskRunner.Run(() => { Thread.Sleep(1500); InnerHotplug2(uiContext); }); + } } } } @@ -839,77 +1024,282 @@ namespace DS4Windows catch { } } - protected void ControllerStatusChange(object sender, EventArgs e) + private void InnerHotplug2(SynchronizationContext uiContext) { - if (InvokeRequired) - Invoke(new ControllerStatusChangedDelegate(ControllerStatusChange), new object[] { sender, e }); - 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++) + inHotPlug = true; + + bool loopHotplug = false; + lock (hotplugCounterLock) { - Pads[Index].Text = Program.rootHub.getDS4MacAddress(Index); - DS4Device d = Program.rootHub.DS4Controllers[Index]; - if (QuickCharge && d?.ConnectionType == ConnectionType.BT && (bool)d?.Charging) + loopHotplug = hotplugCounter > 0; + } + + while (loopHotplug == true) + { + Program.rootHub.HotPlug(uiContext); + //TaskRunner.Run(() => { Program.rootHub.HotPlug(uiContext); }); + lock (hotplugCounterLock) { - d.DisconnectBT(); - return; + hotplugCounter--; + loopHotplug = hotplugCounter > 0; } - switch (Program.rootHub.getDS4Status(Index)) + } + + inHotPlug = false; + } + + protected void BatteryStatusUpdate(object sender, BatteryReportArgs args) + { + string battery; + int level = args.getLevel(); + bool charging = args.isCharging(); + int Index = args.getIndex(); + if (charging) + { + if (level >= 100) + battery = Properties.Resources.Full; + else + battery = level + "%+"; + } + else + { + battery = level + "%"; + } + + Batteries[args.getIndex()].Text = battery; + + // Update device battery level display for tray icon + generateDeviceNotifyText(args.getIndex()); + populateNotifyText(); + } + + protected void populateFullNotifyText() + { + for (int i = 0; i < ControlService.DS4_CONTROLLER_COUNT; i++) + { + string temp = Program.rootHub.getShortDS4ControllerInfo(i); + if (temp != Properties.Resources.NoneText) { - 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) - { - SendKeys.Send("A"); - runningBat = false; - } - Pads[Index].Enabled = true; - nocontrollers = false; - if (Pads[Index].Text != Properties.Resources.Connecting) - { - Enable_Controls(Index, true); - //if (opt != null) - // if (opt.Visible && tabMain.SelectedIndex == 1) - //opt.inputtimer.Start(); - //MinimumSize = new Size(MinimumSize.Width, 137 + 29 * Index); - } - else - opt.inputtimer.Stop(); + notifyText[i + 1] = (i + 1) + ": " + temp; // Carefully stay under the 63 character limit. } else { - Pads[Index].Text = Properties.Resources.Disconnected; - Enable_Controls(Index, false); + notifyText[i + 1] = string.Empty; } - //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; + + populateNotifyText(); + } + + protected void generateDeviceNotifyText(int index) + { + string temp = Program.rootHub.getShortDS4ControllerInfo(index); + if (temp != Properties.Resources.NoneText) + { + notifyText[index + 1] = (index + 1) + ": " + temp; // Carefully stay under the 63 character limit. + } + else + { + notifyText[index + 1] = string.Empty; + } + } + + protected void populateNotifyText() + { + string tooltip = notifyText[0]; + for (int i = 1; i < 5; i++) + { + string temp = notifyText[i]; + if (!string.IsNullOrEmpty(temp)) + { + tooltip += "\n" + notifyText[i]; // Carefully stay under the 63 character limit. + } + } + if (tooltip.Length > 63) notifyIcon1.Text = tooltip.Substring(0, 63); else notifyIcon1.Text = tooltip; } + protected void DeviceSerialChanged(object sender, SerialChangeArgs args) + { + if (this.InvokeRequired) + { + DeviceSerialChangedDelegate d = new DeviceSerialChangedDelegate(DeviceSerialChanged); + this.BeginInvoke(d, new object[] { sender, args }); + } + else + { + int devIndex = args.getIndex(); + string serial = args.getSerial(); + DS4Device device = (devIndex >= 0 && devIndex < ControlService.DS4_CONTROLLER_COUNT) ? + Program.rootHub.DS4Controllers[devIndex] : null; + if (device != null) + { + Pads[devIndex].Text = serial; + if (device.isSynced()) + { + linkedProfileCB[devIndex].Enabled = true; + } + else + { + linkedProfileCB[devIndex].Enabled = false; + } + + if (device.isValidSerial() && containsLinkedProfile(device.getMacAddress())) + { + ProfilePath[devIndex] = getLinkedProfile(device.getMacAddress()); + int profileIndex = cbs[devIndex].FindString(ProfilePath[devIndex]); + if (profileIndex >= 0) + { + cbs[devIndex].SelectedIndex = profileIndex; + } + } + else + { + ProfilePath[devIndex] = OlderProfilePath[devIndex]; + } + + linkedProfileCB[devIndex].Checked = false; + } + } + } + + 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); + + linkedProfileCB[Index].CheckedChanged -= linkCB_CheckedChanged; + if (DS4Device.isValidSerial(Pads[Index].Text)) + { + linkedProfileCB[Index].Checked = containsLinkedProfile(Pads[Index].Text); + linkedProfileCB[Index].Enabled = true; + } + else + { + linkedProfileCB[Index].Checked = false; + linkedProfileCB[Index].Enabled = false; + } + + linkedProfileCB[Index].CheckedChanged += linkCB_CheckedChanged; + + 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); + int profileIndex = cbs[Index].FindString(ProfilePath[Index]); + if (profileIndex >= 0) + { + cbs[Index].SelectedValueChanged -= Profile_Changed; + cbs[Index].SelectedIndex = profileIndex; + cbs[Index].SelectedValueChanged += Profile_Changed; + } + + if (UseCustomLed[Index]) + lights[Index].BackColor = CustomColor[Index].ToColorA; + else + lights[Index].BackColor = MainColor[Index].ToColorA; + + 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); + } + + generateDeviceNotifyText(Index); + populateNotifyText(); + } + + lbNoControllers.Visible = nocontrollers; + tLPControllers.Visible = !nocontrollers; + } + } + + protected void ControllerRemovedChange(object sender, ControllerRemovedArgs args) + { + 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; + + // Update device battery level display for tray icon + generateDeviceNotifyText(devIndex); + populateNotifyText(); + } + private void pBStatus_MouseClick(object sender, MouseEventArgs e) { - 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(); + int i = Convert.ToInt32(((PictureBox)sender).Tag); + DS4Device d = Program.rootHub.DS4Controllers[i]; + if (d != null) + { + if (e.Button == MouseButtons.Right && Program.rootHub.getDS4Status(i) == "BT" && !d.Charging) + { + d.DisconnectBT(); + } + else if (e.Button == MouseButtons.Right && + Program.rootHub.getDS4Status(i) == "SONYWA" && !d.Charging) + { + d.DisconnectDongle(); + } + } } private void Enable_Controls(int device, bool on) @@ -920,24 +1310,16 @@ namespace DS4Windows cbs[device].Visible = on; shortcuts[device].Visible = on; Batteries[device].Visible = on; - } - - void ScpForm_Report(object sender, EventArgs e) - { - if (InvokeRequired) - Invoke(new HotKeysDelegate(Hotkeys), new object[] { sender, e }); - else - Hotkeys(sender, e); + linkedProfileCB[device].Visible = on; + disconnectShortcuts[device].Visible = on && + Program.rootHub.DS4Controllers[device].ConnectionType != ConnectionType.USB; } protected void On_Debug(object sender, DebugEventArgs e) { - //logWriter.WriteLine(e.Time + ":\t" + e.Data); - //logWriter.Flush(); LogDebug(e.Time, e.Data, e.Warning); } - private void lBProfiles_MouseDoubleClick(object sender, MouseEventArgs e) { if (lBProfiles.SelectedIndex >= 0) @@ -947,16 +1329,15 @@ namespace DS4Windows private void lBProfiles_KeyDown(object sender, KeyEventArgs e) { - if (lBProfiles.SelectedIndex >= 0 && !opt.Visible) + if (lBProfiles.SelectedIndex >= 0 && optPop && !opt.Visible) { if (e.KeyValue == 13) ShowOptions(4, lBProfiles.SelectedItem.ToString()); - if (e.KeyValue == 46) + else if (e.KeyValue == 46) tsBDeleteProfle_Click(this, e); - if (e.KeyValue == 68 && e.Modifiers == Keys.Control) + else if (e.KeyValue == 68 && e.Modifiers == Keys.Control) tSBDupProfile_Click(this, e); } - } private void assignToController1ToolStripMenuItem_Click(object sender, EventArgs e) @@ -984,7 +1365,6 @@ namespace DS4Windows ShowOptions(4, ""); } - private void tsBNEditProfile_Click(object sender, EventArgs e) { if (lBProfiles.SelectedIndex >= 0) @@ -996,9 +1376,11 @@ namespace DS4Windows if (lBProfiles.SelectedIndex >= 0) { string filename = lBProfiles.SelectedItem.ToString(); - if (MessageBox.Show(Properties.Resources.ProfileCannotRestore.Replace("*Profile name*", "\"" + filename + "\""), Properties.Resources.DeleteProfile, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) + if (MessageBox.Show(Properties.Resources.ProfileCannotRestore.Replace("*Profile name*", "\"" + filename + "\""), + Properties.Resources.DeleteProfile, + MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { - System.IO.File.Delete(appdatapath + @"\Profiles\" + filename + ".xml"); + File.Delete(appdatapath + @"\Profiles\" + filename + ".xml"); RefreshProfiles(); } } @@ -1014,7 +1396,7 @@ namespace DS4Windows MTB.TopLevel = false; MTB.Dock = DockStyle.Top; MTB.Visible = true; - MTB.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + MTB.FormBorderStyle = FormBorderStyle.None; tabProfiles.Controls.Add(MTB); lBProfiles.SendToBack(); toolStrip1.SendToBack(); @@ -1024,19 +1406,19 @@ namespace DS4Windows } } - - private void tSBImportProfile_Click(object sender, EventArgs e) { if (appdatapath == Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName) openProfiles.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\DS4Tool" + @"\Profiles\"; else openProfiles.InitialDirectory = Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName + @"\Profiles\"; - if (openProfiles.ShowDialog() == System.Windows.Forms.DialogResult.OK) + + if (openProfiles.ShowDialog() == DialogResult.OK) { string[] files = openProfiles.FileNames; - for (int i = 0; i < files.Length; i++) + for (int i = 0, arlen = files.Length; i < arlen; i++) File.Copy(openProfiles.FileNames[i], appdatapath + "\\Profiles\\" + Path.GetFileName(files[i]), true); + RefreshProfiles(); } } @@ -1047,21 +1429,24 @@ namespace DS4Windows { Stream stream; Stream profile = new StreamReader(appdatapath + "\\Profiles\\" + lBProfiles.SelectedItem.ToString() + ".xml").BaseStream; - if (saveProfiles.ShowDialog() == System.Windows.Forms.DialogResult.OK) + if (saveProfiles.ShowDialog() == 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(); + + lBProfiles.Visible = false; + WindowState = FormWindowState.Normal; toolStrip1.Enabled = false; tSOptions.Visible = true; @@ -1070,26 +1455,41 @@ namespace DS4Windows tSTBProfile.Text = profile; else tSTBProfile.Text = "<" + Properties.Resources.TypeProfileName + ">"; - //opt = new Options(devID, profile, this); - lBProfiles.SendToBack(); - toolStrip1.SendToBack(); - tSOptions.SendToBack(); + + opt = new Options(this); + opt.Icon = this.Icon; + opt.TopLevel = false; + opt.Dock = DockStyle.Fill; + opt.FormBorderStyle = FormBorderStyle.None; + tabProfiles.Controls.Add(opt); + optPop = true; + //opt.Dock = DockStyle.Fill; + //lBProfiles.SendToBack(); + //toolStrip1.SendToBack(); + //tSOptions.SendToBack(); opt.BringToFront(); oldsize = Size; { if (Size.Height < (int)(90 * dpiy) + Options.mSize.Height) - Size = new System.Drawing.Size(Size.Width, (int)(90 * dpiy) + Options.mSize.Height); + Size = new Size(Size.Width, (int)(90 * dpiy) + Options.mSize.Height); + if (Size.Width < (int)(20 * dpix) + Options.mSize.Width) - Size = new System.Drawing.Size((int)(20 * dpix) + Options.mSize.Width, Size.Height); + Size = new Size((int)(20 * dpix) + Options.mSize.Width, Size.Height); } - tabMain.SelectedIndex = 1; + opt.Reload(devID, profile); + opt.inputtimer.Start(); opt.Visible = true; + tabMain.SelectedIndex = 1; } public void OptionsClosed() { RefreshProfiles(); + + if (!lbNoControllers.Visible) + tabMain.SelectedIndex = 0; + Size = oldsize; oldsize = new Size(0, 0); tSBKeepSize.Text = Properties.Resources.KeepThisSize; @@ -1099,53 +1499,101 @@ 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; + } + + opt.inputtimer.Stop(); + opt.sixaxisTimer.Stop(); + opt.Dock = DockStyle.None; + tabProfiles.Controls.Remove(opt); + opt.Dispose(); + optPop = false; + + lBProfiles.Visible = true; } + private void editButtons_Click(object sender, EventArgs e) { Button bn = (Button)sender; - int i = Int32.Parse(bn.Tag.ToString()); - if (cbs[i].Text == "(" + Properties.Resources.NoProfileLoaded + ")") - ShowOptions(i, ""); + //int i = Int32.Parse(bn.Tag.ToString()); + int i = Convert.ToInt32(bn.Tag); + string profileText = cbs[i].Text; + if (profileText != "(" + Properties.Resources.NoProfileLoaded + ")") + ShowOptions(i, profileText); else - ShowOptions(i, cbs[i].Text); + ShowOptions(i, ""); } private void editMenu_Click(object sender, EventArgs e) { mAllowVisible = true; - this.Show(); + Show(); WindowState = FormWindowState.Normal; ToolStripMenuItem em = (ToolStripMenuItem)sender; - int i = Int32.Parse(em.Tag.ToString()); + int i = Convert.ToInt32(em.Tag); if (em.Text == Properties.Resources.ContextNew.Replace("*number*", (i + 1).ToString())) ShowOptions(i, ""); else - for (int t = 0; t < em.DropDownItems.Count - 2; t++) + { + for (int t = 0, itemCount = em.DropDownItems.Count - 2; t < itemCount; t++) + { if (((ToolStripMenuItem)em.DropDownItems[t]).Checked) ShowOptions(i, ((ToolStripMenuItem)em.DropDownItems[t]).Text); + } + } } private void lnkControllers_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { - System.Diagnostics.Process.Start("control", "joy.cpl"); + Process.Start("control", "joy.cpl"); } private void hideDS4CheckBox_CheckedChanged(object sender, EventArgs e) { // 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) + Process[] rundll64 = Process.GetProcessesByName("rundll64"); + foreach (Process rundll64Instance in rundll64) + { + foreach (ProcessModule module in rundll64Instance.Modules) + { if (module.FileName.Contains("joy.cpl")) module.Dispose(); + } + } - UseExclusiveMode = hideDS4CheckBox.Checked; - if (Environment.OSVersion.Version.Major >= 10 && Environment.OSVersion.Version.Build < 10586) - btnConnectDS4Win10.Visible = hideDS4CheckBox.Checked; - btnStartStop_Clicked(false); - btnStartStop_Clicked(false); + bool exclusiveMode = hideDS4CheckBox.Checked; + UseExclusiveMode = exclusiveMode; + + hideDS4CheckBox.Enabled = false; Save(); + BtnStartStop_Clicked(false); + finishHideDS4Check(); + } + + private async void finishHideDS4Check() + { + await TaskRunner.Factory.StartNew(() => + { + while (changingService) + { + Thread.Sleep(10); + } + }); + + BtnStartStop_Clicked(false); + + await TaskRunner.Factory.StartNew(() => + { + while (changingService) + { + Thread.Sleep(10); + } + }); + + hideDS4CheckBox.Enabled = true; } private void startMinimizedCheckBox_CheckedChanged(object sender, EventArgs e) @@ -1162,14 +1610,17 @@ namespace DS4Windows private void Profile_Changed(object sender, EventArgs e) //cbs[i] changed { ComboBox cb = (ComboBox)sender; - int tdevice = Int32.Parse(cb.Tag.ToString()); + int tdevice = Convert.ToInt32(cb.Tag); if (cb.Items[cb.Items.Count - 1].ToString() == "+" + Properties.Resources.PlusNewProfile) { if (cb.SelectedIndex < cb.Items.Count - 1) { - for (int i = 0; i < shortcuts[tdevice].DropDownItems.Count; i++) + for (int i = 0, arlen = shortcuts[tdevice].DropDownItems.Count; i < arlen; i++) + { if (!(shortcuts[tdevice].DropDownItems[i] is ToolStripSeparator)) ((ToolStripMenuItem)shortcuts[tdevice].DropDownItems[i]).Checked = false; + } + ((ToolStripMenuItem)shortcuts[tdevice].DropDownItems[cb.SelectedIndex]).Checked = true; LogDebug(DateTime.Now, Properties.Resources.UsingProfile.Replace("*number*", (tdevice + 1).ToString()).Replace("*Profile name*", cb.Text), false); shortcuts[tdevice].Text = Properties.Resources.ContextEdit.Replace("*number*", (tdevice + 1).ToString()); @@ -1180,57 +1631,77 @@ namespace DS4Windows lights[tdevice].BackColor = CustomColor[tdevice].ToColorA; else lights[tdevice].BackColor = MainColor[tdevice].ToColorA; + + if (linkedProfileCB[tdevice].Checked) + { + DS4Device device = Program.rootHub.DS4Controllers[tdevice]; + if (device != null && device.isValidSerial()) + { + changeLinkedProfile(device.getMacAddress(), ProfilePath[tdevice]); + SaveLinkedProfiles(); + } + } + else + { + OlderProfilePath[tdevice] = ProfilePath[tdevice]; + } } else if (cb.SelectedIndex == cb.Items.Count - 1 && cb.Items.Count > 1) //if +New Profile selected ShowOptions(tdevice, ""); + if (cb.Text == "(" + Properties.Resources.NoProfileLoaded + ")") ebns[tdevice].Text = Properties.Resources.New; 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 } private void Profile_Changed_Menu(object sender, ToolStripItemClickedEventArgs e) { ToolStripMenuItem tS = (ToolStripMenuItem)sender; - int tdevice = Int32.Parse(tS.Tag.ToString()); + int tdevice = Convert.ToInt32(tS.Tag); 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) { contextclose = true; - this.Close(); + Close(); } private void openToolStripMenuItem_Click(object sender, EventArgs e) { mAllowVisible = true; - this.Show(); + Show(); Focus(); WindowState = FormWindowState.Normal; } private void startToolStripMenuItem_Click(object sender, EventArgs e) { - btnStartStop_Clicked(); + BtnStartStop_Clicked(); } + private void notifyIcon1_MouseClick(object sender, MouseEventArgs e) { - if (e.Button == System.Windows.Forms.MouseButtons.Middle) + if (e.Button == MouseButtons.Middle) { contextclose = true; - this.Close(); + Close(); } } + private void notifyIcon1_BalloonTipClicked(object sender, EventArgs e) { - this.Show(); + Show(); WindowState = FormWindowState.Normal; } @@ -1244,17 +1715,36 @@ 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() { - Type t = Type.GetTypeFromCLSID(new Guid("72C24DD5-D70A-438B-8A42-98424B88AFB8")); //Windows Script Host Shell Object + Type t = Type.GetTypeFromCLSID(new Guid("72C24DD5-D70A-438B-8A42-98424B88AFB8")); // Windows Script Host Shell Object dynamic shell = Activator.CreateInstance(t); try { @@ -1263,7 +1753,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(); } @@ -1280,50 +1781,33 @@ namespace DS4Windows private void tabMain_SelectedIndexChanged(object sender, EventArgs e) { - lbLastMessage.Visible = tabMain.SelectedTab != tabLog; - if (tabMain.SelectedTab == tabLog) + TabPage currentTab = tabMain.SelectedTab; + lbLastMessage.Visible = currentTab != tabLog; + if (currentTab == tabLog) chData.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize); - if (tabMain.SelectedTab == tabSettings) + + if (currentTab == tabSettings) { lbLastMessage.ForeColor = SystemColors.GrayText; lbLastMessage.Text = Properties.Resources.HoverOverItems; - foreach (System.Windows.Forms.Control control in fLPSettings.Controls) - { - if (control.HasChildren) - foreach (System.Windows.Forms.Control ctrl in control.Controls) - ctrl.MouseHover += Items_MouseHover; - control.MouseHover += Items_MouseHover; - } } else if (lvDebug.Items.Count > 0) - lbLastMessage.Text = lbLastMessage.Text = lvDebug.Items[lvDebug.Items.Count - 1].SubItems[1].Text; + lbLastMessage.Text = lvDebug.Items[lvDebug.Items.Count - 1].SubItems[1].Text; else lbLastMessage.Text = ""; - - 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)) { - - //if (File.Exists(appdatapath + "\\Auto Profiles.xml")) - case "linkUninstall": lbLastMessage.Text = Properties.Resources.IfRemovingDS4Windows; break; - case "cBSwipeProfiles": lbLastMessage.Text = Properties.Resources.TwoFingerSwipe; break; - case "cBQuickCharge": lbLastMessage.Text = Properties.Resources.QuickCharge; break; - case "pnlXIPorts": lbLastMessage.Text = Properties.Resources.XinputPorts; break; - case "lbUseXIPorts": lbLastMessage.Text = Properties.Resources.XinputPorts; break; - case "nUDXIPorts": lbLastMessage.Text = Properties.Resources.XinputPorts; break; - case "lbLastXIPort": lbLastMessage.Text = Properties.Resources.XinputPorts; break; - case "cBCloseMini": lbLastMessage.Text = Properties.Resources.CloseMinimize; break; - default: lbLastMessage.Text = Properties.Resources.HoverOverItems; break; + hoverText = temp; } - if (lbLastMessage.Text != Properties.Resources.HoverOverItems) + + lbLastMessage.Text = hoverText; + if (hoverText != Properties.Resources.HoverOverItems) lbLastMessage.ForeColor = Color.Black; else lbLastMessage.ForeColor = SystemColors.GrayText; @@ -1332,7 +1816,7 @@ namespace DS4Windows private void lBProfiles_MouseDown(object sender, MouseEventArgs e) { lBProfiles.SelectedIndex = lBProfiles.IndexFromPoint(e.X, e.Y); - if (e.Button == System.Windows.Forms.MouseButtons.Right) + if (e.Button == MouseButtons.Right) { if (lBProfiles.SelectedIndex < 0) { @@ -1357,6 +1841,7 @@ namespace DS4Windows assignToController2ToolStripMenuItem, assignToController3ToolStripMenuItem, assignToController4ToolStripMenuItem }; + for (int i = 0; i < 4; i++) { if (lBProfiles.SelectedIndex == cbs[i].SelectedIndex) @@ -1364,6 +1849,7 @@ namespace DS4Windows else assigns[i].Checked = false; } + deleteToolStripMenuItem.Visible = true; editToolStripMenuItem.Visible = true; duplicateToolStripMenuItem.Visible = true; @@ -1377,11 +1863,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(); } @@ -1394,14 +1883,17 @@ namespace DS4Windows e.Effect = DragDropEffects.None; // Unknown data, ignore it } - - private void tBProfile_TextChanged(object sender, EventArgs e) { - 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("|")) - tSTBProfile.ForeColor = System.Drawing.SystemColors.WindowText; + 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("|")) + tSTBProfile.ForeColor = SystemColors.WindowText; else - tSTBProfile.ForeColor = System.Drawing.SystemColors.GrayText; + tSTBProfile.ForeColor = SystemColors.GrayText; } private void tBProfile_Enter(object sender, EventArgs e) @@ -1418,22 +1910,28 @@ namespace DS4Windows private void tSBCancel_Click(object sender, EventArgs e) { - if (opt.Visible) + if (optPop && opt.Visible) opt.Close(); } private void tSBSaveProfile_Click(object sender, EventArgs e) { - if (opt.Visible) + if (optPop && opt.Visible) { opt.saving = true; opt.Set(); - 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("|")) + 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(); } @@ -1467,44 +1965,53 @@ namespace DS4Windows private void nUDUpdateTime_ValueChanged(object sender, EventArgs e) { - if (cBUpdateTime.SelectedIndex == 0) + int currentIndex = cBUpdateTime.SelectedIndex; + if (currentIndex == 0) CheckWhen = (int)nUDUpdateTime.Value; - else if (cBUpdateTime.SelectedIndex == 1) + else if (currentIndex == 1) CheckWhen = (int)nUDUpdateTime.Value * 24; + if (nUDUpdateTime.Value < 1) cBUpdate.Checked = false; + if (nUDUpdateTime.Value == 1) { - int index = cBUpdateTime.SelectedIndex; + int index = currentIndex; + cBUpdateTime.BeginUpdate(); cBUpdateTime.Items.Clear(); cBUpdateTime.Items.Add(Properties.Resources.Hour); cBUpdateTime.Items.Add(Properties.Resources.Day); cBUpdateTime.SelectedIndex = index; + cBUpdateTime.EndUpdate(); } else if (cBUpdateTime.Items[0].ToString() == Properties.Resources.Hour) { - int index = cBUpdateTime.SelectedIndex; + int index = currentIndex; + cBUpdateTime.BeginUpdate(); cBUpdateTime.Items.Clear(); cBUpdateTime.Items.Add(Properties.Resources.Hours); cBUpdateTime.Items.Add(Properties.Resources.Days); cBUpdateTime.SelectedIndex = index; + cBUpdateTime.EndUpdate(); } } private void cBUpdateTime_SelectedIndexChanged(object sender, EventArgs e) { - if (cBUpdateTime.SelectedIndex == 0) + int index = cBUpdateTime.SelectedIndex; + if (index == 0) CheckWhen = (int)nUDUpdateTime.Value; - else if (cBUpdateTime.SelectedIndex == 1) + else if (index == 1) CheckWhen = (int)nUDUpdateTime.Value * 24; } 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 + // Sorry other devs, gonna have to find your own server + Uri url = new Uri("http://23.239.26.40/ds4windows/files/builds/newest.txt"); WebClient wct = new WebClient(); wct.DownloadFileAsync(url, appdatapath + "\\version.txt"); - wct.DownloadFileCompleted += wct_DownloadFileCompleted; + wct.DownloadFileCompleted += (sender2, e2) => TaskRunner.Run(() => wct_DownloadFileCompleted(sender2, e2)); } private void cBDisconnectBT_CheckedChanged(object sender, EventArgs e) @@ -1517,56 +2024,60 @@ namespace DS4Windows LastChecked = DateTime.Now; FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location); string version2 = fvi.FileVersion; - string newversion2 = File.ReadAllText(appdatapath + "\\version.txt"); - if (version2.Replace(',', '.').CompareTo(File.ReadAllText(appdatapath + "\\version.txt")) == -1)//CompareVersions(); - if (MessageBox.Show(Properties.Resources.DownloadVersion.Replace("*number*", newversion2), Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) + string newversion2 = File.ReadAllText(appdatapath + "\\version.txt").Trim(); + if (version2.Replace(',', '.').CompareTo(newversion2) == -1) + { + if ((DialogResult)this.Invoke(new Func(() => + { + return MessageBox.Show(Properties.Resources.DownloadVersion.Replace("*number*", newversion2), + Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question); + })) == DialogResult.Yes) { if (!File.Exists(exepath + "\\DS4Updater.exe") || (File.Exists(exepath + "\\DS4Updater.exe") - && (FileVersionInfo.GetVersionInfo(exepath + "\\DS4Updater.exe").FileVersion.CompareTo("1.1.0.0") == -1))) + && (FileVersionInfo.GetVersionInfo(exepath + "\\DS4Updater.exe").FileVersion.CompareTo(UPDATER_VERSION) == -1))) { - Uri url2 = new Uri("http://ds4windows.com/Files/DS4Updater.exe"); + Uri url2 = new Uri($"http://23.239.26.40/ds4windows/files/{updaterExe}"); 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"); + this.BeginInvoke((System.Action)(() => MessageBox.Show(Properties.Resources.PleaseDownloadUpdater))); + Process.Start($"http://23.239.26.40/ds4windows/files/{updaterExe}"); } } + Process p = new Process(); p.StartInfo.FileName = exepath + "\\DS4Updater.exe"; - if (!cBDownloadLangauge.Checked) - p.StartInfo.Arguments = "-skipLang"; + p.StartInfo.Arguments = "-autolaunch"; if (AdminNeeded()) p.StartInfo.Verb = "runas"; + try { p.Start(); Close(); } catch { } } else File.Delete(appdatapath + "\\version.txt"); + } else { File.Delete(appdatapath + "\\version.txt"); - MessageBox.Show(Properties.Resources.UpToDate, "DS4Windows Updater"); + this.BeginInvoke((System.Action)(() => MessageBox.Show(Properties.Resources.UpToDate, "DS4Windows Updater"))); } } private void linkProfiles_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { - System.Diagnostics.Process.Start(appdatapath + "\\Profiles"); + Process.Start(appdatapath + "\\Profiles"); } private void linkUninstall_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { if (File.Exists(appdatapath + "\\Virtual Bus Driver\\ScpDriver.exe")) - try { System.Diagnostics.Process.Start(appdatapath + "\\Virtual Bus Driver\\ScpDriver.exe"); } - catch { System.Diagnostics.Process.Start(appdatapath + "\\Virtual Bus Driver"); } - } - - private void cBNotifications_CheckedChanged(object sender, EventArgs e) - { - //Notifications = cBNotifications.Checked; + { + try { Process.Start(appdatapath + "\\Virtual Bus Driver\\ScpDriver.exe"); } + catch { Process.Start(appdatapath + "\\Virtual Bus Driver"); } + } } private void cBoxNotifications_SelectedIndexChanged(object sender, EventArgs e) @@ -1588,20 +2099,47 @@ namespace DS4Windows linkSetup.LinkColor = Color.Blue; } + bool tempBool = false; protected void ScpForm_Closing(object sender, FormClosingEventArgs e) { - if (opt.Visible) + if (opt != null && opt.Visible) { opt.Close(); e.Cancel = true; return; } - if (cBCloseMini.Checked && !contextclose) + + bool closeMini = tempBool = cBCloseMini.Checked; + bool userClosing = e.CloseReason == CloseReason.UserClosing; + DS4Device d = null; + bool nocontrollers = tempBool = true; + //in case user accidentally clicks on the close button whilst "Close Minimizes" checkbox is unchecked + if (userClosing && !closeMini && !contextclose) { - this.WindowState = FormWindowState.Minimized; + for (int i = 0, PadsLen = Pads.Length; tempBool && i < PadsLen; i++) + { + d = Program.rootHub.DS4Controllers[i]; + tempBool = (d != null) ? false : tempBool; + } + + nocontrollers = tempBool; + if (!nocontrollers) + { + if (MessageBox.Show(Properties.Resources.CloseConfirm, Properties.Resources.Confirm, + MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + { + e.Cancel = true; + return; + } + } + } + else if (userClosing && closeMini && !contextclose) + { + WindowState = FormWindowState.Minimized; e.Cancel = true; return; } + if (systemShutdown) // Reset the variable because the user might cancel the // shutdown. @@ -1609,7 +2147,8 @@ namespace DS4Windows systemShutdown = false; DS4LightBar.shuttingdown = true; } - if (oldsize == new System.Drawing.Size(0, 0)) + + if (oldsize == new Size(0, 0)) { FormWidth = this.Width; FormHeight = this.Height; @@ -1619,16 +2158,34 @@ namespace DS4Windows FormWidth = oldsize.Width; FormHeight = oldsize.Height; } - if (!String.IsNullOrEmpty(appdatapath)) + + FormLocationX = Location.X > 0 ? Location.X : 0; + FormLocationY = Location.Y > 0 ? Location.Y : 0; + + if (!string.IsNullOrEmpty(appdatapath)) { Save(); + blankControllerTab(); Program.rootHub.Stop(); } + + // Make sure to stop event generation routines. Should fix odd crashes on shutdown + Application.Exit(); } 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) @@ -1646,21 +2203,12 @@ namespace DS4Windows toolTip1.Hide(lbLastMessage); } - private void pnlXIPorts_MouseEnter(object sender, EventArgs e) - { - //oldxiport = (int)Math.Round(nUDXIPorts.Value,0); - } - int oldxiport; - private void pnlXIPorts_MouseLeave(object sender, EventArgs e) - { - - } - private void nUDXIPorts_ValueChanged(object sender, EventArgs e) { lbLastXIPort.Text = "- " + ((int)Math.Round(nUDXIPorts.Value, 0) + 3); } + private int oldxiport; private void nUDXIPorts_Leave(object sender, EventArgs e) { if (oldxiport != (int)Math.Round(nUDXIPorts.Value, 0)) @@ -1668,8 +2216,8 @@ namespace DS4Windows oldxiport = (int)Math.Round(nUDXIPorts.Value, 0); FirstXinputPort = oldxiport; Program.rootHub.x360Bus.FirstController = oldxiport; - btnStartStop_Click(sender, e); - btnStartStop_Click(sender, e); + BtnStartStop_Clicked(false); + finishHideDS4Check(); } } @@ -1686,43 +2234,32 @@ namespace DS4Windows private void Pads_MouseHover(object sender, EventArgs e) { Label lb = (Label)sender; - int i = Int32.Parse(lb.Tag.ToString()); - if (Program.rootHub.DS4Controllers[i] != null && Program.rootHub.DS4Controllers[i].ConnectionType == ConnectionType.BT) + int i = Convert.ToInt32(lb.Tag); + DS4Device d = Program.rootHub.DS4Controllers[i]; + if (d != null) { - double latency = Program.rootHub.DS4Controllers[i].Latency; + double latency = d.Latency; toolTip1.Hide(Pads[i]); 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) - { - if (!runningBat) - { - StreamWriter w = new StreamWriter(exepath + "\\ConnectDS4.bat"); - w.WriteLine("@echo off"); // Turn off echo - w.WriteLine("taskkill /IM explorer.exe /f"); - w.WriteLine("echo Connect your DS4 controller"); // - w.WriteLine("pause"); - w.WriteLine("start explorer.exe"); - w.Close(); - runningBat = true; - bat = Process.Start(exepath + "\\ConnectDS4.bat"); - } - } + int currentCustomLed; private void EditCustomLed(object sender, EventArgs e) { - currentCustomLed = int.Parse(((Button)sender).Tag.ToString()); - useCustomColorToolStripMenuItem.Checked = UseCustomLed[currentCustomLed]; - useProfileColorToolStripMenuItem.Checked = !UseCustomLed[currentCustomLed]; - cMCustomLed.Show((Button)sender, new Point(0, ((Button)sender).Height)); + Button btn = (Button)sender; + currentCustomLed = Convert.ToInt32(btn.Tag); + bool customLedChecked = UseCustomLed[currentCustomLed]; + useCustomColorToolStripMenuItem.Checked = customLedChecked; + useProfileColorToolStripMenuItem.Checked = !customLedChecked; + cMCustomLed.Show(btn, new Point(0, btn.Height)); } private void useProfileColorToolStripMenuItem_Click(object sender, EventArgs e) @@ -1735,6 +2272,10 @@ namespace DS4Windows private void useCustomColorToolStripMenuItem_Click(object sender, EventArgs e) { advColorDialog.Color = CustomColor[currentCustomLed].ToColor; + AdvancedColorDialog.ColorUpdateHandler tempDel = + new AdvancedColorDialog.ColorUpdateHandler(advColor_CustomColorUpdate); + + advColorDialog.OnUpdateColor += tempDel; if (advColorDialog.ShowDialog() == DialogResult.OK) { lights[currentCustomLed].BackColor = new DS4Color(advColorDialog.Color).ToColorA; @@ -1742,10 +2283,24 @@ namespace DS4Windows UseCustomLed[currentCustomLed] = true; Global.Save(); } + + advColorDialog.OnUpdateColor -= tempDel; DS4LightBar.forcedFlash[currentCustomLed] = 0; DS4LightBar.forcelight[currentCustomLed] = false; } + private void advColor_CustomColorUpdate(object sender, EventArgs e) + { + if (sender is Color && currentCustomLed < 4) + { + Color color = (Color)sender; + DS4Color dcolor = new DS4Color { red = color.R, green = color.G, blue = color.B }; + DS4LightBar.forcedColor[currentCustomLed] = dcolor; + DS4LightBar.forcedFlash[currentCustomLed] = 0; + DS4LightBar.forcelight[currentCustomLed] = true; + } + } + private void cBUseWhiteIcon_CheckedChanged(object sender, EventArgs e) { UseWhiteIcon = cBUseWhiteIcon.Checked; @@ -1765,9 +2320,228 @@ namespace DS4Windows } } - private void cBDownloadLangauge_CheckedChanged(object sender, EventArgs e) + private void lBProfiles_SelectedIndexChanged(object sender, EventArgs e) { - DownloadLang = cBDownloadLangauge.Checked; + 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 = true; + 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(); + 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(); + Task tasker = ts.FindTask("RunDS4Windows"); + if (tasker != null) + { + ts.RootFolder.DeleteTask("RunDS4Windows"); + } + } + } + } + + private void linkCB_CheckedChanged(object sender, EventArgs e) + { + CheckBox linkCb = (CheckBox)sender; + int i = Convert.ToInt32(linkCb.Tag); + bool check = linkCb.Checked; + Global.linkedProfileCheck[i] = check; + DS4Device device = Program.rootHub.DS4Controllers[i]; + if (device != null && device.isSynced()) + { + if (check) + { + if (device.isValidSerial()) + { + changeLinkedProfile(device.getMacAddress(), ProfilePath[i]); + } + } + else + { + removeLinkedProfile(device.getMacAddress()); + ProfilePath[i] = OlderProfilePath[i]; + int profileIndex = cbs[i].FindString(ProfilePath[i]); + if (profileIndex >= 0) + { + cbs[i].SelectedIndex = profileIndex; + } + } + + SaveLinkedProfiles(); + } + } + + private void exportLogTxtBtn_Click(object sender, EventArgs e) + { + SaveFileDialog dialog = new SaveFileDialog(); + dialog.AddExtension = true; + dialog.DefaultExt = ".txt"; + dialog.Filter = "Text Documents (*.txt)|*.txt"; + dialog.Title = "Select Export File"; + dialog.InitialDirectory = Global.appdatapath; + if (dialog.ShowDialog() == DialogResult.OK) + { + string outputFile = dialog.FileName; + List < string > outputLines = new List(); + ListViewItem item = null; + for (int i = 0, len = lvDebug.Items.Count; i < len; i++) + { + item = lvDebug.Items[i]; + outputLines.Add(item.SubItems[0].Text + ": " + item.SubItems[1].Text); + } + + try + { + StreamWriter stream = new StreamWriter(outputFile); + string line = string.Empty; + for (int i = 0, len = outputLines.Count; i < len; i++) + { + line = outputLines[i]; + stream.WriteLine(line); + } + stream.Close(); + } + catch { } + } + } + + private void languagePackComboBox1_SelectedValueChanged(object sender, EventArgs e) + { + string newValue = ((DS4Forms.LanguagePackComboBox)sender).SelectedValue.ToString(); + if (newValue != UseLang) + { + UseLang = newValue; + Save(); + MessageBox.Show(Properties.Resources.LanguagePackApplyRestartRequired, Text, MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } + + private void HidGuardWhiteList_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + try + { + RegistryKey key = Registry.LocalMachine.CreateSubKey(@"SYSTEM\CurrentControlSet\Services\HidGuardian\Parameters"); + key.SetValue("AffectedDevices", Program.rootHub.affectedDevs.ToArray(), RegistryValueKind.MultiString); + Log.LogToGui("Wrote HidGuardian Device List to Registry", false); + } + catch { } + } + + private void ClrHidGuardWlistLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + try + { + Registry.LocalMachine.DeleteSubKeyTree(@"SYSTEM\CurrentControlSet\Services\HidGuardian\Parameters\Whitelist"); + Log.LogToGui("Cleared HidGuardian Whitelist", false); + Program.rootHub.createHidGuardKey(); + } + catch { } + } + + private void HidGuardRegLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + try + { + RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Applets\Regedit"); + key.SetValue("LastKey", @"Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HidGuardian\Parameters", RegistryValueKind.String); + Process temp = new Process(); + temp.StartInfo.FileName = "regedit"; + temp.Start(); + } + catch { } + } + + private void OpenProgramFolderToolStripMenuItem_Click(object sender, EventArgs e) + { + Process temp = new Process(); + temp.StartInfo.FileName = "explorer.exe"; + temp.StartInfo.Arguments = @"/select, " + Assembly.GetExecutingAssembly().Location; + try { temp.Start(); } + catch { } + } + + private void DiscontoolStripMenuItem_Click(object sender, EventArgs e) + { + ToolStripMenuItem item = (ToolStripMenuItem)sender; + int i = Convert.ToInt32(item.Tag); + DS4Device d = Program.rootHub.DS4Controllers[i]; + if (d != null) + { + if (d.ConnectionType == ConnectionType.BT && !d.Charging) + { + d.DisconnectBT(); + } + else if (d.ConnectionType == ConnectionType.SONYWA && !d.Charging) + { + d.DisconnectDongle(); + } + } + } + + private void MintoTaskCheckBox_CheckedChanged(object sender, EventArgs e) + { + MinToTaskbar = mintoTaskCheckBox.Checked; + Save(); + } + + private void CBController_KeyPress(object sender, KeyPressEventArgs e) + { + e.Handled = true; } private void cBFlashWhenLate_CheckedChanged(object sender, EventArgs e) @@ -1782,28 +2556,4 @@ namespace DS4Windows FlashWhenLateAt = (int)Math.Round(nUDLatency.Value); } } - - public class ThemeUtil - { - [DllImport("UxTheme", CharSet = CharSet.Unicode, ExactSpelling = true)] - private static extern int SetWindowTheme(IntPtr hWnd, String appName, String partList); - - public static void SetTheme(ListView lv) - { - try - { - SetWindowTheme(lv.Handle, "Explorer", null); - } - catch { } - } - - public static void SetTheme(TreeView tv) - { - try - { - SetWindowTheme(tv.Handle, "Explorer", null); - } - catch { } - } - } } diff --git a/DS4Windows/DS4Forms/DS4Form.cs.resx b/DS4Windows/DS4Forms/DS4Form.cs.resx index 41c4d6b..393b2fa 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs.resx +++ b/DS4Windows/DS4Forms/DS4Form.cs.resx @@ -1,4 +1,4 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 582, 165 + + + 24, 24 + + + 760, 44 + + + 97, 140 + + + 218, 25 + + + 27, 24 + + + 188, 25 + + + 27, 24 + + + 248, 25 + + + 27, 24 + + + 158, 25 + + + 27, 24 + + + 278, 25 + + + 27, 24 + + + 128, 25 + + + 27, 24 + + + 308, 25 + + + 27, 24 + + + 98, 25 + + + 27, 24 + + + 467, 55 + + + 33, 24 + + + 68, 25 + + + 27, 24 + + + 500, 55 + + + 33, 24 + + + 38, 55 + + + 24, 24 + + + 533, 55 + + + 33, 24 + + + 398, 55 + + + 51, 24 + + + 533, 85 + + + 33, 24 + + + 368, 55 + + + 24, 24 + + + 500, 85 + + + 33, 24 + + + 338, 55 + + + 24, 24 + + + 467, 85 + + + 33, 24 + + + 308, 55 + + + 24, 24 + + + 500, 25 + + + 33, 24 + + + 278, 55 + + + 24, 24 + + + 467, 25 + + + 33, 24 + + + 248, 55 + + + 24, 24 + + + 613, 26 + + + 24, 24 + + + 218, 55 + + + 24, 24 + + + 643, 26 + + + 24, 24 + + + 188, 55 + + + 24, 24 + + + 673, 26 + + + 24, 24 + + + 158, 55 + + + 24, 24 + + + 583, 26 + + + 24, 24 + + + 128, 55 + + + 24, 24 + + + 703, 26 + + + 40, 24 + + + 98, 55 + + + 24, 24 + + + 703, 55 + + + 40, 24 + + + 68, 55 + + + 24, 24 + + + 703, 85 + + + 40, 24 + + + 161, 175 + + + 138, 24 + + + 533, 25 + + + 33, 24 + + + 11, 145 + + + 66, 24 + + + 413, 25 + + + 33, 24 + + + 383, 145 + + + 66, 24 + + + 338, 25 + + + 33, 24 + + + 353, 145 + + + 24, 24 + + + 374, 25 + + + 33, 24 + + + 323, 145 + + + 24, 24 + + + 11, 55 + + + 24, 24 + + + 293, 145 + + + 24, 24 + + + 263, 145 + + + 24, 24 + + + 583, 55 + + + 24, 24 + + + 233, 145 + + + 24, 24 + + + 583, 85 + + + 24, 24 + + + 203, 145 + + + 24, 24 + + + 613, 55 + + + 24, 24 + + + 173, 145 + + + 24, 24 + + + 613, 85 + + + 24, 24 + + + 143, 145 + + + 24, 24 + + + 643, 55 + + + 24, 24 + + + 113, 145 + + + 24, 24 + + + 643, 85 + + + 24, 24 + + + 83, 145 + + + 24, 24 + + + 673, 55 + + + 24, 24 + + + 353, 175 + + + 39, 24 + + + 673, 85 + + + 24, 54 + + + 305, 175 + + + 42, 24 + + + 673, 145 + + + 24, 54 + + + 113, 175 + + + 42, 24 + + + 583, 115 + + + 24, 24 + + + 68, 175 + + + 39, 24 + + + 613, 115 + + + 24, 24 + + + 398, 175 + + + 50, 24 + + + 583, 145 + + + 24, 24 + + + 11, 175 + + + 51, 24 + + + 643, 115 + + + 24, 24 + + + 11, 115 + + + 51, 24 + + + 583, 175 + + + 54, 24 + + + 398, 115 + + + 51, 24 + + + 613, 145 + + + 24, 24 + + + 368, 115 + + + 24, 24 + + + 643, 145 + + + 24, 24 + + + 16, 212 + + + 61, 28 + + + 17, 23 + + + 43, 13 + + + 17, 47 + + + 38, 13 + + + 17, 74 + + + 30, 13 + + + 85, 45 + + + 49, 20 + + + 85, 72 + + + 49, 20 + + + 218, 115 + + + 24, 24 + + + 83, 210 + + + 42, 20 + + + 34, 179 + + + 100, 20 + + + 308, 115 + + + 24, 24 + + + 278, 115 + + + 24, 24 + + + 248, 115 + + + 24, 24 + + + 533, 176 + + + 33, 24 + + + 33, 153 + + + 100, 20 + + + 33, 127 + + + 100, 20 + + + 17, 182 + + + 14, 13 + + + 17, 156 + + + 15, 13 + + + 338, 115 + + + 24, 24 + + + 500, 146 + + + 33, 24 + + + 85, 18 + + + 68, 23 + + + 17, 130 + + + 15, 13 + + + 467, 176 + + + 33, 24 + + + 114, 288 + + + 49, 20 + + + 500, 176 + + + 33, 24 + + + 144, 209 + + + 13, 13 + + + 643, 175 + + + 24, 24 + + + 188, 115 + + + 24, 24 + + + 663, 8 + + + 79, 17 + + + 158, 115 + + + 24, 24 + + + 0, 326 + + + 167, 60 + + + 128, 115 + + + 24, 24 + + + 452, 106 + + + 38, 33 + + + 98, 115 + + + 24, 24 + + + 309, 81 + + + 50, 30 + + + 68, 115 + + + 24, 24 + + + 370, 80 + + + 30, 30 + + + 11, 85 + + + 36, 24 + + + 266, 80 + + + 30, 30 + + + 413, 85 + + + 36, 24 + + + 497, 78 + + + 30, 30 + + + 383, 85 + + + 24, 24 + + + 420, 78 + + + 32, 34 + + + 353, 85 + + + 24, 24 + + + 455, 46 + + + 38, 35 + + + 323, 85 + + + 24, 24 + + + 14, 50 + + + 79, 29 + + + 293, 85 + + + 24, 24 + + + 278, 155 + + + 30, 30 + + + 263, 85 + + + 24, 24 + + + 251, 138 + + + 27, 21 + + + 233, 85 + + + 24, 24 + + + 254, 178 + + + 26, 21 + + + 203, 85 + + + 24, 24 + + + 224, 153 + + + 26, 30 + + + 173, 85 + + + 24, 24 + + + 60, 10 + + + 30, 42 + + + 143, 85 + + + 24, 24 + + + 294, 1 + + + 73, 13 + + + 826, 85 + + + 24, 24 + + + 461, 9 + + + 108, 13 + + + 113, 85 + + + 24, 24 + + + 10, 9 + + + 322, 13 + + + 796, 110 + + + 24, 21 + + + 749, 4 + + + 118, 23 + + + 796, 62 + + + 24, 22 + + + 371, 166 + + + 15, 30 + + + 796, 85 + + + 24, 24 + + + 384, 189 + + + 29, 14 + + + 83, 85 + + + 24, 24 + + + 414, 166 + + + 14, 30 + + + 831, 150 + + + 19, 24 + + + 563, 55 + + + 90, 30 + + + 766, 150 + + + 19, 24 + + + 163, 94 + + + 13, 30 + + + 843, 120 + + + 24, 24 + + + 384, 155 + + + 30, 13 + + + 745, 121 + + + 24, 24 + + + 178, 124 + + + 30, 11 + + + 796, 170 + + + 24, 24 + + + 574, 12 + + + 40, 44 + + + 796, 28 + + + 24, 24 + + + 212, 95 + + + 10, 30 + + + 766, 85 + + + 24, 24 + + + 385, 170 + + + 26, 19 + + + 53, 85 + + + 24, 24 + + + 178, 83 + + + 30, 11 + + + 182, 99 + + + 22, 22 + + + 598, 8 + + + 59, 17 + + + 22, 330 + + + 160, 23 + + + 22, 365 + + + 160, 23 + + + 11, 25 + + + 51, 24 + + + 6, 245 + + + 158, 37 + + + 2, 107 + + + 89, 17 + + + 138, 182 + + + 25, 13 + + + 138, 154 + + + 25, 13 + + + 138, 129 + + + 25, 13 + + + 871, 0 + + + 167, 446 + + + 22, 209 + + + + 2, 2, 2, 2 + + + 62, 17 + + + 94, 209 + + + 2, 2, 2, 2 + + + 86, 17 + + + 22, 236 + + + 161, 21 + + + 467, 24 + + + 14, 13 + + + 203, 202 + + + 2, 2, 2, 2 + + + 668, 247 + + + 96, 96 + + + 1038, 446 + + \ No newline at end of file diff --git a/DS4Windows/DS4Forms/KBM360.es.resx b/DS4Windows/DS4Forms/KBM360.es.resx index 35fb542..c1499ef 100644 --- a/DS4Windows/DS4Forms/KBM360.es.resx +++ b/DS4Windows/DS4Forms/KBM360.es.resx @@ -161,7 +161,7 @@ 105, 17 - Controles X360 + Controles Xbox 360 112, 17 diff --git a/DS4Windows/DS4Forms/KBM360.resx b/DS4Windows/DS4Forms/KBM360.resx index f45fd13..b46bff4 100644 --- a/DS4Windows/DS4Forms/KBM360.resx +++ b/DS4Windows/DS4Forms/KBM360.resx @@ -117,6074 +117,5531 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 38, 53 - - - - 4, 4, 4, 4 - - - cBLightbar - - - gBExtras - - - 621, 98 - - - 5 - - - P - - - pnl360Controls - - - 52, 30 - - - 8 - - - 118 - - - Popup - - - btnC - - - 386, 101 - - - 804, 181 - - - btnLT - - + False - - 29 - - - $this - - - Enter - - - btnPREVTRACK - - - 30, 30 - - - btnBACKSPACE - - - 273 - - + + NoControl - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 582, 165 - - 41, 30 - - - 348, 31 - - - A - - - 265 - - - 4, 4, 4, 4 - - - 729, 106 - - - 30, 30 - - - $this - - - 4, 4, 4, 4 - - - 114 - - - 30, 30 - - - 30, 30 - - - 30, 30 - - - 12 - - - Popup - - - NoControl - - - 321 - - - 252 - - - Flat - - - 122 - - - $this - - - 879, 32 - - - 195 - - - 8 - - - G - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - 234 - - - Popup - - - $this + + 24, 24 Zoom - - 32, 26 - - - 64, 30 - - - tBGreenBar - - - 270 - - - gBExtras - - - 30, 30 - - - NoControl - - - 62, 38 - - - H - - - 240 - - - $this - - - btnNUMPLUS - - - NoControl - - - 24 - - - 317 - - - 34 - - - 28, 295 - - - 4, 4, 4, 4 - - - 183 - - - S - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 13 - - - NoControl - - - System.Windows.Forms.Button, 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 - - - Popup - - - 4, 4, 4, 4 - - - $this - - - 247 - - - $this - - - 326 - - - 30, 30 - - - L - - - 187 - - - 4, 4, 4, 4 - - - NoControl - - - System.Windows.Forms.Button, 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 - - - 17 - - - NoControl - - - System.Windows.Forms.Button, 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 - - - 30, 30 - - - F10 - - - 995, 78 - - - cBShiftButton - - - 34, 30 - - - 625, 69 - - - Popup - - - 48, 17 - - - NoControl - - - Popup - - - Popup - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - NoControl - - - 3 - - - NoControl - - - 267 - - - 31 - - - True - - - 30, 30 - - - Popup - - - 122, 144 - - - 1 - - - 0 - - - 30, 30 - - - 256 - - - NoControl - - - NoControl - - - 4, 4, 4, 4 - - - 804, 32 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 9 - - - K - - - 98 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnl360Controls - - - System.Windows.Forms.Button, 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 - - - 625, 31 - - - CenterParent - - - 217 - - - 21, 29 - - - 4 - - - $this - - - 64, 30 - - - U - - - 35 - - - 61, 22 - - - $this - - - 258 - - - 4, 4, 4, 4 - - - 141, 181 - - - 78 - - - No - - - btnL - - - 50, 55 - - - advColorDialog - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 214 - - - $this - - - 125, 25 - - - - - - pnl360Controls - - - 4, 4, 4, 4 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 322 False - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 32, 17 - - - ' - - - 130 - - - 219 - - - Popup - - - btnCOMMA - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - X360Label - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnl360Controls - - - NoControl - - - NoControl - - - 148, 29 - - - 516, 31 - - - 7 - - - Popup - - - 24 - - - 198, 69 - - - pnl360Controls - - - 141, 106 - - - NoControl - - - btnDpadLeft - - - 4, 4, 4, 4 - - - Popup - - - 167 - - - False - - - $this - - - Flat - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 278 - - - 30, 30 - - - Flat - - - btn1 - - - $this - - - Popup - - - 117 - - - 4, 4, 4, 4 - - - NoControl - - - O - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 113 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - btnH - - - Down - - - 4, 4, 4, 4 - - - lbRumble - - - NoControl - - - J - - - bTNRIGHTMOUSE - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 165 - - - True - - - btnDpadDown - - - NoControl - - - 201 - - - $this - - - 4, 4, 4, 4 - - - 84 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 404, 181 - - - 4, 0, 4, 0 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 3 - - - $this - - - 287 - - - NoControl - - - 238 - - - 105 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 841, 181 - - - 101 - - - Flat - - - $this - - - 277 - - - 21, 92 - - - 6 - - - System.Windows.Forms.Button, 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 - - - Popup - - - 30, 30 - - - 237 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gBExtras - - - NoControl - - - NoControl - - - 30, 68 - - - 14 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 180, 261 - - - Flat - - - pnl360Controls - - - G - - - 33, 38 - - - $this - - - 327 - - - 117, 261 - - - 255 - - - B - - - $this - - - 30, 30 - - - NoControl - - - 94 - - - 86 - - - 209 - - - Popup - - - NoControl - - - $this - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 329, 106 - - - Popup - - - 28, 413 - - - 172 - - - 1 - - - 950, 55 - - - 310, 69 - - - 126 - - - button39 - - - NoControl - - - 4, 4, 4, 4 - - - 200, 29 - - - 212 - - - Popup - - - button34 - - - 995, 138 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Popup - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - Change Light - - - 4, 4, 4, 4 - - - btnNUMSLASH - - - $this - - - 4, 4, 4, 4 - - - 295 - - - gBExtras - - - 4, 4, 4, 4 - - - Popup - - - 841, 106 - - - 4, 4, 4, 4 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Popup - - - NoControl - - - 34, 26 - - - 41, 30 - - - 381, 219 - - - 189 - - - 30, 30 - - - btnF8 - - - 41, 30 - - - 4, 4, 4, 4 - - - 13, 38 - - - MiddleRight - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Toggle - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lBTip - - - Popup - - - 30, 30 - - - pnl360Controls - - - Popup - - - 4, 4, 4, 4 - - - 254, 106 - - - 30, 30 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - btnYButton - - - NoControl - - - NoControl - - - 4, 4, 4, 4 - - - V - - - 30, 30 - - - False - - - 569, 57 - - - NoControl - - - button35 - - - 207 - - - 14, 219 - - - 36 - - - NoControl - - - 4, 4, 4, 4 - - - 167 - - - $this - - - btnNEXTTRACK - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnl360Controls - - - Flat - - - 30, 30 - - - 4, 4, 4, 4 - - - 49, 30 - - - - - - - Flat - - - Popup - - - btnMIDDLEMOUSE - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - NoControl - - - $this - - - 422, 69 - - - 4, 4, 4, 4 - - - btnRCTRL - - - 41, 30 - - - 308 - - - $this - - - button4 - - - gBExtras - - - $this - - - $this - - - 30, 30 - - - 272, 69 - - - Popup - - - 4, 4, 4, 4 - - - $this - - - NoControl - - - N - - - True - - - NoControl - - - $this - - - 1032, 106 - - - Flat - - - pgd - - - Popup - - - 4 - - - 30, 30 - - - NoControl - - - btnRSHIFT - - - lb360Tip - - - 7 - - - Popup - - - lbBlueV - - - RCtrl - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - 291, 181 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 22 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 16 - - - 106, 56 + + pBHighlight System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - $this - - - 30, 30 - - - System.Windows.Forms.Button, 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.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - btnLSLeft - - - 38 - - - btnF9 - - - 15 - - - 1 - - - 242 - - - 85, 144 - - - 243 - - - end - - - 14, 144 - - - 441, 106 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 82, 30 - - - 30, 30 - - - $this - - - 262 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 20, 265 - - - 164 - - - 18, 17 - - - F - - - 30, 30 - - - 18 - - - NoControl - - - 274 - - - 201, 219 - - - $this - - - 82 - - - 0 - - - 30, 30 - - - 4, 4, 4, 4 - - - Popup - - - 319 - - - 85, 69 - - - lbRedV - - - $this - - - F11 - - - $this - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 210 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Popup - - - Popup - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - F9 - - - NoControl - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - btnEND - - - NoControl - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 314 - - - 168 - - - / + + pnl360Controls 1 - + NoControl - - 4, 4, 4, 4 + + 760, 44 - - 160, 31 + + 97, 140 - + + Zoom + + + 290 + + + pBMouse + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 132 + + + Popup + + NoControl - - 239 + + 218, 25 - + + 27, 24 + + + 258 + + + F6 + + + btnF6 + + System.Windows.Forms.Button, 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 - - - btnPERIOD - - - M - - - 30, 30 - - - btnEQUALS - - - True - - + $this - - 48, 44 + + 9 - - btnINS - - - 4, 4, 4, 4 - - - 288 - - - tBBlueBar - - - 268 - - + Popup - - Popup + + NoControl - - btnRT + + 188, 25 - - $this + + 27, 24 - - 4, 4, 4, 4 + + 259 - - 4, 4, 4, 4 + + F5 - - 4, 4, 4, 4 + + btnF5 - - True - - - 233 - - - 30, 30 - - - 479, 181 - - - Backspace - - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - gBExtras + + $this - - 4, 0, 4, 0 + + 10 + + + Popup + + + NoControl + + + 248, 25 + + + 27, 24 + + + 257 + + + F7 + + + btnF7 System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - - 958, 188 + + 12 - - btnRSDown - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 222, 155 - - - 91 - - - 4, 4, 4, 4 - - - btnLSHIFT - - - NoControl - - + Popup - - . - - + NoControl - - 30, 30 + + 158, 25 - - T + + 27, 24 - + + 260 + + + F4 + + + btnF4 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 38, 38 + + $this - - 221 + + 13 - - 291, 106 + + Popup - + NoControl - - 666, 220 + + 278, 25 - + + 27, 24 + + + 256 + + + F8 + + + btnF8 + + 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 + + $this - + + 15 + + + Popup + + NoControl - + + 128, 25 + + + 27, 24 + + + 261 + + + F3 + + + btnF3 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this - - 57 - - - 299 - - - NoControl - - - Flat - - - 202 - - - NoControl - - - 0 - - - E - - - 4, 0, 4, 0 - - - btnRETURN - - - Popup - - - 4, 4, 4, 4 - - - Flat - - - pnl360Controls - - - gBExtras - - - TopCenter - - - 48, 69 - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - btnNUM4 - - - 283 - - - 6 - - - 4, 0, 4, 0 - - - 28 - - - 235, 69 - - - 30, 30 - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 232 - - - 30, 30 - - - 4, 4, 4, 4 - - - btnX - - - 841, 69 - - - NoControl - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - btnP - - - NoControl - - - 30, 68 - - + 16 - - 30, 30 - - - 41, 30 - - - L - - - $this - - + Popup - - 804, 69 - - - Popup - - - 69 - - - 24, 30 - - - pnl360Controls - - - btnRALT - - - Popup - - - RAlt - - - ←Left - - - 228, 124 - - - Popup - - - 82, 30 - - - 228 - - - 63 - - - 18 - - - 291 - - - 296 - - - 21 - - - Popup - - - LCtrl - - - 25 - - - 49 - - - Popup - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Popup - - - ` - - - 1054, 150 - - - 188 - - + NoControl - - 42, 224 + + 308, 25 - - $this + + 27, 24 - - 4, 4, 4, 4 + + 255 - + + F9 + + + btnF9 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 318 - - - 310, 31 - - - 20 - - - 30, 30 - - - btnT - - - - - - 368, 1 - - - D - - - 272, 31 - - - 108 - - - btnLEFTMOUSE - - - btnRB - - - 173 - - - System.Windows.Forms.Button, 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 - - - btnD - - - 324 - - - 584, 69 - - - rBShiftModifer - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - btnNUM3 - - - NoControl - - - 4, 4, 4, 4 - - - 106, 23 - - - bnWHEELDOWN - - - Popup - - - NoControl - - - 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.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - Tab - - - pnl360Controls - - - 348, 69 - - - 310, 144 - - - Popup - - - 5Numpad - - - ØVol - - - btnGuide - - - Popup - - - 766, 144 - - - 241 - - - NoControl - - - gBExtras - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - RShift - - - 32, 24 - - - 729, 32 - - - 4, 4, 4, 4 - - - NoControl - - - btnAPOSTROPHE - - - M - - - Popup - - - 309 - - - 729, 219 - - - $this - - - lbLight - - - 49, 30 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - nUDMouse - - - btnSLASH - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 995, 106 - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 265, 119 - - - 99, 36 - - - Popup - - - gBExtras - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - 266 - - - btnMOUSEUP - - - 226 - - - 30, 30 - - - 61, 22 - - - Left - - - 96 - - - Popup - - - Popup - - - Popup - - - 4, 4, 4, 4 - - - 13 - - - NoControl - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Scan Code - - - btnLSUp - - - NoControl - - - 125, 25 - - - NoControl - - - del - - - Popup - - - 204, 118 - - - Y - - - 9 - - - 4, 0, 4, 0 - - - pgu - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 20 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Popup - - - 10 - - - C - - - 80 - $this - - RWin + + 18 - - 41, 30 - - - NoControl - - - btnLALT - - - NoControl - - - 19 - - - 177 - - - 4 - - - 170 - - - 385, 144 - - - 4, 4, 4, 4 - - - 290 - - - $this - - - 259 - - - Default - - - NoControl - - - NoControl - - - 7 - - - 21 - - - 120, 120 - - - True - - - $this - - - 4, 4, 4, 4 - - - 328 - - - 33 - - - 248 - - - btnVolUp - - + Popup - - 209, 558 - - - 110 - - - lbGreen - - - pnl360Controls - - - Rumble - - + NoControl - - 30, 30 - - - 4, 4, 4, 4 - - - 38, 14 - - - NoControl - - - Popup - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 0, 4, 0 - - - 18, 63 - - - 198, 144 - - - 4, 0, 4, 0 - - - Zoom - - - NoControl - - - 112 - - - 66, 106 - - - gBExtras - - - 4, 4, 4, 4 - - - $this - - - 95 - - - Triangle - - - Popup - - - 39 - - 122, 31 + 98, 25 - - Popup + + 27, 24 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 262 - - pnl360Controls + + F2 - - 245 + + btnF2 - - 178 - - - 285 - - - 40 - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 462, 100 - - - 209, 75 - - - 441, 181 - - - 4, 4, 4, 4 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - btnF1 - - - 516, 106 - - - 30, 30 - - - 17 - - - 0 - - - Popup - - - NoControl - - - btnE - - - 41, 30 - - - NoControl - - - NoControl - - - NoControl - - - 50, 30 - - - btn9 - - - 766, 106 - - - 51 - - - 30, 30 - - - NoControl - - - 30, 30 - - - 4, 4, 4, 4 - - - $this - - - 250 - - - 4, 4, 4, 4 - - - 99, 21 - - - 54 - - - btnF10 - - - 584, 220 - - - btnLSClick - - - 30, 30 - - - 313 - - - Heavy - - - 53 - - - Flat - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - 30, 30 - - - 282 - - - 222 - - - btnNUMDOT - - - 196 - - - Popup - - - btnDEL - - - NoControl - - - Cross - - - 38, 38 - - - $this - - - NoControl - - - 4, 4, 4, 4 - - - 3, 134 - - - 64, 30 - - - False - - - 30, 30 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Unbound - - - 38, 38 - - - Popup - - - gBExtras - - - Num Lock - - - gBExtras - - - NoControl - - - 315 - - - 74, 21 - - - 293 - - - Popup - - - btnF7 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - 30, 30 - - - btn5 - - - btnRSClick - - - 172, 30 - - - 464, 207 - - - 198 - - - 936, 5 - - - 1039, 188 - - - NoControl - - - 305 - - - 263 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - 728, 206 - - - $this - - - 4, 4, 4, 4 - - - 222, 104 - - - 279 - - - Flat - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 8 - - - 52 - - - 4, 4, 4, 4 - - - 179, 181 - - - $this - - - 4, 4, 4, 4 - - - 4, 0, 4, 0 - - - Popup - - - 4, 4, 4, 4 - - - 216, 181 - - - prt - - - 4, 4, 4, 4 - - - 46 - - - 30, 30 - - - 16, 16 - - - NoControl - - - System.Windows.Forms.Button, 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 - - - 12 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - 4, 4, 4, 4 - - - 30, 30 - - - 4, 4, 4, 4 - - - btnM - - - NoControl - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 160, 69 - - - 4, 0, 4, 0 - - - NoControl - - - NoControl - - - 9 - - - 310 - - - 748, 10 - - - btn3 - - - : - - - $this - - - Webdings, 8.25pt - - - 4, 4, 4, 4 - - - btnSTOP - - - Flat - - - 176 - - - 19 - - - $this - - - btnNUMLOCK - - - $this - - - $this - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 193 - - - $this - - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this - - nUDHeavy - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Enter - - - 200, 24 - - - $this - - - $this - - - Popup - - - Flat - - - 30, 30 - - - 253 - - - NoControl - - - 79 - - - 55 - - - 304 - - - Popup - - - 16, 38 - - - NoControl - - - 30, 30 - - - 192 - - - Space - - - 30, 30 - - - 205 - - - bk - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 231 - - - btnI - - - $this - - - $this - - - $this - - - 1 - - - 16 - - - 52, 22 - - - 14, 69 - - - 26 - - - $this - - - $this - - - Popup - - - Popup - - - 41, 30 - - - NoControl - - - $this - - - 254 - - - 71 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 229 - - - 4, 4, 4, 4 - - - 254, 181 - - - 132 - - - 13 - - - 281 - - - btnStart - - - Popup - - - 468, 31 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 525, 98 - - - $this - - - NoControl - - - 179 - - - 804, 219 - - - 517, 207 - - - Upper Touch - - - Left Touch - - - R3 - - - L3 - - - R2 - - - L2 - - - R1 - - - L1 - - - PS - - - Right - - - 197, 46 - - - $this - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - NoControl - - - 4, 4, 4, 4 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 41, 30 - - - Popup - - - 4, 4, 4, 4 - - - 2 - - - 90 - - - 879, 69 - - - Popup - - - NoControl - - - NoControl - - - 4, 4, 4, 4 - - - 7 - - - 27 - - - 175 - - - btnESC - - - 4 - - - Flat - - - B - - - pBHighlight - - - $this - - - Popup - - - hm - - - 58 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 0 - - - 30, 30 - - - 220 - - - 294 + + 19 Popup - - 333, 100 + + NoControl - - btnSCL + + 467, 55 - + + 33, 24 + + + 265 + + + ins + + + btnINS + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - NoControl - - - 30, 30 - - - 89 - - - NoControl - - - btn2 - - + $this - - 4, 4, 4, 4 + + 21 - - 88 - - - 41, 30 - - - NoControl - - - $this - - - 181 - - - LWin - - - R - - - 4, 0, 4, 0 - - - pnl360Controls - - - 48, 41 - - - NoControl - - - 211 - - - X360 Controls - - - $this - - - 24, 30 - - - btnNUM0 - - - 45, 30 - - - = - - - 23 - - - 2 - - - btnDpadRight - - - 13, 11 - - - 30, 28 - - - 21, 228 - - - pnl360Controls - - - Keyboard and Mouse - - - 235, 31 - - - Webdings, 8.25pt - - - 4, 4, 4, 4 - - - 208 - - - 4, 4, 4, 4 - - - btnNUM1 - - - btnNUMENTER - - - 995, 35 - - + Popup - - - - + NoControl - - $this - - - 284 - - - tBRedBar - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - button36 - - - Popup - - - Popup - - - [ - - - NoControl - - - 4, 4, 4, 4 - - - 0 - - - 30, 30 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - NoControl - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - btn6 - - - btn8 - - - 243 - - - 63, 30 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Popup - - - 4, 4, 4, 4 - - - btn0 - - - $this - - - 4, 4, 4, 4 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 30, 30 - - - 10 - - - btnNUM7 - - - 4, 0, 4, 0 - - - NoControl - - - 131 - - - 179, 106 - - - $this - - - 264 - - - pnl360Controls - - - 61 - - - NoControl - - - NoControl - - - 4, 4, 4, 4 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnl360Controls - - - btnAButton - - - 323 - - - 163 - - - 6 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 66 - - - 172, 192 - - - 124 - - - 4, 4, 4, 4 - - - Popup - - - 169 - - - NoControl - - - 666, 69 - - - $this - - - btnNUM5 - - - Popup - - - 206 - - - $this - - - Popup - - - 200 - - - 4, 4, 4, 4 - - - 92 - - - 4, 4, 4, 4 - - - $this - - - lbHeavy - - - 255 - - - btnN - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 64 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - btnNUM2 - - - Flat - - - NoControl - - - btn4 - - - 243 - - - Record a macro - - - Caps - - - 87 - - - 4, 4, 4, 4 - - - 704, 69 - - - btnMINUS - - - btnXButton - - - $this - - - NoControl - - - 0 - - - Popup - - - System.Windows.Forms.Button, 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.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - NoControl - - - $this - - - 246 - - - $this - - - True - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 116 - - - 129 - - - $this - - - NoControl - - - 4, 4, 4, 4 - - - NoControl - - - , - - - 79, 21 - - - $this - - - 30, 30 - - - btnA - - - bnWHEELUP - - - $this - - - btnNUM8 - - - 366, 181 - - - 4, 4, 4, 4 - - - ↓Vol - - - Popup - - - nUDLight - - - 83 - - - 120 - - - NoControl - - - Change Mouse Sensitivity - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 199 - - - 348, 144 - - - Extras - - - pnl360Controls - - - btnNUM9 - - - 4, 4, 4, 4 - - - 260 - - - $this - - - Flat - - - 269 - - - + - - - Popup - - - Popup - - - 127 - - - 50, 30 - - - 4, 4, 4, 4 - - - Popup - - - $this - - - 104, 181 - - - NoControl - - - 85, 219 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - NoControl - - - $this - - - 3 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 85, 31 - - - 109 - - - Options - - - 18 - - - 4, 4, 4, 4 - - - Escape - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 67 - - - 30, 30 - - - btnBButton - - - Popup - - - NoControl - - - 191 - - - Popup - - - bnColor - - - Popup - - - $this - - - 17 - - - 307 - - - 4 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - * - - - 4, 4, 4, 4 - - - 111 - - - 93 - - - pnl360Controls - - - 958, 106 - - - 52, 30 - - - btnCLOSEBRACKET - - - 4, 0, 4, 0 - - - 30, 30 - - - btnNUM6 - - - $this - - - 4, 4, 4, 4 - - - 107 - - - 30, 30 - - - 97 - - - NoControl - - - btnHOME - - - NoControl - - - lbRed - - - 100 - - - 23 - - - Popup - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 244 - - - 48 - - - 385, 31 - - - 479, 106 - - - 4, 4, 4, 4 - - - 216 - - - $this - - - btnF - - - NoControl - - - 115 - - - rBRegular - - - 4, 4, 4, 4 - - - btnCAPS - - - 128 - - - 584, 31 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 666, 106 - - - btnPLAYPAUSE - - - 121, 175 - - - - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - F5 - - - $this - - - Popup - - - pnl360Controls - - - ] - - - 280 - - - 103 - - - 300 - - - NoControl - - - A - - - Popup - - - 73 - - - 4, 4, 4, 4 - - - btnTAB - - - 280, 191 - - - btn4THMOUSE - - - btnY - - - 480, 194 - - - $this - - - btnPGUP - - - btnQ - - - 194 - - - 230 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 666, 31 - - - $this - - - 317, 222 - - - 4, 4, 4, 4 - - - 366, 106 - - - 227 - - - 19, 17 - - - btnRSLeft - - - 235, 144 - - - True - - - 62 - - - Popup - - - Popup - - - Zoom - - - NoControl - - - 14, 181 - - - 111, 21 - - - 441, 219 - - - 21, 162 - - - 45 - - - 190 - - - 835, 309 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 311 - - - btnRSRight - - - 4, 4, 4, 4 - - - 0 - - - 225 - - - 4, 4, 4, 4 - - - 14, 106 - - - 50, 30 - - - No - - - 12 - - - 9 - - - $this - - - btnBREAK - - - NoControl - - - 4, 0, 4, 0 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - NoControl - - - 68 - - - 4, 4, 4, 4 - - - NoControl - - - 30, 30 - - - btnU - - - btnLCTRL - - - btnW - - - 30, 30 - - - 77 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Circle - - - 41, 30 - - - NoControl - - - 30, 30 - - - NoControl - - - 41, 30 - - - 41, 30 - - - 322 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 28, 261 - - - Webdings, 8.25pt - - - 161 - - - 4, 4, 4, 4 - - - F6 - - - $this - - - 30, 30 - - - 766, 181 - - - 272 - - - NoControl - - - \ - - - 4, 4, 4, 4 - - - 68, 30 - - - pnl360Controls - - - 218 - - - True - - - 10 - - - NoControl - - - NoControl - - - 30, 30 - - - < - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - NoControl - - - Popup - - - btnG - - - gBExtras - - - 1 - - - 99 - - - $this - - - ↑Up - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - button33 - - - pBMouse - - - 625, 106 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Popup - - - 766, 32 - - - Popup - - - System.Windows.Forms.Label, 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 - - - 4, 4, 4, 4 - - - Popup - - - F4 - - - 4, 4, 4, 4 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 480, 236 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - btnBack - - - 718, 15 - - - 498, 69 - - - btnS - - - Popup - - - 4, 4, 4, 4 - - - Flat - - - 625, 220 - - - 11 - - - NoControl - - - 7, 306 - - - cBScanCode - - - 75, 12 - - - 4, 4, 4, 4 - - - $this - - - 4, 4, 4, 4 - - - 223 - - - 27 - - - F2 - - - btnDpadUp - - - 30, 30 - - - bnMacro - - - btnB - - - 213 - - - - - - - 85 - - - 565, 133 - - - LShift - - - btnLSRight - - - 30, 30 - - - $this - - - Flat - - - NoControl - - - Popup - - - $this - - - 314, 173 - - - 56, 17 - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - btnF3 - - - NoControl - - - 242 - - - Popup - - - 4 - - - 32, 17 - - - 39, 17 - - - 481, 212 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - btnMOUSEDOWN - - - 61, 22 - - - 4, 4, 4, 4 - - - NoControl - - - NoControl - - - pnl360Controls - - - btnJ - - - / - - - NoControl - - - 422, 144 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - 0 - - - System.Windows.Forms.RadioButton, 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 - - - True - - - →Right - - - 4, 4, 4, 4 - - - NoControl - - - 41, 191 - - - 162 - - - F7 - - - 0 - - - 19, 38 - - - ↑Vol - - - NoControl - - - 125 - - - NoControl - - - 2 - - - NoControl - - - pnl360Controls - - - LAlt - - - 34, 30 - - - btnF2 - - - 298 - - - 85, 29 - - - 76, 35 - - - 22 - - - 4, 4, 4, 4 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 38, 14 - - - 184 - - - 72 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Popup - - - NoControl - - - 34, 30 - - - 286 - - - 1298, 558 - - - NoControl - - - 172, 228 - - - 236 - - - gBExtras - - - Popup - - - Flat - - - 289 - - - 32, 17 - - - 4, 4, 4, 4 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - btnWINDOWS - - - 106 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 41, 30 - - - Popup - - - NoControl - - - NoControl - - - 4, 4, 4, 4 - - - 81 - - - btnLSDown - - - 4, 4, 4, 4 - - - - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - 198, 31 - - - NoControl - - - Finger on Touchpad - - - Sixaxis Right - - - Sixaxis Left - - - pnl360Controls - - - Sixaxis Up - - - Right Touch - - - Multitouch - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Yes - - - cBToggle - - - 37 - - - 4, 4, 4, 4 - - - 28, 456 - - - NoControl - - - Flash Rate - - - Popup - - - btnZ - - - BottomLeft - - - Popup - - - $this - - - Flat - - - 841, 32 - - - 4, 4, 4, 4 - - - btnR - - - gBExtras - - - 385, 69 - - - 4, 4, 4, 4 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 216, 106 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Popup - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - W - - - 30, 30 - - - True - - - Popup + 68, 25 - 34, 30 + 27, 24 - - $this + + 263 - - 729, 181 + + F1 - - Popup + + btnF1 - - NoControl - - - NoControl - - - button6 - - - 766, 69 - - - 14 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 215 - - - 4, 4, 4, 4 - - - $this - - - 76 - - - 4, 4, 4, 4 - - - 297 - - - 97, 17 - - - 21, 59 - - - F8 - - - $this - - - 9 - - - Webdings, 8.25pt - - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this - - 38, 38 + + 22 - - gBExtras - - - 125, 25 - - - ; - - - System.Windows.Forms.Button, 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 - - - Flat - - - 41, 30 - - - 2 - - - F3 - - + Popup - - 34, 30 + + NoControl - + + 500, 55 + + + 33, 24 + + + 253 + + + hm + + + btnHOME + + 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 + + $this + + + 24 + + + Popup + + + NoControl + + + 38, 55 + + + 24, 24 + + + 264 + + + 1 + + + btn1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 25 + + + Popup + + + NoControl + + + 533, 55 + + + 33, 24 + + + 238 + + + pgu + + + btnPGUP + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 27 + + + Popup + + + NoControl + + + 398, 55 + + + 51, 24 + + + 234 + + + Backspace + + + btnBACKSPACE + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 28 + + + Popup NoControl - - 4, 4, 4, 4 + + 533, 85 - - btnV + + 33, 24 - - Popup + + 252 - - $this + + pgd - - 41, 30 + + btnPGDN - - 292 - - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - $this - - - 254, 253 - - - Regular - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - btnNUMMINUS - - - 4, 4, 4, 4 - - - NoControl - - - 0, 407 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnl360Controls - - - NoControl - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - - BottomRight - - - 43 - - - 302 - - - btnSPACE - - - $this - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 104 - - - 4, 4, 4, 4 - - - NoControl - - - 4, 4, 4, 4 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Popup - - - gBExtras - - - 203 - - - NoControl - - - gBExtras - - - $this - - - 272, 144 - - - 21 - - - 4, 4, 4, 4 - - - 5 - - - 14, 31 - - - Popup - - - 804, 106 - - - Popup - - - 34, 30 - - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 4, 4, 4, 4 - - - 303 - - - gBExtras - - - 4, 4, 4, 4 - - - 729, 144 - - - 4, 4, 4, 4 - - - $this - - - 30, 30 - - - 276 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - Sixaxis Down - - - 180 - - - 3 - - - 36, 17 - - - NoControl - - - btnMOUSELEFT - - - $this - - - Select Shift Trigger - - - Popup - - - 4, 4, 4, 4 - - - Popup - - - 318 - - - button7 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - 306 - - + $this 30 - - pnl360Controls - - - 460, 144 - - - You can also select -a key by typing it - - - 34, 30 - - - 422, 31 - - - DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.4.401.0, Culture=neutral, PublicKeyToken=null - - - 249 - - - 0 - - - 4, 4, 4, 4 - - - btnDefault - - - NoControl - - - 4, 4, 4, 4 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 143, 360 - - + Popup - - 729, 69 - - - 119 - - - 498, 144 - - - $this - - + NoControl - - btnOPENBRACKET + + 368, 55 - - 34, 30 + + 24, 24 - - Popup + + 233 - - 143, 17 + + = - - 45, 30 - - - $this - - - 4, 0, 4, 0 - - - Popup - - - 5 - - - 4, 4, 4, 4 - - - KBMlabel - - - 804, 144 - - - NoControl - - - 30, 30 - - - 15 - - - 251 + + btnEQUALS System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 114, 21 + + $this - - 44 + + 31 - - 74 + + Popup - - btnPGDN - - - 9 - - - 6 - - - Z - - + NoControl - - 47 + + 500, 85 - - gBExtras + + 33, 24 - - 3 + + 251 - - 584, 30 + + end - - 15 + + btnEND - - Macro On, Choose a key to disable, else close this window to save + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 1 - - - gBExtras - - - cBMouse - - - 4, 4, 4, 4 - - - R - - + $this - + + 33 + + + Popup + + + NoControl + + + 338, 55 + + + 24, 24 + + + 232 + + + - + + + btnMINUS + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + $this - - Test + + 34 - - 102 + + Popup - - True + + NoControl - - 7 + + 467, 85 - - 64, 30 + + 33, 24 - - 30, 30 + + 250 + + + del + + + btnDEL + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this - - 106, 90 + + 36 - + + Popup + + + NoControl + + + 308, 55 + + + 24, 24 + + + 231 + + + 0 + + + btn0 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 37 + + + Popup + + + NoControl + + + 500, 25 + + + 33, 24 + + + 247 + + + scl + + + btnSCL + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 39 + + + Popup + + + NoControl + + + 278, 55 + + + 24, 24 + + + 230 + + + 9 + + + btn9 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 40 + + + Popup + + + NoControl + + + 467, 25 + + + 33, 24 + + + 241 + + + prt + + + button34 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 42 + + + Popup + + + NoControl + + + 248, 55 + + + 24, 24 + + + 229 + + + 8 + + + btn8 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 44 + + + Popup + + + Webdings, 8.25pt + + + NoControl + + + 613, 26 + + + 24, 24 + + + 246 + + + < + + + btnSTOP + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 46 + + + Popup + + + NoControl + + + 218, 55 + + + 24, 24 + + + 228 + + + 7 + + + btn7 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 47 + + + Popup + + + Webdings, 8.25pt + + + NoControl + + + 643, 26 + + + 24, 24 + + + 245 + + + 4 + + + btnPLAYPAUSE + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 49 + + + Popup + + + NoControl + + + 188, 55 + + + 24, 24 + + + 227 + + + 6 + + + btn6 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 51 + + + Popup + + + Webdings, 8.25pt + + + NoControl + + + 673, 26 + + + 24, 24 + + + 244 + + + : + + + btnNEXTTRACK + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 53 + + + Popup + + + NoControl + + + 158, 55 + + + 24, 24 + + + 226 + + + 5 + + + btn5 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this - - pnl360Controls + + 54 - - $this - - - 38, 16 - - - 42 - - - NoControl - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 11 - - - gBExtras - - - 625, 182 - - - lbGreenV - - - NoControl - - - 182 - - - ins - - - $this - - - 224 - - - btnLB - - - 4, 4, 4, 4 - - - $this - - + Popup - - scl - - - 160, 144 - - - 60 - - - 27, 27 - - - Share - - - 104, 263 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 75 - - - btnF12 - - - 30, 26 - - - 4, 4, 4, 4 - - - NoControl - - - 4, 4, 4, 4 - - - 200, 29 - - - 141, 219 - - - 186 - - - True - - - 32 - - - 829, 10 - - - 14 - - - R - - - 931, 151 - - - Guide - - - 30, 30 - - - 133 - - - 123 - - - 312 - - - NoControl - - - True - - - btnO - - - 4 - - - Popup - - - Flat - - - NoControl - - - nUDLightFlash - - - 498, 219 - - - btnF4 - - - 30, 30 - - - $this - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0 - - - 56 - - - btn7 - - - 323 - - - 4, 4, 4, 4 - - - 30, 30 - - - 4, 4, 4, 4 - - - 4, 4, 4, 4 - - - Light - - - 460, 69 - - - $this - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - 65 - - - 6 - - - 30, 30 - - - ↓Down - - - 4, 4, 4, 4 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 2 - - - btnTILDE - - - 235 - - - $this - - - lbFlashRate - - - 204 - - - btnF5 - - - 995, 212 + + Webdings, 8.25pt NoControl - - 166 + + 583, 26 - - 197 + + 24, 24 - + + 243 + + + 9 + + + btnPREVTRACK + + 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 - - - Popup - - - 404, 106 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 11 - - - $this - - - gBExtras - - - 8 - - - 255 - - - NoControl - - - NoControl - - - 21, 195 - - - True - - - btnNUMSTAR - - - $this - - - Square - - - Yes - - - 5 - - - 70 - - - 271 - $this - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 56 - - 41, 159 - - - lBMacroOn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 40, 42 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Up - - - NoControl - - - 25 - - - btnK - - - btnF6 - - - 174 - - - 122, 69 - - - 4, 4, 4, 4 - - - NoControl - - - 275 - - - $this - - - 185 - - - $this - - - $this - - + Popup - - 584, 106 + + NoControl - + + 128, 55 + + + 24, 24 + + + 225 + + + 4 + + + btn4 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 57 + + + Popup + + + NoControl + + + 703, 26 + + + 40, 24 + + + 242 + + + ↑Vol + + + btnVolUp + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 59 + + + Popup + + + NoControl + + + 98, 55 + + + 24, 24 + + + 224 + + + 3 + + + btn3 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 60 + + + Popup + + + NoControl + + + 703, 55 + + + 40, 24 + + + 249 + + + ↓Vol + + + button39 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 62 + + + Popup + + + NoControl + + + 68, 55 + + + 24, 24 + + + 223 + + + 2 + + + btn2 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this - - 64, 30 + + 63 - - 172, 161 + + Popup - + NoControl - - 4, 4, 4, 4 + + 703, 85 - - btnBACKSLASH + + 40, 24 - - 30, 30 + + 248 - + + ØVol + + + button35 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + $this + + 65 + + + Popup + + + NoControl + + + 161, 175 + + + 138, 24 + + + 222 + + + Space + + + btnSPACE + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 66 + + + Popup + + + NoControl + + + 533, 25 + + + 33, 24 + + + 240 + + + bk + + + btnBREAK + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 68 + + + Popup + NoControl - + + 11, 145 + + + 66, 24 + + + 221 + + + LShift + + + btnLSHIFT + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 34, 30 - - - 1089, 0 - - - 4, 4, 4, 4 - - - Q - - + $this - - NoControl + + 69 - - NoControl - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - 576, 11 - - - NoControl - - - 30, 30 - - - NoControl - - - 425, 17 - - - 4, 4, 4, 4 - - - 4, 0, 4, 0 - - - 104, 106 - - + Popup - - 2 + + NoControl - - 17, 38 + + 413, 25 - - 113, 38 + + 33, 24 - - Shift Modifier - - - 59 - - - 1 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Keybaord - - - 301 - - - 19 - - - 5 - - - 171 - - - 8 - - - Flat - - - $this - - - 261 - - - Flat - - - btnF11 - - - 4, 4, 4, 4 - - - Popup - - - 4, 4, 4, 4 - - - System.Windows.Forms.Button, 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 - - - 879, 106 - - - X - - - button5 - - - 257 - - - 26 - - - . - - - Flat - - - 17, 17 - - - Popup - - - btnMOUSERIGHT - - - 4, 4, 4, 4 - - - bnTest - - - 255 - - - Popup - - - F1 - - - lbBlue + + 239 F12 - - 121 + + btnF12 - - I + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 30, 30 + + $this - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 71 - - 4, 4, 4, 4 + + Popup - - - - - 50 - - - 347, 194 - - - pnl360Controls - - - 4, 4, 4, 4 - - + NoControl - + + 383, 145 + + + 66, 24 + + + 220 + + + RShift + + + btnRSHIFT + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - KBM360 + + $this - + + 72 + + + Popup + + NoControl - + + 338, 25 + + + 33, 24 + + + 254 + + + F10 + + + btnF10 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 41 + + $this - - Right + + 74 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Popup - - 20 - - - btnRSUp - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - btnUNBOUND - - - 325 - - - pnl360Controls - - + NoControl - - btnSEMICOLON + + 353, 145 + + + 24, 24 + + + 219 + + + / + + + btnSLASH + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 75 + + + Popup + + + NoControl + + + 374, 25 + + + 33, 24 + + + 237 + + + F11 + + + btnF11 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 77 + + + Popup + + + NoControl + + + 323, 145 + + + 24, 24 + + + 218 + + + . + + + btnPERIOD + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 78 + + + Popup + + + NoControl + + + 11, 55 + + + 24, 24 + + + 236 + + + ` + + + btnTILDE + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 80 + + + Popup + + + NoControl + + + 293, 145 + + + 24, 24 + + + 217 + + + , + + + btnCOMMA + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 81 + + + Popup + + + NoControl + + + 263, 145 + + + 24, 24 + + + 216 + + + M + + + btnM + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 83 + + + Popup + + + NoControl + + + 583, 55 + + + 24, 24 + + + 273 + + + Num Lock + + + btnNUMLOCK + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this - + + 84 + + Popup - + + NoControl + + + 233, 145 + + + 24, 24 + + + 215 + + + N + + + btnN + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 86 + + + Popup + + + NoControl + + + 583, 85 + + + 24, 24 + + + 272 + + + 7 + + + btnNUM7 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 87 + + + Popup + + + NoControl + + + 203, 145 + + + 24, 24 + + + 214 + + + B + + + btnB + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 89 + + + Popup + + + NoControl + + + 613, 55 + + + 24, 24 + + + 271 + + + / + + + btnNUMSLASH + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 90 + + + Popup + + + NoControl + + + 173, 145 + + + 24, 24 + + + 213 + + + V + + + btnV + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 92 + + + Popup + + + NoControl + + + 613, 85 + + + 24, 24 + + + 270 + + + 8 + + + btnNUM8 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 93 + + + Popup + + + NoControl + + + 143, 145 + + + 24, 24 + + + 212 + + + C + + + btnC + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 95 + + + Popup + + + NoControl + + + 643, 55 + + + 24, 24 + + + 274 + + + * + + + btnNUMSTAR + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 96 + + + Popup + + + NoControl + + + 113, 145 + + + 24, 24 + + + 211 + + + X + + + btnX + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 98 + + + Popup + + + NoControl + + + 643, 85 + + + 24, 24 + + + 269 + + + 9 + + + btnNUM9 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 100 + + + Popup + + + NoControl + + + 83, 145 + + + 24, 24 + + + 210 + + + Z + + + btnZ + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 102 + + + Popup + + + NoControl + + + 673, 55 + + + 24, 24 + + + 268 + + + - + + + btnNUMMINUS + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 104 + + + Popup + + + NoControl + + + 353, 175 + + + 39, 24 + + + 202 + + + RAlt + + + btnRALT + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 106 + + + Popup + + + NoControl + + + 673, 85 + + + 24, 54 + + + 267 + + + + + + + btnNUMPLUS + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 108 + + + Popup + + + NoControl + + + 305, 175 + + + 42, 24 + + + 205 + + + RWin + + + button36 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 110 + + + Popup + + + NoControl + + + 673, 145 + + + 24, 54 + + + 266 + + + Enter + + + btnNUMENTER + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 112 + + + Popup + + + NoControl + + + 113, 175 + + + 42, 24 + + + 204 + + + LWin + + + btnWINDOWS + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 114 + + + Popup + + + NoControl + + + 583, 115 + + + 24, 24 + + + 281 + + + 4 + + + btnNUM4 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 116 + + + Popup + + + NoControl + + + 68, 175 + + + 39, 24 + + + 203 + + + LAlt + + + btnLALT + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 118 + + + Popup + + + NoControl + + + 613, 115 + + + 24, 24 + + + 278 + + + 5Numpad + + + btnNUM5 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 120 + + + Popup + + + NoControl + + + 398, 175 + + + 50, 24 + + + 209 + + + RCtrl + + + btnRCTRL + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 122 + + + Popup + + + NoControl + + + 583, 145 + + + 24, 24 + + + 282 + + + 1 + + + btnNUM1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 124 + + + Popup + + + NoControl + + + 11, 175 + + + 51, 24 + + + 207 + + + LCtrl + + + btnLCTRL + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 126 + + + Popup + + + NoControl + + + 643, 115 + + + 24, 24 + + + 277 + + + 6 + + + btnNUM6 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 128 + + + Popup + + + NoControl + + + 11, 115 + + + 51, 24 + + + 208 + + + Caps + + + btnCAPS + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 130 + + + Popup + + + NoControl + + + 583, 175 + + + 54, 24 + + + 280 + + + 0 + + + btnNUM0 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 131 + + + Popup + + + NoControl + + + 398, 115 + + + 51, 24 + + + 206 + + + Enter + + + btnRETURN + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 129 + + + Popup + + + NoControl + + + 613, 145 + + + 24, 24 + + + 279 + + + 2 + + + btnNUM2 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 127 + + + Popup + + + NoControl + + + 368, 115 + + + 24, 24 + + + 201 + + + ' + + + btnAPOSTROPHE + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 125 + + + Popup + + + NoControl + + + 643, 145 + + + 24, 24 + + + 276 + + + 3 + + + btnNUM3 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 123 + + + NoControl + + + 16, 212 + + + 61, 28 + + + 0 + + + Flash Rate + + + lbFlashRate + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBExtras + + + 4 + + + True + + + NoControl + + + 17, 23 + + + 43, 13 + + + 0 + + + Rumble + + + lbRumble + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBExtras + + + 3 + + + True + + + NoControl + + + 17, 47 + + + 38, 13 + + + 0 + + + Heavy + + + lbHeavy + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBExtras + + + 5 + + + True + + + NoControl + + + 17, 74 + + + 30, 13 + + + 0 + + + Light + + + lbLight + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBExtras + + + 10 + + + 85, 45 + + + 49, 20 + + + 1 + + + nUDHeavy + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBExtras + + + 11 + + + 85, 72 + + + 49, 20 + + + 1 + + + nUDLight + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBExtras + + + 13 + + + Popup + + + NoControl + + + 218, 115 + + + 24, 24 + + + 196 + + + H + + + btnH + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 105 + + + 83, 210 + + + 42, 20 + + + 1 + + + nUDLightFlash + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBExtras + + + 14 + + + False + + + NoControl + + + 34, 179 + + + 100, 20 + + + 163 + + + tBBlueBar + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBExtras + + + 17 + + + Popup + + + NoControl + + + 308, 115 + + + 24, 24 + + + 199 + + + L + + + btnL + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 117 + + + Popup + + + NoControl + + + 278, 115 + + + 24, 24 + + + 198 + + + K + + + btnK + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 113 + + + Popup + + + NoControl + + + 248, 115 + + + 24, 24 + + + 197 + + + J + + + btnJ + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 109 + + + Popup + + + NoControl + + + 533, 176 + + + 33, 24 + + + 285 + + + →Right + + + button5 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 107 + + + False + + + NoControl + + + 33, 153 + + + 100, 20 + + + 162 + + + tBGreenBar + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBExtras + + + 19 + + + False + + + NoControl + + + 33, 127 + + + 100, 20 + + + 161 + + + tBRedBar + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBExtras + + + 20 + + + True + + + NoControl + + + 17, 182 + + + 14, 13 + + + 166 + + + B + + + lbBlue + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBExtras + + + 18 + + + True + + + NoControl + + + 17, 156 + + + 15, 13 + + + 165 + + + G + + + lbGreen + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBExtras + + + 15 + + + Popup + + + NoControl + + + 338, 115 + + + 24, 24 + + + 200 + + + ; + + + btnSEMICOLON + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 121 + + + Popup + + + NoControl + + + 500, 146 + + + 33, 24 + + + 286 + + + ↑Up + + + button7 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 103 + + + NoControl + + + 85, 18 + + + 68, 23 + + + 2 + + + Test + + + bnTest + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBExtras + + + 16 + + + True + + + NoControl + + + 17, 130 + + + 15, 13 + + + 164 + + + R + + + lbRed + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBExtras + + + 12 + + + Popup + + + NoControl + + + 467, 176 + + + 33, 24 + + + 284 + + + ←Left + + + button4 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 111 + + + 114, 288 + + + 49, 20 + + + 242 + + + nUDMouse + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBExtras + + + 0 + + + Popup + + + NoControl + + + 500, 176 + + + 33, 24 + + + 283 + + + ↓Down + + + button6 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 115 + + + Flat + + + NoControl + + + 144, 209 + + + 13, 13 + + + 167 + + + bnColor + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBExtras + + + 6 + + + Popup + + + NoControl + + + 643, 175 + + + 24, 24 + + + 275 + + + . + + + btnNUMDOT + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 119 + + + Popup + + + NoControl + + + 188, 115 + + + 24, 24 + + + 195 + + + G + + + btnG + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 101 + + + True + + + NoControl + + + 663, 8 + + + Yes + + + 79, 17 + + + 288 + + + Scan Code + + + cBScanCode + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 99 + + + Popup + + + NoControl + + + 158, 115 + + + 24, 24 + + + 194 + + + F + + + btnF + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 97 + + + NoControl + + + 0, 326 + + + 167, 60 + + + 289 + + + You can also select +a key by typing it + + + TopCenter + + + lBTip + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBExtras + + + 21 + + + Popup + + + NoControl + + + 128, 115 + + + 24, 24 + + + 193 + + + D + + + btnD + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 94 + + + Flat + + + NoControl + + + 452, 106 + + + 38, 33 + + + 293 + + + btnAButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 4 + + + Popup + + + NoControl + + + 98, 115 + + + 24, 24 + + + 192 + + + S + + + btnS + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 91 + + + Flat + + + NoControl + + + 309, 81 + + + 50, 30 + + + 291 + + + Guide + + + btnGuide + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 2 + + + Popup + + + NoControl + + + 68, 115 + + + 24, 24 + + + 191 + + + A + + + btnA + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 88 + + + Flat + + + NoControl + + + 370, 80 + + 30, 30 - - 4, 4, 4, 4 + + 294 - - 329, 181 + + btnStart - - 4, 4, 4, 4 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + pnl360Controls + + + 6 + + + Popup + + + NoControl + + + 11, 85 + + + 36, 24 + + + 189 + + + Tab + + + btnTAB + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 85 + + + Flat + + + NoControl + + + 266, 80 + + + 30, 30 + + + 292 + + + btnBack + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 9 + + + Popup + + + NoControl + + + 413, 85 + + + 36, 24 + + + 190 + + + \ + + + btnBACKSLASH + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 82 + + + Flat + + + NoControl + + + 497, 78 + + + 30, 30 + + + 295 + + + btnBButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 12 + + + Popup + + + NoControl + + + 383, 85 + + + 24, 24 + + + 188 + + + ] + + + btnCLOSEBRACKET + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 79 + + + Flat + + + NoControl + + + 420, 78 + + + 32, 34 + + + 296 + + + btnXButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 15 + + + Popup + + + NoControl + + + 353, 85 + + + 24, 24 + + + 187 + + + [ + + + btnOPENBRACKET + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 76 + + + Flat + + + NoControl + + + 455, 46 + + + 38, 35 + + + 297 + + + btnYButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 18 + + + Popup + + + NoControl + + + 323, 85 + + + 24, 24 + + + 186 + + + P + + + btnP + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 73 + + + Flat + + + NoControl + + + 14, 50 + + + 79, 29 + + + 299 + + + btnLB + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 5 + + + Popup + + + NoControl + + + 293, 85 + + + 24, 24 + + + 185 + + + O + + + btnO + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 70 + + + Flat + + + NoControl + + + 278, 155 + + + 30, 30 + + + 304 + + + btnDpadRight + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 21 + + + Popup + + + NoControl + + + 263, 85 + + + 24, 24 + + + 184 + + + I + + + btnI + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 67 + + + Flat + + + NoControl + + + 251, 138 + + + 27, 21 + + + 305 + + + btnDpadUp + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 27 + + + Popup + + + NoControl + + + 233, 85 + + + 24, 24 + + + 183 + + + U + + + btnU + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 64 + + + Flat + + + NoControl + + + 254, 178 + + + 26, 21 + + + 306 + + + btnDpadDown + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 26 + + + Popup + + + NoControl + + + 203, 85 + + + 24, 24 + + + 182 + + + Y + + + btnY + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 61 + + + Flat + + + NoControl + + + 224, 153 + + + 26, 30 + + + 307 + + + btnDpadLeft + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 23 + + + Popup + + + NoControl + + + 173, 85 + + + 24, 24 + + + 181 + + + T + + + btnT + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 58 + + + Flat + + + NoControl + + + 60, 10 + + + 30, 42 + + + 313 + + + btnLT + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 3 + + + Popup + + + NoControl + + + 143, 85 + + + 24, 24 + + + 180 + + + R + + + btnR + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 55 + + True - - - uk - + + + NoControl + + + 294, 1 + + + 73, 13 + + + 318 + + + X360 Controls + + + X360Label + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 22 + + + Popup + + + NoControl + + + 826, 85 + + + 24, 24 + + + 178 + + + R + + + bTNRIGHTMOUSE + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 52 + + + True + + + NoControl + + + 461, 9 + + + 108, 13 + + + 318 + + + Keyboard and Mouse + + + KBMlabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 50 + + + Popup + + + NoControl + + + 113, 85 + + + 24, 24 + + + 179 + + + E + + + btnE + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 48 + + + True + + + NoControl + + + 10, 9 + + + 322, 13 + + + 319 + + + Macro On, Choose a key to disable, else close this window to save + + + False + + + lBMacroOn + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 6 + + + Popup + + + NoControl + + + 796, 110 + + + 24, 21 + + + 175 + + + + + + bnWHEELDOWN + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 45 + + + NoControl + + + 749, 4 + + + 118, 23 + + + 321 + + + Record a macro + + + bnMacro + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 43 + + + Popup + + + NoControl + + + 796, 62 + + + 24, 22 + + + 174 + + + + + + bnWHEELUP + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 41 + + + Flat + + + NoControl + + + 371, 166 + + + 15, 30 + + + 311 + + + btnRSLeft + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 20 + + + Popup + + + NoControl + + + 796, 85 + + + 24, 24 + + + 176 + + + M + + + btnMIDDLEMOUSE + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 38 + + + Flat + + + NoControl + + + 384, 189 + + + 29, 14 + + + 309 + + + btnRSDown + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 17 + + + Popup + + + NoControl + + + 83, 85 + + + 24, 24 + + + 177 + + + W + + + btnW + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 35 + + + Flat + + + NoControl + + + 414, 166 + + + 14, 30 + + + 314 + + + btnRSRight + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 16 + + + Popup + + + NoControl + + + 831, 150 + + + 19, 24 + + + 169 + + + 5 + + + button33 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 32 + + + Flat + + + NoControl + + + 563, 55 + + + 90, 30 + + + 298 + + + btnRB + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 14 + + + Popup + + + NoControl + + + 766, 150 + + + 19, 24 + + + 173 + + + 4 + + + btn4THMOUSE + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 29 + + + Flat + + + NoControl + + + 163, 94 + + + 13, 30 + + + 310 + + + btnLSLeft + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 13 + + + Popup + + + NoControl + + + 843, 120 + + + 24, 24 + + + 171 + + + + + + btnMOUSERIGHT + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 26 + + + Flat + + + NoControl + + + 384, 155 + + + 30, 13 + + + 302 + + + btnRSUp + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 10 + + + Popup + + + NoControl + + + 745, 121 + + + 24, 24 + + + 172 + + + + + + btnMOUSELEFT + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 23 + + + Flat + + + NoControl + + + 178, 124 + + + 30, 11 + + + 308 + + + btnLSDown + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 8 + + + Popup + + + NoControl + + + 796, 170 + + + 24, 24 + + + 170 + + + + + + btnMOUSEDOWN + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 20 + + + Flat + + + NoControl + + + 574, 12 + + + 40, 44 + + + 312 + + + btnRT + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 7 + + + Popup + + + NoControl + + + 796, 28 + + + 24, 24 + + + 167 + + + + + + btnMOUSEUP + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 17 + + + Flat + + + NoControl + + + 212, 95 + + + 10, 30 + + + 315 + + + btnLSRight + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 11 + + + Popup + + + NoControl + + + 766, 85 + + + 24, 24 + + + 168 + + + L + + + btnLEFTMOUSE + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 14 + + + Flat + + + NoControl + + + 385, 170 + + + 26, 19 + + + 303 + + + btnRSClick + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 19 + + + Popup + + + NoControl + + + 53, 85 + + + 24, 24 + + + 0 + + + Q + + + btnQ + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 11 + + + Flat + + + NoControl + + + 178, 83 + + + 30, 11 + + + 300 + + + btnLSUp + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 25 + + + Flat + + + NoControl + + + 182, 99 + + + 22, 22 + + + 301 + + + btnLSClick + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 24 + + + True + + + NoControl + + + 598, 8 + + + Yes + + + 59, 17 + + + 287 + + + Toggle + + + cBToggle + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 8 + + + NoControl + + + 22, 330 + + + 160, 23 + + + 323 + + + Default + + + btnDefault + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 7 + + + NoControl + + + 22, 365 + + + 160, 23 + + + 317 + + + Unbound + + + btnUNBOUND + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 5 + + + Popup + + + NoControl + + + 11, 25 + + + 51, 24 + + + 235 + + + Escape + + + btnESC + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + + + BottomRight + + + NoControl + + + 6, 245 + + + No + + + 158, 37 + + + 243 + + + Change Mouse Sensitivity + + + BottomLeft + + + cBMouse + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBExtras + + + 1 + + + True + + + MiddleRight + + + NoControl + + + 2, 107 + + + No + + + 89, 17 + + + 243 + + + Change Light + + + cBLightbar + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBExtras + + + 2 + + + True + + + NoControl + + + 138, 182 + + + 25, 13 + + + 0 + + + 255 + + + lbBlueV + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBExtras + + + 7 + + + True + + + NoControl + + + 138, 154 + + + 25, 13 + + + 0 + + + 255 + + + lbGreenV + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBExtras + + + 8 + + + True + + + NoControl + + + 138, 129 + + + 25, 13 + + + 0 + + + 255 + + + lbRedV + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBExtras + + + 9 + + + Right + + + 871, 0 + + + 167, 446 + + + 324 + + + Extras + + + gBExtras + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + True + + + NoControl + + + 22, 209 + + + 2, 2, 2, 2 + + + 62, 17 + + + 325 + + + Regular + + + rBRegular + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + True + + + NoControl + + + 94, 209 + + + 2, 2, 2, 2 + + + 86, 17 + + + 326 + + + Shift Modifier + + + rBShiftModifer + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Select Shift Trigger + + + Cross + + + Circle + + + Square + + + Triangle + + + Options + + + Share + + + Up + + + Down + + + Left + + + Right + + + PS + + + L1 + + + R1 + + + L2 + + + R2 + + + L3 + + + R3 + + + Left Touch + + + Upper Touch + + + Multitouch + + + Right Touch + + + Sixaxis Up + + + Sixaxis Down + + + Sixaxis Left + + + Sixaxis Right + + + Finger on Touchpad + + + 22, 236 + + + 161, 21 + + + 327 + + + cBShiftButton + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + Zoom + + + True + + + NoControl + + + 467, 24 + + + 14, 13 + + + 323 + + + A + + + False + + + lb360Tip + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnl360Controls + + + 0 + + + 203, 202 + + + 2, 2, 2, 2 + + + 668, 247 + + + 328 + + + pnl360Controls + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 133 + 17, 17 + + True + + + 96, 96 + + + 1038, 446 + + + CenterParent + + + Keybaord + + + advColorDialog + + + DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.4.101.0, Culture=neutral, PublicKeyToken=null + + + KBM360 + + + 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/KBM360.uk.resx b/DS4Windows/DS4Forms/KBM360.uk.resx index 2c93104..436a15b 100644 --- a/DS4Windows/DS4Forms/KBM360.uk.resx +++ b/DS4Windows/DS4Forms/KBM360.uk.resx @@ -117,121 +117,1166 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 582, 165 + + + 24, 24 + + + 760, 44 + + + 97, 140 + + + 218, 25 + + + 27, 24 + + + 188, 25 + + + 27, 24 + + + 248, 25 + + + 27, 24 + + + 158, 25 + + + 27, 24 + + + 278, 25 + + + 27, 24 + + + 128, 25 + + + 27, 24 + + + 308, 25 + + + 27, 24 + + + 98, 25 + + + 27, 24 + + + 467, 55 + + + 33, 24 + + + 68, 25 + + + 27, 24 + + + 500, 55 + + + 33, 24 + + + 38, 55 + + + 24, 24 + + + 533, 55 + + + 33, 24 + + + 398, 55 + + + 51, 24 + + + 533, 85 + + + 33, 24 + + + 368, 55 + + + 24, 24 + + + 500, 85 + + + 33, 24 + + + 338, 55 + + + 24, 24 + + + 467, 85 + + + 33, 24 + + + 308, 55 + + + 24, 24 + + + 500, 25 + + + 33, 24 + + + 278, 55 + + + 24, 24 + + + 467, 25 + + + 33, 24 + + + 248, 55 + + + 24, 24 + + + 613, 26 + + + 24, 24 + + + 218, 55 + + + 24, 24 + + + 643, 26 + + + 24, 24 + + + 188, 55 + + + 24, 24 + + + 673, 26 + + + 24, 24 + + + 158, 55 + + + 24, 24 + + + 583, 26 + + + 24, 24 + + + 128, 55 + + + 24, 24 + + + 703, 26 + + + 40, 24 + + + 98, 55 + + + 24, 24 + + + 703, 55 + + + 40, 24 + + + 68, 55 + + + 24, 24 + + + 703, 85 + + + 40, 24 + + + 161, 175 + + + 138, 24 + + + 533, 25 + + + 33, 24 + + + 11, 145 + + + 66, 24 + + + 413, 25 + + + 33, 24 + + + 383, 145 + + + 66, 24 + + + 338, 25 + + + 33, 24 + + + 353, 145 + + + 24, 24 + + + 374, 25 + + + 33, 24 + + + 323, 145 + + + 24, 24 + + + 11, 55 + + + 24, 24 + + + 293, 145 + + + 24, 24 + + + 263, 145 + + + 24, 24 + + + 583, 55 + + + 24, 24 + + + 233, 145 + + + 24, 24 + + + 583, 85 + + + 24, 24 + + + 203, 145 + + + 24, 24 + + + 613, 55 + + + 24, 24 + + + 173, 145 + + + 24, 24 + + + 613, 85 + + + 24, 24 + + + 143, 145 + + + 24, 24 + + + 643, 55 + + + 24, 24 + + + 113, 145 + + + 24, 24 + + + 643, 85 + + + 24, 24 + + + 83, 145 + + + 24, 24 + + + 673, 55 + + + 24, 24 + + + 353, 175 + + + 39, 24 + + + 673, 85 + + + 24, 54 + + + 305, 175 + + + 42, 24 + + + 673, 145 + + + 24, 54 + + + 113, 175 + + + 42, 24 + + + 583, 115 + + + 24, 24 + + + 68, 175 + + + 39, 24 + + + 613, 115 + + + 24, 24 + + + 398, 175 + + + 50, 24 + + + 583, 145 + + + 24, 24 + + + 11, 175 + + + 51, 24 + + + 643, 115 + + + 24, 24 + + + 11, 115 + + + 51, 24 + + + 583, 175 + + + 54, 24 + + + 398, 115 + + + 51, 24 + + + 613, 145 + + + 24, 24 + + + 368, 115 + + + 24, 24 + + + 643, 145 + + + 24, 24 + + + 16, 212 + + + 61, 28 + Частота мерехтіння - + + 17, 23 + - 63, 17 + 48, 13 Вібрація + + 17, 47 + - 57, 17 + 46, 13 Важкий + + 17, 74 + - 54, 17 + 44, 13 Легкий + + 85, 45 + + + 49, 20 + + + 85, 72 + + + 49, 20 + + + 218, 115 + + + 24, 24 + + + 83, 210 + + + 42, 20 + + + 34, 179 + + + 100, 20 + + + 308, 115 + + + 24, 24 + + + 278, 115 + + + 24, 24 + + + 248, 115 + + + 24, 24 + + + 533, 176 + + + 33, 24 + + + 33, 153 + + + 100, 20 + + + 33, 127 + + + 100, 20 + + + 17, 182 + + + 14, 13 + С + + 17, 156 + - 17, 17 + 14, 13 З + + 338, 115 + + + 24, 24 + + + 500, 146 + + + 33, 24 + + + 85, 18 + + + 68, 23 + Тест + + 17, 130 + + + 15, 13 + Ч + + 467, 176 + + + 33, 24 + + + 114, 288 + + + 49, 20 + + + 500, 176 + + + 33, 24 + + + 144, 209 + + + 13, 13 + + + 643, 175 + + + 24, 24 + + + 188, 115 + + + 24, 24 + - 799, 10 + 639, 8 - 126, 21 + 100, 17 Сканувати код + + 158, 115 + + + 24, 24 + + + 0, 326 + + + 167, 60 + Ви можете обрати клавішу натиснувши її + + 128, 115 + + + 24, 24 + + + 452, 106 + + + 38, 33 + + + 98, 115 + + + 24, 24 + + + 309, 81 + + + 50, 30 + Гід + + 68, 115 + + + 24, 24 + + + 370, 80 + + + 30, 30 + + + 11, 85 + + + 36, 24 + + + 266, 80 + + + 30, 30 + + + 413, 85 + + + 36, 24 + + + 497, 78 + + + 30, 30 + + + 383, 85 + + + 24, 24 + + + 420, 78 + + + 32, 34 + + + 353, 85 + + + 24, 24 + + + 455, 46 + + + 38, 35 + + + 323, 85 + + + 24, 24 + + + 14, 50 + + + 79, 29 + + + 293, 85 + + + 24, 24 + + + 278, 155 + + + 30, 30 + + + 263, 85 + + + 24, 24 + + + 251, 138 + + + 27, 21 + + + 233, 85 + + + 24, 24 + + + 254, 178 + + + 26, 21 + + + 203, 85 + + + 24, 24 + + + 224, 153 + + + 26, 30 + + + 173, 85 + + + 24, 24 + + + 60, 10 + + + 30, 42 + + + 143, 85 + + + 24, 24 + + + 294, 1 + - 118, 17 + 90, 13 X360 управління + + 826, 85 + + + 24, 24 + - 581, 150 + 465, 120 - 140, 17 + 107, 13 Клавіатура та миша + + 113, 85 + + + 24, 24 + + + 10, 9 + - 578, 17 + 445, 13 Макро увімкнено, виберіть клавішу, щоб відключити, або зачиніть вікно, щоб зберегти + + 796, 110 + + + 24, 21 + + + 749, 4 + + + 118, 23 + Запис макросу + + 796, 62 + + + 24, 22 + + + 371, 166 + + + 15, 30 + + + 796, 85 + + + 24, 24 + + + 384, 189 + + + 29, 14 + + + 83, 85 + + + 24, 24 + + + 414, 166 + + + 14, 30 + + + 831, 150 + + + 19, 24 + + + 563, 55 + + + 90, 30 + + + 766, 150 + + + 19, 24 + + + 163, 94 + + + 13, 30 + + + 843, 120 + + + 24, 24 + + + 384, 155 + + + 30, 13 + + + 745, 121 + + + 24, 24 + + + 178, 124 + + + 30, 11 + + + 796, 170 + + + 24, 24 + + + 574, 12 + + + 40, 44 + + + 796, 28 + + + 24, 24 + + + 212, 95 + + + 10, 30 + + + 766, 85 + + + 24, 24 + + + 385, 170 + + + 26, 19 + + + 53, 85 + + + 24, 24 + + + 178, 83 + + + 30, 11 + + + 182, 99 + + + 22, 22 + - 692, 10 + 554, 8 - 104, 21 + 83, 17 Перемикач + + 22, 330 + + + 160, 23 + За замовчуванням + + 22, 365 + + + 160, 23 + Незв'язано + + 11, 25 + + + 51, 24 + + + 6, 245 + + + 158, 37 + Змінити чутливість миші + + 2, 107 + - 126, 21 + 100, 17 Змінити світло + + 138, 182 + + + 25, 13 + + + 138, 154 + + + 25, 13 + + + 138, 129 + + + 25, 13 + + + 871, 0 + + + 167, 446 + Додаткове + + 22, 209 + + + + 2, 2, 2, 2 + - 101, 21 + 79, 17 Звичайний - 135, 261 + 108, 209 + + + 2, 2, 2, 2 - 84, 21 + 68, 17 Зміна дії @@ -239,4 +1284,31 @@ Виберіть перемикач зміни дії + + 22, 236 + + + 161, 21 + + + 467, 24 + + + 14, 13 + + + 203, 202 + + + 2, 2, 2, 2 + + + 668, 247 + + + 96, 96 + + + 1038, 446 + \ No newline at end of file diff --git a/DS4Windows/DS4Forms/LanguagePackComboBox.Designer.cs b/DS4Windows/DS4Forms/LanguagePackComboBox.Designer.cs new file mode 100644 index 0000000..1ed1ff2 --- /dev/null +++ b/DS4Windows/DS4Forms/LanguagePackComboBox.Designer.cs @@ -0,0 +1,70 @@ +namespace DS4Windows.DS4Forms +{ + partial class LanguagePackComboBox + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Код, автоматически созданный конструктором компонентов + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LanguagePackComboBox)); + this.cbCulture = new System.Windows.Forms.ComboBox(); + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // cbCulture + // + resources.ApplyResources(this.cbCulture, "cbCulture"); + this.cbCulture.DisplayMember = "Value"; + this.cbCulture.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbCulture.FormattingEnabled = true; + this.cbCulture.Name = "cbCulture"; + this.cbCulture.ValueMember = "Key"; + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + this.label1.SizeChanged += new System.EventHandler(this.LanguagePackComboBox_SizeChanged); + // + // LanguagePackComboBox + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.cbCulture); + this.Controls.Add(this.label1); + this.Name = "LanguagePackComboBox"; + this.SizeChanged += new System.EventHandler(this.LanguagePackComboBox_SizeChanged); + this.Resize += new System.EventHandler(this.LanguagePackComboBox_SizeChanged); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ComboBox cbCulture; + private System.Windows.Forms.Label label1; + } +} diff --git a/DS4Windows/DS4Forms/LanguagePackComboBox.cs b/DS4Windows/DS4Forms/LanguagePackComboBox.cs new file mode 100644 index 0000000..e065aca --- /dev/null +++ b/DS4Windows/DS4Forms/LanguagePackComboBox.cs @@ -0,0 +1,145 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace DS4Windows.DS4Forms +{ + public partial class LanguagePackComboBox : UserControl + { + private string InvariantCultureTextValue = "No (English UI)"; + private TaskCompletionSource LanguageListInitialized = new TaskCompletionSource(); + + // If probing path has been changed in App.config, add the same string here. + private string ProbingPath = "Lang"; + + // Filter language assembly file names in order to ont include irrelevant assemblies to the combo box. + private string LanguageAssemblyName = "DS4Windows.resources.dll"; + + [Category("Action")] + [Description("Fires when the combo box selected index is changed.")] + public event EventHandler SelectedIndexChanged; + + [Category("Action")] + [Description("Fires when the combo box selected value is changed.")] + public event EventHandler SelectedValueChanged; + + [Category("Data")] + [Description("Text used for invariant culture name in the combo box.")] + [Localizable(true)] + public string InvariantCultureText + { + get { return InvariantCultureTextValue; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("InvariantCultureText_Changed call will complete when ready, no need for a warning", "CS4014:Await.Warning")] + set { + InvariantCultureTextValue = value; + InvariantCultureText_Changed(value); + } + } + + [Category("Data")] + [Description("Text for label before the combo box.")] + [Localizable(true)] + public string LabelText { + get { return label1.Text; } + set { label1.Text = value; } + } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public int SelectedIndex + { + get { return cbCulture.SelectedIndex; } + set { cbCulture.SelectedIndex = value; } + } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public string SelectedText + { + get { return cbCulture.SelectedText; } + set { cbCulture.SelectedText = value; } + } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public object SelectedValue + { + get { return cbCulture.SelectedValue; } + set { cbCulture.SelectedValue = value; } + } + + public LanguagePackComboBox() + { + InitializeComponent(); + cbCulture.Enabled = false; + + Task.Run(() => { + // Find available language assemblies and bind the list to the combo box. + cbCulture.DataSource = CreateLanguageAssembliesBindingSource(); + cbCulture.SelectedValue = Thread.CurrentThread.CurrentUICulture.Name; + + // This must be set here instead of Designer or event would fire at initial selected value setting above. + cbCulture.SelectedIndexChanged += new EventHandler(CbCulture_SelectedIndexChanged); + cbCulture.SelectedValueChanged += new EventHandler(CbCulture_SelectedValueChanged); + + cbCulture.Enabled = true; + LanguageListInitialized.SetResult(true); + }); + } + + private BindingSource CreateLanguageAssembliesBindingSource() + { + // Find the location where application installed. + string exeLocation = Path.GetDirectoryName(Uri.UnescapeDataString(new UriBuilder(Assembly.GetExecutingAssembly().CodeBase).Path)); + List lookupPaths = ProbingPath.Split(';') + .Select(path => Path.Combine(exeLocation, path)) + .Where(path => path != exeLocation) + .ToList(); + lookupPaths.Insert(0, exeLocation); + + // Get all culture for which satellite folder found with culture code, then insert invariant culture at the beginning. + List> cultures = CultureInfo.GetCultures(CultureTypes.AllCultures) + .Where(c => IsLanguageAssemblyAvailable(lookupPaths, c)) + .Select(c => new KeyValuePair(c.Name, c.NativeName)) + .ToList(); + cultures.Insert(0, new KeyValuePair("", InvariantCultureText)); + + return new BindingSource(cultures, null); + } + + private bool IsLanguageAssemblyAvailable(List lookupPaths, CultureInfo culture) + { + return lookupPaths.Select(path => Path.Combine(path, culture.Name, LanguageAssemblyName)) + .Where(path => File.Exists(path)) + .Count() > 0; + } + + private async Task InvariantCultureText_Changed(string value) + { + // Normally the completion flag will be long set by the time this method is called. + await LanguageListInitialized.Task; + BindingSource dataSource = ((BindingSource)cbCulture.DataSource); + dataSource[0] = new KeyValuePair("", value); + } + + private void LanguagePackComboBox_SizeChanged(object sender, EventArgs e) + { + cbCulture.Left = label1.Margin.Left + label1.Width + label1.Margin.Right; + cbCulture.Width = Width - cbCulture.Left - cbCulture.Margin.Right - cbCulture.Margin.Left; + } + + private void CbCulture_SelectedIndexChanged(object sender, EventArgs e) + { + SelectedIndexChanged?.Invoke(this, e); + } + + private void CbCulture_SelectedValueChanged(object sender, EventArgs e) + { + SelectedValueChanged?.Invoke(this, e); + } + } +} diff --git a/DS4Windows/DS4Forms/Alreadyrunning.resx b/DS4Windows/DS4Forms/LanguagePackComboBox.resx similarity index 63% rename from DS4Windows/DS4Forms/Alreadyrunning.resx rename to DS4Windows/DS4Forms/LanguagePackComboBox.resx index 1af7de1..175e22a 100644 --- a/DS4Windows/DS4Forms/Alreadyrunning.resx +++ b/DS4Windows/DS4Forms/LanguagePackComboBox.resx @@ -117,4 +117,79 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Right + + + + 112, 3 + + + 145, 21 + + + + 61 + + + cbCulture + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + Left + + + True + + + 3, 6 + + + 100, 13 + + + 62 + + + Use language pack + + + MiddleLeft + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + True + + + 6, 13 + + + 260, 27 + + + LanguagePackComboBox + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/DS4Windows/DS4Forms/Options.Designer.cs b/DS4Windows/DS4Forms/Options.Designer.cs index 4e71cdc..95eaafa 100644 --- a/DS4Windows/DS4Forms/Options.Designer.cs +++ b/DS4Windows/DS4Forms/Options.Designer.cs @@ -76,6 +76,13 @@ this.nUDL2 = new System.Windows.Forms.NumericUpDown(); this.gBTouchpad = new System.Windows.Forms.GroupBox(); this.pnlTPMouse = new System.Windows.Forms.Panel(); + this.trackFrictionLb = new System.Windows.Forms.Label(); + this.trackFrictionNUD = new System.Windows.Forms.NumericUpDown(); + this.trackballCk = new System.Windows.Forms.CheckBox(); + this.touchpadDisInvertButton = new System.Windows.Forms.Button(); + this.label25 = new System.Windows.Forms.Label(); + this.label15 = new System.Windows.Forms.Label(); + this.touchpadInvertComboBox = new System.Windows.Forms.ComboBox(); this.cbStartTouchpadOff = new System.Windows.Forms.CheckBox(); this.rBTPControls = new System.Windows.Forms.RadioButton(); this.rBTPMouse = new System.Windows.Forms.RadioButton(); @@ -114,6 +121,9 @@ this.bnSwipeRight = new System.Windows.Forms.Button(); this.lbSwipeRight = new System.Windows.Forms.Label(); this.gBOther = new System.Windows.Forms.GroupBox(); + this.btPollRateLabel = new System.Windows.Forms.Label(); + this.btPollRateComboBox = new System.Windows.Forms.ComboBox(); + 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(); @@ -249,6 +259,45 @@ this.lbActionsTip = new System.Windows.Forms.Label(); this.tCSens = new System.Windows.Forms.TabControl(); this.tPDeadzone = new System.Windows.Forms.TabPage(); + this.antiDeadzoneTabPage = new System.Windows.Forms.TabPage(); + this.nUDSixaxisZAntiDead = new System.Windows.Forms.NumericUpDown(); + this.nUDSixaxisXAntiDead = new System.Windows.Forms.NumericUpDown(); + this.label20 = new System.Windows.Forms.Label(); + this.label19 = new System.Windows.Forms.Label(); + 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.maxZoneTabPage = new System.Windows.Forms.TabPage(); + this.nUDSixAxisZMaxZone = new System.Windows.Forms.NumericUpDown(); + this.nUDSixAxisXMaxZone = new System.Windows.Forms.NumericUpDown(); + this.label18 = new System.Windows.Forms.Label(); + this.label17 = new System.Windows.Forms.Label(); + this.nUDR2Maxzone = new System.Windows.Forms.NumericUpDown(); + this.nUDL2Maxzone = new System.Windows.Forms.NumericUpDown(); + this.label8 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.nUDRSMaxZone = new System.Windows.Forms.NumericUpDown(); + this.label6 = new System.Windows.Forms.Label(); + this.nUDLSMaxZone = new System.Windows.Forms.NumericUpDown(); + this.label5 = new System.Windows.Forms.Label(); + this.tPOutCurve = new System.Windows.Forms.TabPage(); + this.cBSixaxisZOutputCurve = new System.Windows.Forms.ComboBox(); + this.cBSixaxisXOutputCurve = new System.Windows.Forms.ComboBox(); + this.label24 = new System.Windows.Forms.Label(); + this.label23 = new System.Windows.Forms.Label(); + this.cBR2OutputCurve = new System.Windows.Forms.ComboBox(); + this.cBL2OutputCurve = new System.Windows.Forms.ComboBox(); + this.label22 = new System.Windows.Forms.Label(); + this.label21 = new System.Windows.Forms.Label(); + this.rsOutCurveComboBox = new System.Windows.Forms.ComboBox(); + this.lsOutCurveComboBox = new System.Windows.Forms.ComboBox(); + this.label10 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); this.tPCurve = new System.Windows.Forms.TabPage(); this.nUDLSCurve = new System.Windows.Forms.NumericUpDown(); this.nUDRSCurve = new System.Windows.Forms.NumericUpDown(); @@ -256,11 +305,26 @@ this.lbRSCurvePercent = new System.Windows.Forms.Label(); this.lbLSCurvePercent = new System.Windows.Forms.Label(); this.lbLSCurve = new System.Windows.Forms.Label(); + this.tpRotation = new System.Windows.Forms.TabPage(); + this.nUDRSRotation = new System.Windows.Forms.NumericUpDown(); + this.label14 = new System.Windows.Forms.Label(); + this.nUDLSRotation = new System.Windows.Forms.NumericUpDown(); + this.label13 = 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(); this.rBSAMouse = new System.Windows.Forms.RadioButton(); this.pnlSAMouse = new System.Windows.Forms.Panel(); + this.cBGyroMouseXAxis = new System.Windows.Forms.ComboBox(); + this.label16 = new System.Windows.Forms.Label(); + this.lbGyroSmooth = new System.Windows.Forms.Label(); + this.cBGyroSmooth = new System.Windows.Forms.CheckBox(); + this.lbSmoothWeight = new System.Windows.Forms.Label(); + this.nUDGyroSmoothWeight = new System.Windows.Forms.NumericUpDown(); + this.label12 = new System.Windows.Forms.Label(); + this.nUDGyroMouseVertScale = new System.Windows.Forms.NumericUpDown(); + this.label11 = new System.Windows.Forms.Label(); + this.gyroTriggerBehavior = new System.Windows.Forms.CheckBox(); this.cBGyroInvertY = new System.Windows.Forms.CheckBox(); this.cBGyroInvertX = new System.Windows.Forms.CheckBox(); this.lbGyroInvert = new System.Windows.Forms.Label(); @@ -302,6 +366,26 @@ this.shareToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.pSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.alwaysOnToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.cMTouchDisableInvert = new System.Windows.Forms.ContextMenuStrip(this.components); + this.crossTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.circleTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.squareTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.triangleTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.l1TouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.l2TouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.r1TouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.r2TouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.upTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.downTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.leftTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.rightTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.l3TouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.r3TouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.oneFingerTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.twoFingerTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.optionsTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.shareTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.psTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.advColorDialog = new DS4Windows.AdvancedColorDialog(); ((System.ComponentModel.ISupportInitialize)(this.nUDRainbow)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tBBlueBar)).BeginInit(); @@ -324,6 +408,7 @@ ((System.ComponentModel.ISupportInitialize)(this.nUDL2)).BeginInit(); this.gBTouchpad.SuspendLayout(); this.pnlTPMouse.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.trackFrictionNUD)).BeginInit(); this.fLPTouchSwipe.SuspendLayout(); this.cMSPresets.SuspendLayout(); this.gBOther.SuspendLayout(); @@ -359,12 +444,32 @@ this.fLPActionButtons.SuspendLayout(); this.tCSens.SuspendLayout(); this.tPDeadzone.SuspendLayout(); + this.antiDeadzoneTabPage.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nUDSixaxisZAntiDead)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDSixaxisXAntiDead)).BeginInit(); + ((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.maxZoneTabPage.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nUDSixAxisZMaxZone)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDSixAxisXMaxZone)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDR2Maxzone)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDL2Maxzone)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDRSMaxZone)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDLSMaxZone)).BeginInit(); + this.tPOutCurve.SuspendLayout(); this.tPCurve.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nUDLSCurve)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDRSCurve)).BeginInit(); + this.tpRotation.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nUDRSRotation)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDLSRotation)).BeginInit(); this.fLPSettings.SuspendLayout(); this.gBGyro.SuspendLayout(); this.pnlSAMouse.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nUDGyroSmoothWeight)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDGyroMouseVertScale)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDGyroSensitivity)).BeginInit(); this.gBSensitivity.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nUDL2S)).BeginInit(); @@ -374,12 +479,13 @@ ((System.ComponentModel.ISupportInitialize)(this.nUDSXS)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDSZS)).BeginInit(); this.cMGyroTriggers.SuspendLayout(); + this.cMTouchDisableInvert.SuspendLayout(); 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); @@ -466,7 +572,7 @@ resources.ApplyResources(this.cBDoubleTap, "cBDoubleTap"); this.cBDoubleTap.Checked = true; this.cBDoubleTap.CheckState = System.Windows.Forms.CheckState.Checked; - this.cBDoubleTap.ForeColor = System.Drawing.SystemColors.ControlLightLight; + this.cBDoubleTap.ForeColor = System.Drawing.SystemColors.ControlText; this.cBDoubleTap.Name = "cBDoubleTap"; this.cBDoubleTap.UseVisualStyleBackColor = true; this.cBDoubleTap.CheckedChanged += new System.EventHandler(this.cBDoubleTap_CheckedChanged); @@ -476,7 +582,7 @@ resources.ApplyResources(this.cBTap, "cBTap"); this.cBTap.Checked = true; this.cBTap.CheckState = System.Windows.Forms.CheckState.Checked; - this.cBTap.ForeColor = System.Drawing.SystemColors.ControlLightLight; + this.cBTap.ForeColor = System.Drawing.SystemColors.ControlText; this.cBTap.Name = "cBTap"; this.cBTap.UseVisualStyleBackColor = true; this.cBTap.CheckedChanged += new System.EventHandler(this.cBTap_CheckedChanged); @@ -502,7 +608,7 @@ resources.ApplyResources(this.cBScroll, "cBScroll"); this.cBScroll.Checked = true; this.cBScroll.CheckState = System.Windows.Forms.CheckState.Checked; - this.cBScroll.ForeColor = System.Drawing.SystemColors.ControlLightLight; + this.cBScroll.ForeColor = System.Drawing.SystemColors.ControlText; this.cBScroll.Name = "cBScroll"; this.cBScroll.UseVisualStyleBackColor = true; this.cBScroll.CheckedChanged += new System.EventHandler(this.cBScroll_CheckedChanged); @@ -512,7 +618,7 @@ resources.ApplyResources(this.cBSlide, "cBSlide"); this.cBSlide.Checked = true; this.cBSlide.CheckState = System.Windows.Forms.CheckState.Checked; - this.cBSlide.ForeColor = System.Drawing.SystemColors.ControlLightLight; + this.cBSlide.ForeColor = System.Drawing.SystemColors.ControlText; this.cBSlide.Name = "cBSlide"; this.cBSlide.UseVisualStyleBackColor = true; this.cBSlide.CheckedChanged += new System.EventHandler(this.cBSlide_CheckedChanged); @@ -562,7 +668,7 @@ // cBlowerRCOn // resources.ApplyResources(this.cBlowerRCOn, "cBlowerRCOn"); - this.cBlowerRCOn.ForeColor = System.Drawing.SystemColors.ControlLightLight; + this.cBlowerRCOn.ForeColor = System.Drawing.SystemColors.ControlText; this.cBlowerRCOn.Name = "cBlowerRCOn"; this.cBlowerRCOn.UseVisualStyleBackColor = true; this.cBlowerRCOn.CheckedChanged += new System.EventHandler(this.lowerRCOffCheckBox_CheckedChanged); @@ -570,9 +676,7 @@ // cBTouchpadJitterCompensation // resources.ApplyResources(this.cBTouchpadJitterCompensation, "cBTouchpadJitterCompensation"); - this.cBTouchpadJitterCompensation.Checked = true; - this.cBTouchpadJitterCompensation.CheckState = System.Windows.Forms.CheckState.Checked; - this.cBTouchpadJitterCompensation.ForeColor = System.Drawing.SystemColors.ControlLightLight; + this.cBTouchpadJitterCompensation.ForeColor = System.Drawing.SystemColors.ControlText; this.cBTouchpadJitterCompensation.Name = "cBTouchpadJitterCompensation"; this.cBTouchpadJitterCompensation.UseVisualStyleBackColor = true; this.cBTouchpadJitterCompensation.CheckedChanged += new System.EventHandler(this.touchpadJitterCompensation_CheckedChanged); @@ -594,8 +698,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 +710,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 +822,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 +829,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 +842,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 +857,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 +890,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 +924,25 @@ // // gBTouchpad // - resources.ApplyResources(this.gBTouchpad, "gBTouchpad"); - this.gBTouchpad.BackColor = System.Drawing.Color.Transparent; + this.gBTouchpad.BackColor = System.Drawing.SystemColors.Control; 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; + this.gBTouchpad.ForeColor = System.Drawing.SystemColors.ControlText; + resources.ApplyResources(this.gBTouchpad, "gBTouchpad"); this.gBTouchpad.Name = "gBTouchpad"; this.gBTouchpad.TabStop = false; // // pnlTPMouse // - resources.ApplyResources(this.pnlTPMouse, "pnlTPMouse"); + this.pnlTPMouse.Controls.Add(this.trackFrictionLb); + this.pnlTPMouse.Controls.Add(this.trackFrictionNUD); + this.pnlTPMouse.Controls.Add(this.trackballCk); + this.pnlTPMouse.Controls.Add(this.touchpadDisInvertButton); + this.pnlTPMouse.Controls.Add(this.label25); + this.pnlTPMouse.Controls.Add(this.label15); + this.pnlTPMouse.Controls.Add(this.touchpadInvertComboBox); this.pnlTPMouse.Controls.Add(this.nUDScroll); this.pnlTPMouse.Controls.Add(this.cBDoubleTap); this.pnlTPMouse.Controls.Add(this.cBScroll); @@ -853,12 +953,70 @@ 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"; // + // trackFrictionLb + // + resources.ApplyResources(this.trackFrictionLb, "trackFrictionLb"); + this.trackFrictionLb.Name = "trackFrictionLb"; + // + // trackFrictionNUD + // + this.trackFrictionNUD.DecimalPlaces = 1; + resources.ApplyResources(this.trackFrictionNUD, "trackFrictionNUD"); + this.trackFrictionNUD.Name = "trackFrictionNUD"; + this.trackFrictionNUD.Value = new decimal(new int[] { + 10, + 0, + 0, + 0}); + this.trackFrictionNUD.ValueChanged += new System.EventHandler(this.trackFrictionNUD_ValueChanged); + // + // trackballCk + // + resources.ApplyResources(this.trackballCk, "trackballCk"); + this.trackballCk.Name = "trackballCk"; + this.trackballCk.UseVisualStyleBackColor = true; + this.trackballCk.CheckedChanged += new System.EventHandler(this.trackballCk_CheckedChanged); + // + // touchpadDisInvertButton + // + this.touchpadDisInvertButton.ForeColor = System.Drawing.SystemColors.ControlText; + resources.ApplyResources(this.touchpadDisInvertButton, "touchpadDisInvertButton"); + this.touchpadDisInvertButton.Name = "touchpadDisInvertButton"; + this.touchpadDisInvertButton.UseVisualStyleBackColor = true; + this.touchpadDisInvertButton.Click += new System.EventHandler(this.touchpadDisInvertButton_Click); + // + // label25 + // + resources.ApplyResources(this.label25, "label25"); + this.label25.ForeColor = System.Drawing.SystemColors.ControlText; + this.label25.Name = "label25"; + // + // label15 + // + resources.ApplyResources(this.label15, "label15"); + this.label15.ForeColor = System.Drawing.SystemColors.ControlText; + this.label15.Name = "label15"; + // + // touchpadInvertComboBox + // + this.touchpadInvertComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.touchpadInvertComboBox.FormattingEnabled = true; + this.touchpadInvertComboBox.Items.AddRange(new object[] { + resources.GetString("touchpadInvertComboBox.Items"), + resources.GetString("touchpadInvertComboBox.Items1"), + resources.GetString("touchpadInvertComboBox.Items2"), + resources.GetString("touchpadInvertComboBox.Items3")}); + resources.ApplyResources(this.touchpadInvertComboBox, "touchpadInvertComboBox"); + this.touchpadInvertComboBox.Name = "touchpadInvertComboBox"; + this.touchpadInvertComboBox.SelectedIndexChanged += new System.EventHandler(this.touchpadInvertComboBox_SelectedIndexChanged); + // // cbStartTouchpadOff // resources.ApplyResources(this.cbStartTouchpadOff, "cbStartTouchpadOff"); - this.cbStartTouchpadOff.ForeColor = System.Drawing.SystemColors.ControlLightLight; + this.cbStartTouchpadOff.ForeColor = System.Drawing.SystemColors.ControlText; this.cbStartTouchpadOff.Name = "cbStartTouchpadOff"; this.cbStartTouchpadOff.UseVisualStyleBackColor = true; this.cbStartTouchpadOff.CheckedChanged += new System.EventHandler(this.cbStartTouchpadOff_CheckedChanged); @@ -866,7 +1024,7 @@ // rBTPControls // resources.ApplyResources(this.rBTPControls, "rBTPControls"); - this.rBTPControls.ForeColor = System.Drawing.SystemColors.ControlLightLight; + this.rBTPControls.ForeColor = System.Drawing.SystemColors.ControlText; this.rBTPControls.Name = "rBTPControls"; this.rBTPControls.TabStop = true; this.rBTPControls.UseVisualStyleBackColor = true; @@ -875,7 +1033,7 @@ // rBTPMouse // resources.ApplyResources(this.rBTPMouse, "rBTPMouse"); - this.rBTPMouse.ForeColor = System.Drawing.SystemColors.ControlLightLight; + this.rBTPMouse.ForeColor = System.Drawing.SystemColors.ControlText; this.rBTPMouse.Name = "rBTPMouse"; this.rBTPMouse.TabStop = true; this.rBTPMouse.UseVisualStyleBackColor = true; @@ -883,7 +1041,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 +1049,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 +1064,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 +1078,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 +1088,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 // + this.lbSwipeUp.ForeColor = System.Drawing.SystemColors.ControlText; resources.ApplyResources(this.lbSwipeUp, "lbSwipeUp"); - this.lbSwipeUp.ForeColor = System.Drawing.SystemColors.ControlLightLight; 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 +1262,15 @@ // // lbSwipeDown // + this.lbSwipeDown.ForeColor = System.Drawing.SystemColors.ControlText; resources.ApplyResources(this.lbSwipeDown, "lbSwipeDown"); - this.lbSwipeDown.ForeColor = System.Drawing.SystemColors.ControlLightLight; 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 +1278,15 @@ // // lbSwipeLeft // + this.lbSwipeLeft.ForeColor = System.Drawing.SystemColors.ControlText; resources.ApplyResources(this.lbSwipeLeft, "lbSwipeLeft"); - this.lbSwipeLeft.ForeColor = System.Drawing.SystemColors.ControlLightLight; 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 +1294,16 @@ // // lbSwipeRight // + this.lbSwipeRight.ForeColor = System.Drawing.SystemColors.ControlText; resources.ApplyResources(this.lbSwipeRight, "lbSwipeRight"); - this.lbSwipeRight.ForeColor = System.Drawing.SystemColors.ControlLightLight; this.lbSwipeRight.Name = "lbSwipeRight"; // // gBOther // - resources.ApplyResources(this.gBOther, "gBOther"); - this.gBOther.BackColor = System.Drawing.Color.WhiteSmoke; + this.gBOther.BackColor = System.Drawing.SystemColors.Control; + this.gBOther.Controls.Add(this.btPollRateLabel); + this.gBOther.Controls.Add(this.btPollRateComboBox); + 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,15 +1318,55 @@ 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; // + // btPollRateLabel + // + resources.ApplyResources(this.btPollRateLabel, "btPollRateLabel"); + this.btPollRateLabel.Name = "btPollRateLabel"; + // + // btPollRateComboBox + // + this.btPollRateComboBox.BackColor = System.Drawing.SystemColors.Window; + this.btPollRateComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.btPollRateComboBox.FormattingEnabled = true; + this.btPollRateComboBox.Items.AddRange(new object[] { + resources.GetString("btPollRateComboBox.Items"), + resources.GetString("btPollRateComboBox.Items1"), + resources.GetString("btPollRateComboBox.Items2"), + resources.GetString("btPollRateComboBox.Items3"), + resources.GetString("btPollRateComboBox.Items4"), + resources.GetString("btPollRateComboBox.Items5"), + resources.GetString("btPollRateComboBox.Items6"), + resources.GetString("btPollRateComboBox.Items7"), + resources.GetString("btPollRateComboBox.Items8"), + resources.GetString("btPollRateComboBox.Items9"), + resources.GetString("btPollRateComboBox.Items10"), + resources.GetString("btPollRateComboBox.Items11"), + resources.GetString("btPollRateComboBox.Items12"), + resources.GetString("btPollRateComboBox.Items13"), + resources.GetString("btPollRateComboBox.Items14"), + resources.GetString("btPollRateComboBox.Items15"), + resources.GetString("btPollRateComboBox.Items16")}); + resources.ApplyResources(this.btPollRateComboBox, "btPollRateComboBox"); + this.btPollRateComboBox.Name = "btPollRateComboBox"; + this.btPollRateComboBox.SelectedIndexChanged += new System.EventHandler(this.btPollRateComboBox_SelectedIndexChanged); + // + // 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"); this.cBDinput.Name = "cBDinput"; this.cBDinput.UseVisualStyleBackColor = true; - this.cBDinput.CheckedChanged += new System.EventHandler(this.cBDinput_CheckedChanged); + this.cBDinput.CheckedChanged += new System.EventHandler(this.CBDinput_CheckedChanged); // // pBProgram // @@ -1240,8 +1440,7 @@ // // gBLightbar // - resources.ApplyResources(this.gBLightbar, "gBLightbar"); - this.gBLightbar.BackColor = System.Drawing.Color.WhiteSmoke; + this.gBLightbar.BackColor = System.Drawing.SystemColors.Control; this.gBLightbar.Controls.Add(this.btnRainbow); this.gBLightbar.Controls.Add(this.lbRainbowB); this.gBLightbar.Controls.Add(this.nUDRainbowB); @@ -1257,13 +1456,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); @@ -1287,22 +1487,20 @@ 0, 0, 0}); - this.nUDRainbowB.ValueChanged += new System.EventHandler(this.nUDRainbowB_ValueChanged); // // 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 +1508,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 +1540,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.BackColor = System.Drawing.SystemColors.Control; 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 +1584,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, @@ -1399,7 +1598,7 @@ 0}); this.nUDSZ.Name = "nUDSZ"; this.nUDSZ.Value = new decimal(new int[] { - 25, + 2, 0, 0, 131072}); @@ -1407,13 +1606,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, @@ -1421,19 +1620,15 @@ 0}); this.nUDSX.Name = "nUDSX"; this.nUDSX.Value = new decimal(new int[] { - 25, + 2, 0, 0, 131072}); this.nUDSX.ValueChanged += new System.EventHandler(this.nUDSX_ValueChanged); // - // openFileDialog1 - // - resources.ApplyResources(this.openFileDialog1, "openFileDialog1"); - // // lbL2TrackS // - resources.ApplyResources(this.lbL2TrackS, "lbL2TrackS"); + this.lbL2TrackS.BackColor = System.Drawing.Color.Transparent; this.lbL2TrackS.Controls.Add(this.pnlSATrack); this.lbL2TrackS.Controls.Add(this.lbL2Track); this.lbL2TrackS.Controls.Add(this.lbRSTip); @@ -1446,29 +1641,29 @@ 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 +1719,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,13 +1728,14 @@ 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); // // tBsixaxisAccelX // resources.ApplyResources(this.tBsixaxisAccelX, "tBsixaxisAccelX"); - this.tBsixaxisAccelX.BackColor = System.Drawing.Color.White; + this.tBsixaxisAccelX.BackColor = System.Drawing.SystemColors.ControlLightLight; this.tBsixaxisAccelX.Maximum = 100; this.tBsixaxisAccelX.Minimum = -100; this.tBsixaxisAccelX.Name = "tBsixaxisAccelX"; @@ -1554,7 +1749,7 @@ // tBsixaxisGyroX // resources.ApplyResources(this.tBsixaxisGyroX, "tBsixaxisGyroX"); - this.tBsixaxisGyroX.BackColor = System.Drawing.Color.White; + this.tBsixaxisGyroX.BackColor = System.Drawing.SystemColors.ControlLightLight; this.tBsixaxisGyroX.Maximum = 127; this.tBsixaxisGyroX.Minimum = -127; this.tBsixaxisGyroX.Name = "tBsixaxisGyroX"; @@ -1568,7 +1763,7 @@ // tBsixaxisGyroY // resources.ApplyResources(this.tBsixaxisGyroY, "tBsixaxisGyroY"); - this.tBsixaxisGyroY.BackColor = System.Drawing.Color.White; + this.tBsixaxisGyroY.BackColor = System.Drawing.SystemColors.ControlLightLight; this.tBsixaxisGyroY.Maximum = 127; this.tBsixaxisGyroY.Minimum = -127; this.tBsixaxisGyroY.Name = "tBsixaxisGyroY"; @@ -1577,7 +1772,7 @@ // tBsixaxisGyroZ // resources.ApplyResources(this.tBsixaxisGyroZ, "tBsixaxisGyroZ"); - this.tBsixaxisGyroZ.BackColor = System.Drawing.Color.White; + this.tBsixaxisGyroZ.BackColor = System.Drawing.SystemColors.ControlLightLight; this.tBsixaxisGyroZ.Maximum = 127; this.tBsixaxisGyroZ.Minimum = -127; this.tBsixaxisGyroZ.Name = "tBsixaxisGyroZ"; @@ -1586,7 +1781,7 @@ // tBsixaxisAccelY // resources.ApplyResources(this.tBsixaxisAccelY, "tBsixaxisAccelY"); - this.tBsixaxisAccelY.BackColor = System.Drawing.Color.White; + this.tBsixaxisAccelY.BackColor = System.Drawing.SystemColors.ControlLightLight; this.tBsixaxisAccelY.Maximum = 100; this.tBsixaxisAccelY.Minimum = -100; this.tBsixaxisAccelY.Name = "tBsixaxisAccelY"; @@ -1595,7 +1790,7 @@ // tBsixaxisAccelZ // resources.ApplyResources(this.tBsixaxisAccelZ, "tBsixaxisAccelZ"); - this.tBsixaxisAccelZ.BackColor = System.Drawing.Color.White; + this.tBsixaxisAccelZ.BackColor = System.Drawing.SystemColors.ControlLightLight; this.tBsixaxisAccelZ.Maximum = 100; this.tBsixaxisAccelZ.Minimum = -100; this.tBsixaxisAccelZ.Name = "tBsixaxisAccelZ"; @@ -1603,55 +1798,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 +1854,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 +1872,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 +1885,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 +1898,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 +1911,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); @@ -1727,7 +1922,7 @@ // tPControls // resources.ApplyResources(this.tPControls, "tPControls"); - this.tPControls.BackColor = System.Drawing.SystemColors.WindowFrame; + this.tPControls.BackColor = System.Drawing.Color.DimGray; this.tPControls.Controls.Add(this.lBControls); this.tPControls.Controls.Add(this.gBTouchpad); this.tPControls.Controls.Add(this.lbControlTip); @@ -1779,16 +1974,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.BackColor = System.Drawing.Color.DimGray; 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); @@ -1842,9 +2037,11 @@ this.pnlController.Controls.Add(this.bnCircle); this.pnlController.Controls.Add(this.lbControlName); this.pnlController.Name = "pnlController"; + this.pnlController.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlController_Paint); // // pBHoveredButton // + this.pBHoveredButton.BackColor = System.Drawing.Color.Transparent; resources.ApplyResources(this.pBHoveredButton, "pBHoveredButton"); this.pBHoveredButton.Image = global::DS4Windows.Properties.Resources.DS4_Config_RS; this.pBHoveredButton.Name = "pBHoveredButton"; @@ -1852,22 +2049,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 +2079,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 +2109,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 +2132,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 +2155,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 +2178,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 +2201,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 +2224,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 +2247,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 +2270,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 +2293,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 +2315,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 +2332,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 +2348,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 +2364,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 +2379,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 +2395,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 +2411,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 +2434,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 +2456,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 +2471,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 +2493,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 +2508,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 +2523,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 +2545,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 +2567,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 +2596,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; @@ -2411,12 +2608,13 @@ this.btnLightbar.Name = "btnLightbar"; this.btnLightbar.UseVisualStyleBackColor = false; this.btnLightbar.Click += new System.EventHandler(this.btnLightbar_Click); + this.btnLightbar.Paint += new System.Windows.Forms.PaintEventHandler(this.btnLightbar_Paint); this.btnLightbar.MouseHover += new System.EventHandler(this.btnLightbar_MouseHover); // // 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 +2628,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 +2644,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 +2660,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 +2695,6 @@ 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); // // cHName // @@ -2513,17 +2710,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,16 +2751,19 @@ // // tCSens // - resources.ApplyResources(this.tCSens, "tCSens"); this.tCSens.Controls.Add(this.tPDeadzone); + this.tCSens.Controls.Add(this.antiDeadzoneTabPage); + this.tCSens.Controls.Add(this.maxZoneTabPage); + this.tCSens.Controls.Add(this.tPOutCurve); this.tCSens.Controls.Add(this.tPCurve); + this.tCSens.Controls.Add(this.tpRotation); + 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.BackColor = System.Drawing.SystemColors.Control; this.tPDeadzone.Controls.Add(this.lbL2); this.tPDeadzone.Controls.Add(this.nUDL2); this.tPDeadzone.Controls.Add(this.nUDLS); @@ -2576,39 +2776,498 @@ 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"; // + // antiDeadzoneTabPage + // + this.antiDeadzoneTabPage.BackColor = System.Drawing.SystemColors.Control; + this.antiDeadzoneTabPage.Controls.Add(this.nUDSixaxisZAntiDead); + this.antiDeadzoneTabPage.Controls.Add(this.nUDSixaxisXAntiDead); + this.antiDeadzoneTabPage.Controls.Add(this.label20); + this.antiDeadzoneTabPage.Controls.Add(this.label19); + 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"; + // + // nUDSixaxisZAntiDead + // + this.nUDSixaxisZAntiDead.DecimalPlaces = 2; + this.nUDSixaxisZAntiDead.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + resources.ApplyResources(this.nUDSixaxisZAntiDead, "nUDSixaxisZAntiDead"); + this.nUDSixaxisZAntiDead.Maximum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDSixaxisZAntiDead.Name = "nUDSixaxisZAntiDead"; + this.nUDSixaxisZAntiDead.ValueChanged += new System.EventHandler(this.nUDSixaxisZAntiDead_ValueChanged); + // + // nUDSixaxisXAntiDead + // + this.nUDSixaxisXAntiDead.DecimalPlaces = 2; + this.nUDSixaxisXAntiDead.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + resources.ApplyResources(this.nUDSixaxisXAntiDead, "nUDSixaxisXAntiDead"); + this.nUDSixaxisXAntiDead.Maximum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDSixaxisXAntiDead.Name = "nUDSixaxisXAntiDead"; + this.nUDSixaxisXAntiDead.ValueChanged += new System.EventHandler(this.nUDSixaxisXAntiDead_ValueChanged); + // + // label20 + // + resources.ApplyResources(this.label20, "label20"); + this.label20.Name = "label20"; + // + // label19 + // + resources.ApplyResources(this.label19, "label19"); + this.label19.Name = "label19"; + // + // 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"; + // + // maxZoneTabPage + // + this.maxZoneTabPage.BackColor = System.Drawing.SystemColors.Control; + this.maxZoneTabPage.Controls.Add(this.nUDSixAxisZMaxZone); + this.maxZoneTabPage.Controls.Add(this.nUDSixAxisXMaxZone); + this.maxZoneTabPage.Controls.Add(this.label18); + this.maxZoneTabPage.Controls.Add(this.label17); + 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"; + // + // nUDSixAxisZMaxZone + // + this.nUDSixAxisZMaxZone.DecimalPlaces = 2; + this.nUDSixAxisZMaxZone.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + resources.ApplyResources(this.nUDSixAxisZMaxZone, "nUDSixAxisZMaxZone"); + this.nUDSixAxisZMaxZone.Maximum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDSixAxisZMaxZone.Name = "nUDSixAxisZMaxZone"; + this.nUDSixAxisZMaxZone.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDSixAxisZMaxZone.ValueChanged += new System.EventHandler(this.nUDSixAxisZMaxZone_ValueChanged); + // + // nUDSixAxisXMaxZone + // + this.nUDSixAxisXMaxZone.DecimalPlaces = 2; + this.nUDSixAxisXMaxZone.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + resources.ApplyResources(this.nUDSixAxisXMaxZone, "nUDSixAxisXMaxZone"); + this.nUDSixAxisXMaxZone.Maximum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDSixAxisXMaxZone.Name = "nUDSixAxisXMaxZone"; + this.nUDSixAxisXMaxZone.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDSixAxisXMaxZone.ValueChanged += new System.EventHandler(this.nUDSixAxisXMaxZone_ValueChanged); + // + // label18 + // + resources.ApplyResources(this.label18, "label18"); + this.label18.Name = "label18"; + // + // label17 + // + resources.ApplyResources(this.label17, "label17"); + this.label17.Name = "label17"; + // + // 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); + // + // 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); + // + // label8 + // + resources.ApplyResources(this.label8, "label8"); + this.label8.Name = "label8"; + // + // label7 + // + resources.ApplyResources(this.label7, "label7"); + this.label7.Name = "label7"; + // + // 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); + // + // label6 + // + resources.ApplyResources(this.label6, "label6"); + this.label6.Name = "label6"; + // + // 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); + // + // label5 + // + resources.ApplyResources(this.label5, "label5"); + this.label5.Name = "label5"; + // + // tPOutCurve + // + this.tPOutCurve.BackColor = System.Drawing.SystemColors.Control; + this.tPOutCurve.Controls.Add(this.cBSixaxisZOutputCurve); + this.tPOutCurve.Controls.Add(this.cBSixaxisXOutputCurve); + this.tPOutCurve.Controls.Add(this.label24); + this.tPOutCurve.Controls.Add(this.label23); + this.tPOutCurve.Controls.Add(this.cBR2OutputCurve); + this.tPOutCurve.Controls.Add(this.cBL2OutputCurve); + this.tPOutCurve.Controls.Add(this.label22); + this.tPOutCurve.Controls.Add(this.label21); + this.tPOutCurve.Controls.Add(this.rsOutCurveComboBox); + this.tPOutCurve.Controls.Add(this.lsOutCurveComboBox); + this.tPOutCurve.Controls.Add(this.label10); + this.tPOutCurve.Controls.Add(this.label9); + resources.ApplyResources(this.tPOutCurve, "tPOutCurve"); + this.tPOutCurve.Name = "tPOutCurve"; + // + // cBSixaxisZOutputCurve + // + this.cBSixaxisZOutputCurve.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cBSixaxisZOutputCurve.DropDownWidth = 70; + this.cBSixaxisZOutputCurve.FormattingEnabled = true; + this.cBSixaxisZOutputCurve.Items.AddRange(new object[] { + resources.GetString("cBSixaxisZOutputCurve.Items"), + resources.GetString("cBSixaxisZOutputCurve.Items1"), + resources.GetString("cBSixaxisZOutputCurve.Items2")}); + resources.ApplyResources(this.cBSixaxisZOutputCurve, "cBSixaxisZOutputCurve"); + this.cBSixaxisZOutputCurve.Name = "cBSixaxisZOutputCurve"; + this.cBSixaxisZOutputCurve.SelectedIndexChanged += new System.EventHandler(this.cBSixaxisZOutputCurve_SelectedIndexChanged); + // + // cBSixaxisXOutputCurve + // + this.cBSixaxisXOutputCurve.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cBSixaxisXOutputCurve.DropDownWidth = 70; + this.cBSixaxisXOutputCurve.FormattingEnabled = true; + this.cBSixaxisXOutputCurve.Items.AddRange(new object[] { + resources.GetString("cBSixaxisXOutputCurve.Items"), + resources.GetString("cBSixaxisXOutputCurve.Items1"), + resources.GetString("cBSixaxisXOutputCurve.Items2")}); + resources.ApplyResources(this.cBSixaxisXOutputCurve, "cBSixaxisXOutputCurve"); + this.cBSixaxisXOutputCurve.Name = "cBSixaxisXOutputCurve"; + this.cBSixaxisXOutputCurve.SelectedIndexChanged += new System.EventHandler(this.cBSixaxisXOutputCurve_SelectedIndexChanged); + // + // label24 + // + resources.ApplyResources(this.label24, "label24"); + this.label24.Name = "label24"; + // + // label23 + // + resources.ApplyResources(this.label23, "label23"); + this.label23.Name = "label23"; + // + // cBR2OutputCurve + // + this.cBR2OutputCurve.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cBR2OutputCurve.DropDownWidth = 70; + this.cBR2OutputCurve.FormattingEnabled = true; + this.cBR2OutputCurve.Items.AddRange(new object[] { + resources.GetString("cBR2OutputCurve.Items"), + resources.GetString("cBR2OutputCurve.Items1"), + resources.GetString("cBR2OutputCurve.Items2")}); + resources.ApplyResources(this.cBR2OutputCurve, "cBR2OutputCurve"); + this.cBR2OutputCurve.Name = "cBR2OutputCurve"; + this.cBR2OutputCurve.SelectedIndexChanged += new System.EventHandler(this.cBR2OutputCurve_SelectedIndexChanged); + // + // cBL2OutputCurve + // + this.cBL2OutputCurve.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cBL2OutputCurve.DropDownWidth = 70; + this.cBL2OutputCurve.FormattingEnabled = true; + this.cBL2OutputCurve.Items.AddRange(new object[] { + resources.GetString("cBL2OutputCurve.Items"), + resources.GetString("cBL2OutputCurve.Items1"), + resources.GetString("cBL2OutputCurve.Items2")}); + resources.ApplyResources(this.cBL2OutputCurve, "cBL2OutputCurve"); + this.cBL2OutputCurve.Name = "cBL2OutputCurve"; + this.cBL2OutputCurve.SelectedIndexChanged += new System.EventHandler(this.cBL2OutputCurve_SelectedIndexChanged); + // + // label22 + // + resources.ApplyResources(this.label22, "label22"); + this.label22.Name = "label22"; + // + // label21 + // + resources.ApplyResources(this.label21, "label21"); + this.label21.Name = "label21"; + // + // rsOutCurveComboBox + // + this.rsOutCurveComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.rsOutCurveComboBox.DropDownWidth = 120; + this.rsOutCurveComboBox.FormattingEnabled = true; + this.rsOutCurveComboBox.Items.AddRange(new object[] { + resources.GetString("rsOutCurveComboBox.Items"), + resources.GetString("rsOutCurveComboBox.Items1"), + resources.GetString("rsOutCurveComboBox.Items2"), + resources.GetString("rsOutCurveComboBox.Items3")}); + resources.ApplyResources(this.rsOutCurveComboBox, "rsOutCurveComboBox"); + this.rsOutCurveComboBox.Name = "rsOutCurveComboBox"; + this.rsOutCurveComboBox.SelectedIndexChanged += new System.EventHandler(this.rsOutCurveComboBox_SelectedIndexChanged); + // + // lsOutCurveComboBox + // + this.lsOutCurveComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.lsOutCurveComboBox.DropDownWidth = 120; + this.lsOutCurveComboBox.FormattingEnabled = true; + this.lsOutCurveComboBox.Items.AddRange(new object[] { + resources.GetString("lsOutCurveComboBox.Items"), + resources.GetString("lsOutCurveComboBox.Items1"), + resources.GetString("lsOutCurveComboBox.Items2"), + resources.GetString("lsOutCurveComboBox.Items3")}); + resources.ApplyResources(this.lsOutCurveComboBox, "lsOutCurveComboBox"); + this.lsOutCurveComboBox.Name = "lsOutCurveComboBox"; + this.lsOutCurveComboBox.SelectedIndexChanged += new System.EventHandler(this.lsOutCurveComboBox_SelectedIndexChanged); + // + // label10 + // + resources.ApplyResources(this.label10, "label10"); + this.label10.Name = "label10"; + // + // label9 + // + resources.ApplyResources(this.label9, "label9"); + this.label9.Name = "label9"; + // // tPCurve // - resources.ApplyResources(this.tPCurve, "tPCurve"); - this.tPCurve.BackColor = System.Drawing.Color.WhiteSmoke; + this.tPCurve.BackColor = System.Drawing.SystemColors.Control; this.tPCurve.Controls.Add(this.nUDLSCurve); this.tPCurve.Controls.Add(this.nUDRSCurve); this.tPCurve.Controls.Add(this.lbRSCurve); 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,10 +3291,62 @@ resources.ApplyResources(this.lbLSCurve, "lbLSCurve"); this.lbLSCurve.Name = "lbLSCurve"; // + // tpRotation + // + this.tpRotation.BackColor = System.Drawing.SystemColors.Control; + this.tpRotation.Controls.Add(this.nUDRSRotation); + this.tpRotation.Controls.Add(this.label14); + this.tpRotation.Controls.Add(this.nUDLSRotation); + this.tpRotation.Controls.Add(this.label13); + resources.ApplyResources(this.tpRotation, "tpRotation"); + this.tpRotation.Name = "tpRotation"; + // + // nUDRSRotation + // + resources.ApplyResources(this.nUDRSRotation, "nUDRSRotation"); + this.nUDRSRotation.Maximum = new decimal(new int[] { + 180, + 0, + 0, + 0}); + this.nUDRSRotation.Minimum = new decimal(new int[] { + 180, + 0, + 0, + -2147483648}); + this.nUDRSRotation.Name = "nUDRSRotation"; + this.nUDRSRotation.ValueChanged += new System.EventHandler(this.nUDRSRotation_ValueChanged); + // + // label14 + // + resources.ApplyResources(this.label14, "label14"); + this.label14.Name = "label14"; + // + // nUDLSRotation + // + resources.ApplyResources(this.nUDLSRotation, "nUDLSRotation"); + this.nUDLSRotation.Maximum = new decimal(new int[] { + 180, + 0, + 0, + 0}); + this.nUDLSRotation.Minimum = new decimal(new int[] { + 180, + 0, + 0, + -2147483648}); + this.nUDLSRotation.Name = "nUDLSRotation"; + this.nUDLSRotation.ValueChanged += new System.EventHandler(this.nUDLSRotation_ValueChanged); + // + // label13 + // + resources.ApplyResources(this.label13, "label13"); + this.label13.Name = "label13"; + // // fLPSettings // resources.ApplyResources(this.fLPSettings, "fLPSettings"); - this.fLPSettings.BackColor = System.Drawing.Color.WhiteSmoke; + this.fLPSettings.BackColor = System.Drawing.SystemColors.Control; this.fLPSettings.Controls.Add(this.gBLightbar); this.fLPSettings.Controls.Add(this.gBGyro); this.fLPSettings.Controls.Add(this.gBRumble); @@ -2646,12 +3357,12 @@ // // gBGyro // - resources.ApplyResources(this.gBGyro, "gBGyro"); - this.gBGyro.BackColor = System.Drawing.Color.WhiteSmoke; + this.gBGyro.BackColor = System.Drawing.SystemColors.Control; this.gBGyro.Controls.Add(this.rBSAControls); this.gBGyro.Controls.Add(this.rBSAMouse); - this.gBGyro.Controls.Add(this.pnlSAMouse); this.gBGyro.Controls.Add(this.fLPTiltControls); + this.gBGyro.Controls.Add(this.pnlSAMouse); + resources.ApplyResources(this.gBGyro, "gBGyro"); this.gBGyro.Name = "gBGyro"; this.gBGyro.TabStop = false; // @@ -2673,7 +3384,16 @@ // // pnlSAMouse // - resources.ApplyResources(this.pnlSAMouse, "pnlSAMouse"); + this.pnlSAMouse.Controls.Add(this.cBGyroMouseXAxis); + this.pnlSAMouse.Controls.Add(this.label16); + this.pnlSAMouse.Controls.Add(this.lbGyroSmooth); + this.pnlSAMouse.Controls.Add(this.cBGyroSmooth); + this.pnlSAMouse.Controls.Add(this.lbSmoothWeight); + this.pnlSAMouse.Controls.Add(this.nUDGyroSmoothWeight); + this.pnlSAMouse.Controls.Add(this.label12); + this.pnlSAMouse.Controls.Add(this.nUDGyroMouseVertScale); + this.pnlSAMouse.Controls.Add(this.label11); + this.pnlSAMouse.Controls.Add(this.gyroTriggerBehavior); this.pnlSAMouse.Controls.Add(this.cBGyroInvertY); this.pnlSAMouse.Controls.Add(this.cBGyroInvertX); this.pnlSAMouse.Controls.Add(this.lbGyroInvert); @@ -2681,8 +3401,99 @@ 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"; // + // cBGyroMouseXAxis + // + this.cBGyroMouseXAxis.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cBGyroMouseXAxis.FormattingEnabled = true; + this.cBGyroMouseXAxis.Items.AddRange(new object[] { + resources.GetString("cBGyroMouseXAxis.Items"), + resources.GetString("cBGyroMouseXAxis.Items1")}); + resources.ApplyResources(this.cBGyroMouseXAxis, "cBGyroMouseXAxis"); + this.cBGyroMouseXAxis.Name = "cBGyroMouseXAxis"; + this.cBGyroMouseXAxis.SelectedIndexChanged += new System.EventHandler(this.cBGyroMouseXAxis_SelectedIndexChanged); + // + // label16 + // + resources.ApplyResources(this.label16, "label16"); + this.label16.Name = "label16"; + // + // lbGyroSmooth + // + resources.ApplyResources(this.lbGyroSmooth, "lbGyroSmooth"); + this.lbGyroSmooth.Name = "lbGyroSmooth"; + // + // cBGyroSmooth + // + resources.ApplyResources(this.cBGyroSmooth, "cBGyroSmooth"); + this.cBGyroSmooth.Name = "cBGyroSmooth"; + this.cBGyroSmooth.UseVisualStyleBackColor = true; + this.cBGyroSmooth.CheckedChanged += new System.EventHandler(this.cBGyroSmooth_CheckedChanged); + // + // lbSmoothWeight + // + resources.ApplyResources(this.lbSmoothWeight, "lbSmoothWeight"); + this.lbSmoothWeight.Name = "lbSmoothWeight"; + // + // nUDGyroSmoothWeight + // + this.nUDGyroSmoothWeight.DecimalPlaces = 3; + resources.ApplyResources(this.nUDGyroSmoothWeight, "nUDGyroSmoothWeight"); + this.nUDGyroSmoothWeight.Maximum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nUDGyroSmoothWeight.Name = "nUDGyroSmoothWeight"; + this.nUDGyroSmoothWeight.Value = new decimal(new int[] { + 5, + 0, + 0, + 65536}); + this.nUDGyroSmoothWeight.ValueChanged += new System.EventHandler(this.nUDGyroSmoothWeight_ValueChanged); + // + // label12 + // + resources.ApplyResources(this.label12, "label12"); + this.label12.Name = "label12"; + // + // nUDGyroMouseVertScale + // + this.nUDGyroMouseVertScale.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + resources.ApplyResources(this.nUDGyroMouseVertScale, "nUDGyroMouseVertScale"); + this.nUDGyroMouseVertScale.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.nUDGyroMouseVertScale.Name = "nUDGyroMouseVertScale"; + this.nUDGyroMouseVertScale.Value = new decimal(new int[] { + 100, + 0, + 0, + 0}); + this.nUDGyroMouseVertScale.ValueChanged += new System.EventHandler(this.nUDGyroMouseVertScale_ValueChanged); + // + // label11 + // + resources.ApplyResources(this.label11, "label11"); + this.label11.Name = "label11"; + // + // gyroTriggerBehavior + // + resources.ApplyResources(this.gyroTriggerBehavior, "gyroTriggerBehavior"); + this.gyroTriggerBehavior.Checked = true; + this.gyroTriggerBehavior.CheckState = System.Windows.Forms.CheckState.Checked; + this.gyroTriggerBehavior.Name = "gyroTriggerBehavior"; + this.gyroTriggerBehavior.UseVisualStyleBackColor = true; + this.gyroTriggerBehavior.CheckedChanged += new System.EventHandler(this.gyroTriggerBehavior_CheckedChanged); + // // cBGyroInvertY // resources.ApplyResources(this.cBGyroInvertY, "cBGyroInvertY"); @@ -2737,8 +3548,7 @@ // // gBSensitivity // - resources.ApplyResources(this.gBSensitivity, "gBSensitivity"); - this.gBSensitivity.BackColor = System.Drawing.Color.WhiteSmoke; + this.gBSensitivity.BackColor = System.Drawing.SystemColors.Control; this.gBSensitivity.Controls.Add(this.lbL2S); this.gBSensitivity.Controls.Add(this.nUDL2S); this.gBSensitivity.Controls.Add(this.nUDLSS); @@ -2751,6 +3561,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 +3572,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, + 10, 0, 0, - 65536}); + 0}); this.nUDL2S.Minimum = new decimal(new int[] { - 5, + 1, 0, 0, 65536}); @@ -2784,22 +3595,22 @@ 0, 0, 0}); - this.nUDL2S.ValueChanged += new System.EventHandler(this.nUDSens_ValueChanged); + this.nUDL2S.ValueChanged += new System.EventHandler(this.nUDL2Sens_ValueChanged); // // 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, + 5, 0, 0, - 65536}); + 0}); this.nUDLSS.Minimum = new decimal(new int[] { 5, 0, @@ -2811,7 +3622,7 @@ 0, 0, 0}); - this.nUDLSS.ValueChanged += new System.EventHandler(this.nUDSens_ValueChanged); + this.nUDLSS.ValueChanged += new System.EventHandler(this.nUDLSSens_ValueChanged); // // lbSixaxisXS // @@ -2820,20 +3631,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, + 10, 0, 0, - 65536}); + 0}); this.nUDR2S.Minimum = new decimal(new int[] { - 5, + 1, 0, 0, 65536}); @@ -2843,7 +3654,7 @@ 0, 0, 0}); - this.nUDR2S.ValueChanged += new System.EventHandler(this.nUDSens_ValueChanged); + this.nUDR2S.ValueChanged += new System.EventHandler(this.nUDR2Sens_ValueChanged); // // lbSixaxisZS // @@ -2852,18 +3663,18 @@ // // 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, + 5, 0, 0, - 65536}); + 0}); this.nUDRSS.Minimum = new decimal(new int[] { 5, 0, @@ -2875,7 +3686,7 @@ 0, 0, 0}); - this.nUDRSS.ValueChanged += new System.EventHandler(this.nUDSens_ValueChanged); + this.nUDRSS.ValueChanged += new System.EventHandler(this.nUDRSSens_ValueChanged); // // lbR2LS // @@ -2884,18 +3695,18 @@ // // 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, + 5, 0, 0, - 65536}); + 0}); this.nUDSXS.Minimum = new decimal(new int[] { 5, 0, @@ -2907,7 +3718,7 @@ 0, 0, 0}); - this.nUDSXS.ValueChanged += new System.EventHandler(this.nUDSens_ValueChanged); + this.nUDSXS.ValueChanged += new System.EventHandler(this.nUDSXSens_ValueChanged); // // lbRSS // @@ -2921,18 +3732,18 @@ // // 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, + 5, 0, 0, - 65536}); + 0}); this.nUDSZS.Minimum = new decimal(new int[] { 5, 0, @@ -2944,11 +3755,10 @@ 0, 0, 0}); - this.nUDSZS.ValueChanged += new System.EventHandler(this.nUDSens_ValueChanged); + this.nUDSZS.ValueChanged += new System.EventHandler(this.nUDSZSens_ValueChanged); // // 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,178 +3785,338 @@ 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); // + // cMTouchDisableInvert + // + this.cMTouchDisableInvert.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.crossTouchInvStripMenuItem, + this.circleTouchInvStripMenuItem, + this.squareTouchInvStripMenuItem, + this.triangleTouchInvStripMenuItem, + this.l1TouchInvStripMenuItem, + this.l2TouchInvStripMenuItem, + this.r1TouchInvStripMenuItem, + this.r2TouchInvStripMenuItem, + this.upTouchInvStripMenuItem, + this.downTouchInvStripMenuItem, + this.leftTouchInvStripMenuItem, + this.rightTouchInvStripMenuItem, + this.l3TouchInvStripMenuItem, + this.r3TouchInvStripMenuItem, + this.oneFingerTouchInvStripMenuItem, + this.twoFingerTouchInvStripMenuItem, + this.optionsTouchInvStripMenuItem, + this.shareTouchInvStripMenuItem, + this.psTouchInvStripMenuItem}); + this.cMTouchDisableInvert.Name = "cMTouchDisableInvert"; + this.cMTouchDisableInvert.ShowCheckMargin = true; + this.cMTouchDisableInvert.ShowImageMargin = false; + resources.ApplyResources(this.cMTouchDisableInvert, "cMTouchDisableInvert"); + // + // crossTouchInvStripMenuItem + // + this.crossTouchInvStripMenuItem.CheckOnClick = true; + this.crossTouchInvStripMenuItem.Name = "crossTouchInvStripMenuItem"; + resources.ApplyResources(this.crossTouchInvStripMenuItem, "crossTouchInvStripMenuItem"); + this.crossTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // circleTouchInvStripMenuItem + // + this.circleTouchInvStripMenuItem.CheckOnClick = true; + this.circleTouchInvStripMenuItem.Name = "circleTouchInvStripMenuItem"; + resources.ApplyResources(this.circleTouchInvStripMenuItem, "circleTouchInvStripMenuItem"); + this.circleTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // squareTouchInvStripMenuItem + // + this.squareTouchInvStripMenuItem.CheckOnClick = true; + this.squareTouchInvStripMenuItem.Name = "squareTouchInvStripMenuItem"; + resources.ApplyResources(this.squareTouchInvStripMenuItem, "squareTouchInvStripMenuItem"); + this.squareTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // triangleTouchInvStripMenuItem + // + this.triangleTouchInvStripMenuItem.CheckOnClick = true; + this.triangleTouchInvStripMenuItem.Name = "triangleTouchInvStripMenuItem"; + resources.ApplyResources(this.triangleTouchInvStripMenuItem, "triangleTouchInvStripMenuItem"); + this.triangleTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // l1TouchInvStripMenuItem + // + this.l1TouchInvStripMenuItem.CheckOnClick = true; + this.l1TouchInvStripMenuItem.Name = "l1TouchInvStripMenuItem"; + resources.ApplyResources(this.l1TouchInvStripMenuItem, "l1TouchInvStripMenuItem"); + this.l1TouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // l2TouchInvStripMenuItem + // + this.l2TouchInvStripMenuItem.CheckOnClick = true; + this.l2TouchInvStripMenuItem.Name = "l2TouchInvStripMenuItem"; + resources.ApplyResources(this.l2TouchInvStripMenuItem, "l2TouchInvStripMenuItem"); + this.l2TouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // r1TouchInvStripMenuItem + // + this.r1TouchInvStripMenuItem.CheckOnClick = true; + this.r1TouchInvStripMenuItem.Name = "r1TouchInvStripMenuItem"; + resources.ApplyResources(this.r1TouchInvStripMenuItem, "r1TouchInvStripMenuItem"); + this.r1TouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // r2TouchInvStripMenuItem + // + this.r2TouchInvStripMenuItem.CheckOnClick = true; + this.r2TouchInvStripMenuItem.Name = "r2TouchInvStripMenuItem"; + resources.ApplyResources(this.r2TouchInvStripMenuItem, "r2TouchInvStripMenuItem"); + this.r2TouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // upTouchInvStripMenuItem + // + this.upTouchInvStripMenuItem.CheckOnClick = true; + this.upTouchInvStripMenuItem.Name = "upTouchInvStripMenuItem"; + resources.ApplyResources(this.upTouchInvStripMenuItem, "upTouchInvStripMenuItem"); + this.upTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // downTouchInvStripMenuItem + // + this.downTouchInvStripMenuItem.CheckOnClick = true; + this.downTouchInvStripMenuItem.Name = "downTouchInvStripMenuItem"; + resources.ApplyResources(this.downTouchInvStripMenuItem, "downTouchInvStripMenuItem"); + this.downTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // leftTouchInvStripMenuItem + // + this.leftTouchInvStripMenuItem.CheckOnClick = true; + this.leftTouchInvStripMenuItem.Name = "leftTouchInvStripMenuItem"; + resources.ApplyResources(this.leftTouchInvStripMenuItem, "leftTouchInvStripMenuItem"); + this.leftTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // rightTouchInvStripMenuItem + // + this.rightTouchInvStripMenuItem.CheckOnClick = true; + this.rightTouchInvStripMenuItem.Name = "rightTouchInvStripMenuItem"; + resources.ApplyResources(this.rightTouchInvStripMenuItem, "rightTouchInvStripMenuItem"); + this.rightTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // l3TouchInvStripMenuItem + // + this.l3TouchInvStripMenuItem.CheckOnClick = true; + this.l3TouchInvStripMenuItem.Name = "l3TouchInvStripMenuItem"; + resources.ApplyResources(this.l3TouchInvStripMenuItem, "l3TouchInvStripMenuItem"); + this.l3TouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // r3TouchInvStripMenuItem + // + this.r3TouchInvStripMenuItem.CheckOnClick = true; + this.r3TouchInvStripMenuItem.Name = "r3TouchInvStripMenuItem"; + resources.ApplyResources(this.r3TouchInvStripMenuItem, "r3TouchInvStripMenuItem"); + this.r3TouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // oneFingerTouchInvStripMenuItem + // + this.oneFingerTouchInvStripMenuItem.CheckOnClick = true; + this.oneFingerTouchInvStripMenuItem.Name = "oneFingerTouchInvStripMenuItem"; + resources.ApplyResources(this.oneFingerTouchInvStripMenuItem, "oneFingerTouchInvStripMenuItem"); + this.oneFingerTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // twoFingerTouchInvStripMenuItem + // + this.twoFingerTouchInvStripMenuItem.CheckOnClick = true; + this.twoFingerTouchInvStripMenuItem.Name = "twoFingerTouchInvStripMenuItem"; + resources.ApplyResources(this.twoFingerTouchInvStripMenuItem, "twoFingerTouchInvStripMenuItem"); + this.twoFingerTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // optionsTouchInvStripMenuItem + // + this.optionsTouchInvStripMenuItem.CheckOnClick = true; + this.optionsTouchInvStripMenuItem.Name = "optionsTouchInvStripMenuItem"; + resources.ApplyResources(this.optionsTouchInvStripMenuItem, "optionsTouchInvStripMenuItem"); + this.optionsTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // shareTouchInvStripMenuItem + // + this.shareTouchInvStripMenuItem.CheckOnClick = true; + this.shareTouchInvStripMenuItem.Name = "shareTouchInvStripMenuItem"; + resources.ApplyResources(this.shareTouchInvStripMenuItem, "shareTouchInvStripMenuItem"); + this.shareTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // + // psTouchInvStripMenuItem + // + this.psTouchInvStripMenuItem.CheckOnClick = true; + this.psTouchInvStripMenuItem.Name = "psTouchInvStripMenuItem"; + resources.ApplyResources(this.psTouchInvStripMenuItem, "psTouchInvStripMenuItem"); + this.psTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); + // // Options // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.BackColor = System.Drawing.Color.WhiteSmoke; + this.BackColor = System.Drawing.SystemColors.Window; this.Controls.Add(this.fLPSettings); this.Controls.Add(this.tCControls); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "Options"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Options_FormClosing); - this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Options_Closed); this.Resize += new System.EventHandler(this.Options_Resize); ((System.ComponentModel.ISupportInitialize)(this.nUDRainbow)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tBBlueBar)).EndInit(); @@ -3173,6 +4143,7 @@ this.gBTouchpad.PerformLayout(); this.pnlTPMouse.ResumeLayout(false); this.pnlTPMouse.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.trackFrictionNUD)).EndInit(); this.fLPTouchSwipe.ResumeLayout(false); this.cMSPresets.ResumeLayout(false); this.gBOther.ResumeLayout(false); @@ -3214,15 +4185,39 @@ this.tCSens.ResumeLayout(false); this.tPDeadzone.ResumeLayout(false); this.tPDeadzone.PerformLayout(); + this.antiDeadzoneTabPage.ResumeLayout(false); + this.antiDeadzoneTabPage.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nUDSixaxisZAntiDead)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDSixaxisXAntiDead)).EndInit(); + ((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.maxZoneTabPage.ResumeLayout(false); + this.maxZoneTabPage.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nUDSixAxisZMaxZone)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDSixAxisXMaxZone)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDR2Maxzone)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDL2Maxzone)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDRSMaxZone)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDLSMaxZone)).EndInit(); + this.tPOutCurve.ResumeLayout(false); + this.tPOutCurve.PerformLayout(); this.tPCurve.ResumeLayout(false); this.tPCurve.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.nUDLSCurve)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDRSCurve)).EndInit(); + this.tpRotation.ResumeLayout(false); + this.tpRotation.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nUDRSRotation)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDLSRotation)).EndInit(); this.fLPSettings.ResumeLayout(false); this.gBGyro.ResumeLayout(false); this.gBGyro.PerformLayout(); this.pnlSAMouse.ResumeLayout(false); this.pnlSAMouse.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nUDGyroSmoothWeight)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nUDGyroMouseVertScale)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDGyroSensitivity)).EndInit(); this.gBSensitivity.ResumeLayout(false); this.gBSensitivity.PerformLayout(); @@ -3233,6 +4228,7 @@ ((System.ComponentModel.ISupportInitialize)(this.nUDSXS)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDSZS)).EndInit(); this.cMGyroTriggers.ResumeLayout(false); + this.cMTouchDisableInvert.ResumeLayout(false); this.ResumeLayout(false); } @@ -3514,5 +4510,89 @@ 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; + private System.Windows.Forms.Label btPollRateLabel; + private System.Windows.Forms.ComboBox btPollRateComboBox; + private System.Windows.Forms.TabPage tPOutCurve; + private System.Windows.Forms.ComboBox rsOutCurveComboBox; + private System.Windows.Forms.ComboBox lsOutCurveComboBox; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.CheckBox gyroTriggerBehavior; + private System.Windows.Forms.NumericUpDown nUDGyroMouseVertScale; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label lbSmoothWeight; + private System.Windows.Forms.NumericUpDown nUDGyroSmoothWeight; + private System.Windows.Forms.CheckBox cBGyroSmooth; + private System.Windows.Forms.Label lbGyroSmooth; + private System.Windows.Forms.TabPage tpRotation; + private System.Windows.Forms.NumericUpDown nUDRSRotation; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.NumericUpDown nUDLSRotation; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.ComboBox touchpadInvertComboBox; + private System.Windows.Forms.ComboBox cBGyroMouseXAxis; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.NumericUpDown nUDSixAxisZMaxZone; + private System.Windows.Forms.NumericUpDown nUDSixAxisXMaxZone; + private System.Windows.Forms.Label label18; + private System.Windows.Forms.Label label17; + private System.Windows.Forms.NumericUpDown nUDSixaxisZAntiDead; + private System.Windows.Forms.NumericUpDown nUDSixaxisXAntiDead; + private System.Windows.Forms.Label label20; + private System.Windows.Forms.Label label19; + private System.Windows.Forms.Label label22; + private System.Windows.Forms.Label label21; + private System.Windows.Forms.ComboBox cBR2OutputCurve; + private System.Windows.Forms.ComboBox cBL2OutputCurve; + private System.Windows.Forms.ComboBox cBSixaxisZOutputCurve; + private System.Windows.Forms.ComboBox cBSixaxisXOutputCurve; + private System.Windows.Forms.Label label24; + private System.Windows.Forms.Label label23; + private System.Windows.Forms.ContextMenuStrip cMTouchDisableInvert; + private System.Windows.Forms.ToolStripMenuItem crossTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem circleTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem squareTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem triangleTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem l1TouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem l2TouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem r1TouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem r2TouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem upTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem downTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem leftTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem rightTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem l3TouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem r3TouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem oneFingerTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem twoFingerTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem optionsTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem shareTouchInvStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem psTouchInvStripMenuItem; + private System.Windows.Forms.Button touchpadDisInvertButton; + private System.Windows.Forms.Label label25; + private System.Windows.Forms.Label trackFrictionLb; + private System.Windows.Forms.NumericUpDown trackFrictionNUD; + private System.Windows.Forms.CheckBox trackballCk; } } \ No newline at end of file diff --git a/DS4Windows/DS4Forms/Options.cs b/DS4Windows/DS4Forms/Options.cs index 1818675..1f611f2 100644 --- a/DS4Windows/DS4Forms/Options.cs +++ b/DS4Windows/DS4Forms/Options.cs @@ -3,10 +3,7 @@ using System.Drawing; using System.Windows.Forms; using System.Collections.Generic; using System.IO; -using System.Reflection; -using System.Xml; using static DS4Windows.Global; -using System.Runtime.InteropServices; namespace DS4Windows { @@ -27,11 +24,26 @@ 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(); + private int[] touchpadInvertToValue = new int[4] { 0, 2, 1, 3 }; + private Bitmap pnlControllerBgImg; + private Bitmap btnLightBgImg; + private Bitmap btnLightBg; + + int tempInt = 0; + public Options(DS4Form rt) { InitializeComponent(); + pnlControllerBgImg = (Bitmap)Properties.Resources.DS4_Config.Clone(); + btnLightBg = (Bitmap)Properties.Resources.DS4_lightbar.Clone(); + pnlController.BackgroundImage = null; + pnlController.BackgroundImageLayout = ImageLayout.None; mSize = MaximumSize; settingsSize = fLPSettings.Size; MaximumSize = new Size(0, 0); @@ -46,39 +58,61 @@ 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); b.Text = ""; } - foreach (System.Windows.Forms.Control control in Controls) + foreach (Control control in Controls) { if (control.HasChildren) - foreach (System.Windows.Forms.Control ctrl in control.Controls) + { + foreach (Control ctrl in control.Controls) { if (ctrl.HasChildren) - foreach (System.Windows.Forms.Control ctrl2 in ctrl.Controls) + { + foreach (Control ctrl2 in ctrl.Controls) { if (ctrl2.HasChildren) - foreach (System.Windows.Forms.Control ctrl3 in ctrl2.Controls) + { + foreach (Control ctrl3 in ctrl2.Controls) ctrl3.MouseHover += Items_MouseHover; + } + ctrl2.MouseHover += Items_MouseHover; } + } + ctrl.MouseHover += Items_MouseHover; } + } + control.MouseHover += Items_MouseHover; } @@ -87,10 +121,11 @@ namespace DS4Windows b.MouseHover += button_MouseHover; b.MouseLeave += button_MouseLeave; } - advColorDialog.OnUpdateColor += advColorDialog_OnUpdateColor; + inputtimer.Tick += InputDS4; sixaxisTimer.Tick += ControllerReadout_Tick; sixaxisTimer.Interval = 1000 / 60; + bnGyroZN.Text = Properties.Resources.TiltUp; bnGyroZP.Text = Properties.Resources.TiltDown; bnGyroXP.Text = Properties.Resources.TiltLeft; @@ -99,7 +134,124 @@ namespace DS4Windows bnSwipeDown.Text = Properties.Resources.SwipeDown; bnSwipeLeft.Text = Properties.Resources.SwipeLeft; bnSwipeRight.Text = Properties.Resources.SwipeRight; - } + btnLightbar.BackgroundImage = null; + btnLightbar.BackgroundImageLayout = ImageLayout.None; + + 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 +280,14 @@ namespace DS4Windows root.lbLastMessage.Text = "Hover over items to see description or more about"; if (device < 4) nUDSixaxis.Value = deviceNum + 1; + + lVActions.ItemCheck -= this.lVActions_ItemCheck; + if (filename != "") { if (device == 4) //if temp device is called ProfilePath[4] = name; + LoadProfile(device, false, Program.rootHub); if (Rainbow[device] == 0) @@ -144,6 +300,7 @@ namespace DS4Windows btnRainbow.Image = colored; ToggleRainbow(true); } + DS4Color color = MainColor[device]; tBRedBar.Value = color.red; tBGreenBar.Value = color.green; @@ -153,7 +310,9 @@ namespace DS4Windows reg = Color.FromArgb(color.red, color.green, color.blue); full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), reg); main = Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full); - btnLightbar.BackgroundImage = RecolorImage((Bitmap)btnLightbar.BackgroundImage, main); + + btnLightBgImg = RecolorImage(btnLightBg, main); + btnLightbar.Refresh(); cBLightbyBattery.Checked = LedAsBatteryIndicator[device]; nUDflashLED.Value = FlashAt[device]; @@ -167,18 +326,23 @@ namespace DS4Windows DS4Color cColor = ChargingColor[device]; btnChargingColor.BackColor = Color.FromArgb(cColor.red, cColor.green, cColor.blue); - if (FlashType[device] > cBFlashType.Items.Count - 1) + byte tempFlashType = FlashType[device]; + if (tempFlashType > cBFlashType.Items.Count - 1) cBFlashType.SelectedIndex = 0; else - cBFlashType.SelectedIndex = FlashType[device]; + cBFlashType.SelectedIndex = tempFlashType; + 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; @@ -188,8 +352,13 @@ namespace DS4Windows cBTap.Checked = TapSensitivity[device] > 0; cBDoubleTap.Checked = DoubleTap[device]; cBTouchpadJitterCompensation.Checked = TouchpadJitterCompensation[device]; + + tempInt = TouchpadInvert[device]; + touchpadInvertComboBox.SelectedIndex = touchpadInvertToValue[tempInt]; + 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]; @@ -201,10 +370,20 @@ namespace DS4Windows full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), reg); lowColorChooserButton.BackColor = Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full); nUDRainbow.Value = (decimal)Rainbow[device]; - if (ChargingType[device] > cBWhileCharging.Items.Count - 1) + int tempWhileCharging = ChargingType[device]; + if (tempWhileCharging > cBWhileCharging.Items.Count - 1) cBWhileCharging.SelectedIndex = 0; else - cBWhileCharging.SelectedIndex = ChargingType[device]; + cBWhileCharging.SelectedIndex = tempWhileCharging; + + btPollRateComboBox.SelectedIndex = getBTPollRate(device); + lsOutCurveComboBox.SelectedIndex = getLsOutCurveMode(device); + rsOutCurveComboBox.SelectedIndex = getRsOutCurveMode(device); + cBL2OutputCurve.SelectedIndex = getL2OutCurveMode(device); + cBR2OutputCurve.SelectedIndex = getR2OutCurveMode(device); + cBSixaxisXOutputCurve.SelectedIndex = getSXOutCurveMode(device); + cBSixaxisZOutputCurve.SelectedIndex = getSZOutCurveMode(device); + try { nUDL2.Value = Math.Round((decimal)L2Deadzone[device] / 255, 2); @@ -221,6 +400,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,22 +451,113 @@ 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 + { + nUDLSRotation.Value = (decimal)(LSRotation[device] * 180.0 / Math.PI); + } + catch + { + nUDLSRotation.Value = 0.0m; + } + + try + { + nUDRSRotation.Value = (decimal)(RSRotation[device] * 180.0 / Math.PI); + } + catch + { + nUDRSRotation.Value = 0.0m; + } + try { nUDSX.Value = (decimal)SXDeadzone[device]; } catch { - nUDSX.Value = 0.25m; + nUDSX.Value = 0.02m; } + try { nUDSZ.Value = (decimal)SZDeadzone[device]; } catch { - nUDSZ.Value = 0.25m; + nUDSZ.Value = 0.02m; } + + try + { + nUDSixAxisXMaxZone.Value = (decimal)SXMaxzone[device]; + } + catch + { + nUDSixAxisXMaxZone.Value = 1.0m; + } + + try + { + nUDSixAxisZMaxZone.Value = (decimal)SZMaxzone[device]; + } + catch + { + nUDSixAxisZMaxZone.Value = 1.0m; + } + + try + { + nUDSixaxisXAntiDead.Value = (decimal)SXAntiDeadzone[device]; + } + catch + { + nUDSixaxisXAntiDead.Value = 0.0m; + } + + try + { + nUDSixaxisZAntiDead.Value = (decimal)SZAntiDeadzone[device]; + } + catch + { + nUDSixaxisZAntiDead.Value = 0.0m; + } + try { nUDL2S.Value = Math.Round((decimal)L2Sens[device], 2); @@ -301,12 +606,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]; @@ -317,44 +624,94 @@ namespace DS4Windows nUDLSCurve.Value = LSCurve[device]; nUDRSCurve.Value = RSCurve[device]; cBControllerInput.Checked = DS4Mapping; + trackballCk.Checked = TrackballMode[device]; + trackFrictionNUD.Value = (decimal)TrackballFriction[device]; + if (device < 4) + { + Program.rootHub.touchPad[device]?.ResetTrackAccel(TrackballFriction[device]); + } + + for (int i = 0, arlen = cMGyroTriggers.Items.Count; i < arlen; i++) + { + ((ToolStripMenuItem)cMGyroTriggers.Items[i]).Checked = false; + } + + for (int i = 0, arlen = cMTouchDisableInvert.Items.Count; i < arlen; i++) + { + ((ToolStripMenuItem)cMTouchDisableInvert.Items[i]).Checked = false; + } string[] satriggers = SATriggers[device].Split(','); List s = new List(); - for (int i = 0; i < satriggers.Length; i++) + int gyroTriggerCount = cMGyroTriggers.Items.Count; + for (int i = 0, satrigLen = satriggers.Length; i < satrigLen; i++) { - int tr; + int tr = 0; if (int.TryParse(satriggers[i], out tr)) { - if (tr < cMGyroTriggers.Items.Count && tr > -1) + if (tr < gyroTriggerCount && tr > -1) { ((ToolStripMenuItem)cMGyroTriggers.Items[tr]).Checked = true; s.Add(cMGyroTriggers.Items[tr].Text); } else { - ((ToolStripMenuItem)cMGyroTriggers.Items[cMGyroTriggers.Items.Count - 1]).Checked = true; - s.Add(cMGyroTriggers.Items[cMGyroTriggers.Items.Count - 1].Text); + ((ToolStripMenuItem)cMGyroTriggers.Items[gyroTriggerCount - 1]).Checked = true; + s.Add(cMGyroTriggers.Items[gyroTriggerCount - 1].Text); break; } } else { - ((ToolStripMenuItem)cMGyroTriggers.Items[cMGyroTriggers.Items.Count - 1]).Checked = true; - s.Add(cMGyroTriggers.Items[cMGyroTriggers.Items.Count - 1].Text); + ((ToolStripMenuItem)cMGyroTriggers.Items[gyroTriggerCount - 1]).Checked = true; + s.Add(cMGyroTriggers.Items[gyroTriggerCount - 1].Text); break; } } + + btnGyroTriggers.Text = string.Join(", ", s); + s.Clear(); + + int[] touchDisInvTriggers = TouchDisInvertTriggers[device]; + int touchDisableInvCount = cMTouchDisableInvert.Items.Count; + for (int i = 0, trigLen = touchDisInvTriggers.Length; i < trigLen; i++) + { + int tr = touchDisInvTriggers[i]; + if (tr < touchDisableInvCount && tr > -1) + { + ToolStripMenuItem current = (ToolStripMenuItem)cMTouchDisableInvert.Items[tr]; + current.Checked = true; + s.Add(current.Text); + } + } + + if (s.Count > 0) + touchpadDisInvertButton.Text = string.Join(", ", s); + nUDGyroSensitivity.Value = GyroSensitivity[device]; + gyroTriggerBehavior.Checked = GyroTriggerTurns[device]; + nUDGyroMouseVertScale.Value = GyroSensVerticalScale[device]; int invert = GyroInvert[device]; - cBGyroInvertX.Checked = invert == 2 || invert == 3; - cBGyroInvertY.Checked = invert == 1 || invert == 3; + cBGyroInvertX.Checked = (invert & 0x02) == 2; + cBGyroInvertY.Checked = (invert & 0x01) == 1; if (s.Count > 0) btnGyroTriggers.Text = string.Join(", ", s); + + cBGyroSmooth.Checked = nUDGyroSmoothWeight.Enabled = GyroSmoothing[device]; + nUDGyroSmoothWeight.Value = (decimal)(GyroSmoothingWeight[device]); + cBGyroMouseXAxis.SelectedIndex = GyroMouseHorizontalAxis[device]; } else { cBFlashType.SelectedIndex = 0; cBWhileCharging.SelectedIndex = 0; + btPollRateComboBox.SelectedIndex = 4; + lsOutCurveComboBox.SelectedIndex = 0; + rsOutCurveComboBox.SelectedIndex = 0; + cBL2OutputCurve.SelectedIndex = 0; + cBR2OutputCurve.SelectedIndex = 0; + cBSixaxisXOutputCurve.SelectedIndex = 0; + cBSixaxisZOutputCurve.SelectedIndex = 0; rBTPMouse.Checked = true; rBSAControls.Checked = true; ToggleRainbow(false); @@ -362,6 +719,7 @@ namespace DS4Windows cbStartTouchpadOff.Checked = false; rBSAControls.Checked = true; rBTPMouse.Checked = true; + switch (device) { case 0: tBRedBar.Value = 0; tBGreenBar.Value = 0; tBBlueBar.Value = 255; break; @@ -370,6 +728,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; @@ -386,8 +745,10 @@ namespace DS4Windows cBTap.Checked = false; cBDoubleTap.Checked = false; cBTouchpadJitterCompensation.Checked = true; + touchpadInvertComboBox.SelectedIndex = 0; cBlowerRCOn.Checked = false; - cBFlushHIDQueue.Checked = true; + cBFlushHIDQueue.Checked = false; + enableTouchToggleCheckbox.Checked = true; nUDIdleDisconnect.Value = 5; cBIdleDisconnect.Checked = true; numUDMouseSens.Value = 25; @@ -397,10 +758,22 @@ namespace DS4Windows nUDRainbow.Value = 0; nUDL2.Value = 0; nUDR2.Value = 0; + nUDL2Maxzone.Value = 1; + nUDR2Maxzone.Value = 1; nUDLS.Value = 0; nUDRS.Value = 0; - nUDSX.Value = .25m; - nUDSZ.Value = .25m; + nUDLSAntiDead.Value = 0; + nUDRSAntiDead.Value = 0; + nUDLSMaxZone.Value = 1; + nUDRSMaxZone.Value = 1; + nUDLSRotation.Value = 0; + nUDRSRotation.Value = 0; + nUDSX.Value = 0.02m; + nUDSZ.Value = 0.02m; + nUDSixAxisXMaxZone.Value = 1.0m; + nUDSixAxisZMaxZone.Value = 1.0m; + nUDSixaxisXAntiDead.Value = 0.0m; + nUDSixaxisZAntiDead.Value = 0.0m; nUDL2S.Value = 1; nUDR2S.Value = 1; @@ -418,70 +791,42 @@ namespace DS4Windows nUDLSCurve.Value = 0; nUDRSCurve.Value = 0; cBControllerInput.Checked = DS4Mapping; + trackballCk.Checked = false; + trackFrictionNUD.Value = 10.0m; + if (device < 4) + { + Program.rootHub.touchPad[device]?.ResetTrackAccel(10.0); + } + + for (int i = 0, arlen = cMGyroTriggers.Items.Count - 1; i < arlen; i++) + { + ((ToolStripMenuItem)cMGyroTriggers.Items[i]).Checked = false; + } ((ToolStripMenuItem)cMGyroTriggers.Items[cMGyroTriggers.Items.Count - 1]).Checked = true; + + for (int i = 0, arlen = cMTouchDisableInvert.Items.Count; i < arlen; i++) + { + ((ToolStripMenuItem)cMTouchDisableInvert.Items[i]).Checked = false; + } + nUDGyroSensitivity.Value = 100; + nUDGyroMouseVertScale.Value = 100; + gyroTriggerBehavior.Checked = true; cBGyroInvertX.Checked = false; cBGyroInvertY.Checked = false; + cBGyroSmooth.Checked = false; + nUDGyroSmoothWeight.Value = 0.5m; + cBGyroMouseXAxis.SelectedIndex = 0; Set(); } UpdateLists(); - inputtimer.Start(); LoadActions(string.IsNullOrEmpty(filename)); + lVActions.ItemCheck += new ItemCheckEventHandler(this.lVActions_ItemCheck); loading = false; saving = false; } - private string getDS4ControlsByName(DS4Controls key) - { - switch (key) - { - case DS4Controls.Share: return "bnShare"; - case DS4Controls.L3: return "bnL3"; - case DS4Controls.R3: return "bnR3"; - case DS4Controls.Options: return "bnOptions"; - case DS4Controls.DpadUp: return "bnUp"; - case DS4Controls.DpadRight: return "bnRight"; - case DS4Controls.DpadDown: return "bnDown"; - case DS4Controls.DpadLeft: return "bnLeft"; - - case DS4Controls.L1: return "bnL1"; - case DS4Controls.R1: return "bnR1"; - case DS4Controls.Triangle: return "bnTriangle"; - case DS4Controls.Circle: return "bnCircle"; - case DS4Controls.Cross: return "bnCross"; - case DS4Controls.Square: return "bnSquare"; - - case DS4Controls.PS: return "bnPS"; - case DS4Controls.LXNeg: return "bnLSLeft"; - case DS4Controls.LYNeg: return "bnLSUp"; - case DS4Controls.RXNeg: return "bnRSLeft"; - case DS4Controls.RYNeg: return "bnRSUp"; - - case DS4Controls.LXPos: return "bnLSRight"; - case DS4Controls.LYPos: return "bnLSDown"; - case DS4Controls.RXPos: return "bnRSRight"; - case DS4Controls.RYPos: return "bnRSDown"; - case DS4Controls.L2: return "bnL2"; - case DS4Controls.R2: return "bnR2"; - - case DS4Controls.TouchLeft: return "bnTouchLeft"; - case DS4Controls.TouchMulti: return "bnTouchMulti"; - case DS4Controls.TouchUpper: return "bnTouchUpper"; - case DS4Controls.TouchRight: return "bnTouchRight"; - case DS4Controls.GyroXPos: return "bnGyroXP"; - case DS4Controls.GyroXNeg: return "bnGyroXN"; - case DS4Controls.GyroZPos: return "bnGyroZP"; - case DS4Controls.GyroZNeg: return "bnGyroZN"; - - case DS4Controls.SwipeUp: return "bnSwipeUp"; - case DS4Controls.SwipeDown: return "bnSwipeDown"; - case DS4Controls.SwipeLeft: return "bnSwipeLeft"; - case DS4Controls.SwipeRight: return "bnSwipeRight"; - } - return ""; - } - public void LoadActions(bool newp) { lVActions.Items.Clear(); @@ -496,7 +841,7 @@ namespace DS4Windows case "Macro": lvi.SubItems.Add(Properties.Resources.Macro + (action.keyType.HasFlag(DS4KeyType.ScanCode) ? " (" + Properties.Resources.ScanCode + ")" : "")); break; case "Program": lvi.SubItems.Add(Properties.Resources.LaunchProgram.Replace("*program*", Path.GetFileNameWithoutExtension(action.details))); break; case "Profile": lvi.SubItems.Add(Properties.Resources.LoadProfile.Replace("*profile*", action.details)); break; - case "Key": lvi.SubItems.Add(((Keys)int.Parse(action.details)).ToString() + (action.uTrigger.Count > 0 ? " (Toggle)" : "")); break; + case "Key": lvi.SubItems.Add(((Keys)Convert.ToInt32(action.details)).ToString() + (action.uTrigger.Count > 0 ? " (Toggle)" : "")); break; case "DisconnectBT": lvi.SubItems.Add(Properties.Resources.DisconnectBT); break; @@ -510,32 +855,31 @@ 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); } } - public double Clamp(double min, double value, double max) - { - if (value > max) - return max; - else if (value < min) - return min; - else - return value; - } - void EnableReadings(bool on) + private void EnableReadings(bool on) { lbL2Track.Enabled = on; lbR2Track.Enabled = on; @@ -549,38 +893,49 @@ namespace DS4Windows btnSATrack.Visible = on; btnSATrackS.Visible = on; } - void ControllerReadout_Tick(object sender, EventArgs e) + + private 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) + int tempDeviceNum = (int)nUDSixaxis.Value - 1; + DS4Device ds = Program.rootHub.DS4Controllers[tempDeviceNum]; + + if (ds == null) { EnableReadings(false); lbInputDelay.Text = Properties.Resources.InputDelay.Replace("*number*", Properties.Resources.NA); lbInputDelay.BackColor = Color.Transparent; - lbInputDelay.ForeColor = Color.Black; + lbInputDelay.ForeColor = SystemColors.ControlText; } else { EnableReadings(true); - SetDynamicTrackBarValue(tBsixaxisGyroX, (Program.rootHub.ExposedState[(int)nUDSixaxis.Value - 1].GyroX + tBsixaxisGyroX.Value * 2) / 3); - SetDynamicTrackBarValue(tBsixaxisGyroY, (Program.rootHub.ExposedState[(int)nUDSixaxis.Value - 1].GyroY + tBsixaxisGyroY.Value * 2) / 3); - SetDynamicTrackBarValue(tBsixaxisGyroZ, (Program.rootHub.ExposedState[(int)nUDSixaxis.Value - 1].GyroZ + tBsixaxisGyroZ.Value * 2) / 3); - SetDynamicTrackBarValue(tBsixaxisAccelX, (int)(Program.rootHub.ExposedState[(int)nUDSixaxis.Value - 1].AccelX + tBsixaxisAccelX.Value * 2) / 3); - SetDynamicTrackBarValue(tBsixaxisAccelY, (int)(Program.rootHub.ExposedState[(int)nUDSixaxis.Value - 1].AccelY + tBsixaxisAccelY.Value * 2) / 3); - SetDynamicTrackBarValue(tBsixaxisAccelZ, (int)(Program.rootHub.ExposedState[(int)nUDSixaxis.Value - 1].AccelZ + tBsixaxisAccelZ.Value * 2) / 3); - int x = Program.rootHub.getDS4State((int)nUDSixaxis.Value - 1).LX; - int y = Program.rootHub.getDS4State((int)nUDSixaxis.Value - 1).LY; - btnLSTrackS.Visible = nUDLSS.Value != 1; - if (nUDLSCurve.Value > 0) + DS4StateExposed exposeState = Program.rootHub.ExposedState[tempDeviceNum]; + DS4State baseState = Program.rootHub.getDS4State(tempDeviceNum); + + SetDynamicTrackBarValue(tBsixaxisGyroX, (exposeState.getGyroYaw() + tBsixaxisGyroX.Value * 2) / 3); + SetDynamicTrackBarValue(tBsixaxisGyroY, (exposeState.getGyroPitch() + tBsixaxisGyroY.Value * 2) / 3); + SetDynamicTrackBarValue(tBsixaxisGyroZ, (exposeState.getGyroRoll() + tBsixaxisGyroZ.Value * 2) / 3); + SetDynamicTrackBarValue(tBsixaxisAccelX, (exposeState.getAccelX() + tBsixaxisAccelX.Value * 2) / 3); + SetDynamicTrackBarValue(tBsixaxisAccelY, (exposeState.getAccelY() + tBsixaxisAccelY.Value * 2) / 3); + SetDynamicTrackBarValue(tBsixaxisAccelZ, (exposeState.getAccelZ() + tBsixaxisAccelZ.Value * 2) / 3); + + int x = baseState.LX; + int y = baseState.LY; + + double tempLSS = (double)nUDLSS.Value; + btnLSTrackS.Visible = tempLSS != 1; + double tempLSCurve = (double)nUDLSCurve.Value; + if (tempLSCurve > 0.0) { float max = x + y; double curvex; double curvey; - double multimax = TValue(382.5, max, (double)nUDLSCurve.Value); - double multimin = TValue(127.5, max, (double)nUDLSCurve.Value); + double multimax = TValue(382.5, max, tempLSCurve); + double multimin = TValue(127.5, max, tempLSCurve); if ((x > 127.5f && y > 127.5f) || (x < 127.5f && y < 127.5f)) { curvex = (x > 127.5f ? Math.Min(x, (x / max) * multimax) : Math.Max(x, (x / max) * multimin)); @@ -604,22 +959,28 @@ namespace DS4Windows else { btnLSTrack.Location = new Point((int)(dpix * x / 2.09), (int)(dpiy * y / 2.09)); - btnLSTrackS.Visible = nUDLSS.Value != 1; + btnLSTrackS.Visible = tempLSS != 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) + if (tempLSS != 1) + { + btnLSTrackS.Location = new Point((int)(tempLSS * (btnLSTrack.Location.X - pnlLSTrack.Size.Width / 2f) + pnlLSTrack.Size.Width / 2f), + (int)(tempLSS * (btnLSTrack.Location.Y - pnlLSTrack.Size.Height / 2f) + pnlLSTrack.Size.Height / 2f)); + } + + x = baseState.RX; + y = baseState.RY; + + double tempRSS = (double)nUDRSS.Value; + btnRSTrackS.Visible = tempRSS != 1; + double tempRSCurve = (double)nUDRSCurve.Value; + if (tempRSCurve > 0.0) { float max = x + y; double curvex; double curvey; - double multimax = TValue(382.5, max, (double)nUDRSCurve.Value); - double multimin = TValue(127.5, max, (double)nUDRSCurve.Value); + double multimax = TValue(382.5, max, tempRSCurve); + double multimin = TValue(127.5, max, tempRSCurve); if ((x > 127.5f && y > 127.5f) || (x < 127.5f && y < 127.5f)) { curvex = (x > 127.5f ? Math.Min(x, (x / max) * multimax) : Math.Max(x, (x / max) * multimin)); @@ -643,51 +1004,65 @@ namespace DS4Windows else { btnRSTrack.Location = new Point((int)(dpix * x / 2.09), (int)(dpiy * y / 2.09)); - btnRSTrackS.Visible = nUDRSS.Value != 1; + btnRSTrackS.Visible = tempRSS != 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)); - x = -Program.rootHub.ExposedState[(int)nUDSixaxis.Value - 1].GyroX + 127; - y = Program.rootHub.ExposedState[(int)nUDSixaxis.Value - 1].GyroZ + 127; - btnSATrack.Location = new Point((int)(dpix * Clamp(0, x / 2.09, pnlSATrack.Size.Width)), (int)(dpiy * Clamp(0, y / 2.09, pnlSATrack.Size.Height))); - btnSATrackS.Visible = nUDSXS.Value != 1 || nUDSZS.Value != 1; - if (nUDSXS.Value != 1 || nUDSZS.Value != 1) - btnSATrackS.Location = new Point((int)((float)nUDSXS.Value * (btnSATrack.Location.X - pnlSATrack.Size.Width / 2f) + pnlSATrack.Size.Width / 2f), - (int)((float)nUDSZS.Value * (btnSATrack.Location.Y - pnlSATrack.Size.Height / 2f) + pnlSATrack.Size.Height / 2f)); + if (tempRSS != 1) + { + btnRSTrackS.Location = new Point((int)(tempRSS * (btnRSTrack.Location.X - pnlRSTrack.Size.Width / 2f) + pnlRSTrack.Size.Width / 2f), + (int)(tempRSS * (btnRSTrack.Location.Y - pnlRSTrack.Size.Height / 2f) + pnlRSTrack.Size.Height / 2f)); + } - tBL2.Value = Program.rootHub.getDS4State((int)nUDSixaxis.Value - 1).L2; + x = exposeState.getAccelX() + 127; + y = exposeState.getAccelZ() + 127; + btnSATrack.Location = new Point((int)(dpix * Global.Clamp(0, x / 2.09, pnlSATrack.Size.Width)), (int)(dpiy * Global.Clamp(0, y / 2.09, pnlSATrack.Size.Height))); + + double tempSXS = (double)nUDSXS.Value; + double tempSZS = (double)nUDSZS.Value; + btnSATrackS.Visible = tempSXS != 1 || tempSZS != 1; + if (tempSXS != 1 || tempSZS != 1) + { + btnSATrackS.Location = new Point((int)(tempSXS * (btnSATrack.Location.X - pnlSATrack.Size.Width / 2f) + pnlSATrack.Size.Width / 2f), + (int)(tempSZS * (btnSATrack.Location.Y - pnlSATrack.Size.Height / 2f) + pnlSATrack.Size.Height / 2f)); + } + + double tempL2 = (double)nUDL2.Value; + double tempL2S = (double)nUDL2S.Value; + tBL2.Value = baseState.L2; 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), + Math.Max((int)(((tBL2.Location.Y + tBL2.Size.Height) - (tBL2.Value * tempL2S) / (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) + + if (tBL2.Value * tempL2S >= 255) lbL2Track.ForeColor = Color.Green; - else if (tBL2.Value * (float)nUDL2S.Value < (double)nUDL2.Value * 255) + else if (tBL2.Value * tempL2S < tempL2 * 255) lbL2Track.ForeColor = Color.Red; else lbL2Track.ForeColor = Color.Black; - tBR2.Value = Program.rootHub.getDS4State((int)nUDSixaxis.Value - 1).R2; + double tempR2 = (double)nUDR2.Value; + double tempR2S = (double)nUDR2S.Value; + tBR2.Value = baseState.R2; 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), + Math.Max((int)(1 * ((tBR2.Location.Y + tBR2.Size.Height) - (tBR2.Value * tempR2S) / (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) + + if (tBR2.Value * tempR2S >= 255) lbR2Track.ForeColor = Color.Green; - else if (tBR2.Value * (float)nUDR2S.Value < (double)nUDR2.Value * 255) + else if (tBR2.Value * tempR2S < tempR2 * 255) lbR2Track.ForeColor = Color.Red; else 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 * 0.5)) { lbInputDelay.BackColor = Color.Yellow; lbInputDelay.ForeColor = Color.Black; @@ -695,7 +1070,7 @@ namespace DS4Windows else { lbInputDelay.BackColor = Color.Transparent; - lbInputDelay.ForeColor = Color.Black; + lbInputDelay.ForeColor = SystemColors.ControlText; } } } @@ -705,48 +1080,49 @@ 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)) + { + int tempDeviceNum = (int)nUDSixaxis.Value - 1; + switch (Program.rootHub.GetActiveInputControl(tempDeviceNum)) { - case ("Cross"): Show_ControlsBn(bnCross, e); break; - case ("Circle"): Show_ControlsBn(bnCircle, e); break; - case ("Square"): Show_ControlsBn(bnSquare, e); break; - case ("Triangle"): Show_ControlsBn(bnTriangle, e); break; - case ("Options"): Show_ControlsBn(bnOptions, e); break; - case ("Share"): Show_ControlsBn(bnShare, e); break; - case ("Up"): Show_ControlsBn(bnUp, e); break; - case ("Down"): Show_ControlsBn(bnDown, e); break; - case ("Left"): Show_ControlsBn(bnLeft, e); break; - case ("Right"): Show_ControlsBn(bnRight, e); break; - case ("PS"): Show_ControlsBn(bnPS, e); break; - case ("L1"): Show_ControlsBn(bnL1, e); break; - case ("R1"): Show_ControlsBn(bnR1, e); break; - case ("L2"): Show_ControlsBn(bnL2, e); break; - case ("R2"): Show_ControlsBn(bnR2, e); break; - case ("L3"): Show_ControlsBn(bnL3, e); break; - case ("R3"): Show_ControlsBn(bnR3, e); break; - case ("Touch Left"): Show_ControlsBn(bnTouchLeft, e); break; - case ("Touch Right"): Show_ControlsBn(bnTouchRight, e); break; - case ("Touch Multi"): Show_ControlsBn(bnTouchMulti, e); break; - case ("Touch Upper"): Show_ControlsBn(bnTouchUpper, e); break; - case ("LS Up"): Show_ControlsBn(bnLSUp, e); break; - case ("LS Down"): Show_ControlsBn(bnLSDown, e); break; - case ("LS Left"): Show_ControlsBn(bnLSLeft, e); break; - case ("LS Right"): Show_ControlsBn(bnLSRight, e); break; - case ("RS Up"): Show_ControlsBn(bnRSUp, e); break; - case ("RS Down"): Show_ControlsBn(bnRSDown, e); break; - case ("RS Left"): Show_ControlsBn(bnRSLeft, e); break; - case ("RS Right"): Show_ControlsBn(bnRSRight, e); break; - case ("GyroXP"): Show_ControlsBn(bnGyroXP, e); break; - case ("GyroXN"): Show_ControlsBn(bnGyroXN, e); break; - case ("GyroZP"): Show_ControlsBn(bnGyroZP, e); break; - case ("GyroZN"): Show_ControlsBn(bnGyroZN, e); break; + case DS4Controls.None: break; + case DS4Controls.Cross: Show_ControlsBn(bnCross, e); break; + case DS4Controls.Circle: Show_ControlsBn(bnCircle, e); break; + case DS4Controls.Square: Show_ControlsBn(bnSquare, e); break; + case DS4Controls.Triangle: Show_ControlsBn(bnTriangle, e); break; + case DS4Controls.Options: Show_ControlsBn(bnOptions, e); break; + case DS4Controls.Share: Show_ControlsBn(bnShare, e); break; + case DS4Controls.DpadUp: Show_ControlsBn(bnUp, e); break; + case DS4Controls.DpadDown: Show_ControlsBn(bnDown, e); break; + case DS4Controls.DpadLeft: Show_ControlsBn(bnLeft, e); break; + case DS4Controls.DpadRight: Show_ControlsBn(bnRight, e); break; + case DS4Controls.PS: Show_ControlsBn(bnPS, e); break; + case DS4Controls.L1: Show_ControlsBn(bnL1, e); break; + case DS4Controls.R1: Show_ControlsBn(bnR1, e); break; + case DS4Controls.L2: Show_ControlsBn(bnL2, e); break; + case DS4Controls.R2: Show_ControlsBn(bnR2, e); break; + case DS4Controls.L3: Show_ControlsBn(bnL3, e); break; + case DS4Controls.R3: Show_ControlsBn(bnR3, e); break; + case DS4Controls.TouchLeft: Show_ControlsBn(bnTouchLeft, e); break; + case DS4Controls.TouchRight: Show_ControlsBn(bnTouchRight, e); break; + case DS4Controls.TouchMulti: Show_ControlsBn(bnTouchMulti, e); break; + case DS4Controls.TouchUpper: Show_ControlsBn(bnTouchUpper, e); break; + case DS4Controls.LYNeg: Show_ControlsBn(bnLSUp, e); break; + case DS4Controls.LYPos: Show_ControlsBn(bnLSDown, e); break; + case DS4Controls.LXNeg: Show_ControlsBn(bnLSLeft, e); break; + case DS4Controls.LXPos: Show_ControlsBn(bnLSRight, e); break; + case DS4Controls.RYNeg: Show_ControlsBn(bnRSUp, e); break; + case DS4Controls.RYPos: Show_ControlsBn(bnRSDown, e); break; + case DS4Controls.RXNeg: Show_ControlsBn(bnRSLeft, e); break; + case DS4Controls.RXPos: Show_ControlsBn(bnRSRight, e); break; + default: break; } + } } - private void button_MouseHoverB(object sender, EventArgs e) { Control[] b = Controls.Find(((Button)sender).Name.Remove(1, 1), true); @@ -791,195 +1167,48 @@ 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)) { - #region - case "bnCross": lBControls.SelectedIndex = 0; break; - case "bnCircle": lBControls.SelectedIndex = 1; break; - case "bnSquare": lBControls.SelectedIndex = 2; break; - case "bnTriangle": lBControls.SelectedIndex = 3; break; - case "bnOptions": lBControls.SelectedIndex = 4; break; - case "bnShare": lBControls.SelectedIndex = 5; break; - case "bnUp": lBControls.SelectedIndex = 6; break; - case "bnDown": lBControls.SelectedIndex = 7; break; - case "bnLeft": lBControls.SelectedIndex = 8; break; - case "bnRight": lBControls.SelectedIndex = 9; break; - case "bnPS": lBControls.SelectedIndex = 10; break; - case "bnL1": lBControls.SelectedIndex = 11; break; - case "bnR1": lBControls.SelectedIndex = 12; break; - case "bnL2": lBControls.SelectedIndex = 13; break; - case "bnR2": lBControls.SelectedIndex = 14; break; - case "bnL3": lBControls.SelectedIndex = 15; break; - case "bnR3": lBControls.SelectedIndex = 16; break; - case "bnTouchLeft": lBControls.SelectedIndex = 17; break; - case "bnTouchRight": lBControls.SelectedIndex = 18; break; - case "bnTouchMulti": lBControls.SelectedIndex = 19; break; - case "bnTouchUpper": lBControls.SelectedIndex = 20; break; - case "bnLSUp": lBControls.SelectedIndex = 21; break; - case "bnLSDown": lBControls.SelectedIndex = 22; break; - case "bnLSLeft": lBControls.SelectedIndex = 23; break; - case "bnLSRight": lBControls.SelectedIndex = 24; break; - case "bnRSUp": lBControls.SelectedIndex = 25; break; - case "bnRSDown": lBControls.SelectedIndex = 26; break; - case "bnRSLeft": lBControls.SelectedIndex = 27; break; - case "bnRSRight": lBControls.SelectedIndex = 28; break; - case "bnGyroZN": lBControls.SelectedIndex = 29; break; - case "bnGyroZP": lBControls.SelectedIndex = 30; break; - case "bnGyroXP": lBControls.SelectedIndex = 31; break; - case "bnGyroXN": lBControls.SelectedIndex = 32; break; - #endregion + lBControls.SelectedIndex = tempIndex; } - if (swipesOn) - switch (name) - { - case "bnSwipeUp": if (swipesOn) lBControls.SelectedIndex = 33; break; - case "bnSwipeDown": if (swipesOn) lBControls.SelectedIndex = 34; break; - 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)) { - #region - case "bnCross": - pBHoveredButton.Image = Properties.Resources.DS4_Config_Cross; - pBHoveredButton.Location = lbLCross.Location; - break; - case "bnCircle": - pBHoveredButton.Image = Properties.Resources.DS4_Config_Circle; - pBHoveredButton.Location = lbLCircle.Location; - break; - case "bnSquare": - pBHoveredButton.Image = Properties.Resources.DS4_Config_Square; - pBHoveredButton.Location = lbLSquare.Location; - break; - case "bnTriangle": - pBHoveredButton.Image = Properties.Resources.DS4_Config_Triangle; - pBHoveredButton.Location = lbLTriangle.Location; - break; - case "bnOptions": - pBHoveredButton.Image = Properties.Resources.DS4_Config_Options; - pBHoveredButton.Location = lbLOptions.Location; - break; - case "bnShare": - pBHoveredButton.Image = Properties.Resources.DS4_Config_Share; - pBHoveredButton.Location = lbLShare.Location; - break; - case "bnUp": - pBHoveredButton.Image = Properties.Resources.DS4_Config_Up; - pBHoveredButton.Location = lbLUp.Location; - break; - case "bnDown": - pBHoveredButton.Image = Properties.Resources.DS4_Config_Down; - pBHoveredButton.Location = lbLDown.Location; - break; - case "bnLeft": - pBHoveredButton.Image = Properties.Resources.DS4_Config_Left; - pBHoveredButton.Location = lbLLeft.Location; - break; - case "bnRight": - pBHoveredButton.Image = Properties.Resources.DS4_Config_Right; - pBHoveredButton.Location = lbLright.Location; - break; - case "bnPS": - pBHoveredButton.Image = Properties.Resources.DS4_Config_PS; - pBHoveredButton.Location = lbLPS.Location; - break; - case "bnL1": - pBHoveredButton.Image = Properties.Resources.DS4_Config_L1; - pBHoveredButton.Location = lbLL1.Location; - break; - case "bnR1": - pBHoveredButton.Image = Properties.Resources.DS4_Config_R1; - pBHoveredButton.Location = lbLR1.Location; - break; - case "bnL2": - pBHoveredButton.Image = Properties.Resources.DS4_Config_L2; - pBHoveredButton.Location = lbLL2.Location; - break; - case "bnR2": - pBHoveredButton.Image = Properties.Resources.DS4_Config_R2; - pBHoveredButton.Location = lbLR2.Location; - break; - case "bnTouchLeft": - pBHoveredButton.Image = Properties.Resources.DS4_Config_TouchLeft; - pBHoveredButton.Location = lbLTouchLM.Location; - break; - case "bnTouchRight": - pBHoveredButton.Image = Properties.Resources.DS4_Config_TouchRight; - pBHoveredButton.Location = lbLTouchRight.Location; - break; - case "bnTouchMulti": - pBHoveredButton.Image = Properties.Resources.DS4_Config_TouchMulti; - pBHoveredButton.Location = lbLTouchLM.Location; - break; - case "bnTouchUpper": - pBHoveredButton.Image = Properties.Resources.DS4_Config_TouchUpper; - pBHoveredButton.Location = lbLTouchUpper.Location; - break; - case "bnL3": - pBHoveredButton.Image = Properties.Resources.DS4_Config_LS; - pBHoveredButton.Location = lbLLS.Location; - break; - case "bnLSUp": - pBHoveredButton.Image = Properties.Resources.DS4_Config_LS; - pBHoveredButton.Location = lbLLS.Location; - break; - case "bnLSDown": - pBHoveredButton.Image = Properties.Resources.DS4_Config_LS; - pBHoveredButton.Location = lbLLS.Location; - break; - case "bnLSLeft": - pBHoveredButton.Image = Properties.Resources.DS4_Config_LS; - pBHoveredButton.Location = lbLLS.Location; - break; - case "bnLSRight": - pBHoveredButton.Image = Properties.Resources.DS4_Config_LS; - pBHoveredButton.Location = lbLLS.Location; - break; - case "bnR3": - pBHoveredButton.Image = Properties.Resources.DS4_Config_RS; - pBHoveredButton.Location = lbLRS.Location; - break; - case "bnRSUp": - pBHoveredButton.Image = Properties.Resources.DS4_Config_RS; - pBHoveredButton.Location = lbLRS.Location; - break; - case "bnRSDown": - pBHoveredButton.Image = Properties.Resources.DS4_Config_RS; - pBHoveredButton.Location = lbLRS.Location; - break; - case "bnRSLeft": - pBHoveredButton.Image = Properties.Resources.DS4_Config_RS; - pBHoveredButton.Location = lbLRS.Location; - break; - case "bnRSRight": - pBHoveredButton.Image = Properties.Resources.DS4_Config_RS; - pBHoveredButton.Location = lbLRS.Location; - break; - #endregion + pBHoveredButton.Image = tempBit; } + + Label tempLabel = null; + if (hoverLabelDict.TryGetValue(senderControl, out tempLabel)) + { + pBHoveredButton.Location = tempLabel.Location; + } + if (pBHoveredButton.Image != null) pBHoveredButton.Size = new Size((int)(pBHoveredButton.Image.Size.Width * (dpix / 1.25f)), (int)(pBHoveredButton.Image.Size.Height * (dpix / 1.25f))); } - private void button_MouseLeave(object sender, EventArgs e) { pBHoveredButton.Image = null; @@ -993,6 +1222,7 @@ namespace DS4Windows trackBar.Maximum = value; else if (trackBar.Minimum > value) trackBar.Minimum = value; + trackBar.Value = value; } @@ -1008,8 +1238,18 @@ namespace DS4Windows FlashColor[device] = new DS4Color(btnFlashColor.BackColor); else FlashColor[device] = new DS4Color(Color.Black); + + BTPollRate[device] = btPollRateComboBox.SelectedIndex; + lsOutCurveMode[device] = lsOutCurveComboBox.SelectedIndex; + rsOutCurveMode[device] = rsOutCurveComboBox.SelectedIndex; + l2OutCurveMode[device] = cBL2OutputCurve.SelectedIndex; + r2OutCurveMode[device] = cBR2OutputCurve.SelectedIndex; + sxOutCurveMode[device] = cBSixaxisXOutputCurve.SelectedIndex; + szOutCurveMode[device] = cBSixaxisZOutputCurve.SelectedIndex; 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; @@ -1017,14 +1257,28 @@ namespace DS4Windows ScrollSensitivity[device] = (int)nUDScroll.Value; DoubleTap[device] = cBDoubleTap.Checked; TapSensitivity[device] = (byte)nUDTap.Value; + + tempInt = touchpadInvertComboBox.SelectedIndex; + TouchpadInvert[device] = touchpadInvertToValue[tempInt]; + IdleDisconnectTimeout[device] = (int)(nUDIdleDisconnect.Value * 60); 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); + LSMaxzone[device] = (int)(nUDLSMaxZone.Value * 100); + RSMaxzone[device] = (int)(nUDRSMaxZone.Value * 100); + LSRotation[device] = (double)nUDLSRotation.Value * Math.PI / 180.0; + RSRotation[device] = (double)nUDRSRotation.Value * Math.PI / 180.0; ButtonMouseSensitivity[device] = (int)numUDMouseSens.Value; FlashAt[device] = (int)nUDflashLED.Value; SXDeadzone[device] = (double)nUDSX.Value; SZDeadzone[device] = (double)nUDSZ.Value; + SXMaxzone[device] = (double)nUDSixAxisXMaxZone.Value; + SZMaxzone[device] = (double)nUDSixAxisZMaxZone.Value; + SXAntiDeadzone[device] = (double)nUDSixaxisXAntiDead.Value; + SZAntiDeadzone[device] = (double)nUDSixaxisZAntiDead.Value; MouseAccel[device] = cBMouseAccel.Checked; DinputOnly[device] = cBDinput.Checked; StartTouchpadOff[device] = cbStartTouchpadOff.Checked; @@ -1035,29 +1289,66 @@ 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); + cacheProfileCustomsFlags(device); pnlTPMouse.Visible = rBTPMouse.Checked; pnlSAMouse.Visible = rBSAMouse.Checked; fLPTiltControls.Visible = rBSAControls.Checked; fLPTouchSwipe.Visible = rBTPControls.Checked; + TrackballMode[device] = trackballCk.Checked; + TrackballFriction[device] = (double)trackFrictionNUD.Value; + if (device < 4) + { + Program.rootHub.touchPad[device]?.ResetTrackAccel(TrackballFriction[device]); + } GyroSensitivity[device] = (int)Math.Round(nUDGyroSensitivity.Value, 0); + GyroTriggerTurns[device] = gyroTriggerBehavior.Checked; + GyroSensVerticalScale[device] = (int)nUDGyroMouseVertScale.Value; + GyroSmoothing[device] = cBGyroSmooth.Checked; + GyroSmoothingWeight[device] = (double)nUDGyroSmoothWeight.Value; + GyroMouseHorizontalAxis[device] = cBGyroMouseXAxis.SelectedIndex; + 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++) + for (int i = 0, trigLen = cMGyroTriggers.Items.Count - 1; i < trigLen; i++) + { if (((ToolStripMenuItem)cMGyroTriggers.Items[i]).Checked) ints.Add(i); + } + if (ints.Count == 0) ints.Add(-1); + SATriggers[device] = string.Join(",", ints); + + ints.Clear(); + for (int i = 0, trigLen = cMTouchDisableInvert.Items.Count; i < trigLen; i++) + { + if (((ToolStripMenuItem)cMTouchDisableInvert.Items[i]).Checked) + ints.Add(i); + } + + if (ints.Count == 0) + ints.Add(-1); + + TouchDisInvertTriggers[device] = ints.ToArray(); + if (nUDRainbow.Value == 0) btnRainbow.Image = greyscale; else btnRainbow.Image = colored; } @@ -1076,104 +1367,87 @@ 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); } - public void ChangeButtonText(KeyValuePair tag, Control ctrl, bool SC) - { - if (ctrl is Button) - { + public void ChangeButtonText(KeyValuePair tag, Control ctrl, bool SC) + { + if (ctrl is Button) + { DS4KeyType kt = DS4KeyType.None; if (SC) kt |= DS4KeyType.ScanCode; UpdateDS4CSetting(device, ctrl.Name, false, tag.Key, tag.Value, kt); } - } - - /*public void Toggle_Bn(bool SC, bool TG, bool MC, bool MR) - { - if (lastSelected.Tag is KeyValuePair || lastSelected.Tag is KeyValuePair || lastSelected.Tag is KeyValuePair) - lastSelected.Font = new Font(lastSelected.Font, - (SC ? FontStyle.Bold : FontStyle.Regular) | (TG ? FontStyle.Italic : FontStyle.Regular) | - (MC ? FontStyle.Underline : FontStyle.Regular) | (MR ? FontStyle.Strikeout : FontStyle.Regular)); - else if (lastSelected.Tag is KeyValuePair) - if (lastSelected.Tag.ToString().Contains("Mouse Button")) - lastSelected.Font = new Font(lastSelected.Font, TG ? FontStyle.Italic : FontStyle.Regular); - else - lastSelected.Font = new Font(lastSelected.Font, FontStyle.Regular); } - public void Toggle_Bn(bool SC, bool TG, bool MC, bool MR, System.Windows.Forms.Control ctrl) - { - if (ctrl is Button) - { - Button btn = (Button)ctrl; - if (btn.Tag is KeyValuePair || btn.Tag is KeyValuePair || btn.Tag is KeyValuePair) - btn.Font = new Font(btn.Font, - (SC ? FontStyle.Bold : FontStyle.Regular) | (TG ? FontStyle.Italic : FontStyle.Regular) | - (MC ? FontStyle.Underline : FontStyle.Regular) | (MR ? FontStyle.Strikeout : FontStyle.Regular)); - else if (btn.Tag is KeyValuePair) - if (btn.Tag.ToString().Contains("Mouse Button")) - btn.Font = new Font(btn.Font, TG ? FontStyle.Italic : FontStyle.Regular); - else - btn.Font = new Font(btn.Font, FontStyle.Regular); - } - }*/ - - private void btnLightbar_Click(object sender, EventArgs e) { + AdvancedColorDialog.ColorUpdateHandler tempDel = + new AdvancedColorDialog.ColorUpdateHandler(advColorDialog_OnUpdateColor); + + advColorDialog.OnUpdateColor += tempDel; advColorDialog.Color = Color.FromArgb(tBRedBar.Value, tBGreenBar.Value, tBBlueBar.Value); advColorDialog_OnUpdateColor(main, e); if (advColorDialog.ShowDialog() == DialogResult.OK) { main = advColorDialog.Color; - btnLightbar.BackgroundImage = RecolorImage((Bitmap)btnLightbar.BackgroundImage, main); + btnLightBgImg = RecolorImage(btnLightBg, main); + btnLightbar.Refresh(); 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; } + + advColorDialog.OnUpdateColor -= tempDel; 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; } - 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 +1459,7 @@ namespace DS4Windows DS4LightBar.forcelight[device] = true; } } + private void SetColorToolTip(TrackBar tb, int type) { if (tb != null) @@ -1194,13 +1469,15 @@ 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); full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), reg); main = Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full); - btnLightbar.BackgroundImage = RecolorImage((Bitmap)btnLightbar.BackgroundImage, main); + btnLightBgImg = RecolorImage(btnLightBg, main); + btnLightbar.Refresh(); if (FlashColor[device].Equals(new DS4Color { red = 0, green = 0, blue = 0 })) btnFlashColor.BackColor = main; btnFlashColor.BackgroundImage = nUDRainbow.Enabled ? rainbowImg : null; @@ -1214,6 +1491,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 +1514,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; } @@ -1246,46 +1525,56 @@ namespace DS4Windows else if (300 <= hue && hue < 360) { R = C; B = X; } return Color.FromArgb((int)((R + m) * 255), (int)((G + m) * 255), (int)((B + m) * 255)); } + 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]; + int tempDeviceNum = (int)nUDSixaxis.Value - 1; + DS4Device d = Program.rootHub.DS4Controllers[tempDeviceNum]; 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); + Program.rootHub.setRumble((byte)Math.Min(255, (255 * nUDRumbleBoost.Value / 100)), d.RightLightFastRumble, tempDeviceNum); ((Button)sender).Text = Properties.Resources.StopHText; } else { - Program.rootHub.setRumble(0, d.RightLightFastRumble, (int)nUDSixaxis.Value - 1); + Program.rootHub.setRumble(0, d.RightLightFastRumble, tempDeviceNum); ((Button)sender).Text = Properties.Resources.TestHText; } + } } private void btnRumbleLightTest_Click(object sender, EventArgs e) { - DS4Device d = Program.rootHub.DS4Controllers[(int)nUDSixaxis.Value - 1]; + int tempDeviceNum = (int)nUDSixaxis.Value - 1; + DS4Device d = Program.rootHub.DS4Controllers[tempDeviceNum]; 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); + Program.rootHub.setRumble(d.LeftHeavySlowRumble, (byte)Math.Min(255, (255 * nUDRumbleBoost.Value / 100)), tempDeviceNum); ((Button)sender).Text = Properties.Resources.StopLText; } else { - Program.rootHub.setRumble(d.LeftHeavySlowRumble, 0, (int)nUDSixaxis.Value - 1); + Program.rootHub.setRumble(d.LeftHeavySlowRumble, 0, tempDeviceNum); ((Button)sender).Text = Properties.Resources.TestLText; } + } } private void numUDTouch_ValueChanged(object sender, EventArgs e) @@ -1302,12 +1591,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) @@ -1328,79 +1619,89 @@ namespace DS4Windows private void nUDIdleDisconnect_ValueChanged(object sender, EventArgs e) { IdleDisconnectTimeout[device] = (int)(nUDIdleDisconnect.Value * 60); - //if (nUDIdleDisconnect.Value == 0) - //cBIdleDisconnect.Checked = false; } 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 - if (olddinputcheck != cBDinput.Checked) - { - root.btnStartStop_Clicked(false); - root.btnStartStop_Clicked(false); - } + LoadProfile(i, false, Program.rootHub); // Refreshes all profiles in case other controllers are using the same profile + if (btnRumbleHeavyTest.Text == Properties.Resources.StopText) Program.rootHub.setRumble(0, 0, (int)nUDSixaxis.Value - 1); + + if (saving) + { + if (device < 4) + { + DS4Device tempDev = Program.rootHub.DS4Controllers[device]; + if (tempDev != null) + { + int discon = getIdleDisconnectTimeout(device); + int btCurrentIndex = btPollRateComboBox.SelectedIndex; + + tempDev.queueEvent(() => + { + tempDev.setIdleTimeout(discon); + if (btCurrentIndex >= 0) + { + tempDev.setBTPollRate(btCurrentIndex); + } + }); + } + } + } + inputtimer.Stop(); sixaxisTimer.Stop(); root.OptionsClosed(); + lVActions.ItemCheck -= this.lVActions_ItemCheck; Visible = false; e.Cancel = true; } - private void Options_Closed(object sender, FormClosedEventArgs 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 - 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();*/ - //e.c - } - 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) @@ -1410,6 +1711,7 @@ namespace DS4Windows public void UpdateLists() { + lBControls.BeginUpdate(); lBControls.Items[0] = "Cross : " + UpdateButtonList(bnCross); lBControls.Items[1] = "Circle : " + UpdateButtonList(bnCircle); lBControls.Items[2] = "Square : " + UpdateButtonList(bnSquare); @@ -1456,6 +1758,8 @@ namespace DS4Windows lbSwipeRight.Text = UpdateButtonList(bnSwipeRight); } + lBControls.EndUpdate(); + lbGyroXN.Text = UpdateButtonList(bnGyroXN); lbGyroZN.Text = UpdateButtonList(bnGyroZN); lbGyroZP.Text = UpdateButtonList(bnGyroZP); @@ -1471,21 +1775,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 +1804,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) @@ -1556,8 +1865,9 @@ namespace DS4Windows private void numUDRainbow_ValueChanged(object sender, EventArgs e) { - Rainbow[device]= (double)nUDRainbow.Value; - if ((double)nUDRainbow.Value <= 0.5) + double tempRainbow = (double)nUDRainbow.Value; + Rainbow[device] = tempRainbow; + if (tempRainbow <= 0.5) { btnRainbow.Image = greyscale; ToggleRainbow(false); @@ -1586,17 +1896,21 @@ namespace DS4Windows nUDRainbow.Enabled = on; if (on) { - btnLightbar.BackgroundImage = RecolorImage((Bitmap)btnLightbar.BackgroundImage, main); + btnLightBgImg = RecolorImage(btnLightBg, main); + btnLightbar.Refresh(); cBLightbyBattery.Text = Properties.Resources.DimByBattery.Replace("*nl*", "\n"); } else { pnlLowBattery.Enabled = cBLightbyBattery.Checked; - btnLightbar.BackgroundImage = RecolorImage((Bitmap)btnLightbar.BackgroundImage, main); + btnLightBgImg = RecolorImage(btnLightBg, main); + btnLightbar.Refresh(); 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 +1922,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,17 +1932,21 @@ namespace DS4Windows d.SetPixel(i, x, nc); } } + return d; } private Bitmap RecolorImage(Bitmap image, Color color) { - Bitmap c = Properties.Resources.DS4_lightbar; + Bitmap c = image; Bitmap d = new Bitmap(c.Width, c.Height); + bool rainEnabled = nUDRainbow.Enabled; - for (int i = 0; i < c.Width; i++) - for (int x = 0; x < c.Height; x++) - if (!nUDRainbow.Enabled) + for (int i = 0, bitwidth = c.Width; i < bitwidth; i++) + { + for (int x = 0, bitheight = c.Height; x < bitheight; x++) + { + if (!rainEnabled) { Color col = c.GetPixel(i, x); col = Color.FromArgb((int)(col.A * (color.A / 255f)), color.R, color.G, color.B); @@ -1636,9 +1954,12 @@ namespace DS4Windows } else { - Color col = HuetoRGB((i / (float)c.Width) * 360, .5f, Color.Red); + Color col = HuetoRGB((i / (float)bitwidth) * 360, .5f, Color.Red); d.SetPixel(i, x, Color.FromArgb(c.GetPixel(i, x).A, col)); } + } + } + return d; } @@ -1734,7 +2055,6 @@ namespace DS4Windows private void numUDMouseSens_ValueChanged(object sender, EventArgs e) { ButtonMouseSensitivity[device] = (int)numUDMouseSens.Value; - //ButtonMouseSensitivity(device, (int)numUDMouseSens.Value); } private void LightBar_MouseDown(object sender, MouseEventArgs e) @@ -1757,6 +2077,7 @@ namespace DS4Windows { if (nUDflashLED.Value % 10 != 0) nUDflashLED.Value = Math.Round(nUDflashLED.Value / 10, 0) * 10; + FlashAt[device] = (int)nUDflashLED.Value; } @@ -1767,10 +2088,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) @@ -1810,7 +2137,7 @@ namespace DS4Windows private void btnBrowse_Click(object sender, EventArgs e) { - if( openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) + if (openFileDialog1.ShowDialog() == DialogResult.OK) { cBLaunchProgram.Checked = true; LaunchProgram[device] = openFileDialog1.FileName; @@ -1829,14 +2156,9 @@ namespace DS4Windows } } - private void cBDinput_CheckedChanged(object sender, EventArgs e) + private void CBDinput_CheckedChanged(object sender, EventArgs e) { DinputOnly[device] = cBDinput.Checked; - if (device < 4) - { - root.btnStartStop_Clicked(false); - root.btnStartStop_Clicked(false); - } } private void cbStartTouchpadOff_CheckedChanged(object sender, EventArgs e) @@ -1844,12 +2166,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 +2194,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 +2214,21 @@ 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; + case "btPollRateLabel": root.lbLastMessage.Text = Properties.Resources.BTPollRate; break; + case "btPollRateComboBox": root.lbLastMessage.Text = Properties.Resources.BTPollRate; break; + case "nUDSixaxis": root.lbLastMessage.Text = Properties.Resources.UseControllerForMapping; break; + case "cBControllerInput": root.lbLastMessage.Text = Properties.Resources.UseControllerForMapping; break; + case "lbUseController": root.lbLastMessage.Text = Properties.Resources.UseControllerForMapping; break; + case "gyroTriggerBehavior": root.lbLastMessage.Text = Properties.Resources.GyroTriggerBehavior; 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 @@ -1917,16 +2247,18 @@ namespace DS4Windows } else if (rBTPMouse.Checked && lBControls.Items.Count > 33) { + lBControls.BeginUpdate(); lBControls.Items.RemoveAt(36); lBControls.Items.RemoveAt(35); lBControls.Items.RemoveAt(34); lBControls.Items.RemoveAt(33); + lBControls.EndUpdate(); } } private void cBControllerInput_CheckedChanged(object sender, EventArgs e) { - DS4Mapping=cBControllerInput.Checked; + DS4Mapping = cBControllerInput.Checked; } private void btnAddAction_Click(object sender, EventArgs e) @@ -1958,22 +2290,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 +2311,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,18 +2326,10 @@ namespace DS4Windows controlToolStripMenuItem.Text = "Touchpad Swipes"; else controlToolStripMenuItem.Text = "Select another control"; + MouseToolStripMenuItem.Visible = !(name == "lbTPSwipes" || name.StartsWith("bnSwipe")); } - /*private void BatchToggle_Bn(bool scancode, Button button1, Button button2, Button button3, Button button4) - { - Toggle_Bn(scancode, false, false, false, button1); - Toggle_Bn(scancode, false, false, false, button2); - Toggle_Bn(scancode, false, false, false, button3); - Toggle_Bn(scancode, false, false, false, button4); - }*/ - - private void SetPreset(object sender, EventArgs e) { bool scancode = false; @@ -2022,7 +2337,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 +2502,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 +2518,7 @@ namespace DS4Windows button4 = bnLSDown; button5 = bnL3; } - else if (controlToolStripMenuItem.Text == "Right Stick") + else if (toolStripMenuText == "Right Stick") { button1 = bnRSUp; button2 = bnRSLeft; @@ -2209,21 +2526,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 +2549,7 @@ namespace DS4Windows } else button1 = button2 = button3 = button4 = null; + ChangeButtonText(tagU, button1, scancode); ChangeButtonText(tagL, button2, scancode); ChangeButtonText(tagR, button3, scancode); @@ -2256,6 +2574,7 @@ namespace DS4Windows advColorDialog.Color = btnFlashColor.BackColor; else advColorDialog.Color = Color.Black; + advColorDialog_OnUpdateColor(lbPercentFlashBar.ForeColor, e); if (advColorDialog.ShowDialog() == DialogResult.OK) { @@ -2263,8 +2582,10 @@ namespace DS4Windows btnFlashColor.BackColor = advColorDialog.Color; else btnFlashColor.BackColor = main; + FlashColor[device] = new DS4Color(advColorDialog.Color); } + if (device < 4) DS4LightBar.forcelight[device] = false; } @@ -2278,33 +2599,45 @@ namespace DS4Windows private void btnGyroTriggers_Click(object sender, EventArgs e) { - cMGyroTriggers.Show((Control)sender, new Point(0, ((Control)sender).Height)); + Control button = (Control)sender; + cMGyroTriggers.Show(button, new Point(0, button.Height)); } private void SATrigger_CheckedChanged(object sender, EventArgs e) { - if (sender != cMGyroTriggers.Items[cMGyroTriggers.Items.Count - 1] && ((ToolStripMenuItem)sender).Checked) - ((ToolStripMenuItem)cMGyroTriggers.Items[cMGyroTriggers.Items.Count - 1]).Checked = false; - if (((ToolStripMenuItem)cMGyroTriggers.Items[cMGyroTriggers.Items.Count - 1]).Checked) //always on - for (int i = 0; i < cMGyroTriggers.Items.Count - 1; i++) - ((ToolStripMenuItem)cMGyroTriggers.Items[i]).Checked = false; - - 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) + if (loading == false) { - ints.Add(-1); - s.Add(cMGyroTriggers.Items[cMGyroTriggers.Items.Count - 1].Text); + int gyroTriggerCount = cMGyroTriggers.Items.Count; + if (sender != cMGyroTriggers.Items[gyroTriggerCount - 1] && ((ToolStripMenuItem)sender).Checked) + ((ToolStripMenuItem)cMGyroTriggers.Items[gyroTriggerCount - 1]).Checked = false; + + if (((ToolStripMenuItem)cMGyroTriggers.Items[gyroTriggerCount - 1]).Checked) //always on + { + for (int i = 0; i < gyroTriggerCount - 1; i++) + ((ToolStripMenuItem)cMGyroTriggers.Items[i]).Checked = false; + } + + List ints = new List(); + List s = new List(); + for (int i = 0; i < gyroTriggerCount - 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[gyroTriggerCount - 1].Text); + } + + SATriggers[device] = string.Join(",", ints); + if (s.Count > 0) + btnGyroTriggers.Text = string.Join(", ", s); } - SATriggers[device] = string.Join(",", ints); - if (s.Count > 0) - btnGyroTriggers.Text = string.Join(", ", s); } private void cBGyroInvert_CheckChanged(object sender, EventArgs e) @@ -2312,8 +2645,10 @@ namespace DS4Windows int invert = 0; if (cBGyroInvertX.Checked) invert += 2; + if (cBGyroInvertY.Checked) invert += 1; + GyroInvert[device] = invert; } @@ -2322,19 +2657,336 @@ namespace DS4Windows lbControlName.Text = lbControlTip.Text; } - private void nUDSens_ValueChanged(object sender, EventArgs e) + 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 btPollRateComboBox_SelectedIndexChanged(object sender, EventArgs e) + { + int currentIndex = btPollRateComboBox.SelectedIndex; + BTPollRate[device] = currentIndex; + } + + private void nUDL2Sens_ValueChanged(object sender, EventArgs e) { if (!loading) { L2Sens[device] = (double)nUDL2S.Value; - R2Sens[device] = (double)nUDR2S.Value; + } + } + + private void nUDLSSens_ValueChanged(object sender, EventArgs e) + { + if (!loading) + { LSSens[device] = (double)nUDLSS.Value; + } + } + + private void nUDR2Sens_ValueChanged(object sender, EventArgs e) + { + if (!loading) + { + R2Sens[device] = (double)nUDR2S.Value; + } + } + + private void nUDRSSens_ValueChanged(object sender, EventArgs e) + { + if (!loading) + { RSSens[device] = (double)nUDRSS.Value; + } + } + + private void nUDSXSens_ValueChanged(object sender, EventArgs e) + { + if (!loading) + { SXSens[device] = (double)nUDSXS.Value; + } + } + + private void nUDSZSens_ValueChanged(object sender, EventArgs e) + { + if (!loading) + { SZSens[device] = (double)nUDSZS.Value; } } + private void lsOutCurveComboBox_SelectedIndexChanged(object sender, EventArgs e) + { + if (!loading) + { + lsOutCurveMode[device] = lsOutCurveComboBox.SelectedIndex; + } + } + + private void rsOutCurveComboBox_SelectedIndexChanged(object sender, EventArgs e) + { + if (!loading) + { + rsOutCurveMode[device] = rsOutCurveComboBox.SelectedIndex; + } + } + + private void gyroTriggerBehavior_CheckedChanged(object sender, EventArgs e) + { + if (!loading) + { + GyroTriggerTurns[device] = gyroTriggerBehavior.Checked; + } + } + + private void nUDGyroMouseVertScale_ValueChanged(object sender, EventArgs e) + { + if (!loading) + { + GyroSensVerticalScale[device] = (int)nUDGyroMouseVertScale.Value; + } + } + + private void nUDGyroSmoothWeight_ValueChanged(object sender, EventArgs e) + { + if (!loading) + { + GyroSmoothingWeight[device] = (double)nUDGyroSmoothWeight.Value; + } + } + + private void cBGyroSmooth_CheckedChanged(object sender, EventArgs e) + { + bool value = cBGyroSmooth.Checked; + nUDGyroSmoothWeight.Enabled = value; + if (!loading) + { + GyroSmoothing[device] = value; + } + } + + private void nUDLSRotation_ValueChanged(object sender, EventArgs e) + { + if (!loading) + { + LSRotation[device] = (double)nUDLSRotation.Value * Math.PI / 180.0; + } + } + + private void nUDRSRotation_ValueChanged(object sender, EventArgs e) + { + if (!loading) + { + RSRotation[device] = (double)nUDRSRotation.Value * Math.PI / 180.0; + } + } + + private void touchpadInvertComboBox_SelectedIndexChanged(object sender, EventArgs e) + { + if (!loading) + { + tempInt = touchpadInvertToValue[touchpadInvertComboBox.SelectedIndex]; + TouchpadInvert[device] = tempInt; + } + } + + private void cBGyroMouseXAxis_SelectedIndexChanged(object sender, EventArgs e) + { + if (!loading) + { + GyroMouseHorizontalAxis[device] = cBGyroMouseXAxis.SelectedIndex; + } + } + + private void nUDSixAxisXMaxZone_ValueChanged(object sender, EventArgs e) + { + if (!loading) + { + SXMaxzone[device] = (double)nUDSixAxisXMaxZone.Value; + } + } + + private void nUDSixAxisZMaxZone_ValueChanged(object sender, EventArgs e) + { + if (!loading) + { + SZMaxzone[device] = (double)nUDSixAxisZMaxZone.Value; + } + } + + private void nUDSixaxisXAntiDead_ValueChanged(object sender, EventArgs e) + { + if (loading == false) + { + SXAntiDeadzone[device] = (double)nUDSixaxisXAntiDead.Value; + } + } + + private void nUDSixaxisZAntiDead_ValueChanged(object sender, EventArgs e) + { + if (loading == false) + { + SZAntiDeadzone[device] = (double)nUDSixaxisZAntiDead.Value; + } + } + + private void cBL2OutputCurve_SelectedIndexChanged(object sender, EventArgs e) + { + if (loading == false) + { + l2OutCurveMode[device] = cBL2OutputCurve.SelectedIndex; + } + } + + private void cBR2OutputCurve_SelectedIndexChanged(object sender, EventArgs e) + { + if (loading == false) + { + r2OutCurveMode[device] = cBR2OutputCurve.SelectedIndex; + } + } + + private void cBSixaxisXOutputCurve_SelectedIndexChanged(object sender, EventArgs e) + { + if (loading == false) + { + sxOutCurveMode[device] = cBSixaxisXOutputCurve.SelectedIndex; + } + } + + private void cBSixaxisZOutputCurve_SelectedIndexChanged(object sender, EventArgs e) + { + if (loading == false) + { + szOutCurveMode[device] = cBSixaxisZOutputCurve.SelectedIndex; + } + } + + private void TouchDisableInvert_CheckedChanged(object sender, EventArgs e) + { + if (loading == false) + { + int touchDisableInvCount = cMTouchDisableInvert.Items.Count; + + List ints = new List(); + List s = new List(); + for (int i = 0; i < touchDisableInvCount; i++) + { + ToolStripMenuItem current = (ToolStripMenuItem)cMTouchDisableInvert.Items[i]; + if (current.Checked) + { + ints.Add(i); + s.Add(current.Text); + } + } + + if (ints.Count == 0) + { + ints.Add(-1); + s.Add("None"); + } + + TouchDisInvertTriggers[device] = ints.ToArray(); + if (s.Count > 0) + touchpadDisInvertButton.Text = string.Join(", ", s); + } + } + + private void touchpadDisInvertButton_Click(object sender, EventArgs e) + { + Control button = (Control)sender; + cMTouchDisableInvert.Show(button, new Point(0, button.Height)); + } + + private void pnlController_Paint(object sender, PaintEventArgs e) + { + e.Graphics.DrawImage(pnlControllerBgImg, 0, 0, Convert.ToInt32(pnlController.Width), Convert.ToInt32(pnlController.Height - 1)); + } + + private void trackballCk_CheckedChanged(object sender, EventArgs e) + { + if (loading == false) + { + TrackballMode[device] = trackballCk.Checked; + } + } + + private void trackFrictionNUD_ValueChanged(object sender, EventArgs e) + { + if (loading == false) + { + TrackballFriction[device] = (double)trackFrictionNUD.Value; + if (device < 4) + { + Program.rootHub.touchPad[device]?.ResetTrackAccel(TrackballFriction[device]); + } + } + } + + private void btnLightbar_Paint(object sender, PaintEventArgs e) + { + e.Graphics.DrawImage(btnLightBgImg, new Rectangle(0, -1, Convert.ToInt32(btnLightbar.Width), Convert.ToInt32(btnLightbar.Height - 2))); + } + private void Options_Resize(object sender, EventArgs e) { fLPSettings.AutoScroll = false; @@ -2343,77 +2995,73 @@ 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) { GyroSensitivity[device] = (int)Math.Round(nUDGyroSensitivity.Value, 0); } - private void cBFlashType_SelectedIndexChanged(object sender, EventArgs e) { - FlashType[device]= (byte)cBFlashType.SelectedIndex; - } - - private void nUDRainbowB_ValueChanged(object sender, EventArgs e) - { - // + FlashType[device] = (byte)cBFlashType.SelectedIndex; } } } diff --git a/DS4Windows/DS4Forms/Options.es.resx b/DS4Windows/DS4Forms/Options.es.resx index e2c413a..5f80628 100644 --- a/DS4Windows/DS4Forms/Options.es.resx +++ b/DS4Windows/DS4Forms/Options.es.resx @@ -185,7 +185,7 @@ 158, 21 - Compensación Jitter + Compensación de nervios 257, 56 @@ -386,7 +386,7 @@ 202, 21 - Lanzar Programa con perfil + Abrir Programa con el perfil Explorar... @@ -395,7 +395,7 @@ 129, 17 - Utilizar Controlador + Utilizar Control 227, 11 @@ -413,7 +413,7 @@ 164, 21 - para Mapeo y lectura + para asignación y lectura 173, 21 @@ -461,7 +461,7 @@ Barra de luz - Prueba Ligera + Prueba Rapida Vibración @@ -497,7 +497,7 @@ 212, 156 - Lecturas del Controlador + Lecturas del Control (nada)/Shift desactivado @@ -512,7 +512,7 @@ 164, 17 - para usar estos contoles + para usar estos controles Modificador de Shift @@ -563,10 +563,10 @@ Dpad - Un dedo en el Touchpad + Un dedo en el panel táctil - Dos dedos en el Touchpad + Dos dedos en el panel táctil Sensibilidad diff --git a/DS4Windows/DS4Forms/Options.resx b/DS4Windows/DS4Forms/Options.resx index d59a458..1a792e3 100644 --- a/DS4Windows/DS4Forms/Options.resx +++ b/DS4Windows/DS4Forms/Options.resx @@ -118,7612 +118,11806 @@ 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 + + 26, 73 - - pnlRSTrack + + 100, 20 - - 233, 26 + + 12 - - 14 + + tBBlueBar - - Mouse + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + pnlFull + + + 6 + + + False + + NoControl - - Middle Mouse Button + + 26, 50 - - 156, 156 + + 100, 20 - - 3 + + 11 - - gBTouchpad + + tBGreenBar - - lbL2TrackS + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 1 + + pnlFull - - 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 + + False - - btnRainbow + + NoControl - - Right Bumper + + 26, 24 - - tPControls + + 100, 20 - - 4, 4, 4, 4 + + 10 - - No + + tBRedBar - - 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 + + pnlFull + + + 4 + + + True + + + NoControl + + + 6, 191 + + + 111, 17 + + + 162 + + + Color by Battery % + + + cBLightbyBattery + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + 12 - - 59, 84 + + True - - 4, 4, 4, 4 - - - 180 - - - 31, 156 - - + 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 + + + True + + + NoControl + + + 72, 218 + + + 59, 13 + + + 157 + + + 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 + + + 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 + + + 8 + + + 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 + + + 13 + + + 63, 39 + + + 40, 20 + + + 227 + + + nUDTap + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 11 + + + 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 + + + 9 + + + 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 + + + 14 + + + 167, 9 + + + 40, 20 + + + 228 + + + nUDScroll + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 7 + + + 63, 9 + + + 40, 20 + + + 229 + + + nUDTouch + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 15 + + + True + + + 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 + + + 13 + + + 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 + + + 12 + + + 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 + + + 10 + + + 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 + + + 16 + + + 115, 64 + + + 49, 20 + + + 201 + + + nUDIdleDisconnect + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 11 + + + 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 + + + 15 + + + 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 + + + NoControl + + + 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 - - 10, 28 + + gBLightbar - - 286 + + 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 + + + 14 + + + 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 + + + pnlTPMouse + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBTouchpad + + + 0 + + + rBTPControls + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBTouchpad + + + 1 + + + rBTPMouse + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBTouchpad + + + 2 + + + fLPTouchSwipe + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBTouchpad + + + 3 + + + 2, 259 + + + 270, 190 + + + 246 + + + Touchpad + + + gBTouchpad + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPControls + + + 1 + + + trackFrictionLb + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 0 + + + trackFrictionNUD + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 1 + + + trackballCk + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 2 + + + touchpadDisInvertButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 3 + + + label25 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 4 + + + label15 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 5 + + + touchpadInvertComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 6 + + + cbStartTouchpadOff + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 16 + + + 0, 36 + + + 2, 2, 2, 2 + + + 266, 149 + + + 257 + + + pnlTPMouse + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBTouchpad + + + 0 + + + True + + + NoControl + + + 99, 127 + + + 41, 13 + + + 240 + + + Friction + + + trackFrictionLb + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 0 + + + 162, 125 + + + 57, 20 + + + 239 + + + trackFrictionNUD + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 1 + + + True + + + NoControl + + + 14, 126 + + + 70, 17 + + + 238 + + + Trackball + + + trackballCk + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 2 + + + NoControl + + + 163, 99 + + + 101, 23 + + + 237 + + + None + + + touchpadDisInvertButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 3 + + + True + + + NoControl + + + 142, 83 + + + 75, 13 + + + 236 + + + Disable Invert: + + + label25 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 4 + + + True + + + NoControl + + + 142, 62 + + + 37, 13 + + + 235 + + + Invert: + + + label15 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 5 + + + None + + + X Axis + + + Y Axis + + + Both X and Y Axes + + + 179, 58 + + + 85, 21 + + + 234 + + + touchpadInvertComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlTPMouse + + + 6 + + + 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 + + + 16 + + + 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 + + + bnSwipeUp + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTouchSwipe + + + 0 + + + lbSwipeUp + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTouchSwipe + + + 1 + + + bnSwipeDown + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTouchSwipe + + + 2 + + + lbSwipeDown + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTouchSwipe + + + 3 + + + bnSwipeLeft + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTouchSwipe + + + 4 + + + lbSwipeLeft + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTouchSwipe + + + 5 + + + bnSwipeRight + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTouchSwipe + + + 6 + + + lbSwipeRight + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTouchSwipe + + + 7 + + + 6, 40 + + + 260, 148 + + + 256 + + + fLPTouchSwipe + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBTouchpad + + + 3 + + + 326, 13 + + + 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 + + + False + + + 117, 22 + + + Control + + + 114, 6 + + + 117, 22 + + + Default + + + 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 + + + 127, 22 + + + Inverted + + + 127, 22 + + + Inverted X + + + 127, 22 + + + Inverted Y + + + 117, 22 + + + Face Buttons + + + False + + + 117, 22 + + + WASD + + + 147, 22 + + + w/ Scan Code + + + 117, 22 + + + Arrow Keys + + + 147, 22 + + + w/ Scan Code + + + 117, 22 + + + Mouse + + + 127, 22 + + + Inverted + + + 127, 22 + + + Inverted X + + + 127, 22 + Inverted Y - - pnlSAMouse + + NoControl - - 33, 33 + + 88, 0 - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 2, 0, 2, 0 - - lbL2TrackS + + 168, 23 - - 82, 2 + + 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 - - Circle + + Swipe Down - - 206 + + bnSwipeDown - - 4, 0, 4, 0 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 4, 4, 4, 4 + + fLPTouchSwipe - - 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 + + 88, 29 - - 208, 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 - - Right X-Axis+ - - - 45 - - - 162, 56 - - + NoControl - - 58, 81 + + 88, 87 - - 207 + + 2, 0, 2, 0 - - 233, 26 + + 168, 23 - + + 288 + + + Options + + + MiddleLeft + + + lbSwipeRight + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTouchSwipe + + + 7 + + + btPollRateLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 0 + + + btPollRateComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 1 + + + enableTouchToggleCheckbox + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 2 + + + cBDinput + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 3 + + + pBProgram + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 4 + + + cBLaunchProgram + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 5 + + + btnBrowse + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 6 + + + lbUseController + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 7 + + + cBMouseAccel + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 8 + + + nUDSixaxis + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 9 + + + cBControllerInput + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 10 + + + cBIdleDisconnect + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 12 + + + 281, 221 + + + 272, 256 + + + 247 + + + Other + + + gBOther + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 5 + + + True + + + NoControl + + + 10, 227 + + + 67, 13 + + + 259 + + + BT Poll Rate + + + btPollRateLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 0 + + + Max (1 ms) + + + 1000 Hz (1 ms) + + + 500 Hz (2 ms) + + + 333 Hz (3 ms) + + + 250 Hz (4 ms) + + + 200 Hz (5 ms) + + + 166 Hz (6 ms) + + + 142 Hz (7 ms) + + + 125 Hz (8 ms) + + + 111 Hz (9 ms) + + + 100 Hz (10 ms) + + + 90 Hz (11 ms) + + + 83 Hz (12 ms) + + + 76 Hz (13 ms) + + + 71 Hz (14 ms) + + + 66 Hz (15 ms) + + + 62 Hz (16 ms) + + + 85, 224 + + + 121, 21 + + + 258 + + + btPollRateComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 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 + + + 2 + + + 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 + + 3 NoControl - - 4, 4, 4, 4 + + 215, 122 - - True + + 23, 23 - - Flat + + AutoSize - - lbL2TrackS + + 255 - - 7 + + pBProgram - - 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 + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 gBOther - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 4 - - 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 + + 4, 118 - - 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 + + Yes - 139, 38 + 107, 30 - - 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 - - - 131, 3 - - - 14 - - - 12, 24 - - - 36, 38 - - - 4, 41 - - - cBTap - - - RS - - - 55, 21 - - - True - - - gBSensitivity - - - MiddleCenter - - - None - - - 4 - - - 0 - - - NoControl - - - 1 - - - 182, 4 - - - NoControl - - - 61, 22 - - - 0 - - - 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 - - - lbR2Track - - - No - - - 15 - - - False - - - 104, 21 - - - cBFlushHIDQueue - - - toolStripSeparator1 - - - 34, 17 - - - R2 - - - 16, 16 - - - 136, 20 - - - pnlActions - - - cBDinput - - - False - - - 332, 69 - - - 11 - - - 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 - - - 4, 4, 4, 4 - - - NoControl - - - 20, 17 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 255 - - - StretchImage - - - 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 - - - 70, 28 - - - rBTPControls - - - triangleToolStripMenuItem - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - None - - - Curve - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Sixaxis Down : - - - 2 - - - Inverted X - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 216 - - - 135, 60 - - - Left Mouse Button - - - 47, 17 - - - True - - - 153, 82 - - - NoControl - - - pnlTPMouse - - - 352, 278 - - - 8 - - - RS - - - MiddleLeft - - - 3 - - - False - - - 337, 227 - - - pnlController - - - 3 - - - 549, 35 - 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 - - - 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 - - - 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 - - - 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 - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 50 - - - pnlController - - - lbWhileCharging - - - lbLShare - - - cbStartTouchpadOff - - - NoControl - - + 7 - - 203 - - - 170, 29 - - - Flat - - - nUDL2 - - - lbSixaxisX - - - 4, 0, 4, 0 - - - NoControl - - - downToolStripMenuItem - - - pnlController - - - 7 - - - False - - + True - - MiddleCenter + + NoControl - - 4, 4, 4, 4 + + 8, 42 - - 49 + + Yes - - False + + 120, 17 - - tSMIDPadInverted + + 251 - - Special Actions + + Mouse Acceleration - - Flat + + cBMouseAccel - - 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 + + 85, 95 - - bnTouchLeft + + 29, 20 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 250 - - pnlController + + nUDSixaxis - - 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 - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + gBOther - - 7, 54 + + 9 - - cHName + + True - - lbL2TrackS + + NoControl - - fingerOnTouchpadToolStripMenuItem + + 118, 95 - - pnlController + + Yes - - lbRSTip + + 142, 17 - - 244 + + 242 - - 239 + + for Mapping and readout - - Options + + cBControllerInput + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBOther + + + 10 + + + True + + + NoControl + + + 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 - - 52, 134 + + Idle Disconnect - - 549, 564 + + cBIdleDisconnect - - System.Windows.Forms.ColumnHeader, 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 - - 233, 26 + + gBOther - - 28 + + 12 - + + btnRainbow + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + + + 0 + + + lbRainbowB + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + + + 1 + + + nUDRainbowB + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + + + 2 + + + cBFlashType + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + + + 3 + + + cBWhileCharging + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + + + 4 + + + btnFlashColor + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + + + 5 + + + btnChargingColor + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + + + 6 + + + lbWhileCharging + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + + + 7 + + + lbPercentFlashBar + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBLightbar + + + 8 + + + 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 + + + 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 + + + lbPercentRumble + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBRumble + + + 0 + + + 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 + + + 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 + + + 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 + + + pnlSATrack + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 0 + + + lbL2Track + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 1 + + + lbRSTip + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 2 + + + lbInputDelay + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 3 + + + lbR2Track + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 4 + + + lbLSTip + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 5 + + + lbSATip + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 6 + + + tBR2 + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 7 + + + tBL2 + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 8 + + + pnlSixaxis + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 9 + + + pnlLSTrack + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lbL2TrackS + + + 10 + + + 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, 455 + + + 2 + + + Controller Readings + + + lbL2TrackS + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCControls + + + 2 + + + btnSATrack + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSATrack + + + 0 + + + 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 + + + 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 + + + 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 + + + tBsixaxisAccelX + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSixaxis + + + 0 + + + lb6Accel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSixaxis + + + 1 + + + tBsixaxisGyroX + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSixaxis + + + 2 + + + lb6Gryo + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSixaxis + + + 3 + + + tBsixaxisGyroY + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSixaxis + + + 4 + + + tBsixaxisGyroZ + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSixaxis + + + 5 + + + tBsixaxisAccelY + + + System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSixaxis + + + 6 + + + 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 + + + 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 + + + btnLSTrack + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlLSTrack + + + 0 + + + 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 + + + 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 + + + btnRSTrackS + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlRSTrack + + + 0 + + + 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 + + + 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 + + + bnGyroZN + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTiltControls + + + 0 + + + lbGyroZN + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTiltControls + + + 1 + + + bnGyroZP + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTiltControls + + + 2 + + + lbGyroZP + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTiltControls + + + 3 + + + bnGyroXP + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTiltControls + + + 4 + + + lbGyroXP + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTiltControls + + + 5 + + + bnGyroXN + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTiltControls + + + 6 + + + lbGyroXN + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPTiltControls + + + 7 + + + 6, 51 + + + 271, 167 + + + 254 + + + fLPTiltControls + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBGyro + + + 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 + + + tPControls + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCControls + + + 0 + + + tPSpecial + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCControls + + + 1 + + + Left + + 0, 0 - + + 446, 481 + + + 253 + + + tCControls + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + + + True + + + lBControls + + + System.Windows.Forms.ListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPControls + + + 0 + + + lbControlTip + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPControls + + + 2 + + + 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, 455 + + + 0 + + + Controls + + + tPControls + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCControls + + + 0 + + + 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 + + + pBHoveredButton + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 0 + + + lbLRS + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 1 + + + lbLLS + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 2 + + + bnRSDown + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 3 + + + lbLTouchUpper + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 4 + + + lbLTouchRight + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 5 + + + bnL3 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 6 + + + lbLTouchLM + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 7 + + + bnRSUp + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 8 + + + lbLR2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 9 + + + bnRSRight + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 10 + + + lbLL2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 11 + + + bnR3 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 12 + + + lbLR1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 13 + + + bnRSLeft + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 14 + + + lbLL1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 15 + + + bnLSLeft + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 16 + + + lbLPS + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 17 + + + bnLSUp + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 18 + + + lbLLeft + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 19 + + + bnLSRight + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 20 + + + lbLright + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 21 + + + bnLSDown + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 22 + + + lbLDown + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 23 + + + bnR2 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 24 + + + bnUp + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 25 + + + bnDown + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 26 + + + 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 + + bnR1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 28 + + + bnSquare + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 29 + + + bnRight + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 30 + + + lbLUp + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 31 + + + bnLeft + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController 32 - - NoControl + + lbLShare - - 198 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 225 + + pnlController - - 207 + + 33 - - 4, 0, 4, 0 + + bnOptions - - 38 - - - NoControl - - - 233, 26 - - - gBGyro - - - 63, 17 - - - True - - - 16 - - - 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 + + bnShare - - lbLR2 - - - 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 - - - Upper Touch : - - - 4, 4, 4, 4 - - - 177, 23 - - - Right Stick Right : - - - 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 + + lbLOptions - - NoControl + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 36 + + + bnL1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 37 + + + bnTouchRight + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 38 + + + bnL2 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 39 + + + lbLTriangle + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 40 + + + bnTouchLeft + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController 41 - - 4, 4, 4, 4 + + lbLSquare - - btnRSTrack + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - pnlSixaxis + + pnlController - + + 42 + + + bnTouchMulti + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 43 + + + lbLCircle + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 44 + + + lbLCross + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 45 + + + bnTouchUpper + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 46 + + + btnLightbar + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 47 + + + bnPS + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 48 + + + bnCross + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 49 + + + bnCircle + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 50 + + + 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 + + + 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 - - 4, 4, 4, 4 + + 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 + + + 42, 107 + + + 2, 0, 2, 0 + + + 2, 2 + + + 294 + + + False + + + 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 + + + 27 + + + 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 + + + 122, 66 + + + 2, 0, 2, 0 + + + 2, 2 + + + 290 + + + False + + + lbLShare + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 33 + + + None + + + Flat + + + NoControl + + + 282, 58 + + + 28, 32 + + + 84 + + + Start + + + bnOptions + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 34 + + + None + + + Flat + + + NoControl + + + 120, 57 + + + 22, 32 + + + 85 + + + Back + + + bnShare + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlController + + + 35 + + + 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 + + + NoControl + + + 294, 103 + + + 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 + + + pnlActions + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPSpecial + + + 0 + + + 4, 22 + + + 438, 455 + + + 3 + + + Special Actions + + + tPSpecial + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCControls + + + 1 + + + lVActions + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlActions + + + 0 + + + panel2 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlActions + + + 1 + + + Fill + + + 0, 0 + + + 438, 455 + + + 15 + + + pnlActions + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPSpecial + + + 0 + + + Fill + + + 0, 66 + + + 438, 389 + + + 13 + + + lVActions + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlActions + + + 0 + + + Name + + + 140 + + + Trigger + + + 105 + + + Action + + + 100 + + + fLPActionButtons + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 0 + + + 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 + + + btnNewAction + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPActionButtons + + + 0 + + + btnEditAction + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPActionButtons + + + 1 + + + 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 + + + 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 + + + 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 + + + tPDeadzone + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCSens + + + 0 + + + antiDeadzoneTabPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCSens + + + 1 + + + maxZoneTabPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCSens + + + 2 + + + tPOutCurve + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCSens + + + 3 + + + tPCurve + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCSens + + + 4 + + + tpRotation + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCSens + + + 5 + + + 281, 55 + + + 272, 78 + + + 234 + + + tCSens + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 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 + + + nUDSixaxisZAntiDead + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 0 + + + nUDSixaxisXAntiDead + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 1 + + + label20 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 2 + + + label19 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 3 + + + nUDR2AntiDead + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 4 + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 5 + + + nUDL2AntiDead + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 6 + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 7 + + + nUDRSAntiDead + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 8 + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 9 + + + nUDLSAntiDead + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 10 + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 11 + + + 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 + + + 1 + + + 214, 29 + + + 47, 20 + + + 11 + + + nUDSixaxisZAntiDead + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 0 + + + 215, 4 + + + 46, 20 + + + 10 + + + nUDSixaxisXAntiDead + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 1 + + + True + + + NoControl + + + 160, 31 + + + 52, 13 + + + 9 + + + Sixaxis Z: + + + label20 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 2 + + + True + + + NoControl + + + 160, 6 + + + 52, 13 + + + 8 + + + Sixaxis X: + + + label19 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 3 + + + 107, 29 + + + 44, 20 + + + 7 + + + nUDR2AntiDead + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 4 + + + True + + + NoControl + + + 83, 31 + + + 24, 13 + + + 6 + + + R2: + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 5 + + + 31, 29 + + + 42, 20 + + + 5 + + + nUDL2AntiDead + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 6 + + + 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 + + + 7 + + + 108, 3 + + + 43, 20 + + + 3 + + + nUDRSAntiDead + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 8 + + + True + + + NoControl + + + 82, 6 + + + 25, 13 + + + 2 + + + RS: + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 9 + + + 31, 3 + + + 42, 20 + + + 1 + + + nUDLSAntiDead + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + antiDeadzoneTabPage + + + 10 + + + 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 + + + 11 + + + nUDSixAxisZMaxZone + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 0 + + + nUDSixAxisXMaxZone + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 1 + + + label18 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 2 + + + label17 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 3 + + + nUDR2Maxzone + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 4 + + + nUDL2Maxzone + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 5 + + + label8 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 6 + + + label7 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 7 + + + nUDRSMaxZone + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 8 + + + label6 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 9 + + + nUDLSMaxZone + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 10 + + + label5 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 11 + + + 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 + + + 2 + + + 220, 29 + + + 40, 20 + + + 11 + + + nUDSixAxisZMaxZone + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 0 + + + 220, 3 + + + 41, 20 + + + 10 + + + nUDSixAxisXMaxZone + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 1 + + + True + + + NoControl + + + 162, 31 + + + 52, 13 + + + 9 + + + Sixaxis Z: + + + label18 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 2 + + + True + + + NoControl + + + 162, 6 + + + 52, 13 + + + 8 + + + Sixaxis X: + + + label17 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 3 + + + 114, 29 + + + 40, 20 + + + 7 + + + nUDR2Maxzone + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 4 + + + 36, 29 + + + 41, 20 + + + 6 + + + nUDL2Maxzone + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 5 + + + True + + + NoControl + + + 85, 31 + + + 24, 13 + + + 5 + + + R2: + + + label8 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 6 + + + 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 + + + 7 + + + 114, 4 + + + 40, 20 + + + 3 + + + nUDRSMaxZone + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 8 + + + True + + + NoControl + + + 85, 5 + + + 25, 13 + + + 2 + + + RS: + + + label6 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 9 + + + 37, 3 + + + 40, 20 + + + 1 + + + nUDLSMaxZone + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + maxZoneTabPage + + + 10 + + + 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 + + + 11 + + + cBSixaxisZOutputCurve + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 0 + + + cBSixaxisXOutputCurve + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 1 + + + label24 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 2 + + + label23 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 3 + + + cBR2OutputCurve + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 4 + + + cBL2OutputCurve + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 5 + + + label22 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 6 + + + label21 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 7 + + + rsOutCurveComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 8 + + + lsOutCurveComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 9 + + + label10 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 10 + + + label9 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 11 + + + 4, 22 + + + 264, 52 + + + 4 + + + Output Curve + + + tPOutCurve + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCSens + + + 3 + + + Linear + + + Quadratic + + + Cubic + + + 221, 28 + + + 40, 21 + + + 11 + + + cBSixaxisZOutputCurve + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 0 + + + Linear + + + Quadratic + + + Cubic + + + 221, 1 + + + 40, 21 + + + 10 + + + cBSixaxisXOutputCurve + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 1 + + + True + + + NoControl + + + 168, 31 + + + 52, 13 + + + 9 + + + Sixaxis Z: + + + label24 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 2 + + + True + + + NoControl + + + 168, 4 + + + 52, 13 + + + 8 + + + Sixaxis X: + + + label23 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 3 + + + Linear + + + Quadratic + + + Cubic + + + 111, 28 + + + 49, 21 + + + 7 + + + cBR2OutputCurve + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 4 + + + Linear + + + Quadratic + + + Cubic + + + 31, 28 + + + 46, 21 + + + 6 + + + cBL2OutputCurve + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 5 + + + True + + + NoControl + + + 86, 31 + + + 24, 13 + + + 5 + + + R2: + + + label22 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 6 + + + True + + + NoControl + + + 6, 31 + + + 22, 13 + + + 4 + + + L2: + + + label21 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 7 + + + Linear + + + Enhanced Precison + + + Quadratic + + + Cubic + + + 111, 3 + + + 49, 21 + + + 3 + + + rsOutCurveComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 8 + + + Linear + + + Enhanced Precision + + + Quadratic + + + Cubic + + + 31, 2 + + + 46, 21 + + + 2 + + + lsOutCurveComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 9 + + + True + + + NoControl + + + 85, 5 + + + 25, 13 + + + 1 + + + RS: + + + label10 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 10 + + + True + + + NoControl + + + 6, 5 + + + 23, 13 + + + 0 + + + LS: + + + label9 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPOutCurve + + + 11 + + + nUDLSCurve + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPCurve + + + 0 + + + nUDRSCurve + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPCurve + + + 1 + + + lbRSCurve + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPCurve + + + 2 + + + lbRSCurvePercent + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPCurve + + + 3 + + + lbLSCurvePercent + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tPCurve + + + 4 + + + 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 (Input) + + + tPCurve + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCSens + + + 4 + + + 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 + + + nUDRSRotation + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpRotation + + + 0 + + + label14 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpRotation + + + 1 + + + nUDLSRotation + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpRotation + + + 2 + + + label13 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpRotation + + + 3 + + + 4, 22 + + + 3, 3, 3, 3 + + + 264, 52 + + + 5 + + + Rotation + + + tpRotation + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tCSens + + + 5 + + + 160, 21 + + + 74, 20 + + + 219 + + + nUDRSRotation + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpRotation + + + 0 + + + True + + + NoControl + + + 125, 23 + + + 25, 13 + + + 218 + + + RS: + + + label14 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpRotation + + + 1 + + + 42, 20 + + + 68, 20 + + + 217 + + + nUDLSRotation + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpRotation + + + 2 + + + True + + + NoControl + + + 4, 22 + + + 23, 13 + + + 216 + + + LS: + + + label13 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpRotation + + + 3 + + + True + + + rBSAControls + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBGyro + + + 0 + + + rBSAMouse + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBGyro + + + 1 + + + pnlSAMouse + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBGyro + + + 3 + + + 3, 253 + + + 272, 224 + + + 248 + + + Gyro + + + gBGyro + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 1 + + + True + + + NoControl + + + 11, 50 + + + 19, 13 + + + 204 + + + L2 + + + lbL2S + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBSensitivity + + + 0 + + + 35, 47 + + + No + + + 40, 20 + + + 212 + + + nUDL2S + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBSensitivity + + + 1 + + + 35, 19 + + + 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 + + + 161, 21 + + + 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, 48 + + + 40, 20 + + + 210 + + + nUDR2S + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBSensitivity + + + 4 + + + True + + + NoControl + + + 161, 49 + + + 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, 19 + + + 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 + + + 82, 51 + + + 21, 13 + + + 208 + + + R2 + + + lbR2LS + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBSensitivity + + + 7 + + + 216, 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 + + + 81, 21 + + + 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 + + + 11, 21 + + + 20, 13 + + + 205 + + + LS + + + lbLSS + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBSensitivity + + + 10 + + + 216, 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 + + + 565, 481 + + + 254 + + + fLPSettings + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + 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 + + + cBGyroMouseXAxis + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 0 + + + label16 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 1 + + + lbGyroSmooth + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 2 + + + cBGyroSmooth + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 3 + + + lbSmoothWeight + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 4 + + + nUDGyroSmoothWeight + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 5 + + + label12 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 6 + + + nUDGyroMouseVertScale + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 7 + + + label11 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 8 + + + gyroTriggerBehavior + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 9 + + + cBGyroInvertY + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 10 + + + cBGyroInvertX + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 11 + + + lbGyroInvert + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 12 + + + lbGyroTriggers + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 13 + + + btnGyroTriggers + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 14 + + + nUDGyroSensitivity + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 15 + + + lbGyroSens + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 16 + + + 6, 43 + + + 2, 2, 2, 2 + + + 263, 170 + + + 259 + + + pnlSAMouse + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gBGyro + + + 3 + + + Yaw + + + Roll + + + 170, 93 + + + 74, 21 + + + 271 + + + cBGyroMouseXAxis + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 0 + + + True + + + NoControl + + + 167, 74 + + + 39, 13 + + + 270 + + + X Axis: + + + label16 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 1 + + + True + + + NoControl + + + 8, 145 + + + 60, 13 + + + 269 + + + Smoothing: + + + lbGyroSmooth + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 2 + + + True + + + NoControl + + + 75, 145 + + + Yes + + + 15, 14 + + + 268 + + + cBGyroSmooth + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 3 + + + True + + + NoControl + + + 96, 145 + + + 83, 13 + + + 267 + + + Smooth Weight: + + + lbSmoothWeight + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 4 + + + False + + + 185, 141 + + + 55, 20 + + + 266 + + + nUDGyroSmoothWeight + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 5 + + + True + + + NoControl + + + 151, 98 + + + 15, 13 + + + 265 + + + % + + + label12 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 6 + + + 96, 93 + + + 49, 20 + + + 264 + + + nUDGyroMouseVertScale + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 7 + + + True + + + NoControl + + + 8, 95 + + + 75, 13 + + + 263 + + + Vertical Scale: + + + label11 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 8 + + + True + + + NoControl + + + 5, 41 + + + Yes + + + 165, 17 + + + 262 + + + Trigger Behavior - Turns Gyro + + + gyroTriggerBehavior + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 9 + + + True + + + NoControl + + + 92, 119 + + + Yes + + + 33, 17 + + + 261 + + + Y + + + cBGyroInvertY + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 10 + + + True + + + NoControl + + + 49, 119 + + + Yes + + + 33, 17 + + + 260 + + + X + + + cBGyroInvertX + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 11 + + + True + + + NoControl + + + 8, 119 + + + 37, 13 + + + 259 + + + Invert: + + + TopRight + + + lbGyroInvert + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 12 + + + 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 + + + 13 + + + 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 + + + 14 + + + 96, 67 + + + 49, 20 + + + 256 + + + nUDGyroSensitivity + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 15 + + + True + + + NoControl + + + 8, 69 + + + 82, 13 + + + 255 + + + Gyro Sensitivity: + + + TopRight + + + lbGyroSens + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlSAMouse + + + 16 482, 17 - - 326, 13 + + 195, 444 + + + cMGyroTriggers + + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 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 + + + 144, 63 + + + 195, 422 + + + cMTouchDisableInvert + + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 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 + + + 647, 17 True - - 153, 17 - - - 647, 17 + + 102 + + 96, 96 + + + True + + + 1011, 481 + + + 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 + + + crossTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + circleTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + squareTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + triangleTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + l1TouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + l2TouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + r1TouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + r2TouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + upTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + downTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + leftTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + rightTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + l3TouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + r3TouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + oneFingerTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + twoFingerTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + optionsTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + shareTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + psTouchInvStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + advColorDialog + + + DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.4.119.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/Options.ru-RU.resx b/DS4Windows/DS4Forms/Options.ru-RU.resx index 658a828..5da1886 100644 --- a/DS4Windows/DS4Forms/Options.ru-RU.resx +++ b/DS4Windows/DS4Forms/Options.ru-RU.resx @@ -118,8 +118,11 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 80, 9 + - 149, 21 + 115, 17 Цвет от % заряда @@ -128,128 +131,149 @@ С - 17, 17 + 14, 13 З - 65, 17 + 54, 13 сек/цикл - 17, 17 + 14, 13 К + + 146, 34 + - 146, 21 + 116, 17 Двойное касание + + 2, 34 + - 86, 21 + 69, 17 Касание + + 98, 31 + + + + False + - 187, 12 + 143, 3 - 100, 21 + 75, 21 Прокрутка + + False + + + 2, 3 + - 110, 21 + 89, 21 Скольжение - 290, 11 + 221, 4 - 121, 10 + 98, 3 - False - 106, 40 + 139, 20 Чувствительность мыши: + + False + - 10, 110 + 7, 82 - 309, 21 + 143, 30 Нижняя правая часть тачпада как ПКМ - 10, 83 + 7, 59 - 188, 21 + 148, 17 Компенсация дрожания - 249, 64 + 219, 59 - 47, 17 + 37, 13 минут - 180, 62 + 161, 57 - 7, 208 + 14, 209 - 177, 21 + 137, 17 Очищать очереди HID - 88, 19 + 75, 12 - 128, 29 + 84, 29 Тест сильной - 64, 17 + 61, 13 Заряжена: - 17, 17 + 14, 13 К - 17, 17 + 14, 13 З @@ -257,23 +281,56 @@ С + + 67, 13 + Разряжена: - 120, 26 + 158, 17 + + + 160, 130 + + + 157, 114 + + + 156, 70 + + + 159, 88 + + + False + + + 7, 112 + + + 142, 44 + + + Выключить скольжение и прокрутку тачпада + + + 3, 43 + + + 265, 169 - 7, 46 + 151, 18 - 213, 26 + 178, 22 - 210, 6 + 175, 6 - 213, 26 + 178, 22 По умолчанию @@ -288,7 +345,7 @@ Инверт. Y - 213, 26 + 178, 22 Крестовина @@ -303,7 +360,7 @@ Инверт. Y - 213, 26 + 178, 22 Левый стик @@ -318,37 +375,37 @@ Инверт. Y - 213, 26 + 178, 22 Правый стик - 213, 26 + 178, 22 Лицевые кнопки - 168, 26 + 142, 22 w/ Скан-код - 213, 26 + 178, 22 Управление WASD - 168, 26 + 142, 22 w/ Скан-код - 213, 26 + 178, 22 Клавиши со стрелками @@ -363,34 +420,40 @@ Инверт. Y - 213, 26 + 178, 22 Мышь - 214, 244 + 179, 208 - - 9, 137 + + 260, 170 - - 328, 21 - - - Выключить скольжение и прокрутку тачпада + + 2, 251 - 337, 236 + 270, 201 Тачпад + + 11, 233 + + + 86, 230 + + + 13, 186 + - 8, 181 + 13, 164 - 216, 21 + 172, 17 Использовать только DInput @@ -399,53 +462,56 @@ 287, 144 - 7, 140 + 8, 131 - 176, 38 + 141, 30 Запускать программу с профилем - 193, 144 + 158, 134 Обзор... + + 10, 87 + - 182, 17 + 142, 13 Использовать контроллер - 189, 26 + 13, 39 - 143, 21 + 115, 17 Ускорение мыши - 201, 92 + 164, 85 - 13, 115 + 8, 111 - 294, 21 + 234, 17 для назначения клавиш и вывода текста - 12, 63 + 8, 60 - 160, 21 + 140, 17 Таймаут бездействия: @@ -453,6 +519,9 @@ Другое + + 151, 215 + Мигать при @@ -472,13 +541,13 @@ цвет - 142, 206 + 122, 166 300, 209 - 136, 17 + 111, 13 Индикация зарядки: @@ -487,10 +556,10 @@ Световая панель - 224, 19 + 165, 12 - 112, 29 + 91, 30 Тест слабой @@ -502,7 +571,7 @@ Правый стик - 148, 17 + 119, 13 Задержка ввода: Н/Д @@ -514,19 +583,34 @@ Гироскоп: ось X инвертирована для простоты считывания - 47, 17 + 81, 13 Акселерометр - 40, 17 + 55, 13 Гироскоп - 4, 103 + 0, 55 + + + 271, 128 + + + 275, 237 + + + 157, 199 + + + 41, 238 + + + 182, 14 Нажмите на кнопку для назначения действия @@ -565,133 +649,157 @@ Кривые + + False + - 14, 48 + 140, 20 - 231, 21 + 120, 30 Использовать для управления + + False + 16, 20 - 188, 21 + 120, 30 Использовать как мышь + + 172, 93 + + + 8, 141 + + + 75, 141 + + + 102, 142 + + + 191, 134 + - 191, 95 + 146, 120 - 137, 95 + 102, 120 - 115, 17 + 88, 13 Инвертировать: - 71, 17 + 51, 13 Триггер: + + 101, 67 + + + False + + + 7, 61 + - 196, 17 + 88, 30 Чувствительность гироскопа: - 3, 93 + -2, 51 + + + 269, 168 - 340, 259 + 272, 208 - 244, 26 + 198, 22 - 244, 26 + 198, 22 - 244, 26 + 198, 22 - 244, 26 + 198, 22 - 244, 26 + 198, 22 - 244, 26 + 198, 22 - 244, 26 + 198, 22 - 244, 26 + 198, 22 - 244, 26 + 198, 22 - 244, 26 + 198, 22 - 244, 26 + 198, 22 - 244, 26 + 198, 22 - 244, 26 + 198, 22 - 244, 26 + 198, 22 - 244, 26 + 198, 22 Палец на тачпаде - 244, 26 + 198, 22 Два пальца на тачпаде - 244, 26 + 198, 22 - 244, 26 + 198, 22 - 244, 26 + 198, 22 - 244, 26 + 198, 22 Всегда включен - 245, 524 - - - Чувствительность - - - Сброс - - - Считывание контроллера + 199, 444 \ No newline at end of file diff --git a/DS4Windows/DS4Forms/Options.zh-Hans.resx b/DS4Windows/DS4Forms/Options.zh-Hans.resx index 1c04a13..7277432 100644 --- a/DS4Windows/DS4Forms/Options.zh-Hans.resx +++ b/DS4Windows/DS4Forms/Options.zh-Hans.resx @@ -119,82 +119,106 @@ - 149, 21 + 146, 17 颜色随电量百分比变化 + + 4, 77 + - 22, 17 + 19, 13 + + 4, 55 + - 22, 17 + 19, 13 绿 - 45, 17 + 48, 13 秒/循環 + + 4, 29 + - 22, 17 + 19, 13 - 55, 21 + 50, 17 双击 + + 50, 17 + 轻触 - 55, 21 + 47, 17 滚动 - 55, 21 + 50, 17 滑动 + + 10, 17 + - 66, 17 + 67, 13 鼠标灵敏度 - 107, 21 + 110, 17 右下角設為右鍵 - 74, 21 + 74, 17 抖動補償 + + 179, 65 + - 19, 17 + 19, 13 + + 124, 62 + + + 10, 172 + - 75, 21 + 69, 17 清空HID @@ -203,233 +227,269 @@ 测试震动 - 41, 17 + 37, 13 滿電: + + 3, 30 + - 22, 17 + 19, 13 + + 3, 56 + - 22, 17 + 19, 13 绿 + + 3, 78 + - 22, 17 + 19, 13 - 30, 17 + 25, 13 空: + + 85, 15 + - 136, 21 + 139, 17 開啟時滑動/捲動關閉 - 133, 26 + 114, 22 - 130, 6 + 111, 6 - 133, 26 + 114, 22 默认 - 141, 26 + 120, 22 反转 - 141, 26 + 120, 22 反转X轴 - 141, 26 + 120, 22 反转Y轴 - 133, 26 + 114, 22 十字键 - 141, 26 + 120, 22 反转 - 141, 26 + 120, 22 反转X轴 - 141, 26 + 120, 22 反转Y轴 - 133, 26 + 114, 22 左摇杆 - 141, 26 + 120, 22 反转 - 141, 26 + 120, 22 反转X轴 - 141, 26 + 120, 22 反转Y轴 - 133, 26 + 114, 22 右摇杆 - 133, 26 + 114, 22 右侧动作键 - 164, 26 + 139, 22 用掃描代碼 - 133, 26 + 114, 22 - 164, 26 + 139, 22 用掃描代碼 - 133, 26 + 114, 22 方向键 - 141, 26 + 120, 22 反转 - 141, 26 + 120, 22 反转X轴 - 141, 26 + 120, 22 反转Y轴 - 133, 26 + 114, 22 鼠标 - 134, 244 + 115, 208 触摸板 + + 11, 222 + + + 84, 219 + + + 10, 196 + + + 10, 149 + - 108, 21 + 96, 17 只使用 Dinput - 236, 133 + 233, 119 - 9, 140 + 9, 121 - 129, 21 + 134, 17 运行程式与配置文件 - 146, 135 + 149, 119 浏览... + + 7, 95 + - 63, 17 + 67, 13 使用控制器 - 205, 21 + 9, 40 - 77, 21 + 74, 17 鼠标加速 + + 77, 94 + + + 115, 96 + - 107, 21 + 110, 17 用於映射和讀出 - 116, 21 + 110, 17 空闲时断开连接 + + 267, 250 + 其他 @@ -452,35 +512,11 @@ 颜色 - 58, 17 + 49, 13 充电时: - - 176, 21 - - - shift mode 時用另一種顏色 - - - 22, 17 - - - - - - 22, 17 - - - 绿 - - - 22, 17 - - - - 灯条 @@ -494,7 +530,7 @@ 右摇杆 - 110, 17 + 94, 13 输入延迟:N/Ams @@ -506,32 +542,17 @@ 六軸:X軸已反轉來方便閱讀 - 30, 17 + 31, 13 加速 - 44, 17 + 43, 13 陀螺仪 - - 30, 17 - - - 按住 - - - 85, 17 - - - 來使用這些控制 - - - (無)/shift 關閉 - 點擊光調來開啟顏色選擇器 diff --git a/DS4Windows/DS4Forms/Options.zh-Hant.resx b/DS4Windows/DS4Forms/Options.zh-Hant.resx index 5c51314..8cfa625 100644 --- a/DS4Windows/DS4Forms/Options.zh-Hant.resx +++ b/DS4Windows/DS4Forms/Options.zh-Hant.resx @@ -119,91 +119,103 @@ - 119, 21 + 118, 17 顏色依電量%變化 + + 4, 77 + - 19, 17 + 19, 13 + + 5, 55 + + + 19, 13 + - 45, 17 + 48, 13 秒/循環 + + 4, 29 + - 19, 17 + 19, 13 - 52, 21 + 50, 17 雙擊 - 52, 21 + 50, 17 點擊 - 52, 21 + 50, 17 捲動 - 52, 21 + 50, 17 滑動 - 74, 17 + 73, 13 滑鼠靈敏度: - 107, 21 + 110, 17 右下角設為右鍵 - 74, 21 + 74, 17 抖動補償 - 170, 59 + 155, 66 - 30, 17 + 31, 13 分鐘 - 102, 55 + 100, 62 - 45, 213 + 10, 201 - 79, 21 + 72, 17 刷新 HID @@ -212,233 +224,254 @@ 測試強震 - 41, 17 + 37, 13 滿電: + + 3, 30 + - 19, 17 + 19, 13 + + 3, 51 + + + 19, 13 + + + 3, 74 + - 19, 17 + 19, 13 - 41, 17 + 37, 13 沒電: - 88, 19 + 84, 17 觸控版 - 0, 60 + 3, 36 - 136, 21 + 139, 17 開啟時滑動/捲動關閉 - - 4, 61 + + 4, 40 + + + 260, 153 - 150, 244 + 128, 208 - 149, 26 + 127, 22 - 146, 6 + 124, 6 - 149, 26 + 127, 22 預設 - 149, 26 + 127, 22 十字鍵 - 129, 26 + 110, 22 反轉 - 129, 26 + 110, 22 反轉 X - 129, 26 + 110, 22 反轉 Y - 149, 26 + 127, 22 左搖桿 - 129, 26 + 110, 22 反轉 - 129, 26 + 110, 22 反轉 X - 129, 26 + 110, 22 反轉 Y - 149, 26 + 127, 22 右搖桿 - 129, 26 + 110, 22 反轉 - 129, 26 + 110, 22 反轉 X - 129, 26 + 110, 22 反轉 Y - 149, 26 + 127, 22 右側四個按鈕 - 149, 26 + 127, 22 - 164, 26 + 139, 22 用掃描代碼 - 149, 26 + 127, 22 方向鍵 - 164, 26 + 139, 22 用掃描代碼 - 149, 26 + 127, 22 滑鼠 - 129, 26 + 110, 22 反轉 - 129, 26 + 110, 22 反轉 X - 129, 26 + 110, 22 反轉 Y - - 4, 61 + + 272, 245 其它 + + 10, 226 + + + 83, 221 + + + 10, 179 + - 16, 184 + 8, 158 - 108, 21 + 96, 17 只使用 Dinput - 197, 133 + 183, 125 - 8, 131 + 6, 122 - 85, 38 + 86, 30 啟用程式 使用設定檔 - 107, 135 + 100, 125 瀏覽... - 63, 17 + 67, 13 使用控制器 - - 156, 20 - - 74, 21 + 74, 17 滑鼠加速 @@ -450,13 +483,13 @@ 128, 93 - 107, 21 + 110, 17 用於映射和讀出 - 85, 21 + 86, 17 閒置時斷開 @@ -483,32 +516,11 @@ 顏色 - 63, 17 + 61, 13 當改變時: - - 176, 21 - - - shift mode 時用另一種顏色 - - - 19, 17 - - - - - - - - - 19, 17 - - - - 震動 @@ -519,7 +531,7 @@ 右搖桿 - 101, 17 + 94, 13 輸入延遲: N/Ams @@ -531,35 +543,17 @@ 六軸:X軸已反轉來方便閱讀 - 30, 17 + 31, 13 加速 - 41, 17 + 43, 13 陀螺儀 - - 30, 17 - - - 按住 - - - 85, 17 - - - 來使用這些控制 - - - (無)/shift 關閉 - - - 觸控版 (未點擊) - 控制器 @@ -597,119 +591,103 @@ 死區 - 84, 21 + 85, 17 當成控制器 - 73, 21 + 73, 17 當成滑鼠 - 30, 17 + 31, 13 反轉 - 55, 17 + 55, 13 啟動按鍵 - 74, 17 + 79, 13 陀螺儀靈敏度 - 205, 524 + 172, 444 - 204, 26 + 171, 22 - 204, 26 + 171, 22 - 204, 26 + 171, 22 - 204, 26 + 171, 22 - 204, 26 + 171, 22 - 204, 26 + 171, 22 - 204, 26 + 171, 22 - 204, 26 + 171, 22 - 204, 26 + 171, 22 - 204, 26 + 171, 22 - 204, 26 + 171, 22 - 204, 26 + 171, 22 - 204, 26 + 171, 22 - 204, 26 + 171, 22 - 204, 26 + 171, 22 手指放在觸摸板 - 204, 26 + 171, 22 2手指放在觸摸板 - 204, 26 + 171, 22 - 204, 26 + 171, 22 - 204, 26 + 171, 22 - - 204, 26 - - - 重置 - - - - Inherit - - - 靈敏度 - - - 控制器讀數 - - - Shift Modifier + + 171, 22 總是啟用 diff --git a/DS4Windows/DS4Forms/RecordBox.Designer.cs b/DS4Windows/DS4Forms/RecordBox.Designer.cs index e33b521..b21eef7 100644 --- a/DS4Windows/DS4Forms/RecordBox.Designer.cs +++ b/DS4Windows/DS4Forms/RecordBox.Designer.cs @@ -69,7 +69,7 @@ this.btnRecord.UseVisualStyleBackColor = true; this.btnRecord.Click += new System.EventHandler(this.btnRecord_Click); this.btnRecord.KeyDown += new System.Windows.Forms.KeyEventHandler(this.anyKeyDown); - this.btnRecord.KeyUp += new System.Windows.Forms.KeyEventHandler(this.anyKeyUp); + this.btnRecord.KeyUp += new System.Windows.Forms.KeyEventHandler(this.AnyKeyUp); // // cBRecordDelays // @@ -78,7 +78,7 @@ this.cBRecordDelays.TabStop = false; this.cBRecordDelays.UseVisualStyleBackColor = true; this.cBRecordDelays.KeyDown += new System.Windows.Forms.KeyEventHandler(this.anyKeyDown); - this.cBRecordDelays.KeyUp += new System.Windows.Forms.KeyEventHandler(this.anyKeyUp); + this.cBRecordDelays.KeyUp += new System.Windows.Forms.KeyEventHandler(this.AnyKeyUp); this.cBRecordDelays.MouseDown += new System.Windows.Forms.MouseEventHandler(this.anyMouseDown); this.cBRecordDelays.MouseUp += new System.Windows.Forms.MouseEventHandler(this.anyMouseUp); // @@ -97,7 +97,7 @@ this.lVMacros.View = System.Windows.Forms.View.Details; this.lVMacros.SelectedIndexChanged += new System.EventHandler(this.lVMacros_SelectedIndexChanged); this.lVMacros.KeyDown += new System.Windows.Forms.KeyEventHandler(this.anyKeyDown); - this.lVMacros.KeyUp += new System.Windows.Forms.KeyEventHandler(this.anyKeyUp); + this.lVMacros.KeyUp += new System.Windows.Forms.KeyEventHandler(this.AnyKeyUp); this.lVMacros.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lVMacros_MouseDoubleClick); this.lVMacros.MouseDown += new System.Windows.Forms.MouseEventHandler(this.anyMouseDown); this.lVMacros.MouseHover += new System.EventHandler(this.lVMacros_MouseHover); @@ -185,7 +185,7 @@ this.btnLightbar.UseVisualStyleBackColor = true; this.btnLightbar.Click += new System.EventHandler(this.btnLightbar_Click); this.btnLightbar.KeyDown += new System.Windows.Forms.KeyEventHandler(this.anyKeyDown); - this.btnLightbar.KeyUp += new System.Windows.Forms.KeyEventHandler(this.anyKeyUp); + this.btnLightbar.KeyUp += new System.Windows.Forms.KeyEventHandler(this.AnyKeyUp); // // btnRumble // @@ -194,7 +194,7 @@ this.btnRumble.UseVisualStyleBackColor = true; this.btnRumble.Click += new System.EventHandler(this.btnRumble_Click); this.btnRumble.KeyDown += new System.Windows.Forms.KeyEventHandler(this.anyKeyDown); - this.btnRumble.KeyUp += new System.Windows.Forms.KeyEventHandler(this.anyKeyUp); + this.btnRumble.KeyUp += new System.Windows.Forms.KeyEventHandler(this.AnyKeyUp); // // btn5th // @@ -203,7 +203,7 @@ this.btn5th.UseVisualStyleBackColor = true; this.btn5th.Click += new System.EventHandler(this.btn5th_Click); this.btn5th.KeyDown += new System.Windows.Forms.KeyEventHandler(this.anyKeyDown); - this.btn5th.KeyUp += new System.Windows.Forms.KeyEventHandler(this.anyKeyUp); + this.btn5th.KeyUp += new System.Windows.Forms.KeyEventHandler(this.AnyKeyUp); // // btn4th // @@ -212,7 +212,7 @@ this.btn4th.UseVisualStyleBackColor = true; this.btn4th.Click += new System.EventHandler(this.btn4th_Click); this.btn4th.KeyDown += new System.Windows.Forms.KeyEventHandler(this.anyKeyDown); - this.btn4th.KeyUp += new System.Windows.Forms.KeyEventHandler(this.anyKeyUp); + this.btn4th.KeyUp += new System.Windows.Forms.KeyEventHandler(this.AnyKeyUp); // // btnLoadP // @@ -286,7 +286,7 @@ this.ShowInTaskbar = false; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.RecordBox_FormClosing); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.anyKeyDown); - this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.anyKeyUp); + this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.AnyKeyUp); this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.anyMouseDown); this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.anyMouseUp); this.Resize += new System.EventHandler(this.RecordBox_Resize); diff --git a/DS4Windows/DS4Forms/RecordBox.cs b/DS4Windows/DS4Forms/RecordBox.cs index 4f2ecdb..07040ea 100644 --- a/DS4Windows/DS4Forms/RecordBox.cs +++ b/DS4Windows/DS4Forms/RecordBox.cs @@ -1,15 +1,10 @@ using System; using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Diagnostics; using System.Drawing; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; - +using NonFormTimer = System.Timers.Timer; using System.IO; using System.Reflection; @@ -19,7 +14,8 @@ namespace DS4Windows public partial class RecordBox : Form { Stopwatch sw = new Stopwatch(); - Timer ds4 = new Timer(); + //Timer ds4 = new Timer(); + NonFormTimer ds4 = new NonFormTimer(); public List macros = new List(), macrosAfter = new List(); public List macronames = new List(); SpecActions sA; @@ -36,12 +32,16 @@ namespace DS4Windows openPresets.Filter = Properties.Resources.TextDocs + "|*.txt"; savePresets.Filter = Properties.Resources.TextDocs + "|*.txt"; if (op != null) - if (kbm.macrorepeat) - cBStyle.SelectedIndex = 1; - else - cBStyle.SelectedIndex = 0; + { + if (kbm.macrorepeat) + cBStyle.SelectedIndex = 1; + else + cBStyle.SelectedIndex = 0; + } + AddtoDS4List(); - ds4.Tick += ds4_Tick; + //ds4.Tick += ds4_Tick; + ds4.Elapsed += Ds4_Tick; ds4.Interval = 1; if (kbm.macrostag.Count > 0) { @@ -59,10 +59,13 @@ namespace DS4Windows cBStyle.SelectedIndex = 1; else cBStyle.SelectedIndex = 0; + AddtoDS4List(); if (button > -1) sAButton = button; - ds4.Tick += ds4_Tick; + + //ds4.Tick += ds4_Tick; + ds4.Elapsed += Ds4_Tick; ds4.Interval = 1; lbRecordTip.Visible = false; cBStyle.Visible = false; @@ -86,7 +89,6 @@ namespace DS4Windows void AddtoDS4List() { - dcs.Add(DS4Controls.Cross); dcs.Add(DS4Controls.Cross); dcs.Add(DS4Controls.Circle); dcs.Add(DS4Controls.Square); @@ -121,81 +123,65 @@ namespace DS4Windows else macros.Add(value); } + bool[] pTP = new bool[4]; - void ds4_Tick(object sender, EventArgs e) + + private void Ds4_Tick(object sender, System.Timers.ElapsedEventArgs e) { if (Program.rootHub.DS4Controllers[0] != null) { cState = Program.rootHub.getDS4State(0); - if (btnRecord.Text == Properties.Resources.StopText) + this.BeginInvoke((Action)(() => { - if (cBRecordDelays.Checked) + if (btnRecord.Text == Properties.Resources.StopText) { - Mouse tP = Program.rootHub.touchPad[0]; - if (tP.leftDown && !pTP[0]) - if (!btnRumble.Text.Contains("Stop")) - btnRumble_Click(sender, e); - else if (!tP.leftDown && pTP[0]) - if (btnRumble.Text.Contains("Stop")) - btnRumble_Click(sender, e); - if (tP.rightDown && !pTP[1]) - if (!btnLightbar.Text.Contains("Reset")) - btnLightbar_Click(sender, e); - else if (!tP.rightDown && pTP[1]) - if (btnLightbar.Text.Contains("Reset")) - btnLightbar_Click(sender, e); - pTP[0] = tP.leftDown; - pTP[1] = tP.rightDown; - } - foreach (DS4Controls dc in dcs) - if (Mapping.getBoolMapping(0, dc, cState, null, null)) + if (cBRecordDelays.Checked) { - int value = DS4ControltoInt(dc); - int count = 0; - foreach (int i in macros) - { - if (i == value) - count++; - } - if (macros.Count == 0) - { - AddMacroValue(value); - lVMacros.Items.Add(DS4ControltoX360(dc), 0); - if (cBRecordDelays.Checked) - { - sw.Reset(); - sw.Start(); - } - } - else if (count % 2 == 0) - { - if (cBRecordDelays.Checked) - { - AddMacroValue((int)sw.ElapsedMilliseconds + 300); - lVMacros.Items.Add(Properties.Resources.WaitMS.Replace("*number*", sw.ElapsedMilliseconds.ToString()).Replace("*ms*", "ms"), 2); - sw.Reset(); - sw.Start(); - } - AddMacroValue(value); - lVMacros.Items.Add(DS4ControltoX360(dc), 0); - } - lVMacros.Items[lVMacros.Items.Count - 1].EnsureVisible(); + Mouse tP = Program.rootHub.touchPad[0]; + if (tP.leftDown && !pTP[0]) + if (!btnRumble.Text.Contains("Stop")) + btnRumble_Click(sender, e); + else if (!tP.leftDown && pTP[0]) + if (btnRumble.Text.Contains("Stop")) + btnRumble_Click(sender, e); + if (tP.rightDown && !pTP[1]) + if (!btnLightbar.Text.Contains("Reset")) + btnLightbar_Click(sender, e); + else if (!tP.rightDown && pTP[1]) + if (btnLightbar.Text.Contains("Reset")) + btnLightbar_Click(sender, e); + pTP[0] = tP.leftDown; + pTP[1] = tP.rightDown; } - else if (!Mapping.getBoolMapping(0, dc, cState, null, null)) + + //foreach (DS4Controls dc in dcs) + for (int controlIndex = 0, dcsLen = dcs.Count; controlIndex < dcsLen; controlIndex++) { - if (macros.Count != 0) + 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++; } - /*for (int i = macros.Count - 1; i >= 0; i--) - if (macros.Count == 261) - count++;*/ - if (count % 2 == 1) + + if (macroLen == 0) + { + AddMacroValue(value); + lVMacros.Items.Add(DS4ControltoX360(dc), 0); + if (cBRecordDelays.Checked) + { + sw.Reset(); + sw.Start(); + } + } + else if (count % 2 == 0) { if (cBRecordDelays.Checked) { @@ -205,12 +191,49 @@ namespace DS4Windows sw.Start(); } AddMacroValue(value); - lVMacros.Items.Add(DS4ControltoX360(dc), 1); - lVMacros.Items[lVMacros.Items.Count - 1].EnsureVisible(); + lVMacros.Items.Add(DS4ControltoX360(dc), 0); + } + + lVMacros.Items[lVMacros.Items.Count - 1].EnsureVisible(); + } + else if (!Mapping.getBoolMapping(0, dc, cState, null, null)) + { + int macroLen = macros.Count; + if (macroLen != 0) + { + int value = DS4ControltoInt(dc); + int count = 0; + //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) + { + AddMacroValue((int)sw.ElapsedMilliseconds + 300); + lVMacros.Items.Add(Properties.Resources.WaitMS.Replace("*number*", sw.ElapsedMilliseconds.ToString()).Replace("*ms*", "ms"), 2); + sw.Reset(); + sw.Start(); + } + + AddMacroValue(value); + lVMacros.Items.Add(DS4ControltoX360(dc), 1); + lVMacros.Items[lVMacros.Items.Count - 1].EnsureVisible(); + } } } } - } + } + })); } } @@ -277,16 +300,20 @@ namespace DS4Windows case DS4Controls.RYPos: return "RS Down"; case DS4Controls.RYNeg: return "RS Up"; } + return "None"; } + bool recordAfter = false; int recordAfterInt = 0; + private void btnRecord_Click(object sender, EventArgs e) { if (btnRecord.Text != Properties.Resources.StopText) { if (cBRecordDelays.Checked) sw.Start(); + btnRumble.Visible = cBRecordDelays.Checked; btnLightbar.Visible = cBRecordDelays.Checked; pBLtouch.Visible = cBRecordDelays.Checked; @@ -296,6 +323,7 @@ namespace DS4Windows ds4.Start(); if (!recordAfter) macros.Clear(); + lVMacros.Items.Clear(); btnRecord.Text = Properties.Resources.StopText; EnableControls(false); @@ -314,21 +342,28 @@ namespace DS4Windows recordAfter = false; LoadMacro(); } + if (btn4th.Text.Contains(Properties.Resources.UpText)) btn4th_Click(sender, e); + if (btn5th.Text.Contains(Properties.Resources.UpText)) btn5th_Click(sender, e); + if (cBRecordDelays.Checked) { if (btnRumble.Text.Contains("Stop")) btnRumble_Click(sender, e); + if (btnLightbar.Text.Contains("Reset")) btnLightbar_Click(sender, e); } + if (cBRecordDelays.Checked) sw.Reset(); + if (cBRecordDelays.Checked) lbDelayTip.Visible = true; + btnRecord.Text = Properties.Resources.RecordText; EnableControls(true); } @@ -352,17 +387,22 @@ namespace DS4Windows int value = WhichKey(e, 0); int count = 0; if (recordAfter) + { foreach (int i in macrosAfter) { if (i == value) count++; } - else - foreach (int i in macros) - { - if (i == value) - count++; } + else + { + foreach (int i in macros) + { + if (i == value) + count++; + } + } + if (macros.Count == 0 || (recordAfter && macrosAfter.Count == 0)) { AddMacroValue(value); @@ -382,19 +422,25 @@ namespace DS4Windows sw.Reset(); sw.Start(); } + AddMacroValue(value); lVMacros.Items.Add(((Keys)value).ToString(), 0); } + lVMacros.Items[lVMacros.Items.Count - 1].EnsureVisible(); } else if (e.KeyValue == 27) + { Close(); + } else if (e.KeyCode == Keys.Delete) + { if (lVMacros.SelectedIndices.Count > 0 && lVMacros.SelectedIndices[0] > -1) { macros.RemoveAt(lVMacros.SelectedIndices[0]); lVMacros.Items.Remove(lVMacros.SelectedItems[0]); } + } } private int WhichKey(KeyEventArgs e, int keystate) @@ -406,55 +452,75 @@ namespace DS4Windows if (recordAfter) { for (int i = macrosAfter.Count - 1; i >= 0; i--) + { if (macrosAfter[i] == 160) return 160; else if (macrosAfter[i] == 161) return 161; + } } else + { for (int i = macros.Count - 1; i >= 0; i--) + { if (macros[i] == 160) return 160; else if (macros[i] == 161) return 161; + } + } } else if (e.KeyCode == Keys.ControlKey) { if (recordAfter) { for (int i = macrosAfter.Count - 1; i >= 0; i--) + { if (macrosAfter[i] == 162) return 162; else if (macrosAfter[i] == 163) return 163; + } } else - for (int i = macros.Count - 1; i >= 0; i--) - if (macros[i] == 162) - return 162; - else if (macros[i] == 163) - return 163; + { + for (int i = macros.Count - 1; i >= 0; i--) + { + if (macros[i] == 162) + return 162; + else if (macros[i] == 163) + return 163; + } + } } else if (e.KeyCode == Keys.Menu) { if (recordAfter) { for (int i = macrosAfter.Count - 1; i >= 0; i--) + { if (macrosAfter[i] == 164) return 164; else if (macrosAfter[i] == 165) return 165; + } } else + { for (int i = macros.Count - 1; i >= 0; i--) + { if (macros[i] == 164) return 164; else if (macros[i] == 165) return 165; + } + } } + return e.KeyValue; } else + { if (e.KeyCode == Keys.ShiftKey) { if (Convert.ToBoolean(GetAsyncKeyState(Keys.LShiftKey))) @@ -476,15 +542,17 @@ namespace DS4Windows return 164; if (Convert.ToBoolean(GetAsyncKeyState(Keys.RMenu))) return 165; - } + } + return e.KeyValue; } - private void anyKeyUp(object sender, KeyEventArgs e) + private void AnyKeyUp(object sender, KeyEventArgs e) { if (btnRecord.Text == Properties.Resources.StopText && (macros.Count != 0 || (recordAfter && macrosAfter.Count != 0))) { + lVMacros.BeginUpdate(); int value = WhichKey(e, 1); if (cBRecordDelays.Checked) { @@ -493,9 +561,19 @@ namespace DS4Windows sw.Reset(); sw.Start(); } + + if (e.KeyCode == Keys.PrintScreen) + { + int tempvalue = WhichKey(e, 0); + AddMacroValue(tempvalue); + lVMacros.Items.Add(((Keys)value).ToString(), 0); + lVMacros.Items[lVMacros.Items.Count - 1].EnsureVisible(); + } + AddMacroValue(value); lVMacros.Items.Add(((Keys)value).ToString(), 1); lVMacros.Items[lVMacros.Items.Count - 1].EnsureVisible(); + lVMacros.EndUpdate(); } } private void anyMouseDown(object sender, MouseEventArgs e) @@ -505,13 +583,14 @@ namespace DS4Windows int value; switch (e.Button) { - case System.Windows.Forms.MouseButtons.Left: value = 256; break; - case System.Windows.Forms.MouseButtons.Right: value = 257; break; - case System.Windows.Forms.MouseButtons.Middle: value = 258; break; - case System.Windows.Forms.MouseButtons.XButton1: value = 259; break; - case System.Windows.Forms.MouseButtons.XButton2: value = 260; break; + case MouseButtons.Left: value = 256; break; + case MouseButtons.Right: value = 257; break; + case MouseButtons.Middle: value = 258; break; + case MouseButtons.XButton1: value = 259; break; + case MouseButtons.XButton2: value = 260; break; default: value = 0; break; } + if (macros.Count == 0 || (recordAfter && macrosAfter.Count == 0)) { AddMacroValue(value); @@ -531,13 +610,17 @@ namespace DS4Windows sw.Reset(); sw.Start(); } + AddMacroValue(value); lVMacros.Items.Add(e.Button.ToString() + " Mouse Button", 0); } - if (e.Button == System.Windows.Forms.MouseButtons.XButton1) + + if (e.Button == MouseButtons.XButton1) lVMacros.Items[lVMacros.Items.Count - 1].Text = "4th Mouse Button"; - if (e.Button == System.Windows.Forms.MouseButtons.XButton2) + + if (e.Button == MouseButtons.XButton2) lVMacros.Items[lVMacros.Items.Count - 1].Text = "5th Mouse Button"; + lVMacros.Items[lVMacros.Items.Count - 1].EnsureVisible(); } } @@ -549,11 +632,11 @@ namespace DS4Windows int value; switch (e.Button) { - case System.Windows.Forms.MouseButtons.Left: value = 256; break; - case System.Windows.Forms.MouseButtons.Right: value = 257; break; - case System.Windows.Forms.MouseButtons.Middle: value = 258; break; - case System.Windows.Forms.MouseButtons.XButton1: value = 259; break; - case System.Windows.Forms.MouseButtons.XButton2: value = 260; break; + case MouseButtons.Left: value = 256; break; + case MouseButtons.Right: value = 257; break; + case MouseButtons.Middle: value = 258; break; + case MouseButtons.XButton1: value = 259; break; + case MouseButtons.XButton2: value = 260; break; default: value = 0; break; } @@ -564,12 +647,16 @@ namespace DS4Windows sw.Reset(); sw.Start(); } + AddMacroValue(value); lVMacros.Items.Add(e.Button.ToString() + " Mouse Button", 1); - if (e.Button == System.Windows.Forms.MouseButtons.XButton1) + + if (e.Button == MouseButtons.XButton1) lVMacros.Items[lVMacros.Items.Count - 1].Text = "4th Mouse Button"; - if (e.Button == System.Windows.Forms.MouseButtons.XButton2) + + if (e.Button == MouseButtons.XButton2) lVMacros.Items[lVMacros.Items.Count - 1].Text = "5th Mouse Button"; + lVMacros.Items[lVMacros.Items.Count - 1].EnsureVisible(); } } @@ -598,9 +685,11 @@ namespace DS4Windows sw.Reset(); sw.Start(); } + AddMacroValue(value); lVMacros.Items.Add("4th Mouse Button", 0); } + btn4th.Text = Properties.Resources.FourthMouseUp; } else @@ -612,10 +701,12 @@ namespace DS4Windows sw.Reset(); sw.Start(); } + AddMacroValue(value); lVMacros.Items.Add("4th Mouse Button", 1); btn4th.Text = Properties.Resources.FourthMouseDown; } + lVMacros.Items[lVMacros.Items.Count - 1].EnsureVisible(); } @@ -643,9 +734,11 @@ namespace DS4Windows sw.Reset(); sw.Start(); } + AddMacroValue(value); lVMacros.Items.Add("5th Mouse Button", 0); } + btn5th.Text = Properties.Resources.FifthMouseUp; } else @@ -657,10 +750,12 @@ namespace DS4Windows sw.Reset(); sw.Start(); } + AddMacroValue(value); lVMacros.Items.Add("5th Mouse Button", 1); btn5th.Text = Properties.Resources.FifthMouseDown; } + lVMacros.Items[lVMacros.Items.Count - 1].EnsureVisible(); } @@ -689,9 +784,11 @@ namespace DS4Windows sw.Reset(); sw.Start(); } + AddMacroValue(value); lVMacros.Items.Add("Rumble 255,255 (100%)", 0); } + btnRumble.Text = "Stop Rumble"; } else @@ -704,10 +801,12 @@ namespace DS4Windows sw.Reset(); sw.Start(); } + AddMacroValue(value); lVMacros.Items.Add("Stop Rumble", 1); btnRumble.Text = "Add Rumble"; } + lVMacros.Items[lVMacros.Items.Count - 1].EnsureVisible(); } @@ -735,9 +834,11 @@ namespace DS4Windows sw.Reset(); sw.Start(); } + AddMacroValue(value); lVMacros.Items.Add("Lightbar Color: 255,255,255", 0); } + btnLightbar.Text = "Reset Lightbar Color"; } else @@ -750,10 +851,12 @@ namespace DS4Windows sw.Reset(); sw.Start(); } + AddMacroValue(value); lVMacros.Items.Add("Reset Lightbar", 1); btnLightbar.Text = "Change Lightbar Color"; } + lVMacros.Items[lVMacros.Items.Count - 1].EnsureVisible(); } @@ -768,6 +871,7 @@ namespace DS4Windows case 1: sA.btnHoldT.Text = macros.Count > 0 ? Properties.Resources.MacroRecorded : Properties.Resources.SelectMacro; break; case 2: sA.btnDTapT.Text = macros.Count > 0 ? Properties.Resources.MacroRecorded : Properties.Resources.SelectMacro; break; } + saved = true; Close(); } @@ -778,14 +882,14 @@ namespace DS4Windows { macronames.Add(lvi.Text); } + string macro = string.Join(", ", macronames.ToArray()); if (kbm != null) { 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 +900,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(); @@ -806,10 +909,12 @@ namespace DS4Windows else Close(); } - else MessageBox.Show(Properties.Resources.NoMacroRecorded, "DS4Windows", MessageBoxButtons.OK, MessageBoxIcon.Warning); + else + { + MessageBox.Show(Properties.Resources.NoMacroRecorded, "DS4Windows", MessageBoxButtons.OK, MessageBoxIcon.Warning); + } } - private void btnSaveP_Click(object sender, EventArgs e) { if (macros.Count > 0) @@ -822,13 +927,16 @@ namespace DS4Windows savePresets.InitialDirectory = Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName + @"\Macros\"; else savePresets.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\DS4Tool" + @"\Macros\"; + if (!Directory.Exists(savePresets.InitialDirectory)) { Directory.CreateDirectory(savePresets.InitialDirectory); //savePresets.InitialDirectory = path; } + Console.WriteLine(savePresets.InitialDirectory); - if (savePresets.ShowDialog() == System.Windows.Forms.DialogResult.OK) + if (savePresets.ShowDialog() == DialogResult.OK) + { if ((stream = savePresets.OpenFile()) != null) { string macro = string.Join("/", macros.ToArray()); @@ -836,8 +944,12 @@ namespace DS4Windows sw.Write(macro); sw.Close(); } + } + } + else + { + MessageBox.Show(Properties.Resources.NoMacroRecorded, "DS4Windows", MessageBoxButtons.OK, MessageBoxIcon.Warning); } - else MessageBox.Show(Properties.Resources.NoMacroRecorded, "DS4Windows", MessageBoxButtons.OK, MessageBoxIcon.Warning); } private void btnLoadP_Click(object sender, EventArgs e) @@ -863,7 +975,8 @@ namespace DS4Windows openPresets.InitialDirectory = Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName + @"\Macros\"; else openPresets.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\DS4Tool" + @"\Macros\"; - if (openPresets.ShowDialog() == System.Windows.Forms.DialogResult.OK) + + if (openPresets.ShowDialog() == DialogResult.OK) { string file = openPresets.FileName; macros.Clear(); @@ -876,6 +989,7 @@ namespace DS4Windows if (int.TryParse(s, out temp)) macros.Add(temp); } + LoadMacro(); sr.Close(); } @@ -894,7 +1008,6 @@ namespace DS4Windows void LoadMacro() { - if (macros.Count > 0) { bool[] keydown = new bool[286]; @@ -928,7 +1041,9 @@ namespace DS4Windows lVMacros.Items.Add("Stop Rumble", 1); } else if (i >= 300) //ints over 300 used to delay + { lVMacros.Items.Add(Properties.Resources.WaitMS.Replace("*number*", (i - 300).ToString()).Replace("*ms*", "ms"), 2); + } else if (!keydown[i]) { //anything above 255 is not a keyvalue @@ -1001,6 +1116,7 @@ namespace DS4Windows keydown[i] = false; } } + for (int i = 0; i < keydown.Length; i++) { if (keydown[i]) @@ -1042,13 +1158,15 @@ namespace DS4Windows } } - - private void RecordBox_FormClosing(object sender, FormClosingEventArgs e) { if (!saved && macros.Count > 0) - if (MessageBox.Show(Properties.Resources.SaveRecordedMacro, "DS4Windows", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) + { + if (MessageBox.Show(Properties.Resources.SaveRecordedMacro, "DS4Windows", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) btnSave_Click(null, null); + } + + Program.rootHub.recordingMacro = false; } protected override bool IsInputKey(Keys keyData) @@ -1074,8 +1192,10 @@ namespace DS4Windows case Keys.Shift | Keys.MediaNextTrack: return true; } + return base.IsInputKey(keyData); } + protected override void OnKeyDown(KeyEventArgs e) { base.OnKeyDown(e); @@ -1099,11 +1219,14 @@ namespace DS4Windows break; } } + private int selection; private bool changingDelay = false; + private void lVMacros_MouseDoubleClick(object sender, MouseEventArgs e) { if (lVMacros.SelectedIndices[0] >= 0) + { if (lVMacros.SelectedItems[0].ImageIndex == 2) { TextBox tb = new TextBox(); @@ -1137,7 +1260,7 @@ namespace DS4Windows } else if (macros[lVMacros.SelectedIndices[0]] > 1000000 && macros[lVMacros.SelectedIndices[0]] != 1000000000) { - + lVMacros.MouseHover -= lVMacros_MouseHover; string r = macros[lVMacros.SelectedIndices[0]].ToString().Substring(1); byte heavy = (byte)(int.Parse(r[0].ToString()) * 100 + int.Parse(r[1].ToString()) * 10 + int.Parse(r[2].ToString())); @@ -1166,6 +1289,7 @@ namespace DS4Windows tb2.TextChanged += tb_TextChanged; tb1.Focus(); } + } } void tb_TextChanged(object sender, EventArgs e) @@ -1174,8 +1298,10 @@ namespace DS4Windows //if (changingDelay) { for (int i = tb.Text.Length - 1; i >= 0; i--) + { if (!char.IsDigit(tb.Text[i])) tb.Text = tb.Text.Remove(i, 1); + } } } @@ -1189,6 +1315,7 @@ namespace DS4Windows if (e.KeyCode == Keys.Enter) SaveMacroChange((TextBox)sender); } + private void SaveMacroChange(TextBox tb) { int i, j; @@ -1220,6 +1347,7 @@ namespace DS4Windows } } } + lVMacros.MouseHover += lVMacros_MouseHover; } @@ -1243,6 +1371,7 @@ namespace DS4Windows private void lVMacros_SelectedIndexChanged(object sender, EventArgs e) { if (btnRecord.Text != Properties.Resources.StopText) + { if (lVMacros.SelectedIndices.Count > 0 && lVMacros.SelectedIndices[0] > -1) { recordAfter = true; @@ -1254,7 +1383,7 @@ namespace DS4Windows recordAfter = false; btnRecord.Text = "Record"; } + } } - } } diff --git a/DS4Windows/DS4Forms/RecordBox.ja.resx b/DS4Windows/DS4Forms/RecordBox.ja.resx index edde0ee..668168f 100644 --- a/DS4Windows/DS4Forms/RecordBox.ja.resx +++ b/DS4Windows/DS4Forms/RecordBox.ja.resx @@ -117,10 +117,188 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 536, 29 + + + 213, 46 + + + 591, 121 + + + 96, 17 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAQ + CgAAAk1TRnQBSQFMAgEBAwEAAcwBAQHMAQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA + AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 + AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA + AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm + AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM + AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA + ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz + AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ + AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM + AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA + AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA + AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ + AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/ + AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA + AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm + ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ + Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz + AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA + AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM + AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM + ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM + Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA + AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM + AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ + AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz + AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm + AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw + AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/yIAAf8B7wH3AfQGAAH/ + Au8B/xgAAf8BBw4AAuwB/wcAAf8BBwHxAQcBvAGRAosBkQG8AQcB8QHvAf8XAAH/AuwBBw0AAuwB/wgA + AfQB8AEHBosCBwH0FwAB/wTsAQcMAALsAf8IAAHxAZEBiwe0AZEB8RYAAf8G7AEHCwAC7AH/BwAB9AG0 + Aa0BtAG1AfEC/wHxAbUBtAGtAbQB9BUAAuwBBwLsAf8C7AH/CgAC7AH/BwABvAGzAbQBtQb/ArQBswG8 + FQAB7AEHAQAC7AL/AewB/woAAuwB/wcAAbUBtAG1ARkC9AEHAfMB/wEZAQkCtAG1FQABBwIAAuwB/wEA + Av8HAAH/AgAC7AH/AgAB/wQAArQBtQP0AuwBvAH/ARkDtBgAAuwB/woAAewB/wEAAuwB/wEAAQcB/wQA + ArQBtQH0Av8B7AHvAewBBwEZA7QYAALsAf8KAALsAf8C7AH/AQcB7AH/BAABuwG0AbsBGQH/AfQBkgH0 + Af8B7wEZAbUBtAG7GAAC7AH/CgABBwTsAQcC7AH/BAAB8AG0AbsBCQH/AfQB8gP/ArsBtAHwGAAC7AH/ + CwABBwXsAf8EAAH0AVgBUgG7AgkB8wL0AfMBCQG7ARwBUgF5Af8XAALsAf8MAAEHA+wB/wUAARoBmgF6 + AVIDCQK1AgkBuwFYARoBegH/FwAC7AH/DQABBwHsAf8GAAEaAXoBwwF6AVgB3AQJAbsBUgKaAXoB/xcA + A/8OAAH/BwAB/wEaAXoBwwF6AZkBCQLcAQkBmQF6AZoBegH2MgAB/wEaAVkBegH/BAAB/wFZAXoB9hIA + AUIBTQE+BwABPgMAASgDAAFAAwABEAMAAQEBAAEBBQABgBcAA/8BAAT/AYcB4QIAAf4BfwH+AT8BgAEB + AgAB/AE/Af4BPwHAAQMCAAH4AR8B/gE/AcABAwIAAfABDwH+AT8BgAEBAgAB8AEHAf4BPwGAAQECAAHy + AQcB/gE/AYABAQIAAfYBJwH2ATcBgAEBAgAB/gE/AfIBJwGAAQECAAH+AT8B8AEHAYABAQIAAf4BPwHw + AQcBgAEBAgAB/gE/AfgBDwQAAf4BPwH8AR8EAAH+AT8B/gE/BAAB/gE/Af8BfwEAAQECAAT/AYMBwwIA + Cw== + + + + 3, 29 + + + 527, 342 + + + 578, 179 + + + 121, 21 + + + 536, 2 + + + 104, 23 + 保存 + + 646, 2 + + + 103, 23 + + + 646, 81 + + + 103, 23 + プリセットを保存 + + 309, 7 + + + 221, 13 + + + 152, 106 + + + 43, 23 + + + 152, 77 + + + 43, 23 + + + 17, 106 + + + 131, 23 + + + 17, 77 + + + 131, 23 + + + 39, 39 + + + 131, 23 + + + 39, 10 + + + 131, 23 + + + 539, 225 + + + 210, 138 + + + 536, 81 + + + 104, 23 + + + 3, 8 + + + 66, 13 + + + 536, 142 + + + 212, 33 + + + 132, 22 + + + 132, 22 + + + 133, 48 + + + 6, 13 + + + 750, 375 + + + 260, 205 + \ No newline at end of file diff --git a/DS4Windows/DS4Forms/RecordBox.resx b/DS4Windows/DS4Forms/RecordBox.resx index 1816f1a..211e8b6 100644 --- a/DS4Windows/DS4Forms/RecordBox.resx +++ b/DS4Windows/DS4Forms/RecordBox.resx @@ -140,8 +140,8 @@ 4, 4, 4, 4 - - 4, 0, 4, 0 + + Macro Order 3 @@ -171,8 +171,8 @@ btnSave - - 156, 56 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Save Preset @@ -195,11 +195,8 @@ 2 - - 327 - - - 294, 17 + + 23, 130 4, 4, 4, 4 @@ -207,12 +204,24 @@ pnlMouseButtons + + 4, 0, 4, 0 + btnLightbar + + iLKeys + 8 + + 283, 41 + + + 861, 100 + Record a Macro @@ -243,11 +252,14 @@ 715, 100 + + 1 + fromFileToolStripMenuItem - - 715, 2 + + 2 8, 16 @@ -288,6 +300,12 @@ 4, 4, 4, 4 + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + 5 @@ -324,12 +342,6 @@ Zoom - - Add Rumble - - - 715, 36 - NoControl @@ -345,9 +357,6 @@ 4, 4, 4, 4 - - 0 - Repeat while held @@ -366,9 +375,6 @@ 4, 4, 4, 4 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 284, 57 @@ -378,8 +384,8 @@ lbDelayTip - - True + + 4, 0, 4, 0 0 @@ -387,14 +393,14 @@ 347, 252 - - 771, 220 + + 328 pnlMouseButtons - - Macro Order + + 771, 220 701, 420 @@ -423,6 +429,9 @@ Top, Right + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + 200 @@ -441,9 +450,6 @@ pnlMouseButtons - - Use Keyboard/Mouse + Controller 1 to record - 322 @@ -459,9 +465,6 @@ cMSLoadPresets - - 328 - Cycle Programs @@ -486,15 +489,15 @@ 332 + + 156, 56 + Top, Bottom, Left, Right 4 - - 324 - 333 @@ -504,9 +507,6 @@ System.Windows.Forms.ImageList, 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 - 5 @@ -522,6 +522,9 @@ System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + btnCancel + True @@ -531,18 +534,12 @@ False - - 139, 28 - 4, 36 System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 23, 130 - 4, 4, 4, 4 @@ -588,9 +585,6 @@ 137, 28 - - 412, 9 - Top @@ -612,7 +606,10 @@ pnlMouseButtons - + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + $this @@ -621,8 +618,8 @@ NoControl - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 715, 36 System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -633,14 +630,14 @@ 4 - - iLKeys + + 412, 9 52, 48 - - System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 715, 2 Record @@ -648,8 +645,8 @@ $this - - 203, 130 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 MiddleCenter @@ -660,17 +657,17 @@ 4, 4, 4, 4 - - 2 + + 203, 130 $this - - 4, 0, 4, 0 + + Add Rumble - - 1 + + 324 $this @@ -690,6 +687,9 @@ altTabToolStripMenuItem + + Macro Order + 1000, 462 @@ -702,26 +702,23 @@ pnlMouseButtons - - btnCancel + + $this 2 - - Macro Order - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - $this + + 327 Record Delays - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 0 4, 4, 4, 4 @@ -735,15 +732,15 @@ 9 - - 861, 100 + + Use Keyboard/Mouse + Controller 1 to record AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAQ - CgAAAk1TRnQBSQFMAgEBAwEAAZwBAQHEAQEBEAEAARABAAT/AQkBEAj/AUIBTQE2AQQGAAE2AQQCAAEo + CgAAAk1TRnQBSQFMAgEBAwEAAZwBAQHIAQEBEAEAARABAAT/AQkBEAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -789,6 +786,9 @@ Cw== + + $this + NoControl @@ -807,8 +807,8 @@ NoControl - - 283, 41 + + 139, 28 Edit the Wait to change the cycle rate @@ -831,8 +831,8 @@ 11 - - $this + + 294, 17 238, 17 @@ -849,7 +849,4 @@ True - - ja - \ No newline at end of file diff --git a/DS4Windows/DS4Forms/SaveWhere.Designer.cs b/DS4Windows/DS4Forms/SaveWhere.Designer.cs index d3f8468..68b03ba 100644 --- a/DS4Windows/DS4Forms/SaveWhere.Designer.cs +++ b/DS4Windows/DS4Forms/SaveWhere.Designer.cs @@ -40,14 +40,14 @@ // // label4 // - resources.ApplyResources(this.label4, "label4"); this.label4.ForeColor = System.Drawing.SystemColors.GrayText; + resources.ApplyResources(this.label4, "label4"); this.label4.Name = "label4"; // // label3 // - resources.ApplyResources(this.label3, "label3"); this.label3.ForeColor = System.Drawing.SystemColors.GrayText; + resources.ApplyResources(this.label3, "label3"); this.label3.Name = "label3"; // // bnAppdataFolder diff --git a/DS4Windows/DS4Forms/SaveWhere.es.resx b/DS4Windows/DS4Forms/SaveWhere.es.resx index 2c6e092..d7702fe 100644 --- a/DS4Windows/DS4Forms/SaveWhere.es.resx +++ b/DS4Windows/DS4Forms/SaveWhere.es.resx @@ -127,7 +127,7 @@ No elimines los otros ajustes aún - Para aquellos que prefieren un programa portable Nota: esta opción no funciona si esta en una carpeta admin son o sin UAC + Para aquellos que prefieren un programa portable. Nota: esta opción no funciona si esta en una carpeta admin con o sin UAC Para aquellos que prefieren una instalación de ajustes regular se guarda en %appdata%/ds4tool diff --git a/DS4Windows/DS4Forms/SaveWhere.resx b/DS4Windows/DS4Forms/SaveWhere.resx index 2e32013..ca961b3 100644 --- a/DS4Windows/DS4Forms/SaveWhere.resx +++ b/DS4Windows/DS4Forms/SaveWhere.resx @@ -118,250 +118,226 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 12, 10 + + 206, 89 - - bnPrgmFolder - - - cBDeleteOther - - - 515, 33 + + 177, 69 - - 11 - - - 0 - - - Multiple save locations detected - - - - 5, 5, 5, 5 - - - 4, 0, 4, 0 - - - 187, 28 - - - 5 - - - $this - 9 - - 260, 85 + + For those who prefer a regular install Settings saved at %appdata%/DS4Windows - - 8, 16 + + TopCenter - - Don't Delete the -other settings yet + + label4 - + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + $this - - CenterScreen - - - 4, 0, 4, 0 + + 1 - 7, 110 + 5, 89 - - 43, 78 + + 195, 69 - - 6 + + 10 - - 2 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4, 4, 4, 4 - - - 209, 17 - - - True - - - Top, Left, Right + + For those who prefer a portable program Note: this option does not work if in an admin folder w/o UAC TopCenter + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + + + 222, 63 + + + 140, 23 + + + 7 + + + Appdata + + + bnAppdataFolder + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + $this + + 5 + + + 32, 63 + + + 140, 23 + + + 8 + + + Program Folder + + + bnPrgmFolder + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 6 + + + + Top, Left, Right + + + 1, 33 + + + 386, 27 + + + 10 + + + Pick where you want settings and profiles to be saved + + + TopCenter + + + lbPickWhere + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + 3 - - label4 + + True - - For those who prefer a regular install Settings saved at %appdata%/ds4tool + + 9, 8 - - $this - - - TopCenter - - - TopCenter - - - Pick where you want settings and profiles to be saved - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - For those who prefer a portable program Note: this option does not work if in an admin folder w/o UAC - - - 4, 0, 4, 0 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TopCenter - - - $this - - - 8 - - - 375, 0 - - - 1 - - - 10 - - - Program Folder - - - bnAppdataFolder - - - False - - - 4, 0, 4, 0 - - - label3 - - - 296, 78 + + 159, 13 10 - - SaveWhere + + Multiple save locations detected - - DS4Windows - @Invariant - - 7 - - - lbPickWhere - - - 10 - - - 275, 110 - - - $this - - - 236, 85 - - - $this - - - 4, 4, 4, 4 - - - True - - - System.Windows.Forms.Label, 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 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lbMultiSaves - - - 519, 167 + + TopCenter False - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + lbMultiSaves - - 1, 41 - - - 187, 28 - - - 4 - - - 139, 38 - - + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Appdata + + $this + + + 2 + + + True + + + 281, 0 + + + 106, 30 + + + 11 + + + Don't Delete the +other settings yet + + + False + + + cBDeleteOther + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 True - - zh-Hans - + + 6, 13 + + + 389, 136 + + + 4, 4, 4, 4 + + + CenterScreen + + + DS4Windows + + + SaveWhere + + + 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/SaveWhere.zh-Hans.resx b/DS4Windows/DS4Forms/SaveWhere.zh-Hans.resx index 23c3793..33f6760 100644 --- a/DS4Windows/DS4Forms/SaveWhere.zh-Hans.resx +++ b/DS4Windows/DS4Forms/SaveWhere.zh-Hans.resx @@ -117,35 +117,78 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 206, 89 + + + 177, 69 + 如果使用安装包安装,配置文件将保存至 %appdata%/ds4tool + + 5, 89 + + + 195, 69 + 请注意:如果在UAC保护的文件夹内运行本程序,这个选项不会生效。 + + 222, 63 + + + 140, 23 + 系统文件夹 + + 32, 63 + + + 140, 23 + 程序所在文件夹 + + 1, 33 + + + 386, 27 + 选择将要保存配置文件的位置。 - + + 9, 8 + - 145, 17 + 147, 13 检测到多个配置文件目录。 - 349, 6 + 262, 5 - 167, 21 + 166, 17 目前请不要删除其它设置。 + + 6, 13 + + + 389, 136 + + + + 4, 4, 4, 4 + \ No newline at end of file diff --git a/DS4Windows/DS4Forms/SpecActions.es.resx b/DS4Windows/DS4Forms/SpecActions.es.resx index 37f5963..e1c2265 100644 --- a/DS4Windows/DS4Forms/SpecActions.es.resx +++ b/DS4Windows/DS4Forms/SpecActions.es.resx @@ -139,7 +139,7 @@ Grabar una macro - Lanzar un programa + Abrir un programa Cargar un perfil @@ -151,37 +151,37 @@ Comprobar batería - a través del barra de luz + Por medio de la barra de luz Escanear del código - via notificación + Por medio de notificación - Oprimiendo trigger unload + Presionar gatillo de descarga - Soltando el trigger unload + Soltar gatillo de descarga Gatillo - Liberar Gatillo + Soltar Gatillo Argumentos - Oprimir el gatillo doblemente + Presionar el gatillo doblemente - Dejar oprimido el gatillo + Dejar presionado el gatillo - Dejar oprimido por + Dejar presionado por Nombre @@ -190,9 +190,9 @@ segundos - Oprimir el gatillo + Presionar el gatillo - Desligar tecla por + Desactivar tecla por \ No newline at end of file diff --git a/DS4Windows/DS4Forms/WelcomeDialog.cs b/DS4Windows/DS4Forms/WelcomeDialog.cs index 9ede6f9..bbad1af 100644 --- a/DS4Windows/DS4Forms/WelcomeDialog.cs +++ b/DS4Windows/DS4Forms/WelcomeDialog.cs @@ -1,30 +1,31 @@ using System; -using System.Collections.Generic; using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; using System.Windows.Forms; using System.Net; using System.IO; using System.IO.Compression; using System.Diagnostics; -using System.Runtime.InteropServices; -using System.Security.Principal; -using System.Security.Permissions; -using System.Reflection; +//using NonFormTimer = System.Threading.Timer; +using NonFormTimer = System.Timers.Timer; +using System.Threading.Tasks; +using static DS4Windows.Global; namespace DS4Windows { public partial class WelcomeDialog : Form { - public WelcomeDialog() + public WelcomeDialog(bool loadConfig=false) { + if (loadConfig) + { + Global.FindConfigLocation(); + Global.Load(); + Global.SetCulture(Global.UseLang); + } + InitializeComponent(); Icon = Properties.Resources.DS4; - } private void bnFinish_Click(object sender, EventArgs e) @@ -42,7 +43,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; @@ -54,7 +55,6 @@ namespace DS4Windows bnStep1.Text = Properties.Resources.Downloading.Replace("*number*", e.ProgressPercentage.ToString()); } - string exepath = Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName; private void wb_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e) { bnStep1.Text = Properties.Resources.OpeningInstaller; @@ -80,10 +80,15 @@ namespace DS4Windows } catch { Process.Start(exepath + "\\Virtual Bus Driver"); } - Timer timer = new Timer(); + /*Timer timer = new Timer(); timer.Start(); timer.Tick += timer_Tick; + */ + NonFormTimer timer = new NonFormTimer(); + timer.Elapsed += timer_Tick; + timer.Start(); } + bool waitForFile; DateTime waitFileCheck; private void timer_Tick(object sender, EventArgs e) @@ -97,24 +102,27 @@ namespace DS4Windows waitFileCheck = DateTime.UtcNow; return; } + if (waitForFile && waitFileCheck + TimeSpan.FromMinutes(2) < DateTime.UtcNow) { - bnStep1.Text = Properties.Resources.InstallFailed; Process.Start(exepath + "\\Virtual Bus Driver"); File.Delete(exepath + "\\VBus.zip"); - ((Timer)sender).Stop(); + ((NonFormTimer)sender).Stop(); + this.BeginInvoke((Action)(() => { bnStep1.Text = Properties.Resources.InstallFailed; }), null); return; } else if (waitForFile) return; + string log = File.ReadAllText(exepath + "\\ScpDriver.log"); if (log.Contains("Install Succeeded")) - bnStep1.Text = Properties.Resources.InstallComplete; + this.BeginInvoke((Action)(() => { bnStep1.Text = Properties.Resources.InstallComplete; })); else { - bnStep1.Text = Properties.Resources.InstallFailed; + this.BeginInvoke((Action)(() => { bnStep1.Text = Properties.Resources.InstallFailed; })); Process.Start(exepath + "\\Virtual Bus Driver"); } + try { File.Delete(exepath + "\\ScpDriver.exe"); @@ -123,15 +131,15 @@ namespace DS4Windows Directory.Delete(exepath + "\\DIFxAPI", true); } catch { } + File.Delete(exepath + "\\VBus.zip"); - ((Timer)sender).Stop(); + ((NonFormTimer)sender).Stop(); } } - 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/DS4Forms/WelcomeDialog.es.resx b/DS4Windows/DS4Forms/WelcomeDialog.es.resx index 8562bf7..b0d80d6 100644 --- a/DS4Windows/DS4Forms/WelcomeDialog.es.resx +++ b/DS4Windows/DS4Forms/WelcomeDialog.es.resx @@ -121,20 +121,20 @@ Paso 1: Instalar el Driver DS4 - Paso 2: Si usas Windows 7 o inferior, instala el Driver 360 + Paso 2: Si usas Windows 7 o inferior, instala el Driver de Xbox 360 135, 13 - Configuracion de Bluetooth + Configuración del Bluetooth Si esta ventana reaparece despues de instalar, necesitas reiniciar tu PC o esperar 10-15 minutos a que Windows reconozca el driver - Si usas un Controlador X360 en esta PC, puedes omitir esto + Si usas un Controlador de Xbox 360 en esta PC, puedes omitir esto Finalizado @@ -143,12 +143,12 @@ Bienvenido a DS4Windows - Para configurar el bluetooth (opcional): Mantenga presionado el botón PS y Share durante 3 segundos. La luz del controlador comenzará a parpadear. + Para configurar el bluetooth (opcional): Mantenga presionado el botón PS y Share durante 3 segundos. La luz del control comenzará a parpadear. - Paso 3: Para conectar el control DS4 por medio de cable usb sólo debe conectar el cable microusb en el DS4 y el usb común en la PC. + Paso 3: Para conectar el control DS4 por medio de un cable USB sólo debe conectar el cable micro USB en el DS4 y el USB común en la PC. - Una vez que esté parpadeando, vaya a Configuración de Bluetooth y conéctese al "Wireless Controller". Si le pide un código de emparejamiento, utilice el "0000". Una vez emparejado, el controlador estará listo. ¡A divertirse! + Una vez que esté parpadeando, vaya a Configuración del Bluetooth y conéctese al "Wireless Controller". Si le pide un código de emparejamiento, utilice el "0000". Una vez emparejado, el control estará listo. ¡A divertirse! \ No newline at end of file diff --git a/DS4Windows/DS4Forms/WelcomeDialog.resx b/DS4Windows/DS4Forms/WelcomeDialog.resx index 2b8dfd8..169bb5d 100644 --- a/DS4Windows/DS4Forms/WelcomeDialog.resx +++ b/DS4Windows/DS4Forms/WelcomeDialog.resx @@ -127,56 +127,59 @@ 0 - - - 4, 0, 4, 0 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 146, 544 + + TopCenter + 390, 80 + Bottom + + Top, Left, Right + 3 4, 4, 4, 4 - - 394, 579 + + label1 8 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + 5, 5, 5, 5 - - label1 + + Bottom, Left, Right + + + Bottom - - Step 2: If on Windows 7 or below, Install 360 Driver - - - 5 - - - 324, 29 + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 4, 4, 4, 4 - - $this - labelBluetooth2 @@ -186,13 +189,8 @@ $this - - To set up bluetooth (optional): -Hold the PS Button and Share for 3 seconds -The lightbar will begin to double flash - - - TopCenter + + 120, 120 pictureBox1 @@ -200,23 +198,23 @@ The lightbar will begin to double flash Top, Left, Right - - 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 - - TopCenter + + 2 391, 49 - - 390, 49 + + $this - - TopCenter + + bnFinish - - 1, 223 + + 4 2 @@ -224,8 +222,8 @@ The lightbar will begin to double flash $this - - Bottom + + linkBluetoothSettings 3 @@ -239,8 +237,8 @@ The lightbar will begin to double flash StretchImage - - bnFinish + + $this 0 @@ -248,18 +246,15 @@ The lightbar will begin to double flash 1 - - 3 + + 1, 40 - - 120, 120 + + 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 - - 2 - 45, 298 @@ -275,36 +270,33 @@ The lightbar will begin to double flash System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Bottom + + 5 System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Step 1: Install the DS4 Driver + 94, 29 - - 0, 132 + + CenterScreen - - 3 + + bnStep1 + + + TopCenter 4, 4, 4, 4 - - 211, 466 - 1, 466 - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 4 @@ -314,17 +306,14 @@ The lightbar will begin to double flash 4, 0, 4, 0 - - WelcomeDialog - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 4, 0, 4, 0 306, 165 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Bottom System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -338,35 +327,32 @@ The lightbar will begin to double flash $this - - Top, Left, Right + + 324, 29 - - TopCenter + + 4, 0, 4, 0 + + + labelUSB 36, 101 - - linkBluetoothSettings - - - CenterScreen - 4, 0, 4, 0 - - 4 - - - 1 + + TopCenter label2 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 390, 49 + + + TopCenter 392, 57 @@ -374,15 +360,15 @@ The lightbar will begin to double flash 123, 17 + + WelcomeDialog + + + 1, 223 + 6 - - Step 1: Install the DS4 Driver - - - 1, 40 - Welcome to DS4Windows @@ -398,31 +384,33 @@ Once paired, you're ready. Have fun! 394, 28 - - $this + + To set up bluetooth (optional): +Hold the PS Button and Share for 3 seconds +The lightbar will begin to double flash True - - Top, Left, Right + + 0, 132 button2 - - Bottom, Left, Right + + 3 - - bnStep1 + + 211, 466 Step 3: Connecting the DualShock 4 controller To set up wired/usb: Simply plug a micro usb into your PC and DualShock 4 - - 4, 0, 4, 0 + + Step 2: If on Windows 7 or below, Install 360 Driver $this @@ -436,26 +424,38 @@ Simply plug a micro usb into your PC and DualShock 4 0, 162 + + 3 + 4, 4, 4, 4 - - labelUSB + + 1 + + + 394, 579 324, 29 - - 4, 0, 4, 0 + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Top, Left, Right + + TopCenter + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - TopCenter + + Top, Left, Right + + + 4, 0, 4, 0 Bluetooth Settings @@ -466,7 +466,4 @@ Simply plug a micro usb into your PC and DualShock 4 True - - uk - \ No newline at end of file diff --git a/DS4Windows/DS4Forms/WelcomeDialog.uk.resx b/DS4Windows/DS4Forms/WelcomeDialog.uk.resx index 0b44b46..7bbd8e1 100644 --- a/DS4Windows/DS4Forms/WelcomeDialog.uk.resx +++ b/DS4Windows/DS4Forms/WelcomeDialog.uk.resx @@ -117,18 +117,36 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 29, 8 + + + 259, 23 + Крок 1: Встановити драйвер DS4 + + 29, 81 + + + 259, 23 + Крок 2: Для Windows 7 та попередніх - встановіть драйвер 360 - - 45, 307 + 36, 246 + + + 245, 132 - 1, 242 + 1, 194 + + + 312, 39 Для налаштування Bluetooth (за бажанням): @@ -136,7 +154,10 @@ Світлопанель мерехтітиме подвійним спалахом - 0, 181 + 0, 145 + + + 313, 39 Крок 3: Підключення контролеру DualShock 4 @@ -144,10 +165,10 @@ Просто підключіть micro usb до вашого ПК та DualShock 4 - 1, 479 + 1, 383 - 390, 89 + 312, 71 Як тільки замерехтить, йдіть до налаштувань вашого Bluetooth @@ -155,32 +176,51 @@ Якщо спитає, введіть код пари "0000" При створенні пари, ви готові. Розважайтеся! + + 1, 32 + + + 314, 46 + Якщо це вікно з'явилося знову після встановлення, тоді вам потрібно перезавантажити ПК, або почекати 10-15 хв поки Windows помітить драйвер + + 0, 106 + - 394, 38 + 315, 30 Якщи ви користуєтесь 360 контролером на цьому ПК, можете пропустити - 146, 573 + 117, 458 + + + 75, 23 Завершити - 211, 495 + 169, 396 - 170, 17 + 129, 13 Налаштування Bluetooth + + 96, 96 + - 394, 608 + 315, 486 + + + + 4, 4, 4, 4 Ласкаво просимо до DS4Windows diff --git a/DS4Windows/DS4Forms/WinProgs.Designer.cs b/DS4Windows/DS4Forms/WinProgs.Designer.cs index 4cf71c0..97cfee4 100644 --- a/DS4Windows/DS4Forms/WinProgs.Designer.cs +++ b/DS4Windows/DS4Forms/WinProgs.Designer.cs @@ -191,7 +191,6 @@ // // cMSPrograms // - resources.ApplyResources(this.cMSPrograms, "cMSPrograms"); this.cMSPrograms.ImageScalingSize = new System.Drawing.Size(20, 20); this.cMSPrograms.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.addProgramsFromStartMenuToolStripMenuItem, @@ -201,35 +200,36 @@ this.browseForOtherProgramsToolStripMenuItem}); this.cMSPrograms.Name = "contextMenuStrip1"; this.cMSPrograms.ShowImageMargin = false; + resources.ApplyResources(this.cMSPrograms, "cMSPrograms"); // // addProgramsFromStartMenuToolStripMenuItem // - resources.ApplyResources(this.addProgramsFromStartMenuToolStripMenuItem, "addProgramsFromStartMenuToolStripMenuItem"); this.addProgramsFromStartMenuToolStripMenuItem.Name = "addProgramsFromStartMenuToolStripMenuItem"; + resources.ApplyResources(this.addProgramsFromStartMenuToolStripMenuItem, "addProgramsFromStartMenuToolStripMenuItem"); this.addProgramsFromStartMenuToolStripMenuItem.Click += new System.EventHandler(this.addProgramsFromStartMenuToolStripMenuItem_Click); // // addSteamGamesToolStripMenuItem // - resources.ApplyResources(this.addSteamGamesToolStripMenuItem, "addSteamGamesToolStripMenuItem"); this.addSteamGamesToolStripMenuItem.Name = "addSteamGamesToolStripMenuItem"; + resources.ApplyResources(this.addSteamGamesToolStripMenuItem, "addSteamGamesToolStripMenuItem"); this.addSteamGamesToolStripMenuItem.Click += new System.EventHandler(this.addSteamGamesToolStripMenuItem_Click); // // addOriginGamesToolStripMenuItem // - resources.ApplyResources(this.addOriginGamesToolStripMenuItem, "addOriginGamesToolStripMenuItem"); this.addOriginGamesToolStripMenuItem.Name = "addOriginGamesToolStripMenuItem"; + resources.ApplyResources(this.addOriginGamesToolStripMenuItem, "addOriginGamesToolStripMenuItem"); this.addOriginGamesToolStripMenuItem.Click += new System.EventHandler(this.addOriginGamesToolStripMenuItem_Click); // // addDirectoryToolStripMenuItem // - resources.ApplyResources(this.addDirectoryToolStripMenuItem, "addDirectoryToolStripMenuItem"); this.addDirectoryToolStripMenuItem.Name = "addDirectoryToolStripMenuItem"; + resources.ApplyResources(this.addDirectoryToolStripMenuItem, "addDirectoryToolStripMenuItem"); this.addDirectoryToolStripMenuItem.Click += new System.EventHandler(this.addDirectoryToolStripMenuItem_Click); // // browseForOtherProgramsToolStripMenuItem // - resources.ApplyResources(this.browseForOtherProgramsToolStripMenuItem, "browseForOtherProgramsToolStripMenuItem"); this.browseForOtherProgramsToolStripMenuItem.Name = "browseForOtherProgramsToolStripMenuItem"; + resources.ApplyResources(this.browseForOtherProgramsToolStripMenuItem, "browseForOtherProgramsToolStripMenuItem"); this.browseForOtherProgramsToolStripMenuItem.Click += new System.EventHandler(this.browseForOtherProgramsToolStripMenuItem_Click); // // cBTurnOffDS4W @@ -243,7 +243,7 @@ // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.White; + this.BackColor = System.Drawing.SystemColors.Control; this.Controls.Add(this.cBTurnOffDS4W); this.Controls.Add(this.pBProfilesTip); this.Controls.Add(this.bnHideUnchecked); diff --git a/DS4Windows/DS4Forms/WinProgs.cs b/DS4Windows/DS4Forms/WinProgs.cs index 9d19a14..13f4084 100644 --- a/DS4Windows/DS4Forms/WinProgs.cs +++ b/DS4Windows/DS4Forms/WinProgs.cs @@ -1,20 +1,15 @@ -using Microsoft.Win32; -using System; +using System; using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Drawing; -using System.Linq; using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; using System.IO; -using System.Net; -using System.Text.RegularExpressions; using System.Xml; using System.Runtime.InteropServices; -//using Ookii.Dialogs; +using System.Threading; +using System.Diagnostics; +using System.Threading.Tasks; namespace DS4Windows { @@ -30,6 +25,10 @@ namespace DS4Windows List programpaths = new List(); List lodsf = new List(); bool appsloaded = false; + const string steamCommx86Loc = @"C:\Program Files (x86)\Steam\steamapps\common"; + const string steamCommLoc = @"C:\Program Files\Steam\steamapps\common"; + const string originx86Loc = @"C:\Program Files (x86)\Origin Games"; + const string originLoc = @"C:\Program Files\Origin Games"; public WinProgs(string[] oc, DS4Form main) { @@ -43,28 +42,30 @@ namespace DS4Windows cbs[i].Items.Add(Properties.Resources.noneProfile); cbs[i].SelectedIndex = cbs[i].Items.Count - 1; } + if (!File.Exists(Global.appdatapath + @"\Auto Profiles.xml")) Create(); + LoadP(); - if (Directory.Exists(@"C:\Program Files (x86)\Steam\steamapps\common")) - steamgamesdir = @"C:\Program Files (x86)\Steam\steamapps\common"; - else if (Directory.Exists(@"C:\Program Files\Steam\steamapps\common")) - steamgamesdir = @"C:\Program Files\Steam\steamapps\common"; + if (Directory.Exists(steamCommx86Loc)) + steamgamesdir = steamCommx86Loc; + else if (Directory.Exists(steamCommLoc)) + steamgamesdir = steamCommLoc; else cMSPrograms.Items.Remove(addSteamGamesToolStripMenuItem); - if (Directory.Exists(@"C:\Program Files (x86)\Origin Games")) - origingamesdir = @"C:\Program Files (x86)\Origin Games"; - else if (Directory.Exists(@"C:\Program Files\Origin Games")) - origingamesdir = @"C:\Program Files\Origin Games"; + if (Directory.Exists(originx86Loc)) + origingamesdir = originx86Loc; + else if (Directory.Exists(originLoc)) + origingamesdir = originLoc; else cMSPrograms.Items.Remove(addOriginGamesToolStripMenuItem); } public bool Create() { - Boolean Saved = true; + bool Saved = true; try { @@ -101,39 +102,36 @@ namespace DS4Windows programpaths.Clear(); if (!File.Exists(Global.appdatapath + "\\Auto Profiles.xml")) return; + doc.Load(Global.appdatapath + "\\Auto Profiles.xml"); XmlNodeList programslist = doc.SelectNodes("Programs/Program"); foreach (XmlNode x in programslist) programpaths.Add(x.Attributes["path"].Value); + + lVPrograms.BeginUpdate(); + int index = 0; foreach (string st in programpaths) { - if (File.Exists(st)) + if (!string.IsNullOrEmpty(st)) { - int index = programpaths.IndexOf(st); - if (string.Empty != st) + if (File.Exists(st)) { iLIcons.Images.Add(Icon.ExtractAssociatedIcon(st)); - ListViewItem lvi = new ListViewItem(Path.GetFileNameWithoutExtension(st), index); - lvi.SubItems.Add(st); - lvi.Checked = true; - lvi.ToolTipText = st; - lVPrograms.Items.Add(lvi); } + + ListViewItem lvi = new ListViewItem(Path.GetFileNameWithoutExtension(st), index); + lvi.Checked = true; + lvi.ToolTipText = st; + lvi.SubItems.Add(st); + lVPrograms.Items.Add(lvi); } - else - { - RemoveP(st, false, false); - } + + index++; } + + lVPrograms.EndUpdate(); } - - private void bnLoadSteam_Click(object sender, EventArgs e) - { - - } - - private void GetApps(string path) { lodsf.Clear(); @@ -147,6 +145,7 @@ namespace DS4Windows } catch { } } + appsloaded = true; } @@ -162,31 +161,43 @@ namespace DS4Windows } catch { } } + return lods; } + private void GetShortcuts(string path) { lodsf.Clear(); lodsf.AddRange(Directory.GetFiles(path, "*.lnk", SearchOption.AllDirectories)); - lodsf.AddRange(Directory.GetFiles(@"C:\ProgramData\Microsoft\Windows\Start Menu\Programs", "*.lnk", SearchOption.AllDirectories)); + lodsf.AddRange(Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.CommonStartMenu) + "\\Programs", "*.lnk", SearchOption.AllDirectories)); for (int i = 0; i < lodsf.Count; i++) lodsf[i] = GetTargetPath(lodsf[i]); + appsloaded = true; } - void appstimer_Tick(object sender, EventArgs e) + void AddLoadedApps() { if (appsloaded) { bnAddPrograms.Text = Properties.Resources.AddingToList; for (int i = lodsf.Count - 1; i >= 0; i--) + { if (lodsf[i].Contains("etup") || lodsf[i].Contains("dotnet") || lodsf[i].Contains("SETUP") || lodsf[i].Contains("edist") || lodsf[i].Contains("nstall") || String.IsNullOrEmpty(lodsf[i])) lodsf.RemoveAt(i); + } + for (int i = lodsf.Count - 1; i >= 0; i--) + { for (int j = programpaths.Count - 1; j >= 0; j--) + { if (lodsf[i].ToLower().Replace('/', '\\') == programpaths[j].ToLower().Replace('/', '\\')) lodsf.RemoveAt(i); + } + } + + lVPrograms.BeginUpdate(); foreach (string st in lodsf) { if (File.Exists(st)) @@ -199,14 +210,14 @@ namespace DS4Windows lVPrograms.Items.Add(lvi); } } + lVPrograms.EndUpdate(); + bnAddPrograms.Text = Properties.Resources.AddPrograms; bnAddPrograms.Enabled = true; appsloaded = false; - ((Timer)sender).Stop(); } } - public void Save(string name) { m_Xdoc.Load(m_Profile); @@ -226,16 +237,20 @@ namespace DS4Windows el.AppendChild(m_Xdoc.CreateElement("Controller3")).InnerText = cBProfile3.Text; el.AppendChild(m_Xdoc.CreateElement("Controller4")).InnerText = cBProfile4.Text; el.AppendChild(m_Xdoc.CreateElement("TurnOff")).InnerText = cBTurnOffDS4W.Checked.ToString(); + try { XmlNode oldxmlprocess = m_Xdoc.SelectSingleNode("/Programs/Program[@path=\"" + lBProgramPath.Text + "\"]"); Node.ReplaceChild(el, oldxmlprocess); } catch { Node.AppendChild(el); } + m_Xdoc.AppendChild(Node); m_Xdoc.Save(m_Profile); + if (lVPrograms.SelectedItems.Count > 0) lVPrograms.SelectedItems[0].Checked = true; + form.LoadP(); } @@ -251,7 +266,9 @@ namespace DS4Windows { Item = doc.SelectSingleNode("/Programs/Program[@path=\"" + name + "\"]" + "/Controller" + (i + 1)); if (Item != null) + { for (int j = 0; j < cbs[i].Items.Count; j++) + { if (cbs[i].Items[j].ToString() == Item.InnerText) { cbs[i].SelectedIndex = j; @@ -260,9 +277,12 @@ namespace DS4Windows } else cbs[i].SelectedIndex = cbs[i].Items.Count - 1; + } + } else cbs[i].SelectedIndex = cbs[i].Items.Count - 1; } + Item = doc.SelectSingleNode("/Programs/Program[@path=\"" + name + "\"]" + "/TurnOff"); bool turnOff; if (Item != null && bool.TryParse(Item.InnerText, out turnOff)) @@ -276,29 +296,30 @@ namespace DS4Windows { for (int i = 0; i < 4; i++) cbs[i].SelectedIndex = cbs[i].Items.Count - 1; + cBTurnOffDS4W.Checked = false; bnSave.Enabled = false; } } - public void RemoveP(string name, bool uncheck, bool reload = true) + public void RemoveP(string name, bool uncheck) { - XmlDocument doc = new XmlDocument(); doc.Load(m_Profile); XmlNode Node = doc.SelectSingleNode("Programs"); XmlNode Item = doc.SelectSingleNode("/Programs/Program[@path=\"" + name + "\"]"); if (Item != null) Node.RemoveChild(Item); + doc.AppendChild(Node); doc.Save(m_Profile); if (lVPrograms.SelectedItems.Count > 0 && uncheck) lVPrograms.SelectedItems[0].Checked = false; + for (int i = 0; i < 4; i++) cbs[i].SelectedIndex = cbs[i].Items.Count - 1; + bnSave.Enabled = false; - if (reload) - form.LoadP(); } private void CBProfile_IndexChanged(object sender, EventArgs e) @@ -306,6 +327,7 @@ namespace DS4Windows int last = cbs[0].Items.Count - 1; if (lBProgramPath.Text != string.Empty) bnSave.Enabled = true; + if (cbs[0].SelectedIndex == last && cbs[1].SelectedIndex == last && cbs[2].SelectedIndex == last && cbs[3].SelectedIndex == last && !cBTurnOffDS4W.Checked) bnSave.Enabled = false; @@ -315,6 +337,7 @@ namespace DS4Windows { if (lBProgramPath.Text != "") Save(lBProgramPath.Text); + bnSave.Enabled = false; } @@ -328,8 +351,10 @@ namespace DS4Windows if (lBProgramPath.Text != "") LoadP(lBProgramPath.Text); else + { for (int i = 0; i < 4; i++) cbs[i].SelectedIndex = cbs[i].Items.Count - 1; + } } private void bnDelete_Click(object sender, EventArgs e) @@ -359,41 +384,24 @@ namespace DS4Windows form.RefreshAutoProfilesPage(); } - - private void addSteamGamesToolStripMenuItem_Click(object sender, EventArgs e) + private async void addSteamGamesToolStripMenuItem_Click(object sender, EventArgs e) { - try - { - var AppCollectionThread = new System.Threading.Thread(() => GetApps(steamgamesdir)); - AppCollectionThread.IsBackground = true; - AppCollectionThread.Start(); - } - catch { } bnAddPrograms.Text = Properties.Resources.Loading; bnAddPrograms.Enabled = false; cMSPrograms.Items.Remove(addSteamGamesToolStripMenuItem); - Timer appstimer = new Timer(); - appstimer.Start(); - appstimer.Tick += appstimer_Tick; + await Task.Run(() => GetApps(steamgamesdir)); + AddLoadedApps(); } - private void addDirectoryToolStripMenuItem_Click(object sender, EventArgs e) + private async void addDirectoryToolStripMenuItem_Click(object sender, EventArgs e) { FolderBrowserDialog fbd = new FolderBrowserDialog(); if (fbd.ShowDialog() == DialogResult.OK) { - try - { - var AppCollectionThread = new System.Threading.Thread(() => GetApps(fbd.SelectedPath)); - AppCollectionThread.IsBackground = true; - AppCollectionThread.Start(); - } - catch { } bnAddPrograms.Text = Properties.Resources.Loading; bnAddPrograms.Enabled = false; - Timer appstimer = new Timer(); - appstimer.Start(); - appstimer.Tick += appstimer_Tick; + await Task.Run(() => GetApps(fbd.SelectedPath)); + AddLoadedApps(); } } @@ -406,6 +414,7 @@ namespace DS4Windows { file = GetTargetPath(file); } + lBProgramPath.Text = file; iLIcons.Images.Add(Icon.ExtractAssociatedIcon(file)); ListViewItem lvi = new ListViewItem(Path.GetFileNameWithoutExtension(file), lVPrograms.Items.Count); @@ -414,39 +423,22 @@ namespace DS4Windows } } - private void addOriginGamesToolStripMenuItem_Click(object sender, EventArgs e) + private async void addOriginGamesToolStripMenuItem_Click(object sender, EventArgs e) { - try - { - var AppCollectionThread = new System.Threading.Thread(() => GetApps(origingamesdir)); - AppCollectionThread.IsBackground = true; - AppCollectionThread.Start(); - } - catch { } bnAddPrograms.Text = Properties.Resources.Loading; bnAddPrograms.Enabled = false; cMSPrograms.Items.Remove(addOriginGamesToolStripMenuItem); - Timer appstimer = new Timer(); - appstimer.Start(); - appstimer.Tick += appstimer_Tick; + await Task.Run(() => GetApps(origingamesdir)); + AddLoadedApps(); } - private void addProgramsFromStartMenuToolStripMenuItem_Click(object sender, EventArgs e) + private async void addProgramsFromStartMenuToolStripMenuItem_Click(object sender, EventArgs e) { - //MessageBox.Show(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu) + "\\Programs"); - try - { - var AppCollectionThread = new System.Threading.Thread(() => GetShortcuts(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu) + "\\Programs")); - AppCollectionThread.IsBackground = true; - AppCollectionThread.Start(); - } - catch { } bnAddPrograms.Text = Properties.Resources.Loading; bnAddPrograms.Enabled = false; cMSPrograms.Items.Remove(addProgramsFromStartMenuToolStripMenuItem); - Timer appstimer = new Timer(); - appstimer.Start(); - appstimer.Tick += appstimer_Tick; + await Task.Run(() => GetShortcuts(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu) + "\\Programs")); + AddLoadedApps(); } public static string GetTargetPath(string filePath) @@ -486,36 +478,52 @@ namespace DS4Windows public static string ResolveShortcut(string filePath) { - // IWshRuntimeLibrary is in the COM library "Windows Script Host Object Model" - IWshRuntimeLibrary.WshShell shell = new IWshRuntimeLibrary.WshShell(); + Type t = Type.GetTypeFromCLSID(new Guid("72C24DD5-D70A-438B-8A42-98424B88AFB8")); // Windows Script Host Shell Object + dynamic shell = Activator.CreateInstance(t); + string result; try { - IWshRuntimeLibrary.IWshShortcut shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(filePath); - return shortcut.TargetPath; + var shortcut = shell.CreateShortcut(filePath); + result = shortcut.TargetPath; + Marshal.FinalReleaseComObject(shortcut); } catch (COMException) { // A COMException is thrown if the file is not a valid shortcut (.lnk) file - return null; + result = null; } + finally + { + Marshal.FinalReleaseComObject(shell); + } + + return result; } public static string ResolveShortcutAndArgument(string filePath) { - // IWshRuntimeLibrary is in the COM library "Windows Script Host Object Model" - IWshRuntimeLibrary.WshShell shell = new IWshRuntimeLibrary.WshShell(); + Type t = Type.GetTypeFromCLSID(new Guid("72C24DD5-D70A-438B-8A42-98424B88AFB8")); // Windows Script Host Shell Object + dynamic shell = Activator.CreateInstance(t); + string result; try { - IWshRuntimeLibrary.IWshShortcut shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(filePath); - return shortcut.TargetPath + " " + shortcut.Arguments; + var shortcut = shell.CreateShortcut(filePath); + result = shortcut.TargetPath + " " + shortcut.Arguments; + Marshal.FinalReleaseComObject(shortcut); } catch (COMException) { // A COMException is thrown if the file is not a valid shortcut (.lnk) file - return null; + result = null; } + finally + { + Marshal.FinalReleaseComObject(shell); + } + + return result; } private void cBTurnOffDS4W_CheckedChanged(object sender, EventArgs e) @@ -545,6 +553,7 @@ namespace DS4Windows } } } + class NativeMethods2 { [DllImport("msi.dll", CharSet = CharSet.Auto)] diff --git a/DS4Windows/DS4Forms/WinProgs.de-DE.resx b/DS4Windows/DS4Forms/WinProgs.de-DE.resx index 8b7acef..604908f 100644 --- a/DS4Windows/DS4Forms/WinProgs.de-DE.resx +++ b/DS4Windows/DS4Forms/WinProgs.de-DE.resx @@ -118,26 +118,101 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 5, 2 + - 130, 23 + 98, 19 Programme hinzufügen + + 519, 195 + + + 205, 18 + + + 609, 28 + + + 121, 21 + + + 609, 55 + + + 121, 21 + + + 609, 82 + + + 121, 21 + + + 609, 109 + + + 121, 21 + + + 663, 2 + + + 67, 23 + Speichern + + 516, 31 + + + 60, 13 + + + 516, 58 + + + 60, 13 + + + 516, 85 + + + 60, 13 + + + 516, 112 + + + 60, 13 + + + 590, 2 + + + 67, 23 + Entfernen Verzeichnis + + 5, 28 + + + 505, 190 + - 818, 167 + 614, 136 - 147, 17 + 110, 13 Profile hier auswählen @@ -147,63 +222,66 @@ NoControl - 141, 2 + 106, 2 - 172, 23 + 129, 19 Abgewählte verstecken - 275, 26 + 229, 22 Startmenü Programm hinzufügen - 275, 26 + 229, 22 Steam Spiel hinzufügen - 275, 26 + 229, 22 Origin Spiel hinzufügen - 275, 26 + 229, 22 Verzeichnis Hinzufügen - 275, 26 + 229, 22 Suche nach anderen Programmen - 276, 134 + 230, 114 + + + 514, 152 + + + 2, 2, 2, 2 + + + 215, 41 DS4Windows temporär ausschalten - - Controller 1 + + 6, 13 - - Controller 2 + + 736, 222 - - Controller 3 - - - Controller 4 - - - Name + + 4, 4, 4, 4 \ No newline at end of file diff --git a/DS4Windows/DS4Forms/WinProgs.es.resx b/DS4Windows/DS4Forms/WinProgs.es.resx index 313df40..4ab1ed9 100644 --- a/DS4Windows/DS4Forms/WinProgs.es.resx +++ b/DS4Windows/DS4Forms/WinProgs.es.resx @@ -128,25 +128,25 @@ 70, 13 - Controlador 1 + Control 1 70, 13 - Controlador 2 + Control 2 70, 13 - Controlador 3 + Control 3 70, 13 - Controlador 4 + Control 4 Quitar diff --git a/DS4Windows/DS4Forms/WinProgs.resx b/DS4Windows/DS4Forms/WinProgs.resx index 7682ceb..c983c46 100644 --- a/DS4Windows/DS4Forms/WinProgs.resx +++ b/DS4Windows/DS4Forms/WinProgs.resx @@ -117,625 +117,580 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 13 - - - 232, 26 - - - 14 - - - $this - - - 81, 17 - - - browseForOtherProgramsToolStripMenuItem - - - $this - - - - 5, 5, 5, 5 - - - Top, Right - - - 5 - - - 233, 134 - - - Controller 4 - - - 4, 0, 4, 0 - - - 125, 28 - - - System.Windows.Forms.ComboBox, 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 - - - 4, 0, 4, 0 - - - $this - - - Browse for Other Programs - - - 9 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - addDirectoryToolStripMenuItem - - - Add Steam Games - - - Save - - - 16, 16 - - - $this - - - 4, 0, 4, 0 - - - Name - - - 688, 38 - - - 6 - - - 692, 240 - - - Turn off DS4Windows Temporarily - - - Add Start Menu Programs - - - Top, Right - - - 829, 167 - - - 232, 26 - - - True - - - 884, 2 - - - $this - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 118, 17 - - - 4, 0, 4, 0 - - 7, 2 - - - System.Windows.Forms.OpenFileDialog, 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 - - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 8 - - - 7 - - - System.Windows.Forms.Button, 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 - - - iLIcons - - - 160, 24 - - - PathHeader - - - Add Origin Games - - - 3 - - - 232, 26 - - - System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Top, Right - - - Programs|*.exe|Shortcuts|*.lnk - - - 7 - - - 81, 17 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 688, 138 - - - 11 - - - Top, Right - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 160, 24 - - - $this - - - Top, Right - - - 232, 26 - - - 4, 4, 4, 4 - - - 8 - - - addProgramsFromStartMenuToolStripMenuItem - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 672, 233 - - - nameHeader - - - 4, 4, 4, 4 - - - 1 - - - 4, 4, 4, 4 - - - cBProfile3 - - - 4, 4, 4, 4 - - - System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - $this - - - lBController1 - - - WinProgs - - - lBProgramPath - - - addSteamGamesToolStripMenuItem - - - cMSPrograms - - - 2 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 132, 2 - - - 6 - - - 273, 22 - - - 7 - - - 4, 0, 4, 0 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Add Directory - - - cBProfile2 - - - lBController4 - - - openProgram - - - $this - - - Top, Right - - - 7, 34 - - - $this - - - 81, 17 - - - Pick Profiles here - - - 13 - - - 15 - - - Top, Right - - - Path - - - True - - - 16 + 5, 2 - 117, 28 + 88, 23 - - bnSave - - - 160, 24 - - - addOriginGamesToolStripMenuItem - - - 140 - - - bnDelete - - - Auto-Profiles - - - pBProfilesTip - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - 89, 28 - - - 812, 101 - - - False - - - 812, 68 - - + + 2 - - Top, Right - - - 6 - - - $this - - - 2 - - - 4, 4, 4, 4 - - - 3 - - - 81, 17 - - - Top, Right - - - 232, 26 - - - 12 - - - 4 - - - Top, Right - - - 10 - - - 287, 50 - - - Controller 1 - - - lBController2 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 787, 2 - - - Controller 3 - - - lVPrograms - - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 160, 24 - Add programs - - 6 + + bnAddPrograms - - 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 - - 358 - - - Remove - - - 688, 105 - - - 4, 4, 4, 4 - - - 2 - - + $this - - $this - - - 812, 34 - - - $this - - - True - - - 8, 16 - - - System.Windows.Forms.ImageList, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 4 + Top, Right - + + 519, 195 + + + 205, 18 + + + 3 + + + False + + + lBProgramPath + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 7 + + $this - - 4, 0, 4, 0 + + 14 - - Top, Bottom, Left, Right + + Top, Right - - cBProfile4 + + 609, 28 - - 7 + + 121, 21 - - Controller 2 + + 6 - - bnAddPrograms + + cBProfile1 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 13 + + + Top, Right + + + 609, 55 + + + 121, 21 + + + 6 + + + cBProfile2 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 12 + + + Top, Right + + + 609, 82 + + + 121, 21 + + + 6 + + + cBProfile3 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 11 Top, Right - 812, 134 + 609, 109 - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 121, 21 - + 6 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + cBProfile4 - - 981, 273 + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 686, 187 - - - 12 - - + $this - - lBController3 + + 10 - - 4, 4, 4, 4 + + Top, Right - - bnHideUnchecked + + False - - System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 663, 2 + + + 67, 23 + + + 2 + + + Save + + + bnSave + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 16 + + + Top, Right + + + True + + + 516, 31 + + + 60, 13 + + + 7 + + + Controller 1 + + + lBController1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 9 + + + Top, Right + + + True - 688, 71 + 516, 58 - - cBProfile1 + + 60, 13 + + + 7 + + + Controller 2 + + + lBController2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 8 + + + Top, Right True - - Top, Right + + 516, 85 - - 4, 4, 4, 4 + + 60, 13 - - Hide unchecked + + 7 - - cBTurnOffDS4W + + Controller 3 - - 89, 28 + + lBController3 - + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + $this - - 4, 4, 4, 4 + + 7 - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Top, Right - - 2 + + True + + + 516, 112 + + + 60, 13 + + + 7 + + + Controller 4 + + + lBController4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 6 17, 17 - - True - + + Programs|*.exe|Shortcuts|*.lnk + + + Top, Right + + + 590, 2 + + + 67, 23 + + + 2 + + + Remove + + + bnDelete + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 15 + 143, 17 + + 16, 16 + + + Top, Bottom, Left, Right + + + Name + + + 140 + + + Path + + + 358 + + + 5, 28 + + + 505, 190 + + + 12 + + + lVPrograms + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 5 + + + Top, Right + + + True + + + 622, 136 + + + 89, 13 + + + 8 + + + Pick Profiles here + + + pBProfilesTip + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + 99, 2 + + + 94, 23 + + + 2 + + + Hide unchecked + + + bnHideUnchecked + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + 232, 17 - - de-DE + + 192, 22 + + + Add Start Menu Programs + + + 192, 22 + + + Add Steam Games + + + 192, 22 + + + Add Origin Games + + + 192, 22 + + + Add Directory + + + 192, 22 + + + Browse for Other Programs + + + 193, 114 + + + cMSPrograms + + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Top, Right + + + 514, 152 + + + 2, 2, 2, 2 + + + 215, 41 + + + 13 + + + Turn off DS4Windows Temporarily + + + cBTurnOffDS4W + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + True + + 6, 13 + + + 736, 222 + + + 4, 4, 4, 4 + + + Auto-Profiles + + + openProgram + + + System.Windows.Forms.OpenFileDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + iLIcons + + + System.Windows.Forms.ImageList, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + nameHeader + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + PathHeader + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + addProgramsFromStartMenuToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + addSteamGamesToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + addOriginGamesToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + addDirectoryToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + browseForOtherProgramsToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + WinProgs + + + 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/app.config b/DS4Windows/DS4Forms/app.config deleted file mode 100644 index c5e1dae..0000000 --- a/DS4Windows/DS4Forms/app.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/DS4Windows/DS4Library/Crc32.cs b/DS4Windows/DS4Library/Crc32.cs new file mode 100644 index 0000000..7b7d1e3 --- /dev/null +++ b/DS4Windows/DS4Library/Crc32.cs @@ -0,0 +1,391 @@ +/* + Modified version of http://damieng.com/blog/2006/08/08/calculating_crc32_in_c_and_net + Using a default table improves drastically the performance of the algorithm. + Credit for the implementation should be awarded to Damien Guard. + Modified under the intention of creating a Nuget package + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. + You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + Originally published at http://damieng.com/blog/2006/08/08/calculating_crc32_in_c_and_net + +*/ +using System; +using System.Security.Cryptography; + +namespace DS4Windows +{ + /// + /// Implements a 32-bit CRC hash algorithm compatible with Zip etc. + /// + /// + /// Crc32 should only be used for backward compatibility with older file formats + /// and algorithms. It is not secure enough for new applications. + /// If you need to call multiple times for the same data either use the HashAlgorithm + /// interface or remember that the result of one Compute call needs to be ~ (XOR) before + /// being passed in as the seed for the next Compute call. + /// + public sealed class Crc32Algorithm : HashAlgorithm + { + public const uint DefaultPolynomial = 0xedb88320u; + public const uint DefaultSeed = 0xffffffffu; + + private static readonly uint[] defaultTable = + { + 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, + 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, + 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, + 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, + 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, + 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, + 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, + 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, + 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, + 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, + 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, + 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, + 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, + 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, + 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, + 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, + 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, + 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, + 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, + 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, + 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, + 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, + 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, + 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, + 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, + 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, + 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, + 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, + 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, + 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, + 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, + 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, + 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, + 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, + 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, + 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, + 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, + 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, + 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, + 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, + 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, + 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, + 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, + 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, + 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, + 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, + 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, + 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, + 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, + 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, + 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, + 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, + 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, + 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, + 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, + 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, + 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, + 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D + }; + + private static uint[] testLook = new uint[16 * 256]; + private static bool secondTablePop = false; + + private readonly uint _seed; + private readonly uint[] _table; + private uint _hash; + + public Crc32Algorithm() + : this(DefaultPolynomial, DefaultSeed) + { + } + + public Crc32Algorithm(uint polynomial, uint seed) + { + _table = InitializeTable(polynomial); + _seed = _hash = seed; + } + + public override void Initialize() + { + _hash = _seed; + } + + protected override void HashCore(byte[] buffer, int start, int length) + { + _hash = CalculateHash(_table, _hash, buffer, start, length); + } + + protected override byte[] HashFinal() + { + var hashBuffer = UintToBigEndianBytes(~_hash); + HashValue = hashBuffer; + return hashBuffer; + } + + public override int HashSize { get { return 32; } } + + public static uint Compute(byte[] buffer) + { + return ~CalculateHash(defaultTable, DefaultSeed, buffer, 0, buffer.Length); + } + + public static uint Compute(uint seed, byte[] buffer) + { + return ~CalculateHash(defaultTable, seed, buffer, 0, buffer.Length); + } + + public static uint Compute(uint polynomial, uint seed, byte[] buffer) + { + return ~CalculateHash(InitializeTable(polynomial), seed, buffer, 0, buffer.Length); + } + + public static uint[] InitializeTable(uint polynomial) + { + if (polynomial == DefaultPolynomial) + { + if (!secondTablePop) + { + for (int i = 0; i <= 0xFF; i++) + { + testLook[0 + i] = defaultTable[i]; + testLook[256+i] = (defaultTable[i] >> 8) ^ defaultTable[defaultTable[i] & 0xFF]; + testLook[512 + i] = (testLook[256 + i] >> 8) ^ defaultTable[testLook[256 + i] & 0xFF]; + testLook[768 + i] = (testLook[512 + i] >> 8) ^ defaultTable[testLook[512 + i] & 0xFF]; + + testLook[1024 + i] = (testLook[768 + i] >> 8) ^ defaultTable[testLook[768 + i] & 0xFF]; + testLook[1280 + i] = (testLook[1024 + i] >> 8) ^ defaultTable[testLook[1024 + i] & 0xFF]; + testLook[1536 + i] = (testLook[1280 + i] >> 8) ^ defaultTable[testLook[1280 + i] & 0xFF]; + testLook[1792 + i] = (testLook[1536 + i] >> 8) ^ defaultTable[testLook[1536 + i] & 0xFF]; + + testLook[2048 + i] = (testLook[1792 + i] >> 8) ^ defaultTable[testLook[1792 + i] & 0xFF]; + testLook[2304 + i] = (testLook[2048 + i] >> 8) ^ defaultTable[testLook[2048 + i] & 0xFF]; + testLook[2560 + i] = (testLook[2304 + i] >> 8) ^ defaultTable[testLook[2304 + i] & 0xFF]; + testLook[2816 + i] = (testLook[2560 + i] >> 8) ^ defaultTable[testLook[2560 + i] & 0xFF]; + + testLook[3072 + i] = (testLook[2816 + i] >> 8) ^ defaultTable[testLook[2816 + i] & 0xFF]; + testLook[3328 + i] = (testLook[3072 + i] >> 8) ^ defaultTable[testLook[3072 + i] & 0xFF]; + testLook[3584 + i] = (testLook[3328 + i] >> 8) ^ defaultTable[testLook[3328 + i] & 0xFF]; + testLook[3840 + i] = (testLook[3584 + i] >> 8) ^ defaultTable[testLook[3584 + i] & 0xFF]; + } + + secondTablePop = true; + } + + return defaultTable; + } + + + var createTable = new uint[256]; + for (uint i = 0; i < 256; i++) + { + var entry = i; + for (var j = 0; j < 8; j++) + entry = ((entry & 1) == 1) ? (entry >> 1) ^ polynomial : (entry >> 1); + createTable[i] = entry; + } + + return createTable; + } + + private static uint CalculateHash(uint[] table, uint seed, byte[] buffer, int start, int size) + { + var crc = seed; + for (var i = start; i < size - start; i++) + crc = (crc >> 8) ^ table[buffer[i] ^ crc & 0xff]; + return crc; + } + + public static unsafe uint CalculateBasicHash(ref uint seed, ref byte[] buffer, int offset, int size) + { + uint crc = seed; + int i = offset; + + fixed (byte* byteP = buffer) + fixed (uint* byteT = testLook) + { + while (size >= 16) + { + uint one = (byteP[i++] | + (uint)(byteP[i++] << 8) | + (uint)(byteP[i++] << 16) | + (uint)(byteP[i++] << 24)) ^ crc; + uint two = byteP[i++] | + (uint)(byteP[i++] << 8) | + (uint)(byteP[i++] << 16) | + (uint)(byteP[i++] << 24); + uint three = (byteP[i++] | + (uint)(byteP[i++] << 8) | + (uint)(byteP[i++] << 16) | + (uint)(byteP[i++] << 24)); + uint four = byteP[i++] | + (uint)(byteP[i++] << 8) | + (uint)(byteP[i++] << 16) | + (uint)(byteP[i++] << 24); + + crc = byteT[3840 + (one & 0xFF)] ^ + byteT[3584 + ((one >> 8) & 0xFF)] ^ + byteT[3328 + ((one >> 16) & 0xFF)] ^ + byteT[3072 + ((one >> 24) & 0xFF)] ^ + byteT[2816 + (two & 0xFF)] ^ + byteT[2560 + ((two >> 8) & 0xFF)] ^ + byteT[2304 + ((two >> 16) & 0xFF)] ^ + byteT[2048 + ((two >> 24) & 0xFF)] ^ + byteT[1792 + (three & 0xFF)] ^ + byteT[1536 + ((three >> 8) & 0xFF)] ^ + byteT[1280 + ((three >> 16) & 0xFF)] ^ + byteT[1024 + ((three >> 24) & 0xFF)] ^ + byteT[768 + (four & 0xFF)] ^ + byteT[512 + ((four >> 8) & 0xFF)] ^ + byteT[256 + ((four >> 16) & 0xFF)] ^ + byteT[(four >> 24) & 0xFF]; + + size -= 16; + } + + while (size >= 8) + { + uint one8 = (byteP[i++] | + (uint)(byteP[i++] << 8) | + (uint)(byteP[i++] << 16) | + (uint)(byteP[i++] << 24)) ^ crc; + uint two8 = byteP[i++] | + (uint)(byteP[i++] << 8) | + (uint)(byteP[i++] << 16) | + (uint)(byteP[i++] << 24); + crc = byteT[1792 + (one8 & 0xFF)] ^ + byteT[1536 + ((one8 >> 8) & 0xFF)] ^ + byteT[1280 + ((one8 >> 16) & 0xFF)] ^ + byteT[1024 + (one8 >> 24)] ^ + byteT[768 + (two8 & 0xFF)] ^ + byteT[512 + ((two8 >> 8) & 0xFF)] ^ + byteT[256 + ((two8 >> 16) & 0xFF)] ^ + byteT[two8 >> 24]; + + size -= 8; + } + + while (--size >= 0) + { + crc = (crc >> 8) ^ byteT[(crc & 0xFF) ^ byteP[i++]];// i++; + } + } + + return crc; + } + + public static unsafe uint CalculateFasterBTHash(ref uint seed, ref byte[] buffer, ref int start, ref int size) + { + /*uint crc = seed; + for (int i = start; i < size + start; i++) + crc = (crc >> 8) ^ defaultTable[buffer[i] ^ crc & 0xff]; + return crc; + */ + + uint crc = seed; + int i = start; + int bufsize = size; + //while (bufsize >= 16) + fixed (byte* byteP = buffer) + fixed (uint* byteT = testLook) + { + for (int j = 0; j < 4; j++) + { + uint one = (byteP[i++] | + (uint)(byteP[i++] << 8) | + (uint)(byteP[i++] << 16) | + (uint)(byteP[i++] << 24)) ^ crc; + uint two = byteP[i++] | + (uint)(byteP[i++] << 8) | + (uint)(byteP[i++] << 16) | + (uint)(byteP[i++] << 24); + uint three = (byteP[i++] | + (uint)(byteP[i++] << 8) | + (uint)(byteP[i++] << 16) | + (uint)(byteP[i++] << 24)); + uint four = byteP[i++] | + (uint)(byteP[i++] << 8) | + (uint)(byteP[i++] << 16) | + (uint)(byteP[i++] << 24); + + crc = byteT[3840+(one & 0xFF)] ^ + byteT[3584+((one >> 8) & 0xFF)] ^ + byteT[3328+((one >> 16) & 0xFF)] ^ + byteT[3072+((one >> 24) & 0xFF)] ^ + byteT[2816+(two & 0xFF)] ^ + byteT[2560+((two >> 8) & 0xFF)] ^ + byteT[2304+((two >> 16) & 0xFF)] ^ + byteT[2048+((two >> 24) & 0xFF)] ^ + byteT[1792+(three & 0xFF)] ^ + byteT[1536+((three >> 8) & 0xFF)] ^ + byteT[1280+((three >> 16) & 0xFF)] ^ + byteT[1024+((three >> 24) & 0xFF)] ^ + byteT[768+(four & 0xFF)] ^ + byteT[512+((four >> 8) & 0xFF)] ^ + byteT[256+((four >> 16) & 0xFF)] ^ + byteT[(four >> 24) & 0xFF]; + + bufsize -= 16; + } + + //while (bufsize >= 8) + //if (bufsize >= 8) + + uint one8 = (byteP[i++] | + (uint)(byteP[i++] << 8) | + (uint)(byteP[i++] << 16) | + (uint)(byteP[i++] << 24)) ^ crc; + uint two8 = byteP[i++] | + (uint)(byteP[i++] << 8) | + (uint)(byteP[i++] << 16) | + (uint)(byteP[i++] << 24); + crc = byteT[1792+(one8 & 0xFF)] ^ + byteT[1536+((one8 >> 8) & 0xFF)] ^ + byteT[1280+((one8 >> 16) & 0xFF)] ^ + byteT[1024+(one8 >> 24)] ^ + byteT[768+(two8 & 0xFF)] ^ + byteT[512+((two8 >> 8) & 0xFF)] ^ + byteT[256+((two8 >> 16) & 0xFF)] ^ + byteT[two8 >> 24]; + + bufsize -= 8; + /*crc ^= buffer[i++] | + (uint)(buffer[i++] << 8) | + (uint)(buffer[i++] << 16) | + (uint)(buffer[i++] << 24);// i = i + 4; + //crc ^= buffer[i]; + crc = secondLook[3, (crc & 0xFF)] ^ + secondLook[2, ((crc >> 8) & 0xFF)] ^ + secondLook[1, ((crc >> 16) & 0xFF)] ^ + defaultTable[crc >> 24]; + bufsize -= 4; + */ + + + //while (--bufsize >= 0) + //{ + crc = (crc >> 8) ^ byteT[(crc & 0xFF) ^ byteP[i++]];// i++; + crc = (crc >> 8) ^ byteT[(crc & 0xFF) ^ byteP[i++]];// i++; + //} + } + + return crc; + } + + private static byte[] UintToBigEndianBytes(uint uint32) + { + var result = BitConverter.GetBytes(uint32); + if (BitConverter.IsLittleEndian) + Array.Reverse(result); + return result; + } + } +} \ No newline at end of file diff --git a/DS4Windows/DS4Library/DS4Audio.cs b/DS4Windows/DS4Library/DS4Audio.cs new file mode 100644 index 0000000..e7284b0 --- /dev/null +++ b/DS4Windows/DS4Library/DS4Audio.cs @@ -0,0 +1,266 @@ +using System; +using System.Runtime.InteropServices; +using DS4Windows.DS4Library.CoreAudio; + +namespace DS4Windows.DS4Library +{ + public class DS4Audio : IAudioEndpointVolumeCallback + { + 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 vol; + public uint Volume + { + get + { + return vol; + } + } + + public uint getVolume() + { + return vol; + } + + public void RefreshVolume() + { + float pfLevel = 0; + + if (endpointVolume != null) + endpointVolume.GetMasterVolumeLevelScalar(out pfLevel); + vol = Convert.ToUInt32((75 - 20) * (--pfLevel * pfLevel * pfLevel + 1) + 20); + } + + public void OnNotify(IntPtr pNotify) + { + RefreshVolume(); + } + + 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; + endpointVolume.RegisterControlChangeNotify(this); + } + else if (deviceName.Contains("Wireless Controller")) + { + object interfacePointer; + Marshal.ThrowExceptionForHR(audioDevice.Activate(ref IID_IAudioEndpointVolume, ClsCtx.ALL, IntPtr.Zero, out interfacePointer)); + endpointVolume = interfacePointer as IAudioEndpointVolume; + endpointVolume.RegisterControlChangeNotify(this); + } + + RefreshVolume(); + Marshal.ReleaseComObject(audioDevice); + } + + Marshal.ReleaseComObject(audioDevices); + Marshal.ReleaseComObject(audioEnumerator); + } + + ~DS4Audio() + { + if (endpointVolume != null) + { + endpointVolume.UnregisterControlChangeNotify(this); + 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..9bd6b02 100644 --- a/DS4Windows/DS4Library/DS4Device.cs +++ b/DS4Windows/DS4Library/DS4Device.cs @@ -4,16 +4,11 @@ using System.ComponentModel; using System.Threading; using System.Runtime.InteropServices; -using Microsoft.Win32.SafeHandles; using System.Diagnostics; -using System.Threading.Tasks; - using System.Linq; -using System.Text; -using System.IO; -using System.Collections; using System.Drawing; +using DS4Windows.DS4Library; namespace DS4Windows { @@ -22,18 +17,20 @@ namespace DS4Windows public byte red; public byte green; public byte blue; - public DS4Color(System.Drawing.Color c) + public DS4Color(Color c) { red = c.R; 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 +41,7 @@ namespace DS4Windows else return false; } + public Color ToColor => Color.FromArgb(red, green, blue); public Color ToColorA { @@ -79,14 +77,15 @@ namespace DS4Windows try { string[] ss = value.Split(','); - return byte.TryParse(ss[0], out ds4color.red) &&byte.TryParse(ss[1], out ds4color.green) && byte.TryParse(ss[2], out ds4color.blue); + return byte.TryParse(ss[0], out ds4color.red) && byte.TryParse(ss[1], out ds4color.green) && byte.TryParse(ss[2], out ds4color.blue); } 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 +98,35 @@ 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; + internal const int BT_OUTPUT_REPORT_LENGTH = 78; + internal const int BT_INPUT_REPORT_LENGTH = 547; + internal const int BT_OUTPUT_CHANGE_LENGTH = 13; + internal const int USB_OUTPUT_CHANGE_LENGTH = 11; + // Use large value for worst case scenario + internal const int READ_STREAM_TIMEOUT = 3000; + // Isolated BT report can have latency as high as 15 ms + // due to hardware. + internal const int WARN_INTERVAL_BT = 20; + internal const int WARN_INTERVAL_USB = 10; + // Maximum values for battery level when no USB cable is connected + // and when a USB cable is connected + internal const int BATTERY_MAX = 8; + internal const int BATTERY_MAX_USB = 11; + public const string blankSerial = "00:00:00:00:00:00"; private HidDevice hDevice; private string Mac; private DS4State cState = new DS4State(); @@ -122,7 +136,7 @@ namespace DS4Windows private byte[] gyro = new byte[6]; private byte[] inputReport; private byte[] btInputReport = null; - private byte[] outputReportBuffer, outputReport; + private byte[] outReportBuffer, outputReport; private readonly DS4Touchpad touchpad = null; private readonly DS4SixAxis sixAxis = null; private byte rightLightFastRumble; @@ -131,31 +145,139 @@ 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; + public bool ExitOutputThread => exitOutputThread; + private bool exitInputThread = false; + private object exitLocker = new object(); + public event EventHandler Report = null; public event EventHandler Removal = null; + public event EventHandler SyncChange = null; + public event EventHandler SerialChange = 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 double lastTimeElapsedDouble = 0.0; + public double getLastTimeElapsedDouble() + { + return lastTimeElapsedDouble; + } public byte RightLightFastRumble { get { return rightLightFastRumble; } set { - if (value == rightLightFastRumble) return; - rightLightFastRumble = value; + if (rightLightFastRumble != value) + rightLightFastRumble = value; } } @@ -164,11 +286,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 +319,11 @@ namespace DS4Windows } } } + + public byte getLightBarOnDuration() + { + return ledFlashOn; + } public byte LightBarOffDuration { @@ -205,47 +337,211 @@ namespace DS4Windows } } + public byte getLightBarOffDuration() + { + return ledFlashOff; + } + + // Specify the poll rate interval used for the DS4 hardware when + // connected via Bluetooth + private int btPollRate = 0; + public int BTPollRate + { + get { return btPollRate; } + set + { + if (btPollRate != value && value >= 0 && value <= 16) + { + btPollRate = value; + } + } + } + + public int getBTPollRate() + { + return btPollRate; + } + + public void setBTPollRate(int value) + { + if (btPollRate != value && value >= 0 && value <= 16) + { + btPollRate = value; + } + } + 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 SynchronizationContext getUiContext() + { + return uiContext; + } + public void setUiContext(SynchronizationContext uiContext) + { + this.uiContext = uiContext; + } + + private Queue eventQueue = new Queue(); + private object eventQueueLock = new object(); + + private Thread timeoutCheckThread = null; + private bool timeoutExecuted = false; + private bool timeoutEvent = false; + 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]; outputReport = new byte[hDevice.Capabilities.OutputReportByteLength]; - outputReportBuffer = new byte[hDevice.Capabilities.OutputReportByteLength]; + outReportBuffer = new byte[hDevice.Capabilities.OutputReportByteLength]; + if (conType == ConnectionType.USB) + { + warnInterval = WARN_INTERVAL_USB; + HidDeviceAttributes tempAttr = hDevice.Attributes; + if (tempAttr.VendorId == 0x054C && tempAttr.ProductId == 0x09CC) + { + audio = new DS4Audio(); + micAudio = new DS4Audio(DS4Library.CoreAudio.DataFlow.Capture); + } + + synced = true; + } + else + { + warnInterval = WARN_INTERVAL_BT; + audio = new DS4Audio(); + micAudio = new DS4Audio(DS4Library.CoreAudio.DataFlow.Capture); + synced = isValidSerial(); + } } else { btInputReport = new byte[BT_INPUT_REPORT_LENGTH]; - inputReport = new byte[btInputReport.Length - 2]; + inputReport = new byte[BT_INPUT_REPORT_LENGTH - 2]; outputReport = new byte[BT_OUTPUT_REPORT_LENGTH]; - outputReportBuffer = new byte[BT_OUTPUT_REPORT_LENGTH]; + outReportBuffer = new byte[BT_OUTPUT_REPORT_LENGTH]; + warnInterval = WARN_INTERVAL_BT; + synced = isValidSerial(); } + touchpad = new DS4Touchpad(); sixAxis = new DS4SixAxis(); + Crc32Algorithm.InitializeTable(DefaultPolynomial); + refreshCalibration(); + + if (!hDevice.IsFileStreamOpen()) + { + hDevice.OpenFileStream(inputReport.Length); + } + + sendOutputReport(true, true); // initialize the output report + } + + private void timeoutTestThread() + { + while (!timeoutExecuted) + { + if (timeoutEvent) + { + timeoutExecuted = true; + this.sendOutputReport(true, true); // Kick Windows into noticing the disconnection. + } + else + { + timeoutEvent = true; + Thread.Sleep(READ_STREAM_TIMEOUT); + } + } + } + + const int DS4_FEATURE_REPORT_5_LEN = 41; + const int DS4_FEATURE_REPORT_5_CRC32_POS = DS4_FEATURE_REPORT_5_LEN - 4; + public void refreshCalibration() + { + byte[] calibration = new byte[41]; + calibration[0] = conType == ConnectionType.BT ? (byte)0x05 : (byte)0x02; + + if (conType == ConnectionType.BT) + { + bool found = false; + for (int tries = 0; !found && tries < 5; tries++) + { + hDevice.readFeatureData(calibration); + uint recvCrc32 = calibration[DS4_FEATURE_REPORT_5_CRC32_POS] | + (uint)(calibration[DS4_FEATURE_REPORT_5_CRC32_POS + 1] << 8) | + (uint)(calibration[DS4_FEATURE_REPORT_5_CRC32_POS + 2] << 16) | + (uint)(calibration[DS4_FEATURE_REPORT_5_CRC32_POS + 3] << 24); + + uint calcCrc32 = ~Crc32Algorithm.Compute(new byte[] { 0xA3 }); + calcCrc32 = ~Crc32Algorithm.CalculateBasicHash(ref calcCrc32, ref calibration, 0, DS4_FEATURE_REPORT_5_LEN - 4); + bool validCrc = recvCrc32 == calcCrc32; + if (!validCrc && tries >= 5) + { + Log.LogToGui("Gyro Calibration Failed", true); + continue; + } + else if (validCrc) + { + found = true; + } + } + + sixAxis.setCalibrationData(ref calibration, conType == ConnectionType.USB); + } + else + { + hDevice.readFeatureData(calibration); + sixAxis.setCalibrationData(ref calibration, conType == ConnectionType.USB); + } } public void StartUpdate() { if (ds4Input == null) { - 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) + { + ds4Output = new Thread(performDs4Output); + ds4Output.Priority = ThreadPriority.AboveNormal; + ds4Output.Name = "DS4 Output thread: " + Mac; + ds4Output.IsBackground = true; + ds4Output.Start(); + + timeoutCheckThread = new Thread(timeoutTestThread); + timeoutCheckThread.Priority = ThreadPriority.BelowNormal; + timeoutCheckThread.Name = "DS4 Timeout thread: " + Mac; + timeoutCheckThread.IsBackground = true; + timeoutCheckThread.Start(); + } + ds4Input = new Thread(performDs4Input); + ds4Input.Priority = ThreadPriority.AboveNormal; ds4Input.Name = "DS4 Input thread: " + Mac; + ds4Input.IsBackground = true; ds4Input.Start(); } else @@ -254,11 +550,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 +565,28 @@ 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; + ds4Output.Interrupt(); + ds4Output.Join(); + } + catch (Exception e) + { + Console.WriteLine(e.Message); + } } } } @@ -293,36 +599,62 @@ namespace DS4Windows } else { - return hDevice.WriteOutputReportViaInterrupt(outputReport, 8); + return hDevice.WriteOutputReportViaInterrupt(outReportBuffer, READ_STREAM_TIMEOUT); } } - private void performDs4Output() + private byte outputPendCount = 0; + private unsafe void performDs4Output() { - lock (outputReport) + try { int lastError = 0; - while (true) + bool result = false, currentRumble = false; + while (!exitOutputThread) { - if (writeOutput()) + if (currentRumble) + { + lock(outputReport) + { + result = writeOutput(); + } + + currentRumble = false; + if (!result) + { + currentRumble = true; + exitOutputThread = true; + int thisError = Marshal.GetLastWin32Error(); + if (lastError != thisError) + { + Console.WriteLine(Mac.ToString() + " " + System.DateTime.UtcNow.ToString("o") + "> encountered write failure: " + thisError); + //Log.LogToGui(Mac.ToString() + " encountered write failure: " + thisError, true); + lastError = thisError; + } + } + } + + if (!currentRumble) { 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) + lock (outReportBuffer) { - Console.WriteLine(MacAddress.ToString() + " " + System.DateTime.UtcNow.ToString("o") + "> encountered write failure: " + thisError); - lastError = thisError; + Monitor.Wait(outReportBuffer); + fixed (byte* byteR = outputReport, byteB = outReportBuffer) + { + for (int i = 0, arlen = BT_OUTPUT_CHANGE_LENGTH; i < arlen; i++) + byteR[i] = byteB[i]; + } + //outReportBuffer.CopyTo(outputReport, 0); + outputPendCount--; + outputRumble = false; } + + currentRumble = true; } } } + catch (ThreadInterruptedException) { } } /** Is the device alive and receiving valid sensor input reports? */ @@ -330,85 +662,196 @@ namespace DS4Windows { return priorInputReport30 != 0xff; } + private byte priorInputReport30 = 0xff; - public double Latency = 0; - bool warn; + + private bool synced = false; + public bool Synced + { + get { return synced; } + set + { + if (synced != value) + { + synced = value; + } + } + } + + public bool isSynced() + { + return synced; + } + + public double Latency = 0.0; public string error; - private void performDs4Input() + public bool firstReport = true; + public bool oldCharging = false; + double curTimeDouble = 0.0; + double oldTimeDouble = 0.0; + DateTime utcNow = DateTime.UtcNow; + bool ds4InactiveFrame = true; + bool idleInput = true; + + bool timeStampInit = false; + uint timeStampPrevious = 0; + uint deltaTimeCurrent = 0; + + + const int BT_INPUT_REPORT_CRC32_POS = BT_OUTPUT_REPORT_LENGTH - 4; //last 4 bytes of the 78-sized input report are crc32 + const uint DefaultPolynomial = 0xedb88320u; + uint HamSeed = 2351727372; + + private unsafe 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); + Queue latencyQueue = new Queue(21); // Set capacity at max + 1 to avoid any resizing + int tempLatencyCount = 0; long oldtime = 0; + string currerror = string.Empty; + long curtime = 0; Stopwatch sw = new Stopwatch(); sw.Start(); - while (true) + timeoutEvent = false; + ds4InactiveFrame = true; + idleInput = true; + bool syncWriteReport = conType != ConnectionType.BT; + + int maxBatteryValue = 0; + int tempBattery = 0; + uint tempStamp = 0; + double elapsedDeltaTime = 0.0; + uint tempDelta = 0; + byte tempByte = 0; + int CRC32_POS_1 = BT_INPUT_REPORT_CRC32_POS + 1, + CRC32_POS_2 = BT_INPUT_REPORT_CRC32_POS + 2, + CRC32_POS_3 = BT_INPUT_REPORT_CRC32_POS + 3; + int crcpos = BT_INPUT_REPORT_CRC32_POS; + int crcoffset = 0; + + while (!exitInputThread) { - string currerror = string.Empty; - Latency.Add(sw.ElapsedMilliseconds - oldtime); - oldtime = sw.ElapsedMilliseconds; + oldCharging = charging; + currerror = string.Empty; - if (Latency.Count > 100) - Latency.RemoveAt(0); - - this.Latency = Latency.Average(); - - if (this.Latency > 10 && !warn && sw.ElapsedMilliseconds > 4000) + if (tempLatencyCount >= 20) { - 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"); + latencyQueue.Dequeue(); + tempLatencyCount--; } - else if (this.Latency <= 10 && warn) warn = false; - if (readTimeout.Interval != 3000.0) + latencyQueue.Enqueue(this.lastTimeElapsed); + tempLatencyCount++; + + Latency = latencyQueue.Average(); + + if (conType == ConnectionType.BT) { - 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); + HidDevice.ReadStatus res = hDevice.ReadWithFileStream(btInputReport); + timeoutEvent = false; if (res == HidDevice.ReadStatus.Success) { - Array.Copy(btInputReport, 2, inputReport, 0, inputReport.Length); + //Array.Copy(btInputReport, 2, inputReport, 0, inputReport.Length); + fixed (byte* byteP = &btInputReport[2], imp = inputReport) + { + for (int j = 0; j < BT_INPUT_REPORT_LENGTH-2;j++) + { + imp[j] = byteP[j]; + } + } + + //uint recvCrc32 = BitConverter.ToUInt32(btInputReport, BT_INPUT_REPORT_CRC32_POS); + uint recvCrc32 = btInputReport[BT_INPUT_REPORT_CRC32_POS] | + (uint)(btInputReport[CRC32_POS_1] << 8) | + (uint)(btInputReport[CRC32_POS_2] << 16) | + (uint)(btInputReport[CRC32_POS_3] << 24); + + uint calcCrc32 = ~Crc32Algorithm.CalculateFasterBTHash(ref HamSeed, ref btInputReport, ref crcoffset, ref crcpos); + if (recvCrc32 != calcCrc32) + { + //Log.LogToGui("Crc check failed", true); + //Console.WriteLine(MacAddress.ToString() + " " + System.DateTime.UtcNow.ToString("o") + "" + + // "> invalid CRC32 in BT input report: 0x" + recvCrc32.ToString("X8") + " expected: 0x" + calcCrc32.ToString("X8")); + + //cState.PacketCounter = pState.PacketCounter + 1; //still increase so we know there were lost packets + continue; + } } else { - 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; - if (Removal != null) - Removal(this, EventArgs.Empty); - return; + if (res == HidDevice.ReadStatus.WaitTimedOut) + { + Log.LogToGui(Mac.ToString() + " disconnected due to timeout", true); + } + else + { + int winError = Marshal.GetLastWin32Error(); + Console.WriteLine(Mac.ToString() + " " + DateTime.UtcNow.ToString("o") + "> disconnect due to read failure: " + winError); + //Log.LogToGui(Mac.ToString() + " disconnected due to read failure: " + winError, true); + } + sendOutputReport(true, true); // Kick Windows into noticing the disconnection. + StopOutputUpdate(); + isDisconnecting = true; + uiContext.Send(new SendOrPostCallback(delegate (object state4) + { + Removal?.Invoke(this, EventArgs.Empty); + }), null); + + timeoutExecuted = true; + 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); + HidDevice.ReadStatus res = hDevice.ReadWithFileStream(inputReport); if (res != HidDevice.ReadStatus.Success) { - Console.WriteLine(MacAddress.ToString() + " " + System.DateTime.UtcNow.ToString("o") + "> disconnect due to read failure: " + Marshal.GetLastWin32Error()); + if (res == HidDevice.ReadStatus.WaitTimedOut) + { + Log.LogToGui(Mac.ToString() + " disconnected due to timeout", true); + } + else + { + int winError = Marshal.GetLastWin32Error(); + Console.WriteLine(Mac.ToString() + " " + DateTime.UtcNow.ToString("o") + "> disconnect due to read failure: " + winError); + //Log.LogToGui(Mac.ToString() + " disconnected due to read failure: " + winError, true); + } + 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); + + timeoutExecuted = true; return; } } - if (ConnectionType == 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 + + curTimeDouble = sw.Elapsed.TotalMilliseconds; + curtime = sw.ElapsedMilliseconds; + + lastTimeElapsed = curtime - oldtime; + lastTimeElapsedDouble = (curTimeDouble - oldTimeDouble); + + oldtime = curtime; + oldTimeDouble = curTimeDouble; + + if (conType == ConnectionType.BT && btInputReport[0] != 0x11) + { + //Received incorrect report, skip it + continue; + } + + utcNow = DateTime.UtcNow; // timestamp with UTC in case system time zone changes resetHapticState(); cState.ReportTimeStamp = utcNow; cState.LX = inputReport[1]; @@ -418,23 +861,15 @@ 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; + tempByte = inputReport[5]; + cState.Triangle = (tempByte & (1 << 7)) != 0; + cState.Circle = (tempByte & (1 << 6)) != 0; + cState.Cross = (tempByte & (1 << 5)) != 0; + cState.Square = (tempByte & (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)(tempByte & 0x0F); switch (dpad_state) { @@ -446,55 +881,98 @@ 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; + tempByte = inputReport[6]; + cState.R3 = (tempByte & (1 << 7)) != 0; + cState.L3 = (tempByte & (1 << 6)) != 0; + cState.Options = (tempByte & (1 << 5)) != 0; + cState.Share = (tempByte & (1 << 4)) != 0; + cState.R1 = (tempByte & (1 << 1)) != 0; + cState.L1 = (tempByte & (1 << 0)) != 0; - cState.PS = ((byte)inputReport[7] & (1 << 0)) != 0; - cState.TouchButton = (inputReport[7] & (1 << 2 - 1)) != 0; - cState.FrameCounter = (byte)(inputReport[7] >> 2); + tempByte = inputReport[7]; + cState.PS = (tempByte & (1 << 0)) != 0; + cState.TouchButton = (tempByte & 0x02) != 0; + cState.FrameCounter = (byte)(tempByte >> 2); - // Store Gyro and Accel values - Array.Copy(inputReport, 14, accel, 0, 6); - Array.Copy(inputReport, 20, gyro, 0, 6); - sixAxis.handleSixaxis(gyro, accel, cState); - - try - { - charging = (inputReport[30] & 0x10) != 0; - battery = (inputReport[30] & 0x0f) * 10; + tempByte = inputReport[30]; + charging = (tempByte & 0x10) != 0; + maxBatteryValue = charging ? BATTERY_MAX_USB : BATTERY_MAX; + tempBattery = (tempByte & 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")); - } + //System.Diagnostics.Debug.WriteLine("CURRENT BATTERY: " + (inputReport[30] & 0x0f) + " | " + tempBattery + " | " + battery); + if (tempByte != priorInputReport30) + { + priorInputReport30 = tempByte; + //Console.WriteLine(MacAddress.ToString() + " " + System.DateTime.UtcNow.ToString("o") + "> power subsystem octet: 0x" + inputReport[30].ToString("x02")); } - catch { currerror = "Index out of bounds: battery"; } + + tempStamp = (uint)((ushort)(inputReport[11] << 8) | inputReport[10]); + if (timeStampInit == false) + { + timeStampInit = true; + deltaTimeCurrent = tempStamp * 16u / 3u; + } + else if (timeStampPrevious > tempStamp) + { + tempDelta = ushort.MaxValue - timeStampPrevious + tempStamp + 1u; + deltaTimeCurrent = tempDelta * 16u / 3u; + } + else + { + tempDelta = tempStamp - timeStampPrevious; + deltaTimeCurrent = tempDelta * 16u / 3u; + } + + timeStampPrevious = tempStamp; + elapsedDeltaTime = 0.000001 * deltaTimeCurrent; // Convert from microseconds to seconds + cState.elapsedTime = elapsedDeltaTime; + // 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 + cState.Touch1 = (inputReport[0 + DS4Touchpad.TOUCHPAD_DATA_OFFSET + touchOffset] >> 7) != 0 ? false : true; // finger 1 detected cState.Touch1Identifier = (byte)(inputReport[0 + DS4Touchpad.TOUCHPAD_DATA_OFFSET + touchOffset] & 0x7f); - cState.Touch2 = (inputReport[4 + DS4Touchpad.TOUCHPAD_DATA_OFFSET + touchOffset] >> 7) != 0 ? false : true; // 2 touches detected + cState.Touch2 = (inputReport[4 + DS4Touchpad.TOUCHPAD_DATA_OFFSET + touchOffset] >> 7) != 0 ? false : true; // finger 2 detected cState.Touch2Identifier = (byte)(inputReport[4 + DS4Touchpad.TOUCHPAD_DATA_OFFSET + touchOffset] & 0x7f); - cState.TouchLeft = (inputReport[1 + DS4Touchpad.TOUCHPAD_DATA_OFFSET + touchOffset] + ((inputReport[2 + DS4Touchpad.TOUCHPAD_DATA_OFFSET + touchOffset] & 0xF) * 255) >= 1920 * 2 / 5) ? false : true; - cState.TouchRight = (inputReport[1 + DS4Touchpad.TOUCHPAD_DATA_OFFSET + touchOffset] + ((inputReport[2 + DS4Touchpad.TOUCHPAD_DATA_OFFSET + touchOffset] & 0xF) * 255) < 1920 * 2 / 5) ? false : true; + cState.Touch1Finger = cState.Touch1 || cState.Touch2; // >= 1 touch detected + cState.Touch2Fingers = cState.Touch1 && cState.Touch2; // 2 touches detected + int touchX = (((inputReport[2 + DS4Touchpad.TOUCHPAD_DATA_OFFSET + touchOffset] & 0xF) << 8) | inputReport[1 + DS4Touchpad.TOUCHPAD_DATA_OFFSET + touchOffset]); + cState.TouchLeft = touchX >= 1920 * 2 / 5 ? false : true; + cState.TouchRight = touchX < 1920 * 2 / 5 ? false : true; // Even when idling there is still a touch packet indicating no touch 1 or 2 touchpad.handleTouchpad(inputReport, cState, touchOffset); } } catch { currerror = "Index out of bounds: touchpad"; } - + + // Store Gyro and Accel values + //Array.Copy(inputReport, 13, gyro, 0, 6); + //Array.Copy(inputReport, 19, accel, 0, 6); + fixed (byte* pbInput = &inputReport[13], pbGyro = gyro, pbAccel = accel) + { + for (int i = 0; i < 6; i++) + { + pbGyro[i] = pbInput[i]; + } + + for (int i = 6; i < 12; i++) + { + pbAccel[i-6] = pbInput[i]; + } + } + sixAxis.handleSixaxis(gyro, accel, cState, elapsedDeltaTime); + /* Debug output of incoming HID data: if (cState.L2 == 0xff && cState.R2 == 0xff) { @@ -502,106 +980,245 @@ namespace DS4Windows for (int i = 0; i < inputReport.Length; i++) Console.Write(" " + inputReport[i].ToString("x2")); Console.WriteLine(); - } */ - if (!isDS4Idle()) - lastActive = utcNow; - if (conType == ConnectionType.BT) + } + */ + + if (conType == ConnectionType.SONYWA) { - bool shouldDisconnect = false; - if (IdleTimeout > 0) + bool controllerSynced = inputReport[31] == 0; + if (controllerSynced != synced) { - if (isDS4Idle()) + synced = controllerSynced; + SyncChange?.Invoke(this, EventArgs.Empty); + sendOutputReport(true, true); + } + } + + ds4InactiveFrame = cState.FrameCounter == pState.FrameCounter; + if (!ds4InactiveFrame) + { + isRemoved = false; + } + + if (conType == ConnectionType.USB) + { + if (idleTimeout == 0) + { + lastActive = utcNow; + } + else + { + idleInput = isDS4Idle(); + if (!idleInput) { - DateTime timeout = lastActive + TimeSpan.FromSeconds(IdleTimeout); - if (!Charging) - shouldDisconnect = utcNow >= timeout; + lastActive = utcNow; } } - if (shouldDisconnect && DisconnectBT()) - return; // all done } - // XXX fix initialization ordering so the null checks all go away + else + { + bool shouldDisconnect = false; + if (!isRemoved && idleTimeout > 0) + { + idleInput = isDS4Idle(); + if (idleInput) + { + DateTime timeout = lastActive + TimeSpan.FromSeconds(idleTimeout); + if (!charging) + shouldDisconnect = utcNow >= timeout; + } + else + { + lastActive = utcNow; + } + } + else + { + lastActive = utcNow; + } + + if (shouldDisconnect) + { + Log.LogToGui(Mac.ToString() + " disconnecting due to idle disconnect", false); + + if (conType == ConnectionType.BT) + { + if (DisconnectBT(true)) + { + timeoutExecuted = true; + return; // all done + } + } + else if (conType == ConnectionType.SONYWA) + { + DisconnectDongle(); + } + } + } + + if (conType == ConnectionType.BT && oldCharging != charging) + { + if (Global.getQuickCharge() && charging) + { + DisconnectBT(true); + timeoutExecuted = true; + return; + } + } + if (Report != null) Report(this, EventArgs.Empty); - sendOutputReport(false); - if (!string.IsNullOrEmpty(error)) - error = string.Empty; + + sendOutputReport(syncWriteReport); + if (!string.IsNullOrEmpty(currerror)) - error = currerror; + error = currerror; + else if (!string.IsNullOrEmpty(error)) + error = string.Empty; + cState.CopyTo(pState); + + lock (eventQueueLock) + { + Action tempAct = null; + for (int actInd = 0, actLen = eventQueue.Count; actInd < actLen; actInd++) + { + tempAct = eventQueue.Dequeue(); + tempAct.Invoke(); + } + } } + + timeoutExecuted = true; } public void FlushHID() { hDevice.flush_Queue(); } - private void sendOutputReport(bool synchronous) + + private unsafe void sendOutputReport(bool synchronous, bool force = false) { setTestRumble(); setHapticState(); - if (conType == ConnectionType.BT) + + bool quitOutputThread = false; + bool usingBT = conType == ConnectionType.BT; + + lock (outReportBuffer) { - outputReportBuffer[0] = 0x11; - outputReportBuffer[1] = 0x80; - outputReportBuffer[3] = 0xff; - outputReportBuffer[6] = rightLightFastRumble; //fast motor - outputReportBuffer[7] = leftHeavySlowRumble; //slow motor - outputReportBuffer[8] = LightBarColor.red; //red - outputReportBuffer[9] = LightBarColor.green; //green - outputReportBuffer[10] = LightBarColor.blue; //blue - outputReportBuffer[11] = ledFlashOn; //flash on duration - outputReportBuffer[12] = ledFlashOff; //flash off duration - } - else - { - outputReportBuffer[0] = 0x05; - outputReportBuffer[1] = 0xff; - outputReportBuffer[4] = rightLightFastRumble; //fast motor - outputReportBuffer[5] = leftHeavySlowRumble; //slow motor - outputReportBuffer[6] = LightBarColor.red; //red - outputReportBuffer[7] = LightBarColor.green; //green - outputReportBuffer[8] = LightBarColor.blue; //blue - outputReportBuffer[9] = ledFlashOn; //flash on duration - outputReportBuffer[10] = ledFlashOff; //flash off duration - } - lock (outputReport) - { - if (synchronous) + bool output = outputPendCount > 0, change = force; + + if (usingBT) { - outputReportBuffer.CopyTo(outputReport, 0); - try + outReportBuffer[0] = 0x11; + outReportBuffer[1] = (byte)(0x80 | btPollRate); // input report rate + // enable rumble (0x01), lightbar (0x02), flash (0x04) + outReportBuffer[3] = 0xf7; + outReportBuffer[6] = rightLightFastRumble; // fast motor + outReportBuffer[7] = leftHeavySlowRumble; // slow motor + outReportBuffer[8] = ligtBarColor.red; // red + outReportBuffer[9] = ligtBarColor.green; // green + outReportBuffer[10] = ligtBarColor.blue; // blue + outReportBuffer[11] = ledFlashOn; // flash on duration + outReportBuffer[12] = ledFlashOff; // flash off duration + + fixed (byte* byteR = outputReport, byteB = outReportBuffer) { - if (!writeOutput()) - { - Console.WriteLine(MacAddress.ToString() + " " + System.DateTime.UtcNow.ToString("o") + "> encountered synchronous write failure: " + Marshal.GetLastWin32Error()); - ds4Output.Abort(); - ds4Output.Join(); - } - } - catch - { - // If it's dead already, don't worry about it. + for (int i = 0, arlen = BT_OUTPUT_CHANGE_LENGTH; !change && i < arlen; i++) + change = byteR[i] != byteB[i]; } } else { - bool output = false; - for (int i = 0; !output && i < outputReport.Length; i++) - output = outputReport[i] != outputReportBuffer[i]; - if (output) + outReportBuffer[0] = 0x05; + // enable rumble (0x01), lightbar (0x02), flash (0x04) + outReportBuffer[1] = 0xf7; + outReportBuffer[4] = rightLightFastRumble; // fast motor + outReportBuffer[5] = leftHeavySlowRumble; // slow motor + outReportBuffer[6] = ligtBarColor.red; // red + outReportBuffer[7] = ligtBarColor.green; // green + outReportBuffer[8] = ligtBarColor.blue; // blue + outReportBuffer[9] = ledFlashOn; // flash on duration + outReportBuffer[10] = ledFlashOff; // flash off duration + + fixed (byte* byteR = outputReport, byteB = outReportBuffer) { - outputReportBuffer.CopyTo(outputReport, 0); - Monitor.Pulse(outputReport); + for (int i = 0, arlen = USB_OUTPUT_CHANGE_LENGTH; !change && i < arlen; i++) + change = byteR[i] != byteB[i]; + } + + if (change && audio != null) + { + // Headphone volume levels + outReportBuffer[19] = outReportBuffer[20] = + Convert.ToByte(audio.getVolume()); + // Microphone volume level + outReportBuffer[21] = Convert.ToByte(micAudio.getVolume()); + } + } + + if (synchronous) + { + outputRumble = false; + outputPendCount = 3; + + if (change) + { + if (usingBT) + { + Monitor.Enter(outputReport); + } + + outReportBuffer.CopyTo(outputReport, 0); + + try + { + if (!writeOutput()) + { + int winError = Marshal.GetLastWin32Error(); + quitOutputThread = true; + } + } + catch { } // If it's dead already, don't worry about it. + + if (usingBT) + { + Monitor.Exit(outputReport); + } + } + } + else + { + //for (int i = 0, arlen = outputReport.Length; !change && i < arlen; i++) + // change = outputReport[i] != outReportBuffer[i]; + + if (output || change) + { + if (change) + { + outputPendCount = 3; + } + + outputRumble = true; + Monitor.Pulse(outReportBuffer); } } } + + if (quitOutputThread) + { + StopOutputUpdate(); + exitOutputThread = true; + } } - public bool DisconnectBT() + public bool DisconnectBT(bool callRemoval = false) { if (Mac != null) { + // Wait for output report to be written + StopOutputUpdate(); Console.WriteLine("Trying to disconnect BT device " + Mac); IntPtr btHandle = IntPtr.Zero; int IOCTL_BTH_DISCONNECT_DEVICE = 0x41000c; @@ -610,41 +1227,96 @@ 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) - { - 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; + lock (outputReport) + { + 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); + + //System.Threading.Tasks.Task.Factory.StartNew(() => { 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); + + if (remove) + StopOutputUpdate(); + + lock (outputReport) + { + result = hDevice.WriteFeatureReport(disconnectReport); + } + + if (result && remove) + { + isDisconnecting = true; + + uiContext.Send(new SendOrPostCallback(delegate (object state4) + { + Removal?.Invoke(this, EventArgs.Empty); + }), null); + + //System.Threading.Tasks.Task.Factory.StartNew(() => { Removal?.Invoke(this, EventArgs.Empty); }); + //Removal?.Invoke(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; @@ -656,7 +1328,7 @@ namespace DS4Windows { if (testRumble.IsRumbleSet()) { - pushHapticState(testRumble); + pushHapticState(ref testRumble); if (testRumble.RumbleMotorsExplicitlyOff) testRumble.RumbleMotorsExplicitlyOff = false; } @@ -672,13 +1344,6 @@ namespace DS4Windows return pState.Clone(); } - public void getExposedState(DS4StateExposed expState, DS4State state) - { - cState.CopyTo(state); - expState.Accel = accel; - expState.Gyro = gyro; - } - public void getCurrentState(DS4State state) { cState.CopyTo(state); @@ -689,6 +1354,16 @@ namespace DS4Windows pState.CopyTo(state); } + public DS4State getCurrentStateRef() + { + return cState; + } + + public DS4State getPreviousStateRef() + { + return pState; + } + private bool isDS4Idle() { if (cState.Square || cState.Cross || cState.Circle || cState.Triangle) @@ -717,51 +1392,98 @@ namespace DS4Windows hapticStackIndex = 0; } + delegate void HapticItem(ref DS4HapticState haptic); + // 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) + byte lightBarFlashDurationOn = ledFlashOn, lightBarFlashDurationOff = ledFlashOff; + byte rumbleMotorStrengthLeftHeavySlow = leftHeavySlowRumble, + rumbleMotorStrengthRightLightFast = rightLightFastRumble; + int hapticLen = hapticState.Length; + for (int i=0; i < hapticLen; i++) { - if (i++ == hapticStackIndex) + 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; - } + + ((HapticItem)((ref DS4HapticState haptic) => { + if (haptic.IsLightBarSet()) + { + ligtBarColor = haptic.LightBarColor; + lightBarFlashDurationOn = haptic.LightBarFlashDurationOn; + lightBarFlashDurationOff = haptic.LightBarFlashDurationOff; + } + + if (haptic.IsRumbleSet()) + { + rumbleMotorStrengthLeftHeavySlow = haptic.RumbleMotorStrengthLeftHeavySlow; + rumbleMotorStrengthRightLightFast = haptic.RumbleMotorStrengthRightLightFast; + } + }))(ref hapticState[i]); } - LightBarColor = lightBarColor; - LightBarOnDuration = lightBarFlashDurationOn; - LightBarOffDuration = lightBarFlashDurationOff; - LeftHeavySlowRumble = rumbleMotorStrengthLeftHeavySlow; - RightLightFastRumble = rumbleMotorStrengthRightLightFast; + + ledFlashOn = lightBarFlashDurationOn; + ledFlashOff = lightBarFlashDurationOff; + leftHeavySlowRumble = rumbleMotorStrengthLeftHeavySlow; + rightLightFastRumble = rumbleMotorStrengthRightLightFast; } - public void pushHapticState(DS4HapticState hs) + public void pushHapticState(ref 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; } override - public String ToString() + public string ToString() { return Mac; } + + public void runRemoval() + { + Removal?.Invoke(this, EventArgs.Empty); + } + + public void removeReportHandlers() + { + this.Report = null; + } + + public void queueEvent(Action act) + { + lock (eventQueueLock) + { + eventQueue.Enqueue(act); + } + } + + public void updateSerial() + { + hDevice.resetSerial(); + string tempMac = hDevice.readSerial(); + if (tempMac != Mac) + { + Mac = tempMac; + SerialChange?.Invoke(this, EventArgs.Empty); + } + } + + public bool isValidSerial() + { + return !Mac.Equals(blankSerial); + } + + public static bool isValidSerial(string test) + { + return !test.Equals(blankSerial); + } } } diff --git a/DS4Windows/DS4Library/DS4Devices.cs b/DS4Windows/DS4Library/DS4Devices.cs index 5e7be1b..d0e7199 100644 --- a/DS4Windows/DS4Library/DS4Devices.cs +++ b/DS4Windows/DS4Library/DS4Devices.cs @@ -7,11 +7,42 @@ using System.Security.Principal; namespace DS4Windows { + public class VidPidInfo + { + public readonly int vid; + public readonly int pid; + internal VidPidInfo(int vid, int pid) + { + this.vid = vid; + this.pid = pid; + } + } + public class DS4Devices { + // (HID device path, DS4Device) private static Dictionary Devices = new Dictionary(); - private static HashSet DevicePaths = new HashSet(); + private static HashSet deviceSerials = new HashSet(); + private static HashSet DevicePaths = new HashSet(); + // Keep instance of opened exclusive mode devices not in use (Charging while using BT connection) + private static List DisabledDevices = new List(); + private static Stopwatch sw = new Stopwatch(); public static bool isExclusiveMode = false; + internal const int SONY_VID = 0x054C; + internal const int RAZER_VID = 0x1532; + internal const int NACON_VID = 0x146B; + internal const int HORI_VID = 0x0F0D; + + private static VidPidInfo[] knownDevices = + { + new VidPidInfo(SONY_VID, 0xBA0), + new VidPidInfo(SONY_VID, 0x5C4), + new VidPidInfo(SONY_VID, 0x09CC), + new VidPidInfo(RAZER_VID, 0x1000), + new VidPidInfo(NACON_VID, 0x0D01), + new VidPidInfo(HORI_VID, 0x00EE), // Hori PS4 Mini Wired Gamepad + new VidPidInfo(0x7545, 0x0104) + }; private static string devicePathToInstanceId(string devicePath) { @@ -23,23 +54,35 @@ 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) { - int[] pid = { 0xBA0, 0x5C4, 0x09CC }; - IEnumerable hDevices = HidDevices.Enumerate(0x054C, pid); + IEnumerable hDevices = HidDevices.EnumerateDS4(knownDevices); // 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(); + purgeHiddenExclusiveDevices(); + tempList.AddRange(DisabledDevices); + 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) { - if (DevicePaths.Contains(hDevice.DevicePath)) + HidDevice hDevice = tempList[i]; + if (hDevice.Description == "HID-compliant vendor-defined device") + continue; // ignore the Nacon Revolution Pro programming interface + else if (DevicePaths.Contains(hDevice.DevicePath)) continue; // BT/USB endpoint already open once + if (!hDevice.IsOpen) { hDevice.OpenDevice(isExclusiveMode); @@ -59,6 +102,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,41 +125,42 @@ namespace DS4Windows if (isExclusiveMode && !hDevice.IsOpen) hDevice.OpenDevice(false); } + if (hDevice.IsOpen) { - if (Devices.ContainsKey(hDevice.readSerial())) - continue; // happens when the BT endpoint already is open and the USB is plugged into the same host + string serial = hDevice.readSerial(); + bool validSerial = !serial.Equals(DS4Device.blankSerial); + if (validSerial && deviceSerials.Contains(serial)) + { + // happens when the BT endpoint already is open and the USB is plugged into the same host + if (isExclusiveMode && hDevice.IsExclusive && + !DisabledDevices.Contains(hDevice)) + { + // Grab reference to exclusively opened HidDevice so device + // stays hidden to other processes + DisabledDevices.Add(hDevice); + //DevicePaths.Add(hDevice.DevicePath); + } + + continue; + } else { DS4Device ds4Device = new DS4Device(hDevice); - ds4Device.Removal += On_Removal; - Devices.Add(ds4Device.MacAddress, ds4Device); - DevicePaths.Add(hDevice.DevicePath); - ds4Device.StartUpdate(); + //ds4Device.Removal += On_Removal; + if (!ds4Device.ExitOutputThread) + { + Devices.Add(hDevice.DevicePath, ds4Device); + DevicePaths.Add(hDevice.DevicePath); + deviceSerials.Add(serial); + } } } } - - } - } - - //allows to get DS4Device by specifying unique MAC address - //format for MAC address is XX:XX:XX:XX:XX:XX - public static DS4Device getDS4Controller(string mac) - { - lock (Devices) - { - DS4Device device = null; - try - { - Devices.TryGetValue(mac, out device); - } - catch (ArgumentNullException) { } - return device; } } - //returns DS4 controllers that were found and are running + // Returns DS4 controllers that were found and are running public static IEnumerable getDS4Controllers() { lock (Devices) @@ -131,25 +176,105 @@ 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(); + deviceSerials.Clear(); + DisabledDevices.Clear(); } } - //called when devices is diconnected, timed out or has input reading failure + // Called when devices is diconnected, timed out or has input reading failure public static void On_Removal(object sender, EventArgs e) + { + DS4Device device = (DS4Device)sender; + RemoveDevice(device); + } + + public static void RemoveDevice(DS4Device device) + { + lock (Devices) + { + if (device != null) + { + device.HidDevice.CloseDevice(); + Devices.Remove(device.HidDevice.DevicePath); + DevicePaths.Remove(device.HidDevice.DevicePath); + deviceSerials.Remove(device.MacAddress); + //purgeHiddenExclusiveDevices(); + } + } + } + + public static void UpdateSerial(object sender, EventArgs e) { lock (Devices) { DS4Device device = (DS4Device)sender; - device.HidDevice.CloseDevice(); - Devices.Remove(device.MacAddress); - DevicePaths.Remove(device.HidDevice.DevicePath); + if (device != null) + { + string devPath = device.HidDevice.DevicePath; + string serial = device.getMacAddress(); + if (Devices.ContainsKey(devPath)) + { + deviceSerials.Remove(serial); + device.updateSerial(); + serial = device.getMacAddress(); + if (DS4Device.isValidSerial(serial)) + { + deviceSerials.Add(serial); + } + + device.refreshCalibration(); + } + } + } + } + + private static void purgeHiddenExclusiveDevices() + { + int disabledDevCount = DisabledDevices.Count; + if (disabledDevCount > 0) + { + List disabledDevList = new List(); + for (int i = 0, arlen = disabledDevCount; i < arlen; i++) + { + HidDevice tempDev = DisabledDevices.ElementAt(i); + if (tempDev != null) + { + if (tempDev.IsOpen && tempDev.IsConnected) + { + disabledDevList.Add(tempDev); + } + else if (tempDev.IsOpen) + { + if (!tempDev.IsConnected) + { + try + { + tempDev.CloseDevice(); + } + catch { } + } + + if (DevicePaths.Contains(tempDev.DevicePath)) + { + DevicePaths.Remove(tempDev.DevicePath); + } + } + } + } + + DisabledDevices.Clear(); + DisabledDevices.AddRange(disabledDevList); } } @@ -184,10 +309,24 @@ namespace DS4Windows throw new Exception("Error setting class install params, error code = " + Marshal.GetLastWin32Error()); } success = NativeMethods.SetupDiCallClassInstaller(NativeMethods.DIF_PROPERTYCHANGE, deviceInfoSet, ref deviceInfoData); - if (!success) + // TEST: If previous SetupDiCallClassInstaller fails, just continue + // otherwise device will likely get permanently disabled. + /*if (!success) { throw new Exception("Error disabling device, error code = " + Marshal.GetLastWin32Error()); } + */ + + //System.Threading.Thread.Sleep(50); + sw.Restart(); + while (sw.ElapsedMilliseconds < 50) + { + // Use SpinWait to keep control of current thread. Using Sleep could potentially + // cause other events to get run out of order + System.Threading.Thread.SpinWait(100); + } + sw.Stop(); + propChangeParams.stateChange = NativeMethods.DICS_ENABLE; success = NativeMethods.SetupDiSetClassInstallParams(deviceInfoSet, ref deviceInfoData, ref propChangeParams, Marshal.SizeOf(propChangeParams)); if (!success) @@ -200,6 +339,16 @@ namespace DS4Windows throw new Exception("Error enabling device, error code = " + Marshal.GetLastWin32Error()); } + //System.Threading.Thread.Sleep(50); + sw.Restart(); + while (sw.ElapsedMilliseconds < 50) + { + // Use SpinWait to keep control of current thread. Using Sleep could potentially + // cause other events to get run out of order + System.Threading.Thread.SpinWait(100); + } + sw.Stop(); + NativeMethods.SetupDiDestroyDeviceInfoList(deviceInfoSet); } } diff --git a/DS4Windows/DS4Library/DS4Sixaxis.cs b/DS4Windows/DS4Library/DS4Sixaxis.cs index 8777d34..15b4135 100644 --- a/DS4Windows/DS4Library/DS4Sixaxis.cs +++ b/DS4Windows/DS4Library/DS4Sixaxis.cs @@ -1,107 +1,247 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace DS4Windows { public class SixAxisEventArgs : EventArgs { public readonly SixAxis sixAxis; - public readonly System.DateTime timeStamp; - public SixAxisEventArgs(System.DateTime utcTimestamp, SixAxis sa) + public readonly DateTime timeStamp; + public SixAxisEventArgs(DateTime utcTimestamp, SixAxis sa) { sixAxis = sa; - this.timeStamp = utcTimestamp; + timeStamp = utcTimestamp; } } public class SixAxis { - public readonly int gyroX, gyroY, gyroZ, deltaX, deltaY, deltaZ, accelX, accelY, accelZ; - public readonly byte touchID; - public readonly SixAxis previousAxis; - public SixAxis(int X, int Y, int Z, int aX, int aY, int aZ, SixAxis prevAxis = null) + public const int ACC_RES_PER_G = 8192; + private const float F_ACC_RES_PER_G = ACC_RES_PER_G; + public const int GYRO_RES_IN_DEG_SEC = 16; + private const float F_GYRO_RES_IN_DEG_SEC = GYRO_RES_IN_DEG_SEC; + + public int gyroYaw, gyroPitch, gyroRoll, accelX, accelY, accelZ; + public int outputAccelX, outputAccelY, outputAccelZ; + public double accelXG, accelYG, accelZG; + public double angVelYaw, angVelPitch, angVelRoll; + public int gyroYawFull, gyroPitchFull, gyroRollFull; + public int accelXFull, accelYFull, accelZFull; + public double elapsed; + public SixAxis previousAxis = null; + + private double tempDouble = 0d; + + public SixAxis(int X, int Y, int Z, + int aX, int aY, int aZ, + double elapsedDelta, SixAxis prevAxis = null) { - gyroX = X; - gyroY = Y; - gyroZ = Z; - accelX = aX; - accelY = aY; - accelZ = aZ; - previousAxis = prevAxis; - if (previousAxis != null) - { - deltaX = X - previousAxis.gyroX; - deltaY = Y - previousAxis.gyroY; - deltaZ = Z - previousAxis.gyroZ; - } + populate(X, Y, Z, aX, aY, aZ, elapsedDelta, prevAxis); } + + public void copy(SixAxis src) + { + gyroYaw = src.gyroYaw; + gyroPitch = src.gyroPitch; + gyroRoll = src.gyroRoll; + + gyroYawFull = src.gyroYawFull; + accelXFull = src.accelXFull; accelYFull = src.accelYFull; accelZFull = src.accelZFull; + + angVelYaw = src.angVelYaw; + angVelPitch = src.angVelPitch; + angVelRoll = src.angVelRoll; + + accelXG = src.accelXG; + accelYG = src.accelYG; + accelZG = src.accelZG; + + // Put accel ranges between 0 - 128 abs + accelX = src.accelX; + accelY = src.accelY; + accelZ = src.accelZ; + outputAccelX = accelX; + outputAccelY = accelY; + outputAccelZ = accelZ; + + elapsed = src.elapsed; + previousAxis = src.previousAxis; + } + + public void populate(int X, int Y, int Z, + int aX, int aY, int aZ, + double elapsedDelta, SixAxis prevAxis = null) + { + gyroYaw = -X / 256; + gyroPitch = Y / 256; + gyroRoll = -Z / 256; + + gyroYawFull = -X; gyroPitchFull = Y; gyroRollFull = -Z; + accelXFull = -aX; accelYFull = -aY; accelZFull = aZ; + + angVelYaw = gyroYawFull / F_GYRO_RES_IN_DEG_SEC; + angVelPitch = gyroPitchFull / F_GYRO_RES_IN_DEG_SEC; + angVelRoll = gyroRollFull / F_GYRO_RES_IN_DEG_SEC; + + accelXG = tempDouble = accelXFull / F_ACC_RES_PER_G; + accelYG = tempDouble = accelYFull / F_ACC_RES_PER_G; + accelZG = tempDouble = accelZFull / F_ACC_RES_PER_G; + + // Put accel ranges between 0 - 128 abs + accelX = -aX / 64; + accelY = -aY / 64; + accelZ = aZ / 64; + outputAccelX = accelX; + outputAccelY = accelY; + outputAccelZ = accelZ; + + elapsed = elapsedDelta; + previousAxis = prevAxis; + } + } + + internal class CalibData + { + public int bias; + public int sensNumer; + public int sensDenom; + public const int GyroPitchIdx = 0, GyroYawIdx = 1, GyroRollIdx = 2, + AccelXIdx = 3, AccelYIdx = 4, AccelZIdx = 5; } public class DS4SixAxis { - public event EventHandler SixAxisMoved = null; // deltaX/deltaY are set because one or both fingers were already down on a prior sensor reading - public event EventHandler SixAccelMoved = null; // no status change for the touchpad itself... but other sensors may have changed, or you may just want to do some processing + public event EventHandler SixAccelMoved = null; + private SixAxis sPrev = null, now = null; + private CalibData[] calibrationData = new CalibData[6] { new CalibData(), new CalibData(), + new CalibData(), new CalibData(), new CalibData(), new CalibData() + }; - internal int lastGyroX, lastGyroY, lastGyroZ, lastAX, lastAY, lastAZ; // tracks 0, 1 or 2 touches; we maintain touch 1 and 2 separately - internal byte[] previousPacket = new byte[8]; - - - public void handleSixaxis(byte[] gyro, byte[] accel, DS4State state) + public DS4SixAxis() { - //bool touchPadIsDown = sensors.TouchButton; - /*if (!PacketChanged(data, touchPacketOffset) && touchPadIsDown == lastTouchPadIsDown) - { - if (SixAxisUnchanged != null) - SixAxisUnchanged(this, EventArgs.Empty); - return; - }*/ - /* byte touchID1 = (byte)(data[0 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] & 0x7F); - byte touchID2 = (byte)(data[4 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] & 0x7F);*/ - int currentX = (short)((ushort)(gyro[0] << 8) | gyro[1]) / 64; - int currentY = (short)((ushort)(gyro[2] << 8) | gyro[3]) / 64; - int currentZ = (short)((ushort)(gyro[4] << 8) | gyro[5]) / 64; - int AccelX = (short)((ushort)(accel[2] << 8) | accel[3]) / 256; - int AccelY = (short)((ushort)(accel[0] << 8) | accel[1]) / 256; - int AccelZ = (short)((ushort)(accel[4] << 8) | accel[5]) / 256; - SixAxisEventArgs args; - //if (sensors.Touch1 || sensors.Touch2) - { - /* if (SixAxisMoved != null) - { - SixAxis sPrev, now; - sPrev = new SixAxis(lastGyroX, lastGyroY, lastGyroZ, lastAX,lastAY,lastAZ); - now = new SixAxis(currentX, currentY, currentZ, AccelX, AccelY, AccelZ, sPrev); - args = new SixAxisEventArgs(state.ReportTimeStamp, now); - SixAxisMoved(this, args); - } + sPrev = new SixAxis(0, 0, 0, 0, 0, 0, 0.0); + now = new SixAxis(0, 0, 0, 0, 0, 0, 0.0); + } - lastGyroX = currentX; - lastGyroY = currentY; - lastGyroZ = currentZ; - lastAX = AccelX; - lastAY = AccelY; - lastAZ = AccelZ;*/ + int temInt = 0; + public void setCalibrationData(ref byte[] calibData, bool fromUSB) + { + int pitchPlus, pitchMinus, yawPlus, yawMinus, rollPlus, rollMinus, + accelXPlus, accelXMinus, accelYPlus, accelYMinus, accelZPlus, accelZMinus, + gyroSpeedPlus, gyroSpeedMinus; + + calibrationData[0].bias = (short)((ushort)(calibData[2] << 8) | calibData[1]); + calibrationData[1].bias = (short)((ushort)(calibData[4] << 8) | calibData[3]); + calibrationData[2].bias = (short)((ushort)(calibData[6] << 8) | calibData[5]); + + if (!fromUSB) + { + pitchPlus = temInt = (short)((ushort)(calibData[8] << 8) | calibData[7]); + yawPlus = temInt = (short)((ushort)(calibData[10] << 8) | calibData[9]); + rollPlus = temInt = (short)((ushort)(calibData[12] << 8) | calibData[11]); + pitchMinus = temInt = (short)((ushort)(calibData[14] << 8) | calibData[13]); + yawMinus = temInt = (short)((ushort)(calibData[16] << 8) | calibData[15]); + rollMinus = temInt = (short)((ushort)(calibData[18] << 8) | calibData[17]); } + else + { + pitchPlus = temInt = (short)((ushort)(calibData[8] << 8) | calibData[7]); + pitchMinus = temInt = (short)((ushort)(calibData[10] << 8) | calibData[9]); + yawPlus = temInt = (short)((ushort)(calibData[12] << 8) | calibData[11]); + yawMinus = temInt = (short)((ushort)(calibData[14] << 8) | calibData[13]); + rollPlus = temInt = (short)((ushort)(calibData[16] << 8) | calibData[15]); + rollMinus = temInt = (short)((ushort)(calibData[18] << 8) | calibData[17]); + } + + gyroSpeedPlus = temInt = (short)((ushort)(calibData[20] << 8) | calibData[19]); + gyroSpeedMinus = temInt = (short)((ushort)(calibData[22] << 8) | calibData[21]); + accelXPlus = temInt = (short)((ushort)(calibData[24] << 8) | calibData[23]); + accelXMinus = temInt = (short)((ushort)(calibData[26] << 8) | calibData[25]); + + accelYPlus = temInt = (short)((ushort)(calibData[28] << 8) | calibData[27]); + accelYMinus = temInt = (short)((ushort)(calibData[30] << 8) | calibData[29]); + + accelZPlus = temInt = (short)((ushort)(calibData[32] << 8) | calibData[31]); + accelZMinus = temInt = (short)((ushort)(calibData[34] << 8) | calibData[33]); + + int gyroSpeed2x = temInt = (gyroSpeedPlus + gyroSpeedMinus); + calibrationData[0].sensNumer = gyroSpeed2x* SixAxis.GYRO_RES_IN_DEG_SEC; + calibrationData[0].sensDenom = pitchPlus - pitchMinus; + + calibrationData[1].sensNumer = gyroSpeed2x* SixAxis.GYRO_RES_IN_DEG_SEC; + calibrationData[1].sensDenom = yawPlus - yawMinus; + + calibrationData[2].sensNumer = gyroSpeed2x* SixAxis.GYRO_RES_IN_DEG_SEC; + calibrationData[2].sensDenom = rollPlus - rollMinus; + + int accelRange = temInt = accelXPlus - accelXMinus; + calibrationData[3].bias = accelXPlus - accelRange / 2; + calibrationData[3].sensNumer = 2 * SixAxis.ACC_RES_PER_G; + calibrationData[3].sensDenom = accelRange; + + accelRange = temInt = accelYPlus - accelYMinus; + calibrationData[4].bias = accelYPlus - accelRange / 2; + calibrationData[4].sensNumer = 2 * SixAxis.ACC_RES_PER_G; + calibrationData[4].sensDenom = accelRange; + + accelRange = temInt = accelZPlus - accelZMinus; + calibrationData[5].bias = accelZPlus - accelRange / 2; + calibrationData[5].sensNumer = 2 * SixAxis.ACC_RES_PER_G; + calibrationData[5].sensDenom = accelRange; + } + + private void applyCalibs(ref int yaw, ref int pitch, ref int roll, + ref int accelX, ref int accelY, ref int accelZ) + { + CalibData current = calibrationData[0]; + temInt = pitch - current.bias; + pitch = temInt = (int)(temInt * (current.sensNumer / (float)current.sensDenom)); + + current = calibrationData[1]; + temInt = yaw - current.bias; + yaw = temInt = (int)(temInt * (current.sensNumer / (float)current.sensDenom)); + + current = calibrationData[2]; + temInt = roll - current.bias; + roll = temInt = (int)(temInt * (current.sensNumer / (float)current.sensDenom)); + + current = calibrationData[3]; + temInt = accelX - current.bias; + accelX = temInt = (int)(temInt * (current.sensNumer / (float)current.sensDenom)); + + current = calibrationData[4]; + temInt = accelY - current.bias; + accelY = temInt = (int)(temInt * (current.sensNumer / (float)current.sensDenom)); + + current = calibrationData[5]; + temInt = accelZ - current.bias; + accelZ = temInt = (int)(temInt * (current.sensNumer / (float)current.sensDenom)); + } + + public void handleSixaxis(byte[] gyro, byte[] accel, DS4State state, + double elapsedDelta) + { + int currentYaw = (short)((ushort)(gyro[3] << 8) | gyro[2]); + int currentPitch = (short)((ushort)(gyro[1] << 8) | gyro[0]); + int currentRoll = (short)((ushort)(gyro[5] << 8) | gyro[4]); + int AccelX = (short)((ushort)(accel[1] << 8) | accel[0]); + int AccelY = (short)((ushort)(accel[3] << 8) | accel[2]); + int AccelZ = (short)((ushort)(accel[5] << 8) | accel[4]); + + applyCalibs(ref currentYaw, ref currentPitch, ref currentRoll, ref AccelX, ref AccelY, ref AccelZ); + + SixAxisEventArgs args = null; if (AccelX != 0 || AccelY != 0 || AccelZ != 0) { if (SixAccelMoved != null) { - SixAxis sPrev, now; - sPrev = new SixAxis(lastGyroX, lastGyroY, lastGyroZ, lastAX, lastAY, lastAZ); - now = new SixAxis(currentX, currentY, currentZ, AccelX, AccelY, AccelZ, sPrev); + sPrev.copy(now); + now.populate(currentYaw, currentPitch, currentRoll, + AccelX, AccelY, AccelZ, elapsedDelta, sPrev); + args = new SixAxisEventArgs(state.ReportTimeStamp, now); + state.Motion = now; SixAccelMoved(this, args); } - - lastGyroX = currentX; - lastGyroY = currentY; - lastGyroZ = currentZ; - lastAX = AccelX; - lastAY = AccelY; - lastAZ = AccelZ; } } } diff --git a/DS4Windows/DS4Library/DS4State.cs b/DS4Windows/DS4Library/DS4State.cs index 421fc2b..c909780 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 { @@ -11,24 +8,47 @@ namespace DS4Windows public bool Square, Triangle, Circle, Cross; public bool DpadUp, DpadDown, DpadLeft, DpadRight; public bool L1, L3, R1, R3; - public bool Share, Options, PS, Touch1, Touch2, TouchButton, TouchRight, TouchLeft; + public bool Share, Options, PS, Touch1, Touch2, TouchButton, TouchRight, + TouchLeft, Touch1Finger, Touch2Fingers; public byte Touch1Identifier, Touch2Identifier; public byte LX, RX, LY, RY, L2, R2; 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 double LSAngleRad; // Calculated bearing of the LS X,Y coordinates (in radians) + public double RSAngleRad; // Calculated bearing of the RS X,Y coordinates (in radians) + public double LXUnit; + public double LYUnit; + public double RXUnit; + public double RYUnit; + public double elapsedTime = 0.0; + public SixAxis Motion = null; + public static readonly int DEFAULT_AXISDIR_VALUE = 127; public DS4State() { Square = Triangle = Circle = Cross = false; DpadUp = DpadDown = DpadLeft = DpadRight = false; L1 = L3 = R1 = R3 = false; - Share = Options = PS = Touch1 = Touch2 = TouchButton = TouchRight = TouchLeft = false; + Share = Options = PS = Touch1 = Touch2 = TouchButton = TouchRight = TouchLeft = false; + Touch1Finger = Touch2Fingers = false; LX = RX = LY = RY = 127; L2 = R2 = 0; 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; + LSAngleRad = 0.0; + RSAngle = 0.0; + RSAngleRad = 0.0; + LXUnit = 0.0; + LYUnit = 0.0; + RXUnit = 0.0; + RYUnit = 0.0; + elapsedTime = 0.0; + Motion = new SixAxis(0, 0, 0, 0, 0, 0, 0.0); } public DS4State(DS4State state) @@ -59,12 +79,24 @@ namespace DS4Windows Touch2Identifier = state.Touch2Identifier; TouchButton = state.TouchButton; TouchPacketCounter = state.TouchPacketCounter; + Touch1Finger = state.Touch1Finger; + Touch2Fingers = state.Touch2Fingers; LX = state.LX; RX = state.RX; LY = state.LY; RY = state.RY; FrameCounter = state.FrameCounter; Battery = state.Battery; + LSAngle = state.LSAngle; + LSAngleRad = state.LSAngleRad; + RSAngle = state.RSAngle; + RSAngleRad = state.RSAngleRad; + LXUnit = state.LXUnit; + LYUnit = state.LYUnit; + RXUnit = state.RXUnit; + RYUnit = state.RYUnit; + elapsedTime = state.elapsedTime; + Motion = state.Motion; } public DS4State Clone() @@ -100,13 +132,57 @@ namespace DS4Windows state.TouchRight = TouchRight; state.TouchButton = TouchButton; state.TouchPacketCounter = TouchPacketCounter; + state.Touch1Finger = Touch1Finger; + state.Touch2Fingers = Touch2Fingers; state.LX = LX; state.RX = RX; state.LY = LY; state.RY = RY; state.FrameCounter = FrameCounter; state.Battery = Battery; + state.LSAngle = LSAngle; + state.LSAngleRad = LSAngleRad; + state.RSAngle = RSAngle; + state.RSAngleRad = RSAngleRad; + state.LXUnit = LXUnit; + state.LYUnit = LYUnit; + state.RXUnit = RXUnit; + state.RYUnit = RYUnit; + state.elapsedTime = elapsedTime; + state.Motion = Motion; } + public void calculateStickAngles() + { + double lsangle = Math.Atan2(-(LY - 127), (LX - 127)); + LSAngleRad = lsangle; + lsangle = (lsangle >= 0 ? lsangle : (2 * Math.PI + lsangle)) * 180 / Math.PI; + LSAngle = lsangle; + LXUnit = Math.Abs(Math.Cos(LSAngleRad)); + LYUnit = Math.Abs(Math.Sin(LSAngleRad)); + + double rsangle = Math.Atan2(-(RY - 127), (RX - 127)); + RSAngleRad = rsangle; + rsangle = (rsangle >= 0 ? rsangle : (2 * Math.PI + rsangle)) * 180 / Math.PI; + RSAngle = rsangle; + RXUnit = Math.Abs(Math.Cos(RSAngleRad)); + RYUnit = Math.Abs(Math.Sin(RSAngleRad)); + } + + public void rotateLSCoordinates(double rotation) + { + double sinAngle = Math.Sin(rotation), cosAngle = Math.Cos(rotation); + double tempLX = LX - 127.5, tempLY = LY - 127.5; + LX = (Byte)(Global.Clamp(-127.5, (tempLX * cosAngle - tempLY * sinAngle), 127.5) + 127.5); + LY = (Byte)(Global.Clamp(-127.5, (tempLX * sinAngle + tempLY * cosAngle), 127.5) + 127.5); + } + + public void rotateRSCoordinates(double rotation) + { + double sinAngle = Math.Sin(rotation), cosAngle = Math.Cos(rotation); + double tempRX = RX - 127.5, tempRY = RY - 127.5; + RX = (Byte)(Global.Clamp(-127.5, (tempRX * cosAngle - tempRY * sinAngle), 127.5) + 127.5); + RY = (Byte)(Global.Clamp(-127.5, (tempRX * sinAngle + tempRY * cosAngle), 127.5) + 127.5); + } } } diff --git a/DS4Windows/DS4Library/DS4StateExposed.cs b/DS4Windows/DS4Library/DS4StateExposed.cs index f69dedd..7777dce 100644 --- a/DS4Windows/DS4Library/DS4StateExposed.cs +++ b/DS4Windows/DS4Library/DS4StateExposed.cs @@ -1,73 +1,100 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - + namespace DS4Windows { public class DS4StateExposed { private DS4State _state; - private byte[] accel = new byte[] { 0, 0, 0, 0, 0, 0 }, - gyro = new byte[] { 0, 0, 0, 0, 0, 0 }; public DS4StateExposed() { _state = new DS4State(); } + public DS4StateExposed(DS4State state) { _state = state; } - bool Square { get { return _state.Square; } } - bool Triangle { get { return _state.Triangle; } } - bool Circle { get { return _state.Circle; } } - bool Cross { get { return _state.Cross; } } - bool DpadUp { get { return _state.DpadUp; } } - bool DpadDown { get { return _state.DpadDown; } } - bool DpadLeft { get { return _state.DpadLeft; } } - bool DpadRight { get { return _state.DpadRight; } } - bool L1 { get { return _state.L1; } } - bool L3 { get { return _state.L3; } } - bool R1 { get { return _state.R1; } } - bool R3 { get { return _state.R3; } } - bool Share { get { return _state.Share; } } - bool Options { get { return _state.Options; } } - bool PS { get { return _state.PS; } } - bool Touch1 { get { return _state.Touch1; } } - bool Touch2 { get { return _state.Touch2; } } - bool TouchButton { get { return _state.TouchButton; } } - byte LX { get { return _state.LX; } } - byte RX { get { return _state.RX; } } - byte LY { get { return _state.LY; } } - byte RY { get { return _state.RY; } } - byte L2 { get { return _state.L2; } } - byte R2 { get { return _state.R2; } } + bool Square { get { return _state.Square; } } + bool Triangle { get { return _state.Triangle; } } + bool Circle { get { return _state.Circle; } } + bool Cross { get { return _state.Cross; } } + bool DpadUp { get { return _state.DpadUp; } } + bool DpadDown { get { return _state.DpadDown; } } + bool DpadLeft { get { return _state.DpadLeft; } } + bool DpadRight { get { return _state.DpadRight; } } + bool L1 { get { return _state.L1; } } + bool L3 { get { return _state.L3; } } + bool R1 { get { return _state.R1; } } + bool R3 { get { return _state.R3; } } + bool Share { get { return _state.Share; } } + bool Options { get { return _state.Options; } } + bool PS { get { return _state.PS; } } + bool Touch1 { get { return _state.Touch1; } } + bool Touch2 { get { return _state.Touch2; } } + bool TouchButton { get { return _state.TouchButton; } } + bool Touch1Finger { get { return _state.Touch1Finger; } } + bool Touch2Fingers { get { return _state.Touch2Fingers; } } + byte LX { get { return _state.LX; } } + byte RX { get { return _state.RX; } } + byte LY { get { return _state.LY; } } + byte RY { get { return _state.RY; } } + byte L2 { get { return _state.L2; } } + byte R2 { get { return _state.R2; } } int Battery { get { return _state.Battery; } } - /// Holds raw DS4 input data from 14 to 19 - public byte[] Accel { set { accel = value; } } - /// Holds raw DS4 input data from 20 to 25 - public byte[] Gyro { set { gyro = value; } } + public int GyroYaw { get { return _state.Motion.gyroYaw; } } + public int getGyroYaw() + { + return _state.Motion.gyroYaw; + } - /// Yaw leftward/counter-clockwise/turn to port or larboard side - /// Add double the previous result to this delta and divide by three. - public int AccelX { get { return (short)((ushort)(accel[2] << 8) | accel[3]) / 256; } } - /// Pitch upward/backward - /// Add double the previous result to this delta and divide by three. - public int AccelY { get { return (short)((ushort)(accel[0] << 8) | accel[1] ) / 256; } } - /// roll left/L side of controller down/starboard raising up - /// Add double the previous result to this delta and divide by three. - public int AccelZ { get { return (short)((ushort)(accel[4] << 8) | accel[5]) / 256; } } - /// 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; } } - /// 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; } } - /// 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 GyroPitch { get { return _state.Motion.gyroPitch; } } + public int getGyroPitch() + { + return _state.Motion.gyroPitch; + } + + public int GyroRoll { get { return _state.Motion.gyroRoll; } } + public int getGyroRoll() + { + return _state.Motion.gyroRoll; + } + + public int AccelX { get { return _state.Motion.accelX; } } + public int getAccelX() + { + return _state.Motion.accelX; + } + + public int AccelY { get { return _state.Motion.accelY; } } + public int getAccelY() + { + return _state.Motion.accelY; + } + + public int AccelZ { get { return _state.Motion.accelZ; } } + public int getAccelZ() + { + return _state.Motion.accelZ; + } + + public int OutputAccelX { get { return _state.Motion.outputAccelX; } } + public int getOutputAccelX() + { + return _state.Motion.outputAccelX; + } + + public int OutputAccelY { get { return _state.Motion.outputAccelY; } } + public int getOutputAccelY() + { + return _state.Motion.outputAccelY; + } + + public int OutputAccelZ { get { return _state.Motion.outputAccelZ; } } + public int getOutputAccelZ() + { + return _state.Motion.outputAccelZ; + } } } diff --git a/DS4Windows/DS4Library/DS4Touchpad.cs b/DS4Windows/DS4Library/DS4Touchpad.cs index 104b3a4..47b0a9a 100644 --- a/DS4Windows/DS4Library/DS4Touchpad.cs +++ b/DS4Windows/DS4Library/DS4Touchpad.cs @@ -1,16 +1,13 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Runtime.InteropServices; + namespace DS4Windows { public class TouchpadEventArgs : EventArgs { public readonly Touch[] touches = null; - public readonly System.DateTime timeStamp; + public readonly DateTime timeStamp; public readonly bool touchButtonPressed; - public TouchpadEventArgs(System.DateTime utcTimestamp, bool tButtonDown, Touch t0, Touch t1 = null) + public TouchpadEventArgs(DateTime utcTimestamp, bool tButtonDown, Touch t0, Touch t1 = null) { if (t1 != null) { @@ -23,17 +20,23 @@ namespace DS4Windows touches = new Touch[1]; touches[0] = t0; } + touchButtonPressed = tButtonDown; - this.timeStamp = utcTimestamp; + timeStamp = utcTimestamp; } } public class Touch { - public readonly int hwX, hwY, deltaX, deltaY; - public readonly byte touchID; - public readonly Touch previousTouch; - public Touch(int X, int Y, byte tID, Touch prevTouch = null) + public int hwX, hwY, deltaX, deltaY; + public byte touchID; + public Touch previousTouch; + internal Touch(int X, int Y, byte tID, Touch prevTouch = null) + { + populate(X, Y, tID, prevTouch); + } + + internal void populate(int X, int Y, byte tID, Touch prevTouch = null) { hwX = X; hwY = Y; @@ -55,6 +58,7 @@ namespace DS4Windows public event EventHandler TouchButtonDown = null; // touchpad pushed down until the button clicks public event EventHandler TouchButtonUp = null; // touchpad button released public event EventHandler TouchUnchanged = null; // no status change for the touchpad itself... but other sensors may have changed, or you may just want to do some processing + public event EventHandler PreTouchProcess = null; // used to publish that a touch packet is about to be processed public readonly static int TOUCHPAD_DATA_OFFSET = 35; internal int lastTouchPadX1, lastTouchPadY1, @@ -63,23 +67,35 @@ namespace DS4Windows internal bool lastIsActive1, lastIsActive2; internal byte lastTouchID1, lastTouchID2; internal byte[] previousPacket = new byte[8]; + private Touch tPrev0, tPrev1, t0, t1; + + public DS4Touchpad() + { + tPrev0 = new Touch(0, 0, 0); + tPrev1 = new Touch(0, 0, 0); + t0 = new Touch(0, 0, 0); + t1 = new Touch(0, 0, 0); + } // We check everything other than the not bothering with not-very-useful TouchPacketCounter. private bool PacketChanged(byte[] data, int touchPacketOffset) { bool changed = false; - for (int i = 0; i < previousPacket.Length; i++) + for (int i = 0, arLen = previousPacket.Length; !changed && i < arLen; i++) { - byte oldValue = previousPacket[i]; - previousPacket[i] = data[i + TOUCHPAD_DATA_OFFSET + touchPacketOffset]; - if (previousPacket[i] != oldValue) + //byte oldValue = previousPacket[i]; + //previousPacket[i] = data[i + TOUCHPAD_DATA_OFFSET + touchPacketOffset]; + if (previousPacket[i] != data[i + TOUCHPAD_DATA_OFFSET + touchPacketOffset]) changed = true; } + return changed; } public void handleTouchpad(byte[] data, DS4State sensors, int touchPacketOffset = 0) { + PreTouchProcess?.Invoke(this, EventArgs.Empty); + bool touchPadIsDown = sensors.TouchButton; if (!PacketChanged(data, touchPacketOffset) && touchPadIsDown == lastTouchPadIsDown) { @@ -87,12 +103,14 @@ namespace DS4Windows TouchUnchanged(this, EventArgs.Empty); return; } + + Array.Copy(data, TOUCHPAD_DATA_OFFSET + touchPacketOffset, previousPacket, 0, 8); byte touchID1 = (byte)(data[0 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] & 0x7F); byte touchID2 = (byte)(data[4 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] & 0x7F); - int currentX1 = data[1 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] + ((data[2 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] & 0xF) * 255); - int currentY1 = ((data[2 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] & 0xF0) >> 4) + (data[3 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] * 16); - int currentX2 = data[5 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] + ((data[6 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] & 0xF) * 255); - int currentY2 = ((data[6 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] & 0xF0) >> 4) + (data[7 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] * 16); + int currentX1 = ((data[2 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] & 0x0F) << 8) | data[1 + TOUCHPAD_DATA_OFFSET + touchPacketOffset]; + int currentY1 = (data[3 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] << 4) | ((data[2 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] & 0xF0) >> 4); + int currentX2 = ((data[6 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] & 0x0F) << 8) | data[5 + TOUCHPAD_DATA_OFFSET + touchPacketOffset]; + int currentY2 = (data[7 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] << 4) | ((data[6 + TOUCHPAD_DATA_OFFSET + touchPacketOffset] & 0xF0) >> 4); TouchpadEventArgs args; if (sensors.Touch1 || sensors.Touch2) @@ -102,39 +120,54 @@ namespace DS4Windows if (TouchesBegan != null) { if (sensors.Touch1 && sensors.Touch2) - args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, new Touch(currentX1, currentY1, touchID1), new Touch(currentX2, currentY2, touchID2)); + { + t0.populate(currentX1, currentY1, touchID1); t1.populate(currentX2, currentY2, touchID2); + args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, t0, t1); + } else if (sensors.Touch1) - args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, new Touch(currentX1, currentY1, touchID1)); + { + t0.populate(currentX1, currentY1, touchID1); + args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, t0); + } else - args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, new Touch(currentX2, currentY2, touchID2)); + { + t0.populate(currentX2, currentY2, touchID2); + args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, t0); + } TouchesBegan(this, args); } } else if (sensors.Touch1 == lastIsActive1 && sensors.Touch2 == lastIsActive2 && TouchesMoved != null) { - Touch tPrev, t0, t1; + Touch currentT0, currentT1; if (sensors.Touch1 && sensors.Touch2) { - tPrev = new Touch(lastTouchPadX1, lastTouchPadY1, lastTouchID1); - t0 = new Touch(currentX1, currentY1, touchID1, tPrev); - tPrev = new Touch(lastTouchPadX2, lastTouchPadY2, lastTouchID2); - t1 = new Touch(currentX2, currentY2, touchID2, tPrev); + tPrev0.populate(lastTouchPadX1, lastTouchPadY1, lastTouchID1); + t0.populate(currentX1, currentY1, touchID1, tPrev0); + currentT0 = t0; + + tPrev1.populate(lastTouchPadX2, lastTouchPadY2, lastTouchID2); + t1.populate(currentX2, currentY2, touchID2, tPrev1); + currentT1 = t1; } else if (sensors.Touch1) { - tPrev = new Touch(lastTouchPadX1, lastTouchPadY1, lastTouchID1); - t0 = new Touch(currentX1, currentY1, touchID1, tPrev); - t1 = null; + tPrev0.populate(lastTouchPadX1, lastTouchPadY1, lastTouchID1); + t0.populate(currentX1, currentY1, touchID1, tPrev0); + currentT0 = t0; + currentT1 = null; } else { - tPrev = new Touch(lastTouchPadX2, lastTouchPadY2, lastTouchID2); - t0 = new Touch(currentX2, currentY2, touchID2, tPrev); - t1 = null; + tPrev0.populate(lastTouchPadX2, lastTouchPadY2, lastTouchID2); + t0.populate(currentX2, currentY2, touchID2, tPrev0); + currentT0 = t0; + currentT1 = null; } - args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, t0, t1); + + args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, currentT0, currentT1); TouchesMoved(this, args); } @@ -142,22 +175,42 @@ namespace DS4Windows if (!lastTouchPadIsDown && touchPadIsDown && TouchButtonDown != null) { if (sensors.Touch1 && sensors.Touch2) - args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, new Touch(currentX1, currentY1, touchID1), new Touch(currentX2, currentY2, touchID2)); + { + t0.populate(currentX1, currentY1, touchID1); + t1.populate(currentX2, currentY2, touchID2); + args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, t0, t1); + } else if (sensors.Touch1) - args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, new Touch(currentX1, currentY1, touchID1)); + { + t0.populate(currentX1, currentY1, touchID1); + args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, t0); + } else - args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, new Touch(currentX2, currentY2, touchID2)); + { + t0.populate(currentX2, currentY2, touchID2); + args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, t0); + } TouchButtonDown(this, args); } else if (lastTouchPadIsDown && !touchPadIsDown && TouchButtonUp != null) { if (sensors.Touch1 && sensors.Touch2) - args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, new Touch(currentX1, currentY1, touchID1), new Touch(currentX2, currentY2, touchID2)); + { + t0.populate(currentX1, currentY1, touchID1); + t1.populate(currentX2, currentY2, touchID2); + args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, t0, t1); + } else if (sensors.Touch1) - args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, new Touch(currentX1, currentY1, touchID1)); + { + t0.populate(currentX1, currentY1, touchID1); + args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, t0); + } else - args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, new Touch(currentX2, currentY2, touchID2)); + { + t0.populate(currentX2, currentY2, touchID2); + args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, t0); + } TouchButtonUp(this, args); } @@ -172,6 +225,7 @@ namespace DS4Windows lastTouchPadX2 = currentX2; lastTouchPadY2 = currentY2; } + lastTouchPadIsDown = touchPadIsDown; } else @@ -190,11 +244,21 @@ namespace DS4Windows if ((lastIsActive1 || lastIsActive2) && TouchesEnded != null) { if (lastIsActive1 && lastIsActive2) - args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, new Touch(lastTouchPadX1, lastTouchPadY1, touchID1), new Touch(lastTouchPadX2, lastTouchPadY2, touchID2)); + { + t0.populate(lastTouchPadX1, lastTouchPadY1, touchID1); + t1.populate(lastTouchPadX2, lastTouchPadY2, touchID2); + args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, t0, t1); + } else if (lastIsActive1) - args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, new Touch(lastTouchPadX1, lastTouchPadY1, touchID1)); + { + t0.populate(lastTouchPadX1, lastTouchPadY1, touchID1); + args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, t0); + } else - args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, new Touch(lastTouchPadX2, lastTouchPadY2, touchID2)); + { + t0.populate(lastTouchPadX2, lastTouchPadY2, touchID2); + args = new TouchpadEventArgs(sensors.ReportTimeStamp, sensors.TouchButton, t0); + } TouchesEnded(this, args); } diff --git a/DS4Windows/DS4Library/LICENSE-Crc32.txt b/DS4Windows/DS4Library/LICENSE-Crc32.txt new file mode 100644 index 0000000..d0381d6 --- /dev/null +++ b/DS4Windows/DS4Library/LICENSE-Crc32.txt @@ -0,0 +1,176 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/DS4Windows/DS4Windows.csproj b/DS4Windows/DS4Windows.csproj index 1bc2b7e..7e06a21 100644 --- a/DS4Windows/DS4Windows.csproj +++ b/DS4Windows/DS4Windows.csproj @@ -9,10 +9,25 @@ Properties DS4Windows DS4Windows - v4.5 + v4.5.2 512 true + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true AnyCPU @@ -27,12 +42,16 @@ AnyCPU - pdbonly + none true bin\Release\ - TRACE + + prompt 4 + false + false + 6 DS4Windows.Program @@ -52,26 +71,73 @@ app.manifest + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + true + + + bin\x64\Release\ + true + none + x64 + false + prompt + MinimumRecommendedRules.ruleset + WIN64 + On + 6 + false + true + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + prompt + MinimumRecommendedRules.ruleset + true + true + + + bin\x86\Release\ + true + none + x86 + false + prompt + MinimumRecommendedRules.ruleset + true + 6 + On + true + + + ..\packages\TaskScheduler.2.8.0\lib\net452\Microsoft.Win32.TaskScheduler.dll + - - - - - - + + @@ -98,6 +164,14 @@ X360Device.cs + + UserControl + + + LanguagePackComboBox.cs + + + @@ -106,12 +180,6 @@ - - Form - - - Alreadyrunning.cs - Form @@ -187,56 +255,68 @@ - - Alreadyrunning.cs - DS4Form.cs + Designer DS4Form.cs + Designer DS4Form.cs + Designer DS4Form.cs + Designer DS4Form.cs + Designer DS4Form.cs + Designer DS4Form.cs + Designer DS4Form.cs + Designer DS4Form.cs + Designer DS4Form.cs + Designer DS4Form.cs + Designer DS4Form.cs DS4Form.cs + Designer DS4Form.cs + Designer DS4Form.cs + Designer DS4Form.cs + Designer DS4Form.cs @@ -246,27 +326,34 @@ DS4Form.cs + Designer DS4Form.cs + Designer DS4Form.cs + Designer DS4Form.cs DS4Form.cs + Designer DS4Form.cs + Designer DS4Form.cs + Designer DS4Form.cs + Designer DS4Keyboard.cs @@ -505,6 +592,9 @@ KBM360.cs + + LanguagePackComboBox.cs + Options.cs @@ -1004,6 +1094,7 @@ + SettingsSingleFileGenerator Settings.Designer.cs @@ -1023,18 +1114,7 @@ - - {F935DC20-1CF0-11D0-ADB9-00C04FD58A0B} - 1 - 0 - 0 - tlbimp - False - True - - - - + @@ -1117,7 +1197,28 @@ + + + False + Microsoft .NET Framework 4.5.2 %28x86 and x64%29 + true + + + + rem Copy compiled l18n assemblies to alt folder +GOTO END +if not exist $(TargetDir)Lang mkdir $(TargetDir)Lang +set langs=ar cs de de-DE el es fi fr fr-FR he hu id it it-IT ja ko nl pl ^ + +pt-BR ro-RO ru-RU sl sv tr uk vi zh-CN zh-Hans zh-Hant + +for %25%25l in (%25langs%25) do ( + xcopy $(TargetDir)%25%25l $(TargetDir)Lang\%25%25l\ /s /y +) + +:END + - -
- - -
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..647cdd1 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); @@ -229,7 +229,10 @@ namespace DS4Windows internal static DEVPROPKEY DEVPKEY_Device_BusReportedDeviceDesc = new DEVPROPKEY { fmtid = new Guid(0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2), pid = 4 }; - [DllImport("setupapi.dll", EntryPoint = "SetupDiGetDeviceRegistryProperty")] + internal static DEVPROPKEY DEVPKEY_Device_HardwareIds = + new DEVPROPKEY { fmtid = new Guid(0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0), pid = 3 }; + + [DllImport("setupapi.dll", EntryPoint = "SetupDiGetDeviceRegistryProperty")] public static extern bool SetupDiGetDeviceRegistryProperty(IntPtr deviceInfoSet, ref SP_DEVINFO_DATA deviceInfoData, int propertyVal, ref int propertyRegDataType, byte[] propertyBuffer, int propertyBufferSize, ref int requiredSize); [DllImport("setupapi.dll", EntryPoint = "SetupDiGetDevicePropertyW", SetLastError = true)] @@ -391,7 +394,12 @@ namespace DS4Windows [DllImport("hid.dll")] static internal extern int HidP_GetValueCaps(short reportType, ref byte valueCaps, ref short valueCapsLength, IntPtr preparsedData); +#if WIN64 [DllImport("hid.dll")] static internal extern bool HidD_GetSerialNumberString(IntPtr HidDeviceObject, byte[] Buffer, ulong BufferLength); +#else + [DllImport("hid.dll")] + static internal extern bool HidD_GetSerialNumberString(IntPtr HidDeviceObject, byte[] Buffer, uint BufferLength); +#endif } } diff --git a/DS4Windows/Program.cs b/DS4Windows/Program.cs index b03b573..789393f 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 { @@ -14,16 +15,15 @@ namespace DS4Windows [return: MarshalAs(UnmanagedType.Bool)] static extern bool SetForegroundWindow(IntPtr hWnd); - [DllImport("user32.dll")] - private static extern IntPtr GetForegroundWindow(); // Add "global\" in front of the EventName, then only one instance is allowed on the // whole system, including other users. But the application can not be brought // into view, of course. - private static String SingleAppComEventName = "{a52b5b20-d9ee-4f32-8518-307fa14aa0c6}"; - static Mutex mutex = new Mutex(true, "{FI329DM2-DS4W-J2K2-HYES-92H21B3WJARG}"); - private static BackgroundWorker singleAppComThread = null; + private static string SingleAppComEventName = "{a52b5b20-d9ee-4f32-8518-307fa14aa0c6}"; private static EventWaitHandle threadComEvent = null; + private static bool exitComThread = false; public static ControlService rootHub; + private static Thread testThread; + private static Thread controlThread; /// /// The main entry point for the application. @@ -31,15 +31,14 @@ namespace DS4Windows [STAThread] static void Main(string[] args) { - //Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("he"); - for (int i = 0; i < args.Length; i++) + //Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("ja"); + for (int i = 0, argsLen = args.Length; i < argsLen; i++) { string s = args[i]; if (s == "driverinstall" || s == "-driverinstall") { Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new WelcomeDialog()); + Application.Run(new WelcomeDialog(true)); return; } else if (s == "re-enabledevice" || s == "-re-enabledevice") @@ -58,16 +57,32 @@ 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; + Process.GetCurrentProcess().PriorityClass = + ProcessPriorityClass.High; } catch { // Ignore problems raising the priority. } + try { // another instance is already running if OpenExsting succeeds. @@ -77,58 +92,72 @@ namespace DS4Windows return; // return immediatly. } catch { /* don't care about errors */ } + // Create the Event handle - threadComEvent = new EventWaitHandle(false, EventResetMode.AutoReset, SingleAppComEventName); - CreateInterAppComThread(); + threadComEvent = new EventWaitHandle(false, EventResetMode.ManualReset, SingleAppComEventName); + //System.Threading.Tasks.Task.Run(() => CreateTempWorkerThread()); + //CreateInterAppComThread(); + CreateTempWorkerThread(); + //System.Threading.Tasks.Task.Run(() => { Thread.CurrentThread.Priority = ThreadPriority.Lowest; CreateInterAppComThread(); Thread.CurrentThread.Priority = ThreadPriority.Lowest; }).Wait(); - if (mutex.WaitOne(TimeSpan.Zero, true)) - { - rootHub = new ControlService(); + //if (mutex.WaitOne(TimeSpan.Zero, true)) + //{ + createControlService(); + rootHub.createHidGuardKey(); + //rootHub = new ControlService(); Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); Application.Run(new DS4Form(args)); - mutex.ReleaseMutex(); - } + rootHub.removeHidGuardKey(); + //mutex.ReleaseMutex(); + //} - // End the communication thread. - singleAppComThread.CancelAsync(); - while (singleAppComThread.IsBusy) - Thread.Sleep(50); + exitComThread = true; + threadComEvent.Set(); // signal the other instance. + while (testThread.IsAlive) + Thread.SpinWait(500); threadComEvent.Close(); } - static private void CreateInterAppComThread() + private static void createControlService() { - singleAppComThread = new BackgroundWorker(); - singleAppComThread.WorkerReportsProgress = false; - singleAppComThread.WorkerSupportsCancellation = true; - singleAppComThread.DoWork += new DoWorkEventHandler(singleAppComThread_DoWork); - singleAppComThread.RunWorkerAsync(); + controlThread = new Thread(() => { rootHub = new ControlService(); }); + controlThread.Priority = ThreadPriority.Normal; + controlThread.IsBackground = true; + controlThread.Start(); + while (controlThread.IsAlive) + Thread.SpinWait(500); } - static private void singleAppComThread_DoWork(object sender, DoWorkEventArgs e) + private static void CreateTempWorkerThread() + { + testThread = new Thread(singleAppComThread_DoWork); + testThread.Priority = ThreadPriority.Lowest; + testThread.IsBackground = true; + testThread.Start(); + } + + private static void singleAppComThread_DoWork() { - BackgroundWorker worker = sender as BackgroundWorker; WaitHandle[] waitHandles = new WaitHandle[] { threadComEvent }; - while (!worker.CancellationPending) + while (!exitComThread) { // check every second for a signal. - if (WaitHandle.WaitAny(waitHandles, 1000) == 0) + if (WaitHandle.WaitAny(waitHandles) == 0) { + threadComEvent.Reset(); // The user tried to start another instance. We can't allow that, // so bring the other instance back into view and enable that one. // That form is created in another thread, so we need some thread sync magic. - if (Application.OpenForms.Count > 0) + if (!exitComThread && Application.OpenForms.Count > 0) { Form mainForm = Application.OpenForms[0]; - mainForm.Invoke(new SetFormVisableDelegate(ThreadFormVisable), mainForm); + mainForm?.Invoke(new SetFormVisableDelegate(ThreadFormVisable), mainForm); } } } } - /// /// When this method is called using a Invoke then this runs in the thread /// that created the form, which is nice. @@ -153,6 +182,7 @@ namespace DS4Windows SetForegroundWindow(wp.form.Handle); } } + SetForegroundWindow(frm.Handle); } } diff --git a/DS4Windows/Properties/AssemblyInfo.cs b/DS4Windows/Properties/AssemblyInfo.cs index 89532d7..149f758 100644 --- a/DS4Windows/Properties/AssemblyInfo.cs +++ b/DS4Windows/Properties/AssemblyInfo.cs @@ -1,4 +1,5 @@ -using System.Reflection; +using System.Resources; +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -10,7 +11,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, 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +33,7 @@ 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.120")] +[assembly: AssemblyFileVersion("1.4.120")] +[assembly: NeutralResourcesLanguage("en")] + diff --git a/DS4Windows/Properties/Resources.Designer.cs b/DS4Windows/Properties/Resources.Designer.cs index 8c205c4..2f233d7 100644 --- a/DS4Windows/Properties/Resources.Designer.cs +++ b/DS4Windows/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace DS4Windows.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -211,6 +211,15 @@ namespace DS4Windows.Properties { } } + /// + /// Looks up a localized string similar to Determines the poll rate used for the DS4 hardware when connected via Bluetooth. + /// + internal static string BTPollRate { + get { + return ResourceManager.GetString("BTPollRate", resourceCulture); + } + } + /// /// Looks up a localized string similar to Cannot move files to new location, Please rename the DS4Tool folder to "DS4Windows". /// @@ -265,6 +274,15 @@ namespace DS4Windows.Properties { } } + /// + /// Looks up a localized string similar to This will disconnect all your connected controllers. Proceed?. + /// + internal static string CloseConfirm { + get { + return ResourceManager.GetString("CloseConfirm", resourceCulture); + } + } + /// /// Looks up a localized string similar to Close DS4Windows?. /// @@ -293,7 +311,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 { @@ -301,6 +319,15 @@ namespace DS4Windows.Properties { } } + /// + /// Looks up a localized string similar to Confirm.... + /// + internal static string Confirm { + get { + return ResourceManager.GetString("Confirm", resourceCulture); + } + } + /// /// Looks up a localized string similar to Connecting.... /// @@ -412,7 +439,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 { @@ -918,6 +945,15 @@ namespace DS4Windows.Properties { } } + /// + /// Looks up a localized string similar to Check to have gyro active while trigger is active. Uncheck to disable gyro while trigger is active.. + /// + internal static string GyroTriggerBehavior { + get { + return ResourceManager.GetString("GyroTriggerBehavior", resourceCulture); + } + } + /// /// Looks up a localized string similar to GyroX, Left and Right Tilt. /// @@ -1054,6 +1090,15 @@ namespace DS4Windows.Properties { } } + /// + /// Looks up a localized string similar to Language pack change will take effect after DS4Windows application is restarted.. + /// + internal static string LanguagePackApplyRestartRequired { + get { + return ResourceManager.GetString("LanguagePackApplyRestartRequired", resourceCulture); + } + } + /// /// Looks up a localized string similar to Controller *number*'s latency now under 10ms. /// @@ -1112,7 +1157,7 @@ namespace DS4Windows.Properties { } /// - /// Looks up a localized string similar to Also dim light by idle timeout if on. + /// Looks up a localized string similar to Also dim light by idle timeout if enabled when DS4 is fully charged. /// internal static string LightByBatteryTip { get { @@ -1428,7 +1473,7 @@ namespace DS4Windows.Properties { } /// - /// Looks up a localized string similar to EXPERIMENTAL: Auto-Disable BT when conencting to USB. + /// Looks up a localized string similar to EXPERIMENTAL: Auto-Disable BT when connecting to USB. /// internal static string QuickCharge { get { @@ -1573,6 +1618,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. /// @@ -1602,7 +1656,7 @@ namespace DS4Windows.Properties { } /// - /// Looks up a localized string similar to Searching for controllers…. + /// Looks up a localized string similar to Searching for controllers.... /// internal static string SearchingController { get { @@ -1945,6 +1999,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.cs.resx b/DS4Windows/Properties/Resources.cs.resx index 4eb7aee..1301483 100644 --- a/DS4Windows/Properties/Resources.cs.resx +++ b/DS4Windows/Properties/Resources.cs.resx @@ -126,6 +126,9 @@ Přidat programy + + Změna jazykového balíčku se projeví po restartu aplikace DS4Windows. + Test diff --git a/DS4Windows/Properties/Resources.es.resx b/DS4Windows/Properties/Resources.es.resx index f27f10d..01449d0 100644 --- a/DS4Windows/Properties/Resources.es.resx +++ b/DS4Windows/Properties/Resources.es.resx @@ -124,10 +124,10 @@ Agregar programas - Siempre Modo Alcoiris + Siempre en Modo Arcoiris - Asignar a Controlador *number* + Asignar al Control *number* Batería: *number*% @@ -157,13 +157,13 @@ Conectando... - Editar perfil para el Controlador *number* + Editar perfil para el Control *number* - Crear perfil para el Controlador *number* + Crear perfil para el Control *number* - Controlador *Mac address* perdió la conexión o fue desconectado + Control *Mac address* perdió la conexión o fue desconectado Copia completa, por favor reinicia DS4Windows y elimina preferencias del directorio de programa @@ -184,7 +184,7 @@ Borrar perfil? - Apagar la entrada X360 y utilizar solo la entrada nativa DS4, ocultar ds4 debe estar apagado + Apagar la entrada de Xbox 360 y utilizar solo la entrada nativa DS4, ocultar DS4 debe estar apagado Desconectado @@ -211,7 +211,7 @@ Brillar HID - Controlador Encontrado: + Control Encontrado: Completo @@ -283,7 +283,7 @@ Carpeta de Perfil se ha movido a Carpeta de Programa - Debes salir de otras aplicaciones como Steam, Uplay antes de activar la opción "Ocultar controlador DS4" + Debes salir de otras aplicaciones como Steam, Uplay antes de activar la opción "Ocultar control DS4" Grabar @@ -292,7 +292,7 @@ Guardar Macro grabado? - Buscando controladores... + Buscando controles... Selecciona una acción para *action* @@ -316,10 +316,10 @@ DS4Windows detenido - Deteniendo Controladores DS4 + Deteniendo Controles DS4 - Deteniendo Controladores X360 + Deteniendo Controles X360 Detener @@ -349,10 +349,10 @@ Inclinacion Arriba - Movimiento de Panel Táctil Apagado + Movimiento del Panel Táctil Apagado - Movimiento de Panel Táctil Encendido + Movimiento del Panel Táctil Encendido escriba nuevo nombre aquí @@ -367,13 +367,13 @@ Actualizado - También puedes utilizar tu controlador para cambiar controles + También puedes utilizar tu control para cambiar controles Usando Modo Exclusivo - Controlador *number* está usando perfil "*Profile name*" + Control *number* está usando el perfil "*Profile name*" Usando Modo Compartido @@ -403,7 +403,7 @@ Cerrar DS4Windows? - Cierra DS4Windows vía el icono de notificación + Cierra DS4Windows por medio del icono de notificación Atenuar al % de la batería @@ -451,10 +451,10 @@ Utiliza Sixaxis para ayudar a calcular el movimiento del Panel Táctil - Controlador *number* tiene menos de 10ms de latencia + El control *number* tiene menos de 10ms de latencia - Controlador *number* tiene más de 10ms de latencia + El control *number* tiene más de 10ms de latencia Abrir *program* @@ -469,7 +469,7 @@ Macro - Controlador *number* no está utilizando un perfil + El control *number* no está utilizando un perfil , otros archivos de localización serán eliminados @@ -520,10 +520,10 @@ Inclinacion Abajo - Rehabilita pulsando PS+Panel Táctil + Rehabilita pulsando PS + Panel Táctil - 2 dedos en el Panel Táctil desliza derecha o izquierda + Dos dedos en el Panel Táctil: desliza derecha o izquierda Esto desactiva el panel táctil como un ratón @@ -544,6 +544,6 @@ Test - Utiliza puertos más altos si tienes conflictos en otros programas de emulación X360, como la herramienta SCP + Utiliza puertos más altos si tienes conflictos en otros programas emuladores de Xbox 360, como la herramienta SCP \ No newline at end of file diff --git a/DS4Windows/Properties/Resources.resx b/DS4Windows/Properties/Resources.resx index 2cc05e5..f04a78a 100644 --- a/DS4Windows/Properties/Resources.resx +++ b/DS4Windows/Properties/Resources.resx @@ -118,128 +118,20 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\Resources\mouse.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\rainbow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\rainbowC.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\DS4 Controller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Pairmode.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\shell32_copy.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\shell32_new.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\delete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\imageres_new.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\BT.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\none.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\USB.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\export.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\imageres_import.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\saveprofile.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\A.PNG;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\B.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Name of this action already exists - - ..\Resources\BACK.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Adding to list... - - ..\Resources\DOWN.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Add Programs - - ..\Resources\LB.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\LEFT.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\LS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\LSD.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\LSL.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\LSR.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\LSU.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\LT.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\RB.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\RIGHT.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\RS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\RSD.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\RSL.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\RSR.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\RSU.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\RT.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\START.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\UP.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\X.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Y.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\size.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\checked.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + A location must be picked to continue Always Rainbow Mode @@ -247,23 +139,62 @@ Assign to Controller *number* + + ..\Resources\B.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\BACK.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Battery: *number*% Best used with right side as a mouse function + + Browse... + + + ..\Resources\BT.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Determines the poll rate used for the DS4 hardware when connected via Bluetooth + + + Cannot move files to new location, Please rename the DS4Tool folder to "DS4Windows" + Cannot write at current location. Copy Settings to appdata? + + Charge the battery + Charged Charging: *number*% + + Check Battery + + + This will disconnect all your connected controllers. Proceed? + + + Close DS4Windows? + + + Close DS4Windows via the notification icon + + + Color + - Color by Battey % + Color by Battery % + + + Confirm... Connecting... @@ -277,6 +208,9 @@ Controller *Mac address* was removed or lost connection + + ..\Resources\shell32_copy.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Copy complete, please relaunch DS4Windows and remove settings from Program Directory @@ -292,386 +226,50 @@ days + + ..\Resources\delete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Delete Profile? - Dim by Battey % + Dim by Battery % + + + Turn off X360 input and only use the DS4's native input, hide ds4 must be off (Wired Only) + + + Disconnect BT Disconnected + + ..\Resources\DOWN.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Downloading *number*% Download Version *number* now? - - DS4Windows Update Available! - - - DS4Windows cannot edit settings here, This will now close - - - Edit - - - 5th Mouse Button Down - - - 5th Mouse Button Up - - - Flush HID - - - Found Controller: - - - 4th Mouse Button Down - - - 4th Mouse Button Up - - - Full - - - hour - - - hours - - - If removing DS4Windows, You can delete the settings following the profile folder link - - - Install Complete - - - Loading... - - - Make a New Profile - - - N/A - - - New - - - No macro was recorded - - - (none) - - - none - - - No Profile Loaded - - - Not valid - - - Opening Installer - - - Please Open ScpDriver.exe - - - Please Download the Updater now, and place it in the programs folder, then check for update again - - - Please import or make a profile - - - *Profile name* cannot be restored. - - - Profile Folder Moved to program folder - - - You must quit other applications like Steam, Uplay before activating the 'Hide DS4 Controller' option." - - - Save Recorded Macro? - - - Searching for controllers… - - - Select an action for *action* - - - Starting... - - - Start - - - Stopping DS4 Controllers - - - Stopping X360 Controllers - - - Stop - - - Swipe Touchpad to change profiles - - - Tap and hold to drag, slight delay with single taps - - - Touchpad Movement is now Off - - - Touchpad Movement is now On - - - type new name here - - - type profile name here - - - You can also use your controller to change controls - - - Using Exclusive Mode - - - Using Shared Mode - - - Please enter a valid name - - - Wait *number*ms - - - Will Keep - - - 2 finger touchpad swipe left or right - - - You are up to date - - - Adding to list... - - - Add Programs - - - Browse... - - - Color - Down - - Input Delay: *number*ms - - - Keep this window size after closing - - - Record - - - Step 1: Install the DS4 Driver - - - Up - - - Turn off X360 input and only use the DS4's native input, hide ds4 must be off (Wired Only) - - - Install Drivers here - - - Tilt Down - - - Tilt Left - - - Tilt Right - - - Tilt Up - - - Installing... - ..\Resources\DS4.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + DS4Windows Update Available! + ..\Resources\DS4W.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Install Failed, Please Retry + + DS4Windows cannot edit settings here, This will now close - - Swipe Down - - - Swipe Left - - - Swipe Right - - - Swipe Up - - - Stop Heavy - - - Stop Light - - - Test Heavy - - - Test Light - - - EXPERIMENTAL: Auto-Disable BT when conencting to USB - - - Test - - - Cannot move files to new location, Please rename the DS4Tool folder to "DS4Windows" - - - Use higher ports if you get conflicts in other emulating X360 programs, such as SCP's tool - - - Name of this action already exists - - - Launch *program* - - - Load *profile* - - - Set Regular Trigger - - - Set Unload Trigger - - - Close DS4Windows via the notification icon - - - Right Click to set presets for a set of controls - - - Disconnect BT - - - New Profile - - - Fall Back to *button* - - - Click to change flash color. Black = default color - - - Flush HID Queue after each reading - - - Click to see readout of Sixaxis Gyro - - - GyroX, Left and Right Tilt - - - GyroY, Forward and Back Tilt - - - GyroZ, Up and Down Tilt - - - Hover over items to see description or more about - - - Use Sixaxis to help calculate touchpad movement - - - Also dim light by idle timeout if on - - - Macro - - - Programs - - - Scan Code - - - Shortcuts - - - Click for advanced Sixaxis reading - - - Re-enable by pressing PS+Touchpad - - - This disables the Touchpad as a mouse - - - Fall Back - - - A location must be picked to continue - - - Close DS4Windows? - - - , other location files will be deleted - - - ..\Resources\EE.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Stopped DS4Windows - - - Controller *number*'s latency now under 10ms - - - Controller *number*'s latency over 10ms - - - Controller *number* is not using a profile - - - Check Battery - - - Controller *number* is using Profile “*Profile name*" - - - Charge the battery + + ..\Resources\DS4W - White.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\DS4 Config.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -739,40 +337,463 @@ ..\Resources\DS4-Config_Up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\DS4 Controller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\DS4 lightbar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Text Document (*.txt) + + ..\Resources\shell32_new.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - XML Files (*.xml) + + Edit - - Unassigned + + ..\Resources\EE.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\export.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Fall Back + + + Fall Back to *button* + + + 5th Mouse Button Down + + + 5th Mouse Button Up + + + Click to change flash color. Black = default color + + + Flush HID + + + Flush HID Queue after each reading + + + Found Controller: + + + 4th Mouse Button Down + + + 4th Mouse Button Up + + + Full + + + Click to see readout of Sixaxis Gyro + + + Check to have gyro active while trigger is active. Uncheck to disable gyro while trigger is active. + + + GyroX, Left and Right Tilt + + + GyroY, Forward and Back Tilt + + + GyroZ, Up and Down Tilt + + + hour + + + hours + + + Hover over items to see description or more about + + + If removing DS4Windows, You can delete the settings following the profile folder link + + + ..\Resources\imageres_import.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Input Delay: *number*ms + + + Install Complete + + + Install Drivers here + + + Install Failed, Please Retry + + + Installing... + + + Use Sixaxis to help calculate touchpad movement + + + Keep this window size after closing + + + Language pack change will take effect after DS4Windows application is restarted. + + + Controller *number*'s latency now under 10ms + + + Controller *number*'s latency over 10ms + + + Launch *program* + + + ..\Resources\LB.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\LEFT.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\left touch.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Also dim light by idle timeout if enabled when DS4 is fully charged + + + Loading... + + + Load *profile* + + + ..\Resources\LS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\LSD.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\LSL.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\LSR.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\LSU.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\LT.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Macro + + + Macro Recorded + + + Make a New Profile + + + ..\Resources\mouse.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Mutli-Action Button + + + N/A + + + New + + + ..\Resources\imageres_new.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + No macro was recorded + + + ..\Resources\none.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + (none) + + + none + + + No Profile Loaded + + + Controller *number* is not using a profile + + + Not valid + + + Opening Installer + + + Please Open ScpDriver.exe + + + , other location files will be deleted + + + ..\Resources\Pairmode.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Please Download the Updater now, and place it in the programs folder, then check for update again + + + Please import or make a profile + + + New Profile + + + *Profile name* cannot be restored. + + + Profile Folder Moved to program folder + + + Programs + + + EXPERIMENTAL: Auto-Disable BT when connecting to USB + + + You must quit other applications like Steam, Uplay before activating the 'Hide DS4 Controller' option." + + + ..\Resources\rainbow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\rainbowC.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\RB.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Record + + + ..\Resources\RIGHT.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Right Click to set presets for a set of controls + ..\Resources\right touch.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\RS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\RSD.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\RSL.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\RSR.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\RSU.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\RT.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Tells Windows to start DS4Windows after login + + + ..\Resources\saveprofile.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Save Recorded Macro? + + + Scan Code + + + Searching for controllers... + + + Select an action for *action* + + + Select a macro + + + Set Regular Trigger + + + Set Unload Trigger + + + Shortcuts + + + Click for advanced Sixaxis reading + + + ..\Resources\size.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\START.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Starting... + + + Start + + + Step 1: Install the DS4 Driver + + + Stop Heavy + + + Stop Light + + + Stopped DS4Windows + + + Stopping DS4 Controllers + + + Stopping X360 Controllers + + + Stop + + + Swipe Down + + + Swipe Left + + + Swipe Right + + + Swipe Touchpad to change profiles + + + Swipe Up + + + Tap and hold to drag, slight delay with single taps + + + Test Heavy + + + Test Light + + + Test + + + Text Document (*.txt) + + + Tilt Down + + + Tilt Left + + + Tilt Right + + + Tilt Up + + + Touchpad Movement is now Off + + + Touchpad Movement is now On + + + Re-enable by pressing PS+Touchpad + + + 2 finger touchpad swipe left or right + + + type new name here + + + type profile name here + + + You need to run DS4Windows as the Administrator in order to activate this mode. + + + Unassigned + + + ..\Resources\UP.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Up + + + You are up to date + + + ..\Resources\USB.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + You can also use your controller to change controls + + + Using Exclusive Mode + + + Controller *number* is using Profile “*Profile name*" + + + Using Shared Mode + + + This disables the Touchpad as a mouse + + + Please enter a valid name + + + Wait *number*ms + + + Will Keep + + + ..\Resources\X.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Use higher ports if you get conflicts in other emulating X360 programs, such as SCP's tool + + + XML Files (*.xml) + + + ..\Resources\Y.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\360 highlight.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\360 map.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\DS4W - White.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Mutli-Action Button - - - Macro Recorded - - - Select a macro + + ..\Resources\checked.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/DS4Windows/Properties/Resources.ru-RU.resx b/DS4Windows/Properties/Resources.ru-RU.resx index deacf82..ae54755 100644 --- a/DS4Windows/Properties/Resources.ru-RU.resx +++ b/DS4Windows/Properties/Resources.ru-RU.resx @@ -144,9 +144,15 @@ Обзор… + + Невозможно переместить файлы в новое место. Пожалуйста переименуйте папку с DS4Tool в "DS4Windows" + Невозможно записать в текущее местоположение. Скопировать настройки в AppData? + + Зарядите батарею + Заряжено @@ -231,6 +237,9 @@ Вернуть + + Вернуть на *button* + 5-я кнопка мыши Вниз @@ -291,6 +300,9 @@ Установите этот драйвер + + Установка не удалась. Пожалуйста повторите + Установка... @@ -300,6 +312,9 @@ Запоминать размер окна после закрытия + + Выбранный языковой пакет будет применен после перезапуска приложения DS4Windows. + Задержка *number*-го контроллера сейчас меньше 10 мс @@ -426,6 +441,9 @@ Ост. лёгкий + + Остановлена работа DS4Windows + Остановлена работа DS4Windows @@ -462,6 +480,12 @@ Тест. лёгкого + + Проверка + + + Текстовый документ (*.txt) + Накл. вниз @@ -492,6 +516,9 @@ введите сюда имя профиля + + Не назначено + Вверх @@ -525,31 +552,7 @@ Используйте иной порт, если у вас возникла проблема с другой программой эмулятора контроллера X360, такой как SCP's tool - - Остановлена работа DS4Windows - - - Текстовый документ (*.txt) - - - Невозможно переместить файлы в новое место. Пожалуйста переименуйте папку с DS4Tool в "DS4Windows" - - - Зарядите батарею - - - Вернуть на *button* - - - Установка не удалась. Пожалуйста повторите - - - Не назначено - XML-файлы (*.xml) - - Проверка - \ 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/app.config b/DS4Windows/app.config index d1428ad..4b7b07e 100644 --- a/DS4Windows/app.config +++ b/DS4Windows/app.config @@ -1,6 +1,11 @@ - + + + + + + diff --git a/DS4Windows/packages.config b/DS4Windows/packages.config new file mode 100644 index 0000000..b9f6d9e --- /dev/null +++ b/DS4Windows/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/NOTICE.txt b/NOTICE.txt new file mode 100644 index 0000000..71ce9ec --- /dev/null +++ b/NOTICE.txt @@ -0,0 +1,7 @@ +This project includes the source code of some third party projects. This file +will attempt to document some third party source code that is used in the +DS4Windows source code and state the original source. + +Crc32: + +https://github.com/dariogriffo/Crc32 diff --git a/README.md b/README.md index 1c72831..d01c428 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,73 @@ # 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. +DS4Windows is an extract anywhere program that allows you to get the best DualShock 4 experience 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/Ryochan7/DS4Windows/releases). + +UdpServer builds for using Gyro motion controls in Cemu. + +http://ryochan7.xyz/ds4windows/test/DS4Windows_1.4.120_UdpServer_x64.zip +http://ryochan7.xyz/ds4windows/test/DS4Windows_1.4.120_ViGEm_UdpServer_x64.zip + +ViGEm build. + +http://ryochan7.xyz/ds4windows/test/DS4Windows_1.4.120_ViGEm_x64.zip + +This project is a fork of the work of Jays2Kings. You can find the old project +website at [ds4windows.com](http://ds4windows.com). ## 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) +- Windows 7 or newer +- [Microsoft .NET 4.5.2 or higher (needed to unzip the driver and for macros to work properly)](http://www.microsoft.com/en-us/download/details.aspx?id=42642) +- SCP Virtual Bus 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)](https://www.newegg.com/Product/Product.aspx?Item=N82E16833166126) (Toshiba's bluetooth adapters currently do not work) + +## Device Detection Issue + +If your DS4 is not detected by DS4Windows and the lightbar continues to +flash yellow, there is a chance that Exclusive Mode has permanently +disabled your DS4 in Windows. The easiest way to test if this has happened is +for you to plug in the controller into a different USB port and see if it +works then. Although this problem mainly affected versions of +DS4Windows prior to 1.4.109 when using some applications, other mapping +programs can cause the same problem to occur. + + +If you suspect that your DS4 has been disabled, open the Device Manager +(Control Panel\Hardware and Sound\Device Manager) and look for devices listed +under the path "Human Interface Devices\HID-compliant game controller". + +![Disabled Device Example](https://raw.githubusercontent.com/Ryochan7/DS4Windows/jay/disabled_device_example_small.png) + +If the icon shown for a device has a down arrow icon then you should +check the device's device instance path and see if the device is a +DualShock 4 device. Right click the device item and select "Enable device" +from the menu. That will re-enable the device and be seen by applications +again. + +## Pull Requests + +Pull requests for DS4Windows are welcome. Before making a pull request, please +test your changes to ensure that the changes made do not negatively affect +the performance of other parts of the application. Some consideration will +be made during code review to try to tweak the changes in order to improve +application performance. However, there is a chance that a pull request will be +rejected if no reasonable solution can be found to incorporate code changes. + +## Tip Jar + +If you would like to send some coin my way, here are some means by +which to do so. + +Bitcoin: 1DnMJwjdd7JRfHJap2mmTmADYm38SzR2z9 +Dogecoin: D9fhbXp9bCHEhuS8vX1BmVu6t7Y2nVNUCK +Litecoin: La5mniW7SFMH2RhqDgUty3RwkBSYbjbnJ6 +Monero: 49RvRMiMewaeez1Y2auxHmfMaAUYfhUpBem4ohzRJd9b5acPcxzh1icjnhZfjnYd1S7NQ57reQ7cP1swGre3rpfzUgJhEB7 +PayPal: https://paypal.me/ryochan7 -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) diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..ae89e3e --- /dev/null +++ b/TODO.md @@ -0,0 +1,15 @@ +# TODO + +* Perform some final cleanup and release version 1.5 +* ~~Attempt to work out BT disconnect issues by looking at older versions~~ +* Attempt to remove reliance on the main thread when disconnecting a device. +Currently used to delay hotplug routine +* Look into distributing profile properties around various objects +rather than using a lot of getters to obtain properties each poll. +It will complicate the architecture a little bit but hopefully +any speed difference will make up for it. +* Remove old welcome dialog and make new driver installer executable. +Use newer standards (WPF) and bundle app with DS4Windows +* ~~Attempt to no longer disable service when changing dinput only option +in profiles +* ~~Update Task Scheduler to latest version~~ diff --git a/contributors.txt b/contributors.txt new file mode 100644 index 0000000..ec5e9e3 --- /dev/null +++ b/contributors.txt @@ -0,0 +1,5 @@ +Travis Nickles (Ryochan7) +Korney Czukowski (czukowski) +jdfeng +Yuki-nyan + diff --git a/disabled_device_example.png b/disabled_device_example.png new file mode 100644 index 0000000..22c2009 Binary files /dev/null and b/disabled_device_example.png differ diff --git a/disabled_device_example_small.png b/disabled_device_example_small.png new file mode 100644 index 0000000..b702ff5 Binary files /dev/null and b/disabled_device_example_small.png differ