diff --git a/DS4Windows/DS4Control/ControlSerivce.cs b/DS4Windows/DS4Control/ControlSerivce.cs index 5855ade..fa8b5dd 100644 --- a/DS4Windows/DS4Control/ControlSerivce.cs +++ b/DS4Windows/DS4Control/ControlSerivce.cs @@ -423,7 +423,7 @@ namespace DS4Windows if (DS4Controllers[index] != null) { DS4Device d = DS4Controllers[index]; - String battery; + string battery; if (!d.IsAlive()) battery = "..."; @@ -483,9 +483,10 @@ namespace DS4Windows CurrentState[ind].Battery = PreviousState[ind].Battery = 0; // Reset for the next connection's initial status change. x360Bus.Unplug(ind); string removed = Properties.Resources.ControllerWasRemoved.Replace("*Mac address*", (ind + 1).ToString()); - if (device.Battery <= 20 && - device.ConnectionType == ConnectionType.BT && !device.Charging) + if (device.getBattery() <= 20 && + device.getConnectionType() == ConnectionType.BT && !device.isCharging()) removed += ". " + Properties.Resources.ChargeController; + LogDebug(removed); Log.LogToTray(removed); System.Threading.Thread.Sleep(XINPUT_UNPLUG_SETTLE_TIME); diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs index be2a8f5..831b97a 100644 --- a/DS4Windows/DS4Control/Mapping.cs +++ b/DS4Windows/DS4Control/Mapping.cs @@ -794,15 +794,17 @@ namespace DS4Windows cState.calculateStickAngles(); DS4StateFieldMapping fieldMapping = new DS4StateFieldMapping(cState, eState, tp); - + DS4StateFieldMapping outputfieldMapping = new DS4StateFieldMapping(cState, eState, tp); + SyntheticState deviceState = Mapping.deviceState[device]; if (getProfileActionCount(device) > 0 || !string.IsNullOrEmpty(tempprofilename[device])) - MapCustomAction(device, cState, MappedState, eState, tp, ctrl, fieldMapping); + MapCustomAction(device, cState, MappedState, eState, tp, ctrl, fieldMapping, outputfieldMapping); if (ctrl.DS4Controllers[device] == null) return; cState.CopyTo(MappedState); Dictionary tempControlDict = new Dictionary(); + //MultiValueDict tempControlDict = new MultiValueDict(); DS4Controls usingExtra = DS4Controls.None; List tempSettingsList = getDS4CSettings(device); //foreach (DS4ControlSettings dcs in getDS4CSettings(device)) @@ -832,7 +834,7 @@ namespace DS4Windows bool active = getBoolMapping2(device, dcs.control, cState, eState, tp, fieldMapping); if (active) { - resetToDefaultValue2(dcs.control, MappedState, fieldMapping); + resetToDefaultValue2(dcs.control, MappedState, outputfieldMapping); PlayMacro(device, macroControl, string.Join("/", (int[])action), dcs.control, keyType); } else @@ -845,7 +847,7 @@ namespace DS4Windows ushort value = ushort.Parse(action.ToString()); if (getBoolActionMapping2(device, dcs.control, cState, eState, tp, fieldMapping)) { - resetToDefaultValue2(dcs.control, MappedState, fieldMapping); + resetToDefaultValue2(dcs.control, MappedState, outputfieldMapping); SyntheticState.KeyPresses kp; if (!deviceState.keyPresses.TryGetValue(value, out kp)) deviceState.keyPresses[value] = kp = new SyntheticState.KeyPresses(); @@ -901,10 +903,10 @@ namespace DS4Windows { switch (xboxControl) { - case X360Controls.A: tempControlDict.Add(DS4Controls.Cross, dcs.control); break; - case X360Controls.B: tempControlDict.Add(DS4Controls.Circle, dcs.control); break; - case X360Controls.X: tempControlDict.Add(DS4Controls.Square, dcs.control); break; - case X360Controls.Y: tempControlDict.Add(DS4Controls.Triangle, dcs.control); break; + case X360Controls.A: tempControlDict.Add(dcs.control, DS4Controls.Cross); break; + case X360Controls.B: tempControlDict.Add(dcs.control, DS4Controls.Circle); break; + case X360Controls.X: tempControlDict.Add(dcs.control, DS4Controls.Square); break; + case X360Controls.Y: tempControlDict.Add(dcs.control, DS4Controls.Triangle); break; default: break; } } @@ -912,12 +914,12 @@ namespace DS4Windows { switch (xboxControl) { - case X360Controls.LB: tempControlDict.Add(DS4Controls.L1, dcs.control); break; - case X360Controls.LT: tempControlDict.Add(DS4Controls.L2, dcs.control); break; - case X360Controls.LS: tempControlDict.Add(DS4Controls.L3, dcs.control); break; - case X360Controls.RB: tempControlDict.Add(DS4Controls.R1, dcs.control); break; - case X360Controls.RT: tempControlDict.Add(DS4Controls.R2, dcs.control); break; - case X360Controls.RS: tempControlDict.Add(DS4Controls.R3, dcs.control); break; + case X360Controls.LB: tempControlDict.Add(dcs.control, DS4Controls.L1); break; + case X360Controls.LT: tempControlDict.Add(dcs.control, DS4Controls.L2); break; + case X360Controls.LS: tempControlDict.Add(dcs.control, DS4Controls.L3); break; + case X360Controls.RB: tempControlDict.Add(dcs.control, DS4Controls.R1); break; + case X360Controls.RT: tempControlDict.Add(dcs.control, DS4Controls.R2); break; + case X360Controls.RS: tempControlDict.Add(dcs.control, DS4Controls.R3); break; default: break; } } @@ -925,10 +927,10 @@ namespace DS4Windows { switch (xboxControl) { - case X360Controls.DpadUp: tempControlDict.Add(DS4Controls.DpadUp, dcs.control); break; - case X360Controls.DpadDown: tempControlDict.Add(DS4Controls.DpadDown, dcs.control); break; - case X360Controls.DpadLeft: tempControlDict.Add(DS4Controls.DpadLeft, dcs.control); break; - case X360Controls.DpadRight: tempControlDict.Add(DS4Controls.DpadRight, dcs.control); break; + case X360Controls.DpadUp: tempControlDict.Add(dcs.control, DS4Controls.DpadUp); break; + case X360Controls.DpadDown: tempControlDict.Add(dcs.control, DS4Controls.DpadDown); break; + case X360Controls.DpadLeft: tempControlDict.Add(dcs.control, DS4Controls.DpadLeft); break; + case X360Controls.DpadRight: tempControlDict.Add(dcs.control, DS4Controls.DpadRight); break; default: break; } } @@ -936,14 +938,14 @@ namespace DS4Windows { switch (xboxControl) { - case X360Controls.LXNeg: tempControlDict.Add(DS4Controls.LXNeg, dcs.control); break; - case X360Controls.LYNeg: tempControlDict.Add(DS4Controls.LYNeg, dcs.control); break; - case X360Controls.RXNeg: tempControlDict.Add(DS4Controls.RXNeg, dcs.control); break; - case X360Controls.RYNeg: tempControlDict.Add(DS4Controls.RYNeg, dcs.control); break; - case X360Controls.LXPos: tempControlDict.Add(DS4Controls.LXPos, dcs.control); break; - case X360Controls.LYPos: tempControlDict.Add(DS4Controls.LYPos, dcs.control); break; - case X360Controls.RXPos: tempControlDict.Add(DS4Controls.RXPos, dcs.control); break; - case X360Controls.RYPos: tempControlDict.Add(DS4Controls.RYPos, dcs.control); break; + case X360Controls.LXNeg: tempControlDict.Add(dcs.control, DS4Controls.LXNeg); break; + case X360Controls.LYNeg: tempControlDict.Add(dcs.control, DS4Controls.LYNeg); break; + case X360Controls.RXNeg: tempControlDict.Add(dcs.control, DS4Controls.RXNeg); break; + case X360Controls.RYNeg: tempControlDict.Add(dcs.control, DS4Controls.RYNeg); break; + case X360Controls.LXPos: tempControlDict.Add(dcs.control, DS4Controls.LXPos); break; + case X360Controls.LYPos: tempControlDict.Add(dcs.control, DS4Controls.LYPos); break; + case X360Controls.RXPos: tempControlDict.Add(dcs.control, DS4Controls.RXPos); break; + case X360Controls.RYPos: tempControlDict.Add(dcs.control, DS4Controls.RYPos); break; default: break; } } @@ -1033,9 +1035,9 @@ namespace DS4Windows { switch (xboxControl) { - case X360Controls.Start: tempControlDict.Add(DS4Controls.Options, dcs.control); break; - case X360Controls.Guide: tempControlDict.Add(DS4Controls.PS, dcs.control); break; - case X360Controls.Back: tempControlDict.Add(DS4Controls.Share, dcs.control); break; + case X360Controls.Start: tempControlDict.Add(dcs.control, DS4Controls.Options); break; + case X360Controls.Guide: tempControlDict.Add(dcs.control, DS4Controls.PS); break; + case X360Controls.Back: tempControlDict.Add(dcs.control, DS4Controls.Share); break; default: break; } } @@ -1044,7 +1046,7 @@ namespace DS4Windows { if (getBoolActionMapping2(device, dcs.control, cState, eState, tp, fieldMapping)) { - resetToDefaultValue2(dcs.control, MappedState, fieldMapping); + resetToDefaultValue2(dcs.control, MappedState, outputfieldMapping); if (!pressedonce[keyvalue]) { deviceState.currentClicks.toggle = !deviceState.currentClicks.toggle; @@ -1058,7 +1060,7 @@ namespace DS4Windows } } - resetToDefaultValue2(dcs.control, MappedState, fieldMapping); // erase default mappings for things that are remapped + resetToDefaultValue2(dcs.control, MappedState, outputfieldMapping); // erase default mappings for things that are remapped } } @@ -1115,7 +1117,9 @@ namespace DS4Windows usingExtra = DS4Controls.None; } } - } + } + + outputfieldMapping.populateState(MappedState); if (macroControl[00]) MappedState.Cross = true; if (macroControl[01]) MappedState.Circle = true; @@ -1168,6 +1172,7 @@ namespace DS4Windows tempControlDict.Add(DS4Controls.RYPos, DS4Controls.RYPos); Dictionary.KeyCollection controlKeys = tempControlDict.Keys; + //Dictionary>.KeyCollection controlKeys = tempControlDict.Keys; //foreach (KeyValuePair entry in tempControlDict) for (int i = 0, keyCount = controlKeys.Count; i < keyCount; i++) @@ -1176,11 +1181,12 @@ namespace DS4Windows DS4Controls dc = tempControlDict[key]; //DS4Controls key = entry.Key; //DS4Controls dc = entry.Value; - if (getBoolActionMapping2(device, dc, cState, eState, tp, fieldMapping, true)) + + if (getBoolActionMapping2(device, key, cState, eState, tp, fieldMapping, true)) { - if (key >= DS4Controls.Square && key <= DS4Controls.Cross) + if (dc >= DS4Controls.Square && dc <= DS4Controls.Cross) { - switch (key) + switch (dc) { case DS4Controls.Cross: MappedState.Cross = true; break; case DS4Controls.Circle: MappedState.Circle = true; break; @@ -1189,22 +1195,22 @@ namespace DS4Windows default: break; } } - else if (key >= DS4Controls.L1 && key <= DS4Controls.R3) + else if (dc >= DS4Controls.L1 && dc <= DS4Controls.R3) { - switch (key) + switch (dc) { case DS4Controls.L1: MappedState.L1 = true; break; - case DS4Controls.L2: MappedState.L2 = getByteMapping(device, dc, cState, eState, tp); break; + case DS4Controls.L2: MappedState.L2 = getByteMapping(device, key, cState, eState, tp); break; case DS4Controls.L3: MappedState.L3 = true; break; case DS4Controls.R1: MappedState.R1 = true; break; - case DS4Controls.R2: MappedState.R2 = getByteMapping(device, dc, cState, eState, tp); break; + case DS4Controls.R2: MappedState.R2 = getByteMapping(device, key, cState, eState, tp); break; case DS4Controls.R3: MappedState.R3 = true; break; default: break; } } - else if (key >= DS4Controls.DpadUp && key <= DS4Controls.DpadLeft) + else if (dc >= DS4Controls.DpadUp && dc <= DS4Controls.DpadLeft) { - switch (key) + switch (dc) { case DS4Controls.DpadUp: MappedState.DpadUp = true; break; case DS4Controls.DpadRight: MappedState.DpadRight = true; break; @@ -1213,100 +1219,100 @@ namespace DS4Windows default: break; } } - else if (key >= DS4Controls.LXNeg && key <= DS4Controls.RYPos) + else if (dc >= DS4Controls.LXNeg && dc <= DS4Controls.RYPos) { - switch (key) + switch (dc) { case DS4Controls.LXNeg: case DS4Controls.LXPos: - { - if (Math.Abs(MappedState.LX - 127) < 10) { - if (key == DS4Controls.LXNeg) + if (Math.Abs(MappedState.LX - 127) < 10) { - byte axisMapping = getXYAxisMapping(device, dc, cState, eState, tp, true); - if (Math.Abs(127 - axisMapping) > 5) - MappedState.LX = axisMapping; + if (dc == DS4Controls.LXNeg) + { + byte axisMapping = getXYAxisMapping(device, key, cState, eState, tp, true); + if (Math.Abs(127 - axisMapping) > 5) + MappedState.LX = axisMapping; + } + else + { + byte axisMapping = getXYAxisMapping(device, key, cState, eState, tp); + if (Math.Abs(127 - axisMapping) > 5) + MappedState.LX = axisMapping; + } } - else - { - byte axisMapping = getXYAxisMapping(device, dc, cState, eState, tp); - if (Math.Abs(127 - axisMapping) > 5) - MappedState.LX = axisMapping; - } - } - break; - } + break; + } case DS4Controls.LYNeg: case DS4Controls.LYPos: - { - if (Math.Abs(MappedState.LY - 127) < 10) { - if (key == DS4Controls.LYNeg) + if (Math.Abs(MappedState.LY - 127) < 10) { - byte axisMapping = getXYAxisMapping(device, dc, cState, eState, tp); - if (Math.Abs(127 - axisMapping) > 5) - MappedState.LY = axisMapping; + if (dc == DS4Controls.LYNeg) + { + byte axisMapping = getXYAxisMapping(device, key, cState, eState, tp); + if (Math.Abs(127 - axisMapping) > 5) + MappedState.LY = axisMapping; + } + else + { + byte axisMapping = getXYAxisMapping(device, key, cState, eState, tp, true); + if (Math.Abs(127 - axisMapping) > 5) + MappedState.LY = axisMapping; + } } - else - { - byte axisMapping = getXYAxisMapping(device, dc, cState, eState, tp, true); - if (Math.Abs(127 - axisMapping) > 5) - MappedState.LY = axisMapping; - } - } - break; - } + break; + } case DS4Controls.RXNeg: case DS4Controls.RXPos: - { - if (Math.Abs(MappedState.RX - 127) < 10) { - if (key == DS4Controls.RXNeg) + if (Math.Abs(MappedState.RX - 127) < 10) { - byte axisMapping = getXYAxisMapping(device, dc, cState, eState, tp); - if (Math.Abs(127 - axisMapping) > 5) - MappedState.RX = axisMapping; + if (dc == DS4Controls.RXNeg) + { + byte axisMapping = getXYAxisMapping(device, key, cState, eState, tp); + if (Math.Abs(127 - axisMapping) > 5) + MappedState.RX = axisMapping; + } + else + { + byte axisMapping = getXYAxisMapping(device, key, cState, eState, tp, true); + if (Math.Abs(127 - axisMapping) > 5) + MappedState.RX = axisMapping; + } } - else - { - byte axisMapping = getXYAxisMapping(device, dc, cState, eState, tp, true); - if (Math.Abs(127 - axisMapping) > 5) - MappedState.RX = axisMapping; - } - } - break; - } + break; + } case DS4Controls.RYNeg: case DS4Controls.RYPos: - { - if (Math.Abs(MappedState.RY - 127) < 10) { - if (key == DS4Controls.RYNeg) + if (Math.Abs(MappedState.RY - 127) < 10) { - byte axisMapping = getXYAxisMapping(device, dc, cState, eState, tp); - if (Math.Abs(127 - axisMapping) > 5) - MappedState.RY = axisMapping; + if (dc == DS4Controls.RYNeg) + { + byte axisMapping = getXYAxisMapping(device, key, cState, eState, tp); + if (Math.Abs(127 - axisMapping) > 5) + MappedState.RY = axisMapping; + } + else + { + byte axisMapping = getXYAxisMapping(device, key, cState, eState, tp, true); + if (Math.Abs(127 - axisMapping) > 5) + MappedState.RY = axisMapping; + } } - else - { - byte axisMapping = getXYAxisMapping(device, dc, cState, eState, tp, true); - if (Math.Abs(127 - axisMapping) > 5) - MappedState.RY = axisMapping; - } - } - break; - } + break; + } default: break; } } else { - switch (key) + switch (dc) { case DS4Controls.Options: MappedState.Options = true; break; case DS4Controls.Share: MappedState.Share = true; break; @@ -1317,8 +1323,6 @@ namespace DS4Windows } } - fieldMapping.populateState(MappedState); - calculateFinalMouseMovement(ref tempMouseDeltaX, ref tempMouseDeltaY, out mouseDeltaX, out mouseDeltaY); if (mouseDeltaX != 0 || mouseDeltaY != 0) @@ -1333,7 +1337,7 @@ namespace DS4Windows } private static async void MapCustomAction(int device, DS4State cState, DS4State MappedState, - DS4StateExposed eState, Mouse tp, ControlService ctrl, DS4StateFieldMapping fieldMapping) + DS4StateExposed eState, Mouse tp, ControlService ctrl, DS4StateFieldMapping fieldMapping, DS4StateFieldMapping outputfieldMapping) { /* TODO: This method is slow sauce. Find ways to speed up action execution */ try @@ -1527,7 +1531,7 @@ namespace DS4Windows for (int i = 0, arlen = action.trigger.Count; i < arlen; i++) { DS4Controls dc = action.trigger[i]; - resetToDefaultValue2(dc, MappedState, fieldMapping); + resetToDefaultValue2(dc, MappedState, outputfieldMapping); } PlayMacro(device, macroControl, String.Join("/", action.macro), DS4Controls.None, keyType); diff --git a/DS4Windows/DS4Control/ScpUtil.cs b/DS4Windows/DS4Control/ScpUtil.cs index e0420e0..77d586e 100644 --- a/DS4Windows/DS4Control/ScpUtil.cs +++ b/DS4Windows/DS4Control/ScpUtil.cs @@ -142,6 +142,21 @@ namespace DS4Windows } } + public class MultiValueDict : Dictionary> + { + public void Add(Key key, Value val) + { + List values = null; + if (!this.TryGetValue(key, out values)) + { + values = new List(); + this.Add(key, values); + } + + values.Add(val); + } + } + public class Global { protected static BackingStore m_Config = new BackingStore(); diff --git a/DS4Windows/DS4Forms/AdvancedColorDialog.cs b/DS4Windows/DS4Forms/AdvancedColorDialog.cs index 8e2b313..0e47bd1 100644 --- a/DS4Windows/DS4Forms/AdvancedColorDialog.cs +++ b/DS4Windows/DS4Forms/AdvancedColorDialog.cs @@ -19,26 +19,26 @@ namespace DS4Windows internal class WindowsEnumerator { private delegate int EnumCallBackDelegate(IntPtr hwnd, int lParam); - [DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] + [DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] private static extern int EnumWindows(EnumCallBackDelegate lpEnumFunc, int lParam); - [DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] + [DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] private static extern int EnumChildWindows(IntPtr hWndParent, EnumCallBackDelegate lpEnumFunc, int lParam); + [DllImport("user32", EntryPoint = "GetClassNameA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] - private static extern int GetClassName(IntPtr hwnd, System.Text.StringBuilder lpClassName, int nMaxCount); - [DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] + [DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] private static extern int IsWindowVisible(IntPtr hwnd); + [DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] - private static extern int GetParent(IntPtr hwnd); - [DllImport("user32", EntryPoint = "SendMessageA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] + [DllImport("user32", EntryPoint = "SendMessageA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] private static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam); - [DllImport("user32", EntryPoint = "SendMessageA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] + [DllImport("user32", EntryPoint = "SendMessageA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] private static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, System.Text.StringBuilder lParam); private List _listChildren = new List(); diff --git a/DS4Windows/DS4Forms/DS4Form.Designer.cs b/DS4Windows/DS4Forms/DS4Form.Designer.cs index f64d894..c631a3b 100644 --- a/DS4Windows/DS4Forms/DS4Form.Designer.cs +++ b/DS4Windows/DS4Forms/DS4Form.Designer.cs @@ -119,6 +119,7 @@ this.cBSwipeProfiles = new System.Windows.Forms.CheckBox(); this.StartWindowsCheckBox = new System.Windows.Forms.CheckBox(); this.runStartupPanel = new System.Windows.Forms.Panel(); + this.uacTaskButton = new System.Windows.Forms.Button(); this.runStartTaskRadio = new System.Windows.Forms.RadioButton(); this.label1 = new System.Windows.Forms.Label(); this.runStartProgRadio = new System.Windows.Forms.RadioButton(); @@ -893,12 +894,21 @@ // runStartupPanel // this.runStartupPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.runStartupPanel.Controls.Add(this.uacTaskButton); 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"; // + // uacTaskButton + // + this.uacTaskButton.FlatAppearance.BorderSize = 0; + resources.ApplyResources(this.uacTaskButton, "uacTaskButton"); + this.uacTaskButton.ForeColor = System.Drawing.SystemColors.ControlLightLight; + this.uacTaskButton.Name = "uacTaskButton"; + this.uacTaskButton.UseVisualStyleBackColor = true; + // // runStartTaskRadio // resources.ApplyResources(this.runStartTaskRadio, "runStartTaskRadio"); @@ -1379,6 +1389,7 @@ private System.Windows.Forms.Label label1; private System.Windows.Forms.RadioButton runStartProgRadio; private System.Windows.Forms.RadioButton runStartTaskRadio; + private System.Windows.Forms.Button uacTaskButton; //private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2; } } diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index 1052895..02326f7 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -57,12 +57,18 @@ namespace DS4Windows bool runningBat; //bool outputlog = false; + internal const int BCM_FIRST = 0x1600; // Normal button + internal const int BCM_SETSHIELD = (BCM_FIRST + 0x000C); // Elevated button + [DllImport("user32.dll")] private static extern IntPtr GetForegroundWindow(); [DllImport("user32.dll")] private static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId); + [DllImport("user32.dll")] + private static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, uint lParam); + [DllImport("kernel32.dll")] private static extern IntPtr OpenProcess(uint dwDesiredAccess, bool bInheritHandle, uint dwProcessId); @@ -344,6 +350,16 @@ namespace DS4Windows { StartWindowsCheckBox.Checked = true; runStartupPanel.Visible = true; + + if (Global.IsAdministrator()) + { + runStartTaskRadio.Enabled = true; + } + else + { + runStartTaskRadio.Enabled = false; + } + string lnkpath = WinProgs.ResolveShortcutAndArgument(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\DS4Windows.lnk"); string onlylnkpath = WinProgs.ResolveShortcut(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\DS4Windows.lnk"); if (!lnkpath.EndsWith("-runtask")) @@ -361,6 +377,8 @@ namespace DS4Windows appShortcutToStartup(); changeStartupRoutine(); } + + SendMessage(uacTaskButton.Handle, BCM_SETSHIELD, 0, 1); } UpdateTheUpdater(); @@ -869,53 +887,61 @@ namespace DS4Windows else ControllerStatusChanged(); } + protected void ControllerStatusChanged() { String tooltip = "DS4Windows v" + FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion; bool nocontrollers = true; + DS4Device[] devices = Program.rootHub.DS4Controllers; + int controllerLen = devices.Length; for (Int32 Index = 0, PadsLen = Pads.Length; Index < PadsLen; Index++) { - Pads[Index].Text = Program.rootHub.getDS4MacAddress(Index); - DS4Device d = Program.rootHub.DS4Controllers[Index]; - - switch (Program.rootHub.getDS4Status(Index)) + // Make sure a controller exists + if (Index < controllerLen) { - case "USB": statPB[Index].Visible = true; statPB[Index].Image = Properties.Resources.USB; toolTip1.SetToolTip(statPB[Index], ""); break; - case "BT": statPB[Index].Visible = true; statPB[Index].Image = Properties.Resources.BT; toolTip1.SetToolTip(statPB[Index], "Right click to disconnect"); break; - case "SONYWA": statPB[Index].Visible = true; statPB[Index].Image = Properties.Resources.BT; toolTip1.SetToolTip(statPB[Index], "Right click to disconnect"); break; - default: statPB[Index].Visible = false; toolTip1.SetToolTip(statPB[Index], ""); break; - } + Pads[Index].Text = Program.rootHub.getDS4MacAddress(Index); + DS4Device d = devices[Index]; - Batteries[Index].Text = Program.rootHub.getDS4Battery(Index); - if (Pads[Index].Text != String.Empty) - { - if (runningBat) + switch (Program.rootHub.getDS4Status(Index)) { - SendKeys.Send("A"); - runningBat = false; + case "USB": statPB[Index].Visible = true; statPB[Index].Image = Properties.Resources.USB; toolTip1.SetToolTip(statPB[Index], ""); break; + case "BT": statPB[Index].Visible = true; statPB[Index].Image = Properties.Resources.BT; toolTip1.SetToolTip(statPB[Index], "Right click to disconnect"); break; + case "SONYWA": statPB[Index].Visible = true; statPB[Index].Image = Properties.Resources.BT; toolTip1.SetToolTip(statPB[Index], "Right click to disconnect"); break; + default: statPB[Index].Visible = false; toolTip1.SetToolTip(statPB[Index], ""); break; } - Pads[Index].Enabled = true; - nocontrollers = false; - if (Pads[Index].Text != Properties.Resources.Connecting) + + Batteries[Index].Text = Program.rootHub.getDS4Battery(Index); + if (Pads[Index].Text != String.Empty) { - Enable_Controls(Index, true); - //if (opt != null) - // if (opt.Visible && tabMain.SelectedIndex == 1) + 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); + //MinimumSize = new Size(MinimumSize.Width, 137 + 29 * Index); + } + else + opt.inputtimer.Stop(); } else - opt.inputtimer.Stop(); + { + Pads[Index].Text = Properties.Resources.Disconnected; + Enable_Controls(Index, false); + } + //if (((Index + 1) + ": " + Program.rootHub.getShortDS4ControllerInfo(Index)).Length > 50) + //MessageBox.Show(((Index + 1) + ": " + Program.rootHub.getShortDS4ControllerInfo(Index)).Length.ToString()); + if (Program.rootHub.getShortDS4ControllerInfo(Index) != Properties.Resources.NoneText) + tooltip += "\n" + (Index + 1) + ": " + Program.rootHub.getShortDS4ControllerInfo(Index); // Carefully stay under the 63 character limit. } - else - { - Pads[Index].Text = Properties.Resources.Disconnected; - Enable_Controls(Index, false); - } - //if (((Index + 1) + ": " + Program.rootHub.getShortDS4ControllerInfo(Index)).Length > 50) - //MessageBox.Show(((Index + 1) + ": " + Program.rootHub.getShortDS4ControllerInfo(Index)).Length.ToString()); - if (Program.rootHub.getShortDS4ControllerInfo(Index) != Properties.Resources.NoneText) - tooltip += "\n" + (Index + 1) + ": " + Program.rootHub.getShortDS4ControllerInfo(Index); // Carefully stay under the 63 character limit. } lbNoControllers.Visible = nocontrollers; diff --git a/DS4Windows/DS4Forms/DS4Form.resx b/DS4Windows/DS4Forms/DS4Form.resx index 2cb42bf..86c1808 100644 --- a/DS4Windows/DS4Forms/DS4Form.resx +++ b/DS4Windows/DS4Forms/DS4Form.resx @@ -117,6 +117,19 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Time + + + + 167 + + + Data + + + 84 + Fill @@ -131,7 +144,6 @@ 890, 330 - 0 @@ -147,93 +159,9 @@ 0 - - Time - - - 167 - - - Data - - - 84 - 153, 17 - - llbHelp - - - System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlButton - - - 0 - - - lbTest - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlButton - - - 1 - - - btnStartStop - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlButton - - - 2 - - - lbLastMessage - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlButton - - - 3 - - - Bottom - - - 0, 385 - - - 904, 30 - - - 10 - - - pnlButton - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 4 - Bottom, Right @@ -363,6 +291,30 @@ 3 + + Bottom + + + 0, 385 + + + 904, 30 + + + 10 + + + pnlButton + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + Bottom @@ -405,21 +357,6 @@ 377, 17 - - 215, 164 - - - cMTaskbar - - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - DS4 Xinput Tool - - - True - 214, 22 @@ -468,6 +405,21 @@ Exit (Middle Mouse) + + 215, 164 + + + cMTaskbar + + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + DS4 Xinput Tool + + + True + 211, 6 @@ -477,6 +429,24 @@ XML Files (*.xml)|*.xml + + Top + + + NoControl + + + 0, 127 + + + 896, 23 + + + 48 + + + Connect DS4 exclusivly (experimental) + btnConnectDS4Win10 @@ -489,6 +459,915 @@ 0 + + True + + + 6 + + + Fill + + + Flat + + + NoControl + + + 828, 74 + + + 65, 22 + + + 50 + + + bnLight3 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 0 + + + None + + + NoControl + + + 395, 19 + + + 39, 20 + + + AutoSize + + + 47 + + + pBStatus1 + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 1 + + + Left + + + True + + + Microsoft Sans Serif, 9pt + + + NoControl + + + 3, 21 + + + 111, 15 + + + 44 + + + MA:C1:23:45:67:89 + + + lbPad1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 2 + + + Left + + + True + + + Microsoft Sans Serif, 9pt + + + NoControl + + + 3, 49 + + + 70, 15 + + + 44 + + + Controller 2 + + + lbPad2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 3 + + + Left + + + NoControl + + + 785, 74 + + + 37, 22 + + + 43 + + + Edit + + + bnEditC3 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 4 + + + Left + + + NoControl + + + 785, 102 + + + 37, 22 + + + 43 + + + Edit + + + bnEditC4 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 5 + + + Left + + + True + + + Microsoft Sans Serif, 9pt + + + NoControl + + + 3, 77 + + + 70, 15 + + + 44 + + + Controller 3 + + + lbPad3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 6 + + + Left + + + True + + + Microsoft Sans Serif, 9pt + + + NoControl + + + 3, 105 + + + 70, 15 + + + 44 + + + Controller 4 + + + lbPad4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 7 + + + None + + + 668, 18 + + + 111, 21 + + + 42 + + + cBController1 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 8 + + + Left + + + NoControl + + + 785, 46 + + + 37, 22 + + + 43 + + + Edit + + + bnEditC2 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 9 + + + None + + + 668, 46 + + + 111, 21 + + + 42 + + + cBController2 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 10 + + + None + + + 668, 74 + + + 111, 21 + + + 42 + + + cBController3 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 11 + + + Left + + + NoControl + + + 785, 18 + + + 37, 22 + + + 43 + + + Edit + + + bnEditC1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 12 + + + None + + + 668, 102 + + + 111, 21 + + + 42 + + + cBController4 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 13 + + + None + + + True + + + Microsoft Sans Serif, 9pt, style=Bold + + + NoControl + + + 669, 0 + + + 109, 15 + + + 45 + + + Selected Profile + + + lbSelectedProfile + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 14 + + + Left + + + True + + + Microsoft Sans Serif, 9pt, style=Bold + + + NoControl + + + 3, 0 + + + 21, 15 + + + 45 + + + ID + + + lbID + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 15 + + + None + + + True + + + Microsoft Sans Serif, 9pt, style=Bold + + + NoControl + + + 391, 0 + + + 47, 15 + + + 45 + + + Status + + + lbStatus + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 16 + + + None + + + True + + + Microsoft Sans Serif, 9pt, style=Bold + + + NoControl + + + 559, 0 + + + 51, 15 + + + 45 + + + Battery + + + lbBattery + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 17 + + + None + + + True + + + Microsoft Sans Serif, 9pt + + + NoControl + + + 565, 21 + + + 39, 15 + + + 44 + + + 100% + + + lbBatt1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 18 + + + None + + + True + + + Microsoft Sans Serif, 9pt + + + NoControl + + + 565, 49 + + + 39, 15 + + + 44 + + + 100% + + + lbBatt2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 19 + + + None + + + True + + + Microsoft Sans Serif, 9pt + + + NoControl + + + 565, 77 + + + 39, 15 + + + 44 + + + 100% + + + lbBatt3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 20 + + + None + + + True + + + Microsoft Sans Serif, 9pt + + + NoControl + + + 565, 105 + + + 39, 15 + + + 44 + + + 100% + + + lbBatt4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 21 + + + None + + + NoControl + + + 395, 47 + + + 39, 20 + + + AutoSize + + + 47 + + + pBStatus2 + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 22 + + + None + + + NoControl + + + 395, 75 + + + 39, 20 + + + AutoSize + + + 47 + + + pBStatus3 + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 23 + + + None + + + NoControl + + + 395, 103 + + + 39, 20 + + + AutoSize + + + 47 + + + pBStatus4 + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 24 + + + Fill + + + Flat + + + NoControl + + + 828, 18 + + + 65, 22 + + + 50 + + + bnLight1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 25 + + + Fill + + + Flat + + + NoControl + + + 828, 46 + + + 65, 22 + + + 51 + + + bnLight2 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 26 + + + Fill + + + Flat + + + NoControl + + + 828, 102 + + + 65, 22 + + + 52 + + + bnLight4 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tLPControllers + + + 27 + + + Top + + + 0, 0 + + + 5 + + + 896, 127 + + + 46 + tLPControllers @@ -502,7 +1381,31 @@ 1 - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="bnLight3" Row="3" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="pBStatus1" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbPad1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPad2" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="bnEditC3" Row="3" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="bnEditC4" Row="4" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="lbPad3" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPad4" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cBController1" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="bnEditC2" Row="2" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="cBController2" Row="2" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="cBController3" Row="3" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="bnEditC1" Row="1" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="cBController4" Row="4" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="lbSelectedProfile" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="lbID" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbStatus" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbBattery" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt1" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt2" Row="2" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt3" Row="3" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt4" Row="4" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="pBStatus2" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="pBStatus3" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="pBStatus4" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="bnLight1" Row="1" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="bnLight2" Row="2" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="bnLight4" Row="4" RowSpan="1" Column="5" ColumnSpan="1" /></Controls><Columns Styles="Percent,48.95498,Percent,26.82658,Percent,24.21844,AutoSize,0,AutoSize,0,Absolute,58" /><Rows Styles="AutoSize,0,Percent,25,Percent,25,Percent,25,Percent,25" /></TableLayoutSettings> + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="bnLight3" Row="3" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="pBStatus1" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbPad1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPad2" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="bnEditC3" Row="3" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="bnEditC4" Row="4" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="lbPad3" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPad4" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cBController1" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="bnEditC2" Row="2" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="cBController2" Row="2" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="cBController3" Row="3" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="bnEditC1" Row="1" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="cBController4" Row="4" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="lbSelectedProfile" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="lbID" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbStatus" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbBattery" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt1" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt2" Row="2" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt3" Row="3" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt4" Row="4" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="pBStatus2" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="pBStatus3" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="pBStatus4" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="bnLight1" Row="1" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="bnLight2" Row="2" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="bnLight4" Row="4" RowSpan="1" Column="5" ColumnSpan="1" /></Controls><Columns Styles="Percent,48.95498,Percent,26.82658,Percent,24.21844,AutoSize,0,AutoSize,0,Absolute,69" /><Rows Styles="AutoSize,0,Percent,25,Percent,25,Percent,25,Percent,25" /></TableLayoutSettings> + + + Fill + + + False + + + NoControl + + + 0, 0 + + + 896, 359 + + + 47 + + + No Controllers Connected (Max 4) + + + MiddleCenter lbNoControllers @@ -540,12 +1443,99 @@ 0 - - 17, 56 - - - 606, 17 + + 826, 17 + + Segoe UI, 9pt, style=Bold + + + 188, 22 + + + Edit + + + 188, 22 + + + Assign to Controller 1 + + + 188, 22 + + + Assign to Controller 2 + + + 188, 22 + + + Assign to Controller 3 + + + 188, 22 + + + Assign to Controller 4 + + + 188, 22 + + + Delete (Del) + + + 188, 22 + + + Duplicate (Ctrl+D) + + + 188, 22 + + + New Profile + + + 188, 22 + + + Import + + + 188, 22 + + + Export + + + 189, 224 + + + cMProfile + + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Fill + + + Microsoft Sans Serif, 9.75pt + + + 16 + + + 3, 57 + + + 890, 299 + + + 0 + lBProfiles @@ -558,6 +1548,63 @@ 0 + + 17, 56 + + + 79, 24 + + + Profile Name: + + + 150, 27 + + + <type profile name here> + + + Magenta + + + 92, 24 + + + Save Profile + + + Magenta + + + 67, 24 + + + Cancel + + + 6, 27 + + + Magenta + + + 214, 24 + + + Keep this window size after closing + + + 3, 30 + + + 890, 27 + + + 2 + + + Profile Options + tSOptions @@ -570,6 +1617,108 @@ 1 + + 606, 17 + + + Magenta + + + 55, 24 + + + New + + + Make a New Profile + + + False + + + Magenta + + + 51, 24 + + + Edit + + + Edit Selected Profile (Enter) + + + False + + + Magenta + + + 64, 24 + + + Delete + + + Delete Selected Profle (Delete) + + + False + + + Magenta + + + 81, 24 + + + Duplicate + + + Dupliacate Selected Profile (Ctrl+D) + + + False + + + Magenta + + + 67, 24 + + + Import + + + Import Profile or Profiles + + + False + + + Magenta + + + 64, 24 + + + Export + + + Export Selected Profile + + + 3, 3 + + + 890, 27 + + + 1 + + + toolStrip1 + toolStrip1 @@ -726,9 +1875,42 @@ 2 + + System + + + NoControl + + + 65, 51 + + + 43, 23 + + + 3 + + + + + + uacTaskButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + runStartupPanel + + + 0 + True + + NoControl + 10, 54 @@ -751,11 +1933,14 @@ runStartupPanel - 0 + 1 True + + NoControl + 10, 4 @@ -778,11 +1963,14 @@ runStartupPanel - 1 + 2 True + + NoControl + 10, 25 @@ -805,7 +1993,7 @@ runStartupPanel - 2 + 3 10, 79 @@ -861,6 +2049,24 @@ 4 + + True + + + NoControl + + + 3, 4 + + + 95, 13 + + + 45 + + + Show Notifications + lbNotifications @@ -873,6 +2079,27 @@ 0 + + Top, Right + + + None + + + Warnings only + + + All + + + 104, 1 + + + 106, 21 + + + 44 + cBoxNotifications @@ -936,6 +2163,18 @@ 6 + + Top, Right + + + 185, 2 + + + 44, 20 + + + 42 + nUDLatency @@ -948,6 +2187,27 @@ 0 + + Top, Right + + + True + + + NoControl + + + 235, 4 + + + 20, 13 + + + 0 + + + ms + lbMsLatency @@ -960,6 +2220,24 @@ 1 + + True + + + NoControl + + + 0, 3 + + + 170, 17 + + + 53 + + + Flash Lightbar at High Latency + cBFlashWhenLate @@ -1146,2082 +2424,6 @@ 12 - - cBUpdateTime - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pNUpdate - - - 0 - - - lbCheckEvery - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pNUpdate - - - 1 - - - nUDUpdateTime - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pNUpdate - - - 2 - - - False - - - 274, 56 - - - 189, 22 - - - 43 - - - pNUpdate - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - - 13 - - - lbUseXIPorts - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlXIPorts - - - 0 - - - nUDXIPorts - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlXIPorts - - - 1 - - - lbLastXIPort - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - pnlXIPorts - - - 2 - - - 274, 84 - - - 186, 22 - - - 44 - - - pnlXIPorts - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - - 14 - - - True - - - linkProfiles - - - System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - flowLayoutPanel1 - - - 0 - - - lnkControllers - - - System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - flowLayoutPanel1 - - - 1 - - - linkUninstall - - - System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - flowLayoutPanel1 - - - 2 - - - linkSetup - - - System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - flowLayoutPanel1 - - - 3 - - - lLBUpdate - - - System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - flowLayoutPanel1 - - - 4 - - - TopDown - - - 274, 112 - - - 122, 65 - - - 56 - - - flowLayoutPanel1 - - - System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - fLPSettings - - - 15 - - - Fill - - - TopDown - - - 3, 3 - - - 7, 7, 0, 9 - - - 890, 353 - - - 0 - - - fLPSettings - - - System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabSettings - - - 0 - - - 4, 22 - - - 3, 3, 3, 3 - - - 896, 359 - - - 4 - - - Settings - - - tabSettings - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabMain - - - 3 - - - 4, 22 - - - 3, 3, 3, 3 - - - 896, 359 - - - 1 - - - Log - - - tabLog - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabMain - - - 4 - - - Fill - - - 0, 0 - - - 904, 385 - - - 12 - - - tabMain - - - System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - - Top - - - NoControl - - - 0, 127 - - - 896, 23 - - - 48 - - - Connect DS4 exclusivly (experimental) - - - btnConnectDS4Win10 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabControllers - - - 0 - - - True - - - 6 - - - bnLight3 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 0 - - - pBStatus1 - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 1 - - - lbPad1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 2 - - - lbPad2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 3 - - - bnEditC3 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 4 - - - bnEditC4 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 5 - - - lbPad3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 6 - - - lbPad4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 7 - - - cBController1 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 8 - - - bnEditC2 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 9 - - - cBController2 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 10 - - - cBController3 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 11 - - - bnEditC1 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 12 - - - cBController4 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 13 - - - lbSelectedProfile - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 14 - - - lbID - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 15 - - - lbStatus - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 16 - - - lbBattery - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 17 - - - lbBatt1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 18 - - - lbBatt2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 19 - - - lbBatt3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 20 - - - lbBatt4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 21 - - - pBStatus2 - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 22 - - - pBStatus3 - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 23 - - - pBStatus4 - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 24 - - - bnLight1 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 25 - - - bnLight2 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 26 - - - bnLight4 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 27 - - - Top - - - 0, 0 - - - 5 - - - 896, 127 - - - 46 - - - tLPControllers - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabControllers - - - 1 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="bnLight3" Row="3" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="pBStatus1" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbPad1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPad2" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="bnEditC3" Row="3" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="bnEditC4" Row="4" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="lbPad3" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbPad4" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cBController1" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="bnEditC2" Row="2" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="cBController2" Row="2" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="cBController3" Row="3" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="bnEditC1" Row="1" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="cBController4" Row="4" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="lbSelectedProfile" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="lbID" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lbStatus" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lbBattery" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt1" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt2" Row="2" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt3" Row="3" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="lbBatt4" Row="4" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="pBStatus2" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="pBStatus3" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="pBStatus4" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="bnLight1" Row="1" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="bnLight2" Row="2" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="bnLight4" Row="4" RowSpan="1" Column="5" ColumnSpan="1" /></Controls><Columns Styles="Percent,48.95498,Percent,26.82658,Percent,24.21844,AutoSize,0,AutoSize,0,Absolute,58" /><Rows Styles="AutoSize,0,Percent,25,Percent,25,Percent,25,Percent,25" /></TableLayoutSettings> - - - Fill - - - Flat - - - NoControl - - - 839, 74 - - - 54, 22 - - - 50 - - - bnLight3 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 0 - - - None - - - NoControl - - - 402, 19 - - - 39, 20 - - - AutoSize - - - 47 - - - pBStatus1 - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 1 - - - Left - - - True - - - Microsoft Sans Serif, 9pt - - - NoControl - - - 3, 21 - - - 111, 15 - - - 44 - - - MA:C1:23:45:67:89 - - - lbPad1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 2 - - - Left - - - True - - - Microsoft Sans Serif, 9pt - - - NoControl - - - 3, 49 - - - 70, 15 - - - 44 - - - Controller 2 - - - lbPad2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 3 - - - Left - - - NoControl - - - 796, 74 - - - 37, 22 - - - 43 - - - Edit - - - bnEditC3 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 4 - - - Left - - - NoControl - - - 796, 102 - - - 37, 22 - - - 43 - - - Edit - - - bnEditC4 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 5 - - - Left - - - True - - - Microsoft Sans Serif, 9pt - - - NoControl - - - 3, 77 - - - 70, 15 - - - 44 - - - Controller 3 - - - lbPad3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 6 - - - Left - - - True - - - Microsoft Sans Serif, 9pt - - - NoControl - - - 3, 105 - - - 70, 15 - - - 44 - - - Controller 4 - - - lbPad4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 7 - - - None - - - 679, 18 - - - 111, 21 - - - 42 - - - cBController1 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 8 - - - Left - - - NoControl - - - 796, 46 - - - 37, 22 - - - 43 - - - Edit - - - bnEditC2 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 9 - - - None - - - 679, 46 - - - 111, 21 - - - 42 - - - cBController2 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 10 - - - None - - - 679, 74 - - - 111, 21 - - - 42 - - - cBController3 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 11 - - - Left - - - NoControl - - - 796, 18 - - - 37, 22 - - - 43 - - - Edit - - - bnEditC1 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 12 - - - None - - - 679, 102 - - - 111, 21 - - - 42 - - - cBController4 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 13 - - - None - - - True - - - Microsoft Sans Serif, 9pt, style=Bold - - - NoControl - - - 680, 0 - - - 109, 15 - - - 45 - - - Selected Profile - - - lbSelectedProfile - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 14 - - - Left - - - True - - - Microsoft Sans Serif, 9pt, style=Bold - - - NoControl - - - 3, 0 - - - 21, 15 - - - 45 - - - ID - - - lbID - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 15 - - - None - - - True - - - Microsoft Sans Serif, 9pt, style=Bold - - - NoControl - - - 398, 0 - - - 47, 15 - - - 45 - - - Status - - - lbStatus - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 16 - - - None - - - True - - - Microsoft Sans Serif, 9pt, style=Bold - - - NoControl - - - 568, 0 - - - 51, 15 - - - 45 - - - Battery - - - lbBattery - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 17 - - - None - - - True - - - Microsoft Sans Serif, 9pt - - - NoControl - - - 574, 21 - - - 39, 15 - - - 44 - - - 100% - - - lbBatt1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 18 - - - None - - - True - - - Microsoft Sans Serif, 9pt - - - NoControl - - - 574, 49 - - - 39, 15 - - - 44 - - - 100% - - - lbBatt2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 19 - - - None - - - True - - - Microsoft Sans Serif, 9pt - - - NoControl - - - 574, 77 - - - 39, 15 - - - 44 - - - 100% - - - lbBatt3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 20 - - - None - - - True - - - Microsoft Sans Serif, 9pt - - - NoControl - - - 574, 105 - - - 39, 15 - - - 44 - - - 100% - - - lbBatt4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 21 - - - None - - - NoControl - - - 402, 47 - - - 39, 20 - - - AutoSize - - - 47 - - - pBStatus2 - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 22 - - - None - - - NoControl - - - 402, 75 - - - 39, 20 - - - AutoSize - - - 47 - - - pBStatus3 - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 23 - - - None - - - NoControl - - - 402, 103 - - - 39, 20 - - - AutoSize - - - 47 - - - pBStatus4 - - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 24 - - - Fill - - - Flat - - - NoControl - - - 839, 18 - - - 54, 22 - - - 50 - - - bnLight1 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 25 - - - Fill - - - Flat - - - NoControl - - - 839, 46 - - - 54, 22 - - - 51 - - - bnLight2 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 26 - - - Fill - - - Flat - - - NoControl - - - 839, 102 - - - 54, 22 - - - 52 - - - bnLight4 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tLPControllers - - - 27 - - - Fill - - - False - - - NoControl - - - 0, 0 - - - 896, 359 - - - 47 - - - No Controllers Connected (Max 4) - - - MiddleCenter - - - lbNoControllers - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabControllers - - - 2 - - - 826, 17 - - - 189, 224 - - - cMProfile - - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Fill - - - Microsoft Sans Serif, 9.75pt - - - 16 - - - 3, 57 - - - 890, 299 - - - 0 - - - lBProfiles - - - System.Windows.Forms.ListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabProfiles - - - 0 - - - Segoe UI, 9pt, style=Bold - - - 188, 22 - - - Edit - - - 188, 22 - - - Assign to Controller 1 - - - 188, 22 - - - Assign to Controller 2 - - - 188, 22 - - - Assign to Controller 3 - - - 188, 22 - - - Assign to Controller 4 - - - 188, 22 - - - Delete (Del) - - - 188, 22 - - - Duplicate (Ctrl+D) - - - 188, 22 - - - New Profile - - - 188, 22 - - - Import - - - 188, 22 - - - Export - - - 17, 56 - - - 3, 30 - - - 890, 27 - - - 2 - - - Profile Options - - - tSOptions - - - System.Windows.Forms.ToolStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabProfiles - - - 1 - - - 79, 24 - - - Profile Name: - - - 150, 27 - - - <type profile name here> - - - Magenta - - - 92, 24 - - - Save Profile - - - Magenta - - - 67, 24 - - - Cancel - - - 6, 27 - - - Magenta - - - 214, 24 - - - Keep this window size after closing - - - 606, 17 - - - 3, 3 - - - 890, 27 - - - 1 - - - toolStrip1 - - - toolStrip1 - - - System.Windows.Forms.ToolStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabProfiles - - - 2 - - - Magenta - - - 55, 24 - - - New - - - Make a New Profile - - - False - - - Magenta - - - 51, 24 - - - Edit - - - Edit Selected Profile (Enter) - - - False - - - Magenta - - - 64, 24 - - - Delete - - - Delete Selected Profle (Delete) - - - False - - - Magenta - - - 81, 24 - - - Duplicate - - - Dupliacate Selected Profile (Ctrl+D) - - - False - - - Magenta - - - 67, 24 - - - Import - - - Import Profile or Profiles - - - False - - - Magenta - - - 64, 24 - - - Export - - - Export Selected Profile - - - True - - - NoControl - - - 3, 4 - - - 95, 13 - - - 45 - - - Show Notifications - - - lbNotifications - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel1 - - - 0 - - - Top, Right - - - None - - - Warnings only - - - All - - - 104, 1 - - - 106, 21 - - - 44 - - - cBoxNotifications - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel1 - - - 1 - - - Top, Right - - - 185, 2 - - - 44, 20 - - - 42 - - - nUDLatency - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - 0 - - - Top, Right - - - True - - - NoControl - - - 235, 4 - - - 20, 13 - - - 0 - - - ms - - - lbMsLatency - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - 1 - - - True - - - NoControl - - - 0, 3 - - - 170, 17 - - - 53 - - - Flash Lightbar at High Latency - - - cBFlashWhenLate - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - 2 - Top, Right @@ -3309,6 +2511,30 @@ 2 + + False + + + 274, 56 + + + 189, 22 + + + 43 + + + pNUpdate + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 13 + Left @@ -3399,6 +2625,30 @@ 2 + + 274, 84 + + + 186, 22 + + + 44 + + + pnlXIPorts + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 14 + + + True + True @@ -3555,6 +2805,138 @@ 4 + + TopDown + + + 274, 112 + + + 122, 65 + + + 56 + + + flowLayoutPanel1 + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fLPSettings + + + 15 + + + Fill + + + TopDown + + + 3, 3 + + + 7, 7, 0, 9 + + + 890, 353 + + + 0 + + + fLPSettings + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabSettings + + + 0 + + + 4, 22 + + + 3, 3, 3, 3 + + + 896, 359 + + + 4 + + + Settings + + + tabSettings + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabMain + + + 3 + + + 4, 22 + + + 3, 3, 3, 3 + + + 896, 359 + + + 1 + + + Log + + + tabLog + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabMain + + + 4 + + + Fill + + + 0, 0 + + + 904, 385 + + + 12 + + + tabMain + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + 711, 17 @@ -3567,15 +2949,6 @@ 220, 56 - - 171, 48 - - - cMCustomLed - - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 170, 22 @@ -3588,12 +2961,24 @@ Use Custom Color + + 171, 48 + + + cMCustomLed + + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + 17, 17 True + + 91 + 96, 96 @@ -3850,7 +3235,7 @@ advColorDialog - DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.4.61.0, Culture=neutral, PublicKeyToken=null + DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.4.63.0, Culture=neutral, PublicKeyToken=null DS4Form diff --git a/DS4Windows/DS4Library/DS4Devices.cs b/DS4Windows/DS4Library/DS4Devices.cs index fbd2b8d..2cdfdd8 100644 --- a/DS4Windows/DS4Library/DS4Devices.cs +++ b/DS4Windows/DS4Library/DS4Devices.cs @@ -36,10 +36,13 @@ namespace DS4Windows // Sort Bluetooth first in case USB is also connected on the same controller. hDevices = hDevices.OrderBy((HidDevice d) => { return DS4Device.HidConnectionType(d); }); - foreach (HidDevice hDevice in hDevices) + for (int i = 0, devCount = hDevices.Count(); i < devCount; i++) + //foreach (HidDevice hDevice in hDevices) { + HidDevice hDevice = hDevices.ElementAt(i); if (DevicePaths.Contains(hDevice.DevicePath)) continue; // BT/USB endpoint already open once + if (!hDevice.IsOpen) { hDevice.OpenDevice(isExclusiveMode); @@ -98,7 +101,6 @@ namespace DS4Windows } } } - } } @@ -134,11 +136,14 @@ 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.HidDevice.CloseDevice(); } + Devices.Clear(); DevicePaths.Clear(); }