From b09e5c277e63b84ee18b274941688b339e81fc54 Mon Sep 17 00:00:00 2001 From: mika-n Date: Tue, 23 Apr 2019 14:54:04 +0300 Subject: [PATCH] Added "Unload on regular trigger release" checkbox option to "SpecialAction.Profiles" edit panel. This option can be used to automatically unload a profile (ie. goes back to previous profile) when a regular trigger key is released. --- DS4Windows/DS4Forms/SpecActions.Designer.cs | 9 +++++ DS4Windows/DS4Forms/SpecActions.cs | 3 +- DS4Windows/DS4Forms/SpecActions.resx | 43 ++++++++++++++++++++- 3 files changed, 52 insertions(+), 3 deletions(-) diff --git a/DS4Windows/DS4Forms/SpecActions.Designer.cs b/DS4Windows/DS4Forms/SpecActions.Designer.cs index 3283401..16d0036 100644 --- a/DS4Windows/DS4Forms/SpecActions.Designer.cs +++ b/DS4Windows/DS4Forms/SpecActions.Designer.cs @@ -86,6 +86,7 @@ this.lbDTapDVR = new System.Windows.Forms.Label(); this.lbHoldDVR = new System.Windows.Forms.Label(); this.lbTapDVR = new System.Windows.Forms.Label(); + this.cbProfileAutoUntrigger = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.pBProgram)).BeginInit(); this.pnlProgram.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nUDProg)).BeginInit(); @@ -383,6 +384,7 @@ // // pnlProfile // + this.pnlProfile.Controls.Add(this.cbProfileAutoUntrigger); this.pnlProfile.Controls.Add(this.lbUnloadTipProfile); this.pnlProfile.Controls.Add(this.cBProfiles); this.pnlProfile.Controls.Add(this.btnSetUTriggerProfile); @@ -596,6 +598,12 @@ resources.ApplyResources(this.lbTapDVR, "lbTapDVR"); this.lbTapDVR.Name = "lbTapDVR"; // + // cbProfileAutoUntrigger + // + resources.ApplyResources(this.cbProfileAutoUntrigger, "cbProfileAutoUntrigger"); + this.cbProfileAutoUntrigger.Name = "cbProfileAutoUntrigger"; + this.cbProfileAutoUntrigger.UseVisualStyleBackColor = true; + // // SpecActions // resources.ApplyResources(this, "$this"); @@ -698,5 +706,6 @@ public System.Windows.Forms.Button btnDTapT; public System.Windows.Forms.Button btnHoldT; public System.Windows.Forms.Button btnSTapT; + private System.Windows.Forms.CheckBox cbProfileAutoUntrigger; } } \ No newline at end of file diff --git a/DS4Windows/DS4Forms/SpecActions.cs b/DS4Windows/DS4Forms/SpecActions.cs index cf6f338..69c4b57 100644 --- a/DS4Windows/DS4Forms/SpecActions.cs +++ b/DS4Windows/DS4Forms/SpecActions.cs @@ -102,6 +102,7 @@ namespace DS4Windows break; } } + cbProfileAutoUntrigger.Checked = act.automaticUntrigger; break; case "Key": cBActions.SelectedIndex = 4; @@ -270,7 +271,7 @@ namespace DS4Windows actRe = true; if (!string.IsNullOrEmpty(oldprofilename) && oldprofilename != tBName.Text) Global.RemoveAction(oldprofilename); - Global.SaveAction(tBName.Text, String.Join("/", controls), cBActions.SelectedIndex, cBProfiles.Text, edit, String.Join("/", ucontrols) + (/* TODO: Is automaticUntrigger set */ true ? (ucontrols.Count > 0 ? "/" : "") + "AutomaticUntrigger" : "") ); + Global.SaveAction(tBName.Text, String.Join("/", controls), cBActions.SelectedIndex, cBProfiles.Text, edit, String.Join("/", ucontrols) + (cbProfileAutoUntrigger.Checked ? (ucontrols.Count > 0 ? "/" : "") + "AutomaticUntrigger" : "") ); } else btnSetUTriggerProfile.ForeColor = Color.Red; diff --git a/DS4Windows/DS4Forms/SpecActions.resx b/DS4Windows/DS4Forms/SpecActions.resx index 13b7a3a..66c2e08 100644 --- a/DS4Windows/DS4Forms/SpecActions.resx +++ b/DS4Windows/DS4Forms/SpecActions.resx @@ -2116,7 +2116,7 @@ NoControl - 0, 55 + 0, 95 100, 23 @@ -2140,7 +2140,7 @@ 206, 58 - 161, 94 + 161, 121 262 @@ -2160,6 +2160,45 @@ 11 + + cbProfileAutoUntrigger + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlProfile + + + 0 + + + True + + + 0, 61 + + + 144, 17 + + + 260 + + + Unload on trigger release + + + cbProfileAutoUntrigger + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + pnlProfile + + + 0 + 56, 3