diff --git a/DS4Windows/DS4Forms/DS4Form.Designer.cs b/DS4Windows/DS4Forms/DS4Form.Designer.cs index dd6b88c..1197b47 100644 --- a/DS4Windows/DS4Forms/DS4Form.Designer.cs +++ b/DS4Windows/DS4Forms/DS4Form.Designer.cs @@ -44,6 +44,12 @@ 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(); @@ -147,7 +153,6 @@ this.lbUseXIPorts = new System.Windows.Forms.Label(); this.nUDXIPorts = new System.Windows.Forms.NumericUpDown(); this.lbLastXIPort = new System.Windows.Forms.Label(); - 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(); @@ -167,6 +172,7 @@ this.cMCustomLed = new System.Windows.Forms.ContextMenuStrip(this.components); this.useProfileColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.useCustomColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.languagePackComboBox1 = new DS4Windows.DS4Forms.LanguagePackComboBox(); this.advColorDialog = new DS4Windows.AdvancedColorDialog(); this.pnlButton.SuspendLayout(); this.cMTaskbar.SuspendLayout(); @@ -272,6 +278,8 @@ this.editProfileForController2ToolStripMenuItem, this.editProfileForController3ToolStripMenuItem, this.editProfileForController4ToolStripMenuItem, + this.toolStripSeparator4, + this.disconToolStripMenuItem, this.toolStripSeparator1, this.startToolStripMenuItem, this.openToolStripMenuItem, @@ -309,6 +317,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"; @@ -1150,12 +1201,6 @@ resources.ApplyResources(this.lbLastXIPort, "lbLastXIPort"); this.lbLastXIPort.Name = "lbLastXIPort"; // - // languagePackComboBox1 - // - resources.ApplyResources(this.languagePackComboBox1, "languagePackComboBox1"); - this.languagePackComboBox1.Name = "languagePackComboBox1"; - this.languagePackComboBox1.SelectedValueChanged += new System.EventHandler(this.languagePackComboBox1_SelectedValueChanged); - // // flowLayoutPanel1 // resources.ApplyResources(this.flowLayoutPanel1, "flowLayoutPanel1"); @@ -1294,6 +1339,12 @@ resources.ApplyResources(this.useCustomColorToolStripMenuItem, "useCustomColorToolStripMenuItem"); this.useCustomColorToolStripMenuItem.Click += new System.EventHandler(this.useCustomColorToolStripMenuItem_Click); // + // languagePackComboBox1 + // + resources.ApplyResources(this.languagePackComboBox1, "languagePackComboBox1"); + this.languagePackComboBox1.Name = "languagePackComboBox1"; + this.languagePackComboBox1.SelectedValueChanged += new System.EventHandler(this.languagePackComboBox1_SelectedValueChanged); + // // DS4Form // this.AllowDrop = true; @@ -1491,6 +1542,12 @@ 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.ToolStripMenuItem toolStripMenuItem2; } } diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index 7265cc1..51fd68a 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -33,6 +33,7 @@ namespace DS4Windows private Button[] lights; private PictureBox[] statPB; private ToolStripMenuItem[] shortcuts; + private ToolStripMenuItem[] disconnectShortcuts; protected CheckBox[] linkedProfileCB; WebClient wc = new WebClient(); NonFormTimer hotkeysTimer = new NonFormTimer(); @@ -55,7 +56,6 @@ namespace DS4Windows bool turnOffTemp; bool runningBat; private bool changingService; - public bool ChangingService => 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] @@ -124,6 +124,11 @@ 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 }; @@ -1283,6 +1288,8 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question shortcuts[device].Visible = on; Batteries[device].Visible = on; linkedProfileCB[device].Visible = on; + disconnectShortcuts[device].Visible = on && + Program.rootHub.DS4Controllers[device].ConnectionType != ConnectionType.USB; } protected void On_Debug(object sender, DebugEventArgs e) @@ -2485,6 +2492,24 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question 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 cBFlashWhenLate_CheckedChanged(object sender, EventArgs e) { FlashWhenLate = cBFlashWhenLate.Checked; diff --git a/DS4Windows/DS4Forms/DS4Form.resx b/DS4Windows/DS4Forms/DS4Form.resx index c77ca24..cac8dd5 100644 --- a/DS4Windows/DS4Forms/DS4Form.resx +++ b/DS4Windows/DS4Forms/DS4Form.resx @@ -310,7 +310,7 @@ $this - 4 + 2 264, 17 @@ -345,6 +345,39 @@ Edit Profile for Controller 4 + + 211, 6 + + + 198, 22 + + + Disconnect Controller 1 + + + 198, 22 + + + Disconnect Controller 2 + + + 198, 22 + + + Disconnect Controller 3 + + + 198, 22 + + + Disconnect Controller 4 + + + 214, 22 + + + Disconnect Menu + 211, 6 @@ -376,7 +409,7 @@ Exit (Middle Mouse) - 215, 186 + 215, 214 cMTaskbar @@ -412,10 +445,10 @@ NoControl - 790, 89 + 785, 89 - 103, 22 + 108, 22 50 @@ -439,7 +472,7 @@ NoControl - 378, 34 + 375, 34 39, 20 @@ -541,7 +574,7 @@ NoControl - 750, 89 + 745, 89 34, 22 @@ -571,7 +604,7 @@ NoControl - 750, 117 + 745, 117 34, 22 @@ -670,7 +703,7 @@ None - 633, 33 + 628, 33 111, 21 @@ -697,7 +730,7 @@ NoControl - 750, 61 + 745, 61 34, 22 @@ -724,7 +757,7 @@ None - 633, 61 + 628, 61 111, 21 @@ -748,7 +781,7 @@ None - 633, 89 + 628, 89 111, 21 @@ -775,7 +808,7 @@ NoControl - 750, 33 + 745, 33 34, 22 @@ -802,7 +835,7 @@ None - 633, 117 + 628, 117 111, 21 @@ -835,7 +868,7 @@ NoControl - 634, 7 + 629, 7 109, 15 @@ -907,7 +940,7 @@ NoControl - 374, 7 + 371, 7 47, 15 @@ -943,7 +976,7 @@ NoControl - 476, 7 + 471, 7 51, 15 @@ -979,7 +1012,7 @@ NoControl - 482, 36 + 477, 36 39, 15 @@ -1015,7 +1048,7 @@ NoControl - 482, 64 + 477, 64 39, 15 @@ -1051,7 +1084,7 @@ NoControl - 482, 92 + 477, 92 39, 15 @@ -1087,7 +1120,7 @@ NoControl - 482, 120 + 477, 120 39, 15 @@ -1117,7 +1150,7 @@ NoControl - 378, 62 + 375, 62 39, 20 @@ -1147,7 +1180,7 @@ NoControl - 378, 90 + 375, 90 39, 20 @@ -1177,7 +1210,7 @@ NoControl - 378, 118 + 375, 118 39, 20 @@ -1210,10 +1243,10 @@ NoControl - 790, 33 + 785, 33 - 103, 22 + 108, 22 50 @@ -1240,10 +1273,10 @@ NoControl - 790, 61 + 785, 61 - 103, 22 + 108, 22 51 @@ -1270,10 +1303,10 @@ NoControl - 790, 117 + 785, 117 - 103, 22 + 108, 22 52 @@ -1303,7 +1336,7 @@ NoControl - 556, 0 + 551, 0 67, 30 @@ -1342,7 +1375,7 @@ NoControl - 582, 37 + 577, 37 15, 14 @@ -1375,7 +1408,7 @@ NoControl - 582, 65 + 577, 65 15, 14 @@ -1408,7 +1441,7 @@ NoControl - 582, 93 + 577, 93 15, 14 @@ -1441,7 +1474,7 @@ NoControl - 582, 121 + 577, 121 15, 14 @@ -1489,7 +1522,7 @@ 0 - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="bnLight3" Row="3" RowSpan="1" Column="6" 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="5" ColumnSpan="1" /><Control Name="bnEditC4" Row="4" RowSpan="1" Column="5" 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="4" ColumnSpan="1" /><Control Name="bnEditC2" Row="2" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="cBController2" Row="2" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="cBController3" Row="3" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="bnEditC1" Row="1" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="cBController4" Row="4" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="lbSelectedProfile" Row="0" RowSpan="1" Column="4" 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="6" ColumnSpan="1" /><Control Name="bnLight2" Row="2" RowSpan="1" Column="6" ColumnSpan="1" /><Control Name="bnLight4" Row="4" RowSpan="1" Column="6" ColumnSpan="1" /><Control Name="lbLinkProfile" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB1" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB2" Row="2" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB3" Row="3" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB4" Row="4" RowSpan="1" Column="3" ColumnSpan="1" /></Controls><Columns Styles="Percent,62.29144,Percent,20.02225,Percent,17.68632,Absolute,80,AutoSize,0,AutoSize,0,Absolute,107" /><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="6" 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="5" ColumnSpan="1" /><Control Name="bnEditC4" Row="4" RowSpan="1" Column="5" 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="4" ColumnSpan="1" /><Control Name="bnEditC2" Row="2" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="cBController2" Row="2" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="cBController3" Row="3" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="bnEditC1" Row="1" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="cBController4" Row="4" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="lbSelectedProfile" Row="0" RowSpan="1" Column="4" 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="6" ColumnSpan="1" /><Control Name="bnLight2" Row="2" RowSpan="1" Column="6" ColumnSpan="1" /><Control Name="bnLight4" Row="4" RowSpan="1" Column="6" ColumnSpan="1" /><Control Name="lbLinkProfile" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB1" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB2" Row="2" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB3" Row="3" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="linkCB4" Row="4" RowSpan="1" Column="3" ColumnSpan="1" /></Controls><Columns Styles="Percent,62.29144,Percent,20.02225,Percent,17.68632,Absolute,80,AutoSize,0,AutoSize,0,Absolute,112" /><Rows Styles="AutoSize,0,Percent,25,Percent,25,Percent,25,Percent,25" /></TableLayoutSettings> Fill @@ -2767,7 +2800,7 @@ languagePackComboBox1 - DS4Windows.DS4Forms.LanguagePackComboBox, DS4Windows, Version=1.4.110.0, Culture=neutral, PublicKeyToken=null + DS4Windows.DS4Forms.LanguagePackComboBox, DS4Windows, Version=1.4.119.0, Culture=neutral, PublicKeyToken=null fLPSettings @@ -2937,6 +2970,9 @@ Left, Right + + NoControl + 7, 73 @@ -2964,6 +3000,9 @@ True + + NoControl + 7, 77 @@ -2991,6 +3030,9 @@ True + + NoControl + 7, 90 @@ -3018,6 +3060,9 @@ True + + NoControl + 7, 103 @@ -3256,7 +3301,7 @@ $this - 3 + 1 711, 17 @@ -3306,6 +3351,9 @@ 904, 415 + + NoControl + 630, 229 @@ -3357,6 +3405,42 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + toolStripSeparator4 + + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + disconToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + discon1toolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + discon2ToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + discon3ToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + discon4ToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + toolStripSeparator1 @@ -3559,7 +3643,7 @@ advColorDialog - DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.4.110.0, Culture=neutral, PublicKeyToken=null + DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.4.119.0, Culture=neutral, PublicKeyToken=null DS4Form