mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-01-11 15:59:08 +01:00
Version 1.4.27
(Windows 10) Thanks to another workaround found, it has been added to DS4Windows, there is a button on the main tab, to connect your controller exclusively, this will temporarily kill explorer (The taskbar) and bring it back once a controller is connected Macros: When recording with a delay, you can now add rumble and changing the lightbar color during the macro, you can use the touchpad zones to add rumble or lightbar options. To change how much rumble happens or the lightbar color, just double click the item in the list
This commit is contained in:
parent
7143a0ce81
commit
3680b6b425
@ -1279,7 +1279,7 @@ namespace DS4Windows
|
||||
DateTime now = DateTime.UtcNow;
|
||||
if (!subtriggeractivated && now <= oldnowKeyAct[device] + TimeSpan.FromMilliseconds(250))
|
||||
{
|
||||
await Task.Delay(3); //if the button is assigned to the same key use a delay so the keydown is the last action, not key up
|
||||
await Task.Delay(3); //if the button is assigned to the same key use a delay so the key down is the last action, not key up
|
||||
triggeractivated = true;
|
||||
oldnowKeyAct[device] = DateTime.MinValue;
|
||||
}
|
||||
@ -1459,6 +1459,10 @@ namespace DS4Windows
|
||||
{
|
||||
if (Global.getCustomButton(device, action.trigger[0]) != X360Controls.Unbound)
|
||||
Global.getCustomButtons(device)[action.trigger[0]] = X360Controls.Unbound;
|
||||
if (Global.getCustomMacro(device, action.trigger[0]) != "0")
|
||||
Global.getCustomMacros(device).Remove(action.trigger[0]);
|
||||
if (Global.getCustomKey(device, action.trigger[0]) != 0)
|
||||
Global.getCustomMacros(device).Remove(action.trigger[0]);
|
||||
string[] dets = action.details.Split(',');
|
||||
DS4Device d = ctrl.DS4Controllers[device];
|
||||
//Global.cus
|
||||
@ -1493,7 +1497,7 @@ namespace DS4Windows
|
||||
}
|
||||
|
||||
int type = 0;
|
||||
string macro = "91/71/71/91";
|
||||
string macro = "";
|
||||
if (tappedOnce) //single tap
|
||||
{
|
||||
if (int.TryParse(dets[0], out type))
|
||||
@ -1625,7 +1629,7 @@ namespace DS4Windows
|
||||
keys = new int[0];
|
||||
}
|
||||
for (int i = 0; i < keys.Length; i++)
|
||||
keys[i] = ushort.Parse(skeys[i]);
|
||||
keys[i] = int.Parse(skeys[i]);
|
||||
bool[] keydown = new bool[286];
|
||||
if (control == DS4Controls.None || !macrodone[DS4ControltoInt(control)])
|
||||
{
|
||||
@ -1633,7 +1637,33 @@ namespace DS4Windows
|
||||
macrodone[DS4ControltoInt(control)] = true;
|
||||
foreach (int i in keys)
|
||||
{
|
||||
if (i >= 300) //ints over 300 used to delay
|
||||
if (i >= 1000000000)
|
||||
{
|
||||
string lb = i.ToString().Substring(1);
|
||||
if (i > 1000000000)
|
||||
{
|
||||
byte r = (byte)(int.Parse(lb[0].ToString()) * 100 + int.Parse(lb[1].ToString()) * 10 + int.Parse(lb[2].ToString()));
|
||||
byte g = (byte)(int.Parse(lb[3].ToString()) * 100 + int.Parse(lb[4].ToString()) * 10 + int.Parse(lb[5].ToString()));
|
||||
byte b = (byte)(int.Parse(lb[6].ToString()) * 100 + int.Parse(lb[7].ToString()) * 10 + int.Parse(lb[8].ToString()));
|
||||
DS4LightBar.forcelight[device] = true;
|
||||
DS4LightBar.forcedFlash[device] = 0;
|
||||
DS4LightBar.forcedColor[device] = new DS4Color(r, g, b);
|
||||
}
|
||||
else
|
||||
{
|
||||
DS4LightBar.forcedFlash[device] = 0;
|
||||
DS4LightBar.forcelight[device] = false;
|
||||
}
|
||||
}
|
||||
else if (i >= 1000000)
|
||||
{
|
||||
DS4Device d = Program.rootHub.DS4Controllers[device];
|
||||
string r = i.ToString().Substring(1);
|
||||
byte heavy = (byte)(int.Parse(r[0].ToString()) * 100 + int.Parse(r[1].ToString()) * 10 + int.Parse(r[2].ToString()));
|
||||
byte light = (byte)(int.Parse(r[3].ToString()) * 100 + int.Parse(r[4].ToString()) * 10 + int.Parse(r[5].ToString()));
|
||||
d.setRumble(light, heavy);
|
||||
}
|
||||
else if (i >= 300) //ints over 300 used to delay
|
||||
await Task.Delay(i - 300);
|
||||
else if (!keydown[i])
|
||||
{
|
||||
@ -1750,6 +1780,9 @@ namespace DS4Windows
|
||||
else
|
||||
InputMethods.performKeyRelease(i);
|
||||
}
|
||||
DS4LightBar.forcedFlash[device] = 0;
|
||||
DS4LightBar.forcelight[device] = false;
|
||||
Program.rootHub.DS4Controllers[device].setRumble(0, 0);
|
||||
if (keyType.HasFlag(DS4KeyType.HoldMacro))
|
||||
{
|
||||
await Task.Delay(50);
|
||||
|
@ -461,6 +461,7 @@
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.ro-RO.resx" />
|
||||
<EmbeddedResource Include="Properties\Resources.ru-RU.resx" />
|
||||
@ -470,7 +471,11 @@
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Resources1.Designer.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
@ -513,6 +518,7 @@
|
||||
<Content Include="Resources\imageres_import.png" />
|
||||
<Content Include="Resources\imageres_new.png" />
|
||||
<Content Include="Resources\LB.png" />
|
||||
<None Include="Resources\left touch.png" />
|
||||
<Content Include="Resources\LEFT.png" />
|
||||
<Content Include="Resources\LeftTouch.png" />
|
||||
<Content Include="Resources\LS.png" />
|
||||
@ -529,6 +535,7 @@
|
||||
<Content Include="Resources\rainbowC.png" />
|
||||
<Content Include="Resources\RB.png" />
|
||||
<Content Include="Resources\Red Circle.png" />
|
||||
<None Include="Resources\right touch.png" />
|
||||
<Content Include="Resources\RIGHT.png" />
|
||||
<Content Include="Resources\RightTouch.png" />
|
||||
<Content Include="Resources\RS.png" />
|
||||
|
82
DS4Windows/DS4Windows/DS4Form.Designer.cs
generated
82
DS4Windows/DS4Windows/DS4Form.Designer.cs
generated
@ -54,6 +54,7 @@
|
||||
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.pBStatus1 = new System.Windows.Forms.PictureBox();
|
||||
this.lbPad1 = new System.Windows.Forms.Label();
|
||||
@ -114,6 +115,9 @@
|
||||
this.cBSwipeProfiles = new System.Windows.Forms.CheckBox();
|
||||
this.StartWindowsCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.startMinimizedCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.lbNotifications = new System.Windows.Forms.Label();
|
||||
this.cBoxNotifications = new System.Windows.Forms.ComboBox();
|
||||
this.cBDisconnectBT = new System.Windows.Forms.CheckBox();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.nUDLatency = new System.Windows.Forms.NumericUpDown();
|
||||
@ -121,11 +125,8 @@
|
||||
this.cBFlashWhenLate = new System.Windows.Forms.CheckBox();
|
||||
this.cBCloseMini = new System.Windows.Forms.CheckBox();
|
||||
this.cBQuickCharge = new System.Windows.Forms.CheckBox();
|
||||
this.cBUpdate = new System.Windows.Forms.CheckBox();
|
||||
this.cBDownloadLangauge = new System.Windows.Forms.CheckBox();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.lbNotifications = new System.Windows.Forms.Label();
|
||||
this.cBoxNotifications = new System.Windows.Forms.ComboBox();
|
||||
this.cBUpdate = new System.Windows.Forms.CheckBox();
|
||||
this.pNUpdate = new System.Windows.Forms.Panel();
|
||||
this.cBUpdateTime = new System.Windows.Forms.ComboBox();
|
||||
this.lbCheckEvery = new System.Windows.Forms.Label();
|
||||
@ -159,9 +160,9 @@
|
||||
this.toolStrip1.SuspendLayout();
|
||||
this.tabSettings.SuspendLayout();
|
||||
this.fLPSettings.SuspendLayout();
|
||||
this.panel1.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDLatency)).BeginInit();
|
||||
this.panel1.SuspendLayout();
|
||||
this.pNUpdate.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDUpdateTime)).BeginInit();
|
||||
this.pnlXIPorts.SuspendLayout();
|
||||
@ -339,12 +340,20 @@
|
||||
//
|
||||
// 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");
|
||||
@ -824,6 +833,30 @@
|
||||
this.startMinimizedCheckBox.UseVisualStyleBackColor = true;
|
||||
this.startMinimizedCheckBox.CheckedChanged += new System.EventHandler(this.startMinimizedCheckBox_CheckedChanged);
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.lbNotifications);
|
||||
this.panel1.Controls.Add(this.cBoxNotifications);
|
||||
resources.ApplyResources(this.panel1, "panel1");
|
||||
this.panel1.Name = "panel1";
|
||||
//
|
||||
// lbNotifications
|
||||
//
|
||||
resources.ApplyResources(this.lbNotifications, "lbNotifications");
|
||||
this.lbNotifications.Name = "lbNotifications";
|
||||
//
|
||||
// cBoxNotifications
|
||||
//
|
||||
resources.ApplyResources(this.cBoxNotifications, "cBoxNotifications");
|
||||
this.cBoxNotifications.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cBoxNotifications.FormattingEnabled = true;
|
||||
this.cBoxNotifications.Items.AddRange(new object[] {
|
||||
resources.GetString("cBoxNotifications.Items"),
|
||||
resources.GetString("cBoxNotifications.Items1"),
|
||||
resources.GetString("cBoxNotifications.Items2")});
|
||||
this.cBoxNotifications.Name = "cBoxNotifications";
|
||||
this.cBoxNotifications.SelectedIndexChanged += new System.EventHandler(this.cBoxNotifications_SelectedIndexChanged);
|
||||
//
|
||||
// cBDisconnectBT
|
||||
//
|
||||
resources.ApplyResources(this.cBDisconnectBT, "cBDisconnectBT");
|
||||
@ -883,13 +916,6 @@
|
||||
this.cBQuickCharge.UseVisualStyleBackColor = true;
|
||||
this.cBQuickCharge.CheckedChanged += new System.EventHandler(this.cBQuickCharge_CheckedChanged);
|
||||
//
|
||||
// cBUpdate
|
||||
//
|
||||
resources.ApplyResources(this.cBUpdate, "cBUpdate");
|
||||
this.cBUpdate.Name = "cBUpdate";
|
||||
this.cBUpdate.UseVisualStyleBackColor = true;
|
||||
this.cBUpdate.CheckedChanged += new System.EventHandler(this.cBUpdate_CheckedChanged);
|
||||
//
|
||||
// cBDownloadLangauge
|
||||
//
|
||||
resources.ApplyResources(this.cBDownloadLangauge, "cBDownloadLangauge");
|
||||
@ -899,29 +925,12 @@
|
||||
this.cBDownloadLangauge.UseVisualStyleBackColor = true;
|
||||
this.cBDownloadLangauge.CheckedChanged += new System.EventHandler(this.cBDownloadLangauge_CheckedChanged);
|
||||
//
|
||||
// panel1
|
||||
// cBUpdate
|
||||
//
|
||||
this.panel1.Controls.Add(this.lbNotifications);
|
||||
this.panel1.Controls.Add(this.cBoxNotifications);
|
||||
resources.ApplyResources(this.panel1, "panel1");
|
||||
this.panel1.Name = "panel1";
|
||||
//
|
||||
// lbNotifications
|
||||
//
|
||||
resources.ApplyResources(this.lbNotifications, "lbNotifications");
|
||||
this.lbNotifications.Name = "lbNotifications";
|
||||
//
|
||||
// cBoxNotifications
|
||||
//
|
||||
resources.ApplyResources(this.cBoxNotifications, "cBoxNotifications");
|
||||
this.cBoxNotifications.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cBoxNotifications.FormattingEnabled = true;
|
||||
this.cBoxNotifications.Items.AddRange(new object[] {
|
||||
resources.GetString("cBoxNotifications.Items"),
|
||||
resources.GetString("cBoxNotifications.Items1"),
|
||||
resources.GetString("cBoxNotifications.Items2")});
|
||||
this.cBoxNotifications.Name = "cBoxNotifications";
|
||||
this.cBoxNotifications.SelectedIndexChanged += new System.EventHandler(this.cBoxNotifications_SelectedIndexChanged);
|
||||
resources.ApplyResources(this.cBUpdate, "cBUpdate");
|
||||
this.cBUpdate.Name = "cBUpdate";
|
||||
this.cBUpdate.UseVisualStyleBackColor = true;
|
||||
this.cBUpdate.CheckedChanged += new System.EventHandler(this.cBUpdate_CheckedChanged);
|
||||
//
|
||||
// pNUpdate
|
||||
//
|
||||
@ -1099,11 +1108,11 @@
|
||||
this.tabSettings.ResumeLayout(false);
|
||||
this.fLPSettings.ResumeLayout(false);
|
||||
this.fLPSettings.PerformLayout();
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.panel2.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDLatency)).EndInit();
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
this.pNUpdate.ResumeLayout(false);
|
||||
this.pNUpdate.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nUDUpdateTime)).EndInit();
|
||||
@ -1233,6 +1242,7 @@
|
||||
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.ToolStripMenuItem toolStripMenuItem2;
|
||||
}
|
||||
}
|
||||
|
@ -48,6 +48,7 @@ namespace DS4Windows
|
||||
bool contextclose;
|
||||
string logFile = appdatapath + @"\DS4Service.log";
|
||||
StreamWriter logWriter;
|
||||
bool runningBat;
|
||||
//bool outputlog = false;
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
@ -186,12 +187,16 @@ namespace DS4Windows
|
||||
//MessageBox.Show(Environment.OSVersion.VersionString);
|
||||
foreach (ToolStripMenuItem t in shortcuts)
|
||||
t.DropDownItemClicked += Profile_Changed_Menu;
|
||||
hideDS4CheckBox.CheckedChanged -= hideDS4CheckBox_CheckedChanged;
|
||||
hideDS4CheckBox.Checked = UseExclusiveMode;
|
||||
hideDS4CheckBox.CheckedChanged += hideDS4CheckBox_CheckedChanged;
|
||||
hideDS4CheckBox.CheckedChanged -= hideDS4CheckBox_CheckedChanged;
|
||||
hideDS4CheckBox.Checked = UseExclusiveMode;
|
||||
hideDS4CheckBox.CheckedChanged += hideDS4CheckBox_CheckedChanged;
|
||||
if (Environment.OSVersion.Version.Major >= 10)
|
||||
toolTip1.SetToolTip(hideDS4CheckBox, "Currently does not work on Windows 10");
|
||||
cBDisconnectBT.Checked = DCBTatStop;
|
||||
{
|
||||
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");
|
||||
}
|
||||
cBDisconnectBT.Checked = DCBTatStop;
|
||||
cBQuickCharge.Checked = QuickCharge;
|
||||
nUDXIPorts.Value = FirstXinputPort;
|
||||
Program.rootHub.x360Bus.FirstController = FirstXinputPort;
|
||||
@ -320,6 +325,23 @@ namespace DS4Windows
|
||||
appShortcutToStartup();
|
||||
}
|
||||
}
|
||||
UpdateTheUpdater();
|
||||
}
|
||||
|
||||
private async void UpdateTheUpdater()
|
||||
{
|
||||
if (File.Exists(exepath + "\\Update Files\\DS4Updater.exe"))
|
||||
{
|
||||
Process[] processes = Process.GetProcessesByName("DS4Updater");
|
||||
while (processes.Length > 0)
|
||||
{
|
||||
await Task.Delay(500);
|
||||
}
|
||||
File.Delete(exepath + "\\DS4Updater.exe");
|
||||
File.Move(exepath + "\\Update Files\\DS4Updater.exe", exepath + "\\DS4Updater.exe");
|
||||
Directory.Delete(exepath + "\\Update Files");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void NewVersion()
|
||||
@ -475,6 +497,13 @@ namespace DS4Windows
|
||||
LoadProfile(j, false, Program.rootHub);
|
||||
}
|
||||
}
|
||||
if (bat != null && bat.HasExited && runningBat)
|
||||
{
|
||||
Process.Start("explorer.exe");
|
||||
bat = null;
|
||||
runningBat = false;
|
||||
}
|
||||
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
@ -791,6 +820,11 @@ namespace DS4Windows
|
||||
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)
|
||||
@ -1062,6 +1096,8 @@ namespace DS4Windows
|
||||
module.Dispose();
|
||||
|
||||
UseExclusiveMode = hideDS4CheckBox.Checked;
|
||||
if (Environment.OSVersion.Version.Major >= 10)
|
||||
btnConnectDS4Win10.Visible = hideDS4CheckBox.Checked;
|
||||
btnStartStop_Clicked(false);
|
||||
btnStartStop_Clicked(false);
|
||||
Save();
|
||||
@ -1615,6 +1651,22 @@ namespace DS4Windows
|
||||
{
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
private void cBDownloadLangauge_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
@ -6583,6 +6583,33 @@
|
||||
<data name="openProfiles.Filter" xml:space="preserve">
|
||||
<value>XML Files (*.xml)|*.xml</value>
|
||||
</data>
|
||||
<data name="btnConnectDS4Win10.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Top</value>
|
||||
</data>
|
||||
<data name="btnConnectDS4Win10.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 130</value>
|
||||
</data>
|
||||
<data name="btnConnectDS4Win10.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>896, 23</value>
|
||||
</data>
|
||||
<data name="btnConnectDS4Win10.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>48</value>
|
||||
</data>
|
||||
<data name="btnConnectDS4Win10.Text" xml:space="preserve">
|
||||
<value>Connect DS4 exclusivly (experimental)</value>
|
||||
</data>
|
||||
<data name=">>btnConnectDS4Win10.Name" xml:space="preserve">
|
||||
<value>btnConnectDS4Win10</value>
|
||||
</data>
|
||||
<data name=">>btnConnectDS4Win10.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>btnConnectDS4Win10.Parent" xml:space="preserve">
|
||||
<value>tabControllers</value>
|
||||
</data>
|
||||
<data name=">>btnConnectDS4Win10.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="tLPControllers.ColumnCount" type="System.Int32, mscorlib">
|
||||
<value>5</value>
|
||||
</data>
|
||||
@ -7573,7 +7600,7 @@
|
||||
<value>tabControllers</value>
|
||||
</data>
|
||||
<data name=">>tLPControllers.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="tLPControllers.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms">
|
||||
<value><?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><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" /></Controls><Columns Styles="Percent,46.27451,Percent,28.23529,Percent,25.4902,AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,Percent,25,Percent,25,Percent,25,Percent,25,Absolute,20" /></TableLayoutSettings></value>
|
||||
@ -7609,7 +7636,7 @@
|
||||
<value>tabControllers</value>
|
||||
</data>
|
||||
<data name=">>lbNoControllers.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="tabControllers.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>4, 22</value>
|
||||
|
54
DS4Windows/DS4Windows/RecordBox.Designer.cs
generated
54
DS4Windows/DS4Windows/RecordBox.Designer.cs
generated
@ -41,6 +41,8 @@
|
||||
this.btnSaveP = new System.Windows.Forms.Button();
|
||||
this.lbRecordTip = new System.Windows.Forms.Label();
|
||||
this.pnlMouseButtons = new System.Windows.Forms.Panel();
|
||||
this.btnLightbar = new System.Windows.Forms.Button();
|
||||
this.btnRumble = new System.Windows.Forms.Button();
|
||||
this.btn5th = new System.Windows.Forms.Button();
|
||||
this.btn4th = new System.Windows.Forms.Button();
|
||||
this.btnLoadP = new System.Windows.Forms.Button();
|
||||
@ -51,8 +53,12 @@
|
||||
this.cMSLoadPresets = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.altTabToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.fromFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.pBLtouch = new System.Windows.Forms.PictureBox();
|
||||
this.pBRtouch = new System.Windows.Forms.PictureBox();
|
||||
this.pnlMouseButtons.SuspendLayout();
|
||||
this.cMSLoadPresets.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pBLtouch)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pBRtouch)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnRecord
|
||||
@ -148,12 +154,34 @@
|
||||
// pnlMouseButtons
|
||||
//
|
||||
resources.ApplyResources(this.pnlMouseButtons, "pnlMouseButtons");
|
||||
this.pnlMouseButtons.Controls.Add(this.pBRtouch);
|
||||
this.pnlMouseButtons.Controls.Add(this.pBLtouch);
|
||||
this.pnlMouseButtons.Controls.Add(this.btnLightbar);
|
||||
this.pnlMouseButtons.Controls.Add(this.btnRumble);
|
||||
this.pnlMouseButtons.Controls.Add(this.btn5th);
|
||||
this.pnlMouseButtons.Controls.Add(this.btn4th);
|
||||
this.pnlMouseButtons.Name = "pnlMouseButtons";
|
||||
this.pnlMouseButtons.MouseDown += new System.Windows.Forms.MouseEventHandler(this.anyMouseDown);
|
||||
this.pnlMouseButtons.MouseUp += new System.Windows.Forms.MouseEventHandler(this.anyMouseUp);
|
||||
//
|
||||
// btnLightbar
|
||||
//
|
||||
resources.ApplyResources(this.btnLightbar, "btnLightbar");
|
||||
this.btnLightbar.Name = "btnLightbar";
|
||||
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);
|
||||
//
|
||||
// btnRumble
|
||||
//
|
||||
resources.ApplyResources(this.btnRumble, "btnRumble");
|
||||
this.btnRumble.Name = "btnRumble";
|
||||
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);
|
||||
//
|
||||
// btn5th
|
||||
//
|
||||
resources.ApplyResources(this.btn5th, "btn5th");
|
||||
@ -200,25 +228,39 @@
|
||||
//
|
||||
// cMSLoadPresets
|
||||
//
|
||||
resources.ApplyResources(this.cMSLoadPresets, "cMSLoadPresets");
|
||||
this.cMSLoadPresets.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.altTabToolStripMenuItem,
|
||||
this.fromFileToolStripMenuItem});
|
||||
this.cMSLoadPresets.Name = "cMSLoadPresets";
|
||||
this.cMSLoadPresets.ShowImageMargin = false;
|
||||
resources.ApplyResources(this.cMSLoadPresets, "cMSLoadPresets");
|
||||
//
|
||||
// altTabToolStripMenuItem
|
||||
//
|
||||
resources.ApplyResources(this.altTabToolStripMenuItem, "altTabToolStripMenuItem");
|
||||
this.altTabToolStripMenuItem.Name = "altTabToolStripMenuItem";
|
||||
resources.ApplyResources(this.altTabToolStripMenuItem, "altTabToolStripMenuItem");
|
||||
this.altTabToolStripMenuItem.Click += new System.EventHandler(this.altTabToolStripMenuItem_Click);
|
||||
//
|
||||
// fromFileToolStripMenuItem
|
||||
//
|
||||
resources.ApplyResources(this.fromFileToolStripMenuItem, "fromFileToolStripMenuItem");
|
||||
this.fromFileToolStripMenuItem.Name = "fromFileToolStripMenuItem";
|
||||
resources.ApplyResources(this.fromFileToolStripMenuItem, "fromFileToolStripMenuItem");
|
||||
this.fromFileToolStripMenuItem.Click += new System.EventHandler(this.fromFileToolStripMenuItem_Click);
|
||||
//
|
||||
// pBLtouch
|
||||
//
|
||||
this.pBLtouch.Image = global::DS4Windows.Properties.Resources.left_touch;
|
||||
resources.ApplyResources(this.pBLtouch, "pBLtouch");
|
||||
this.pBLtouch.Name = "pBLtouch";
|
||||
this.pBLtouch.TabStop = false;
|
||||
//
|
||||
// pBRtouch
|
||||
//
|
||||
this.pBRtouch.Image = global::DS4Windows.Properties.Resources.right_touch;
|
||||
resources.ApplyResources(this.pBRtouch, "pBRtouch");
|
||||
this.pBRtouch.Name = "pBRtouch";
|
||||
this.pBRtouch.TabStop = false;
|
||||
//
|
||||
// RecordBox
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
@ -249,6 +291,8 @@
|
||||
this.Resize += new System.EventHandler(this.RecordBox_Resize);
|
||||
this.pnlMouseButtons.ResumeLayout(false);
|
||||
this.cMSLoadPresets.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pBLtouch)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pBRtouch)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
@ -277,5 +321,9 @@
|
||||
private System.Windows.Forms.ContextMenuStrip cMSLoadPresets;
|
||||
private System.Windows.Forms.ToolStripMenuItem altTabToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem fromFileToolStripMenuItem;
|
||||
private System.Windows.Forms.Button btnLightbar;
|
||||
private System.Windows.Forms.Button btnRumble;
|
||||
private System.Windows.Forms.PictureBox pBRtouch;
|
||||
private System.Windows.Forms.PictureBox pBLtouch;
|
||||
}
|
||||
}
|
@ -27,6 +27,7 @@ namespace DS4Windows
|
||||
DS4State cState;
|
||||
public bool saved = false;
|
||||
List<DS4Controls> dcs = new List<DS4Controls>();
|
||||
TextBox tb1, tb2;
|
||||
public RecordBox(KBM360 op)
|
||||
{
|
||||
kbm = op;
|
||||
@ -106,12 +107,32 @@ namespace DS4Windows
|
||||
else
|
||||
macros.Add(value);
|
||||
}
|
||||
bool[] pTP = new bool[4];
|
||||
void ds4_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.rootHub.DS4Controllers[0] != null)
|
||||
{
|
||||
cState = Program.rootHub.getDS4State(0);
|
||||
if (btnRecord.Text == Properties.Resources.StopText)
|
||||
{
|
||||
if (cBRecordDelays.Checked)
|
||||
{
|
||||
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(dc, cState, null, null))
|
||||
{
|
||||
@ -175,6 +196,7 @@ namespace DS4Windows
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -251,6 +273,10 @@ namespace DS4Windows
|
||||
{
|
||||
if (cBRecordDelays.Checked)
|
||||
sw.Start();
|
||||
btnRumble.Visible = cBRecordDelays.Checked;
|
||||
btnLightbar.Visible = cBRecordDelays.Checked;
|
||||
pBLtouch.Visible = cBRecordDelays.Checked;
|
||||
pBRtouch.Visible = cBRecordDelays.Checked;
|
||||
Program.rootHub.recordingMacro = true;
|
||||
saved = false;
|
||||
ds4.Start();
|
||||
@ -278,6 +304,13 @@ namespace DS4Windows
|
||||
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)
|
||||
@ -618,6 +651,98 @@ namespace DS4Windows
|
||||
}
|
||||
|
||||
|
||||
private void btnRumble_Click(object sender, EventArgs e)
|
||||
{
|
||||
int value = 1255255;
|
||||
if (btnRumble.Text.Contains("Add"))
|
||||
{
|
||||
if (macros.Count == 0 || (recordAfter && macrosAfter.Count == 0))
|
||||
{
|
||||
AddMacroValue(value);
|
||||
lVMacros.Items.Add("Rumble 255,255 (100%)", 0);
|
||||
if (cBRecordDelays.Checked)
|
||||
{
|
||||
sw.Reset();
|
||||
sw.Start();
|
||||
}
|
||||
}
|
||||
else if (macros.Count > 0 || (recordAfter && macrosAfter.Count > 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("Rumble 255,255 (100%)", 0);
|
||||
}
|
||||
btnRumble.Text = "Stop Rumble";
|
||||
}
|
||||
else
|
||||
{
|
||||
value = 1000000;
|
||||
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("Stop Rumble", 1);
|
||||
btnRumble.Text = "Add Rumble";
|
||||
}
|
||||
lVMacros.Items[lVMacros.Items.Count - 1].EnsureVisible();
|
||||
}
|
||||
|
||||
private void btnLightbar_Click(object sender, EventArgs e)
|
||||
{
|
||||
int value = 1255255255;
|
||||
if (btnLightbar.Text.Contains("Change"))
|
||||
{
|
||||
if (macros.Count == 0 || (recordAfter && macrosAfter.Count == 0))
|
||||
{
|
||||
AddMacroValue(value);
|
||||
lVMacros.Items.Add("Lightbar Color: 255,255,255", 0);
|
||||
if (cBRecordDelays.Checked)
|
||||
{
|
||||
sw.Reset();
|
||||
sw.Start();
|
||||
}
|
||||
}
|
||||
else if (macros.Count > 0 || (recordAfter && macrosAfter.Count > 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("Lightbar Color: 255,255,255", 0);
|
||||
}
|
||||
btnLightbar.Text = "Reset Lightbar Color";
|
||||
}
|
||||
else
|
||||
{
|
||||
value = 1000000000;
|
||||
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("Reset Lightbar", 1);
|
||||
btnLightbar.Text = "Change Lightbar Color";
|
||||
}
|
||||
lVMacros.Items[lVMacros.Items.Count - 1].EnsureVisible();
|
||||
}
|
||||
|
||||
public void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (macros.Count > 0)
|
||||
@ -749,7 +874,34 @@ namespace DS4Windows
|
||||
bool[] keydown = new bool[286];
|
||||
foreach (int i in macros)
|
||||
{
|
||||
if (i >= 300) //ints over 300 used to delay
|
||||
if (i >= 1000000000)
|
||||
{
|
||||
if (i > 1000000000)
|
||||
{
|
||||
string lb = i.ToString().Substring(1);
|
||||
byte r = (byte)(int.Parse(lb[0].ToString()) * 100 + int.Parse(lb[1].ToString()) * 10 + int.Parse(lb[2].ToString()));
|
||||
byte g = (byte)(int.Parse(lb[3].ToString()) * 100 + int.Parse(lb[4].ToString()) * 10 + int.Parse(lb[5].ToString()));
|
||||
byte b = (byte)(int.Parse(lb[6].ToString()) * 100 + int.Parse(lb[7].ToString()) * 10 + int.Parse(lb[8].ToString()));
|
||||
lVMacros.Items.Add($"Lightbar Color: {r},{g},{b}", 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
lVMacros.Items.Add("Reset Lightbar", 1);
|
||||
}
|
||||
}
|
||||
else if (i >= 1000000)
|
||||
{
|
||||
if (i > 1000000)
|
||||
{
|
||||
string r = i.ToString().Substring(1);
|
||||
byte heavy = (byte)(int.Parse(r[0].ToString()) * 100 + int.Parse(r[1].ToString()) * 10 + int.Parse(r[2].ToString()));
|
||||
byte light = (byte)(int.Parse(r[3].ToString()) * 100 + int.Parse(r[4].ToString()) * 10 + int.Parse(r[5].ToString()));
|
||||
lVMacros.Items.Add($"Rumble {heavy}, {light} ({Math.Round((heavy * .75f + light * .25f) / 2.55f, 1)}%)", 0);
|
||||
}
|
||||
else
|
||||
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])
|
||||
{
|
||||
@ -823,7 +975,7 @@ namespace DS4Windows
|
||||
keydown[i] = false;
|
||||
}
|
||||
}
|
||||
for (ushort i = 0; i < keydown.Length; i++)
|
||||
for (int i = 0; i < keydown.Length; i++)
|
||||
{
|
||||
if (keydown[i])
|
||||
{
|
||||
@ -922,61 +1074,127 @@ namespace DS4Windows
|
||||
}
|
||||
}
|
||||
private int selection;
|
||||
private bool changingDelay = false;
|
||||
private void lVMacros_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (lVMacros.SelectedIndices[0] >= 0 && lVMacros.SelectedItems[0].ImageIndex == 2)
|
||||
{
|
||||
TextBox tb = new TextBox();
|
||||
tb.MaxLength = 5;
|
||||
tb.KeyDown += nud_KeyDown;
|
||||
tb.LostFocus += nud_LostFocus;
|
||||
selection = lVMacros.SelectedIndices[0];
|
||||
Controls.Add(tb);
|
||||
tb.Location = new Point(lVMacros.Location.X + lVMacros.SelectedItems[0].Position.X, lVMacros.Location.Y + lVMacros.SelectedItems[0].Position.Y);
|
||||
tb.BringToFront();
|
||||
lVMacros.MouseHover -= lVMacros_MouseHover;
|
||||
tb.TextChanged += tb_TextChanged;
|
||||
tb.Focus();
|
||||
}
|
||||
if (lVMacros.SelectedIndices[0] >= 0)
|
||||
if (lVMacros.SelectedItems[0].ImageIndex == 2)
|
||||
{
|
||||
TextBox tb = new TextBox();
|
||||
tb.MaxLength = 5;
|
||||
tb.KeyDown += nud_KeyDown;
|
||||
tb.LostFocus += nud_LostFocus;
|
||||
selection = lVMacros.SelectedIndices[0];
|
||||
Controls.Add(tb);
|
||||
changingDelay = true;
|
||||
tb.Location = new Point(lVMacros.Location.X + lVMacros.SelectedItems[0].Position.X, lVMacros.Location.Y + lVMacros.SelectedItems[0].Position.Y);
|
||||
tb.BringToFront();
|
||||
lVMacros.MouseHover -= lVMacros_MouseHover;
|
||||
tb.TextChanged += tb_TextChanged;
|
||||
tb.Focus();
|
||||
}
|
||||
else if (macros[lVMacros.SelectedIndices[0]] > 1000000000)
|
||||
{
|
||||
selection = lVMacros.SelectedIndices[0];
|
||||
string lb = macros[lVMacros.SelectedIndices[0]].ToString().Substring(1);
|
||||
byte r = (byte)(int.Parse(lb[0].ToString()) * 100 + int.Parse(lb[1].ToString()) * 10 + int.Parse(lb[2].ToString()));
|
||||
byte g = (byte)(int.Parse(lb[3].ToString()) * 100 + int.Parse(lb[4].ToString()) * 10 + int.Parse(lb[5].ToString()));
|
||||
byte b = (byte)(int.Parse(lb[6].ToString()) * 100 + int.Parse(lb[7].ToString()) * 10 + int.Parse(lb[8].ToString()));
|
||||
AdvancedColorDialog advColorDialog = new AdvancedColorDialog();
|
||||
advColorDialog.Color = Color.FromArgb(r, g, b);
|
||||
advColorDialog.OnUpdateColor += advColorDialog_OnUpdateColor;
|
||||
if (advColorDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
macros[selection] = 1000000000 + advColorDialog.Color.R * 1000000 + advColorDialog.Color.G * 1000 + advColorDialog.Color.B;
|
||||
}
|
||||
lVMacros.Items[selection].Text = ($"Lightbar Color: {advColorDialog.Color.R},{advColorDialog.Color.G},{advColorDialog.Color.B}");
|
||||
}
|
||||
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()));
|
||||
byte light = (byte)(int.Parse(r[3].ToString()) * 100 + int.Parse(r[4].ToString()) * 10 + int.Parse(r[5].ToString()));
|
||||
selection = lVMacros.SelectedIndices[0];
|
||||
tb1 = new TextBox();
|
||||
tb2 = new TextBox();
|
||||
tb1.Name = "tBHeavy";
|
||||
tb1.Name = "tBLight";
|
||||
tb1.MaxLength = 3;
|
||||
tb2.MaxLength = 3;
|
||||
tb1.KeyDown += nud_KeyDown;
|
||||
tb2.KeyDown += nud_KeyDown;
|
||||
Controls.Add(tb1);
|
||||
Controls.Add(tb2);
|
||||
changingDelay = false;
|
||||
tb1.Location = new Point(lVMacros.Location.X + lVMacros.SelectedItems[0].Position.X, lVMacros.Location.Y + lVMacros.SelectedItems[0].Position.Y);
|
||||
tb1.Size = new Size(tb1.Size.Width / 2, tb1.Size.Height);
|
||||
tb2.Location = new Point(lVMacros.Location.X + lVMacros.SelectedItems[0].Position.X + tb1.Size.Width, lVMacros.Location.Y + lVMacros.SelectedItems[0].Position.Y);
|
||||
tb2.Size = tb1.Size;
|
||||
tb1.BringToFront();
|
||||
tb2.BringToFront();
|
||||
tb1.Text = heavy.ToString();
|
||||
tb2.Text = light.ToString();
|
||||
tb1.TextChanged += tb_TextChanged;
|
||||
tb2.TextChanged += tb_TextChanged;
|
||||
tb1.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
void tb_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
TextBox tb = (TextBox)sender;
|
||||
for (int i = tb.Text.Length - 1; i >= 0; i--)
|
||||
if (!Char.IsDigit(tb.Text[i]))
|
||||
tb.Text = tb.Text.Remove(i, 1);
|
||||
//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);
|
||||
}
|
||||
}
|
||||
|
||||
void nud_LostFocus(object sender, EventArgs e)
|
||||
{
|
||||
TextBox tb = (TextBox)sender;
|
||||
int i;
|
||||
if (!string.IsNullOrEmpty(tb.Text) && int.TryParse(tb.Text, out i))
|
||||
{
|
||||
lVMacros.Items[selection] = new ListViewItem(Properties.Resources.WaitMS.Replace("*number*", (tb.Text)).Replace("*ms*", "ms"), 2);
|
||||
macros[selection] = i + 300;
|
||||
saved = false;
|
||||
}
|
||||
Controls.Remove(tb);
|
||||
lVMacros.MouseHover += lVMacros_MouseHover;
|
||||
SaveMacroChange((TextBox)sender);
|
||||
}
|
||||
|
||||
void nud_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
TextBox tb = (TextBox)sender;
|
||||
if (e.KeyCode == Keys.Enter && !string.IsNullOrEmpty(tb.Text))
|
||||
if (e.KeyCode == Keys.Enter)
|
||||
SaveMacroChange((TextBox)sender);
|
||||
}
|
||||
private void SaveMacroChange(TextBox tb)
|
||||
{
|
||||
int i, j;
|
||||
if (!string.IsNullOrEmpty(tb.Text))
|
||||
{
|
||||
int i;
|
||||
if (int.TryParse(tb.Text, out i))
|
||||
if (changingDelay && int.TryParse(tb.Text, out i))
|
||||
{
|
||||
lVMacros.Items[selection] = new ListViewItem(Properties.Resources.WaitMS.Replace("*number*", (tb.Text)).Replace("*ms*", "ms"), 2);
|
||||
macros[selection] = i + 300;
|
||||
saved = false;
|
||||
Controls.Remove(tb);
|
||||
lVMacros.MouseHover += lVMacros_MouseHover;
|
||||
saved = false;
|
||||
}
|
||||
else if (!changingDelay)
|
||||
{
|
||||
if (int.TryParse(tb1.Text, out i) && int.TryParse(tb2.Text, out j))
|
||||
{
|
||||
if (i + j > 0)
|
||||
{
|
||||
byte heavy = (byte)i;
|
||||
byte light = (byte)j;
|
||||
lVMacros.Items[selection].Text = ($"Rumble {heavy}, {light} ({Math.Round((heavy * .75f + light * .25f) / 2.55f, 1)}%)");
|
||||
macros[selection] = 1000000 + heavy * 1000 + light;
|
||||
saved = false;
|
||||
Controls.Remove(tb1);
|
||||
Controls.Remove(tb2);
|
||||
tb1 = null;
|
||||
tb2 = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
lVMacros.MouseHover += lVMacros_MouseHover;
|
||||
}
|
||||
|
||||
private void RecordBox_Resize(object sender, EventArgs e)
|
||||
@ -984,6 +1202,18 @@ namespace DS4Windows
|
||||
cHMacro.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
|
||||
}
|
||||
|
||||
private void advColorDialog_OnUpdateColor(object sender, EventArgs e)
|
||||
{
|
||||
if (sender is Color && Program.rootHub.DS4Controllers[0] != null)
|
||||
{
|
||||
Color color = (Color)sender;
|
||||
DS4Color dcolor = new DS4Color { red = color.R, green = color.G, blue = color.B };
|
||||
DS4LightBar.forcedColor[0] = dcolor;
|
||||
DS4LightBar.forcedFlash[0] = 0;
|
||||
DS4LightBar.forcelight[0] = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void lVMacros_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (btnRecord.Text != Properties.Resources.StopText)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -135,7 +135,7 @@
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAQ
|
||||
CgAAAk1TRnQBSQFMAgEBAwEAAWABAQFgAQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
CgAAAk1TRnQBSQFMAgEBAwEAAWgBAQFoAQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
|
||||
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
|
||||
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
|
||||
@ -229,9 +229,6 @@
|
||||
<data name="lbDelayTip.Text" xml:space="preserve">
|
||||
<value>Süreyi ayarlamak için çift tıklayın</value>
|
||||
</data>
|
||||
<data name="cMSLoadPresets.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>151, 48</value>
|
||||
</data>
|
||||
<data name="altTabToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>150, 22</value>
|
||||
</data>
|
||||
@ -247,4 +244,7 @@
|
||||
<data name="fromFileToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>Dosyadan...</value>
|
||||
</data>
|
||||
<data name="cMSLoadPresets.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>151, 48</value>
|
||||
</data>
|
||||
</root>
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.4.269")]
|
||||
[assembly: AssemblyFileVersion("1.4.269")]
|
||||
[assembly: AssemblyVersion("1.4.27")]
|
||||
[assembly: AssemblyFileVersion("1.4.27")]
|
||||
|
@ -851,6 +851,16 @@ namespace DS4Windows.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap left_touch {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("left_touch", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
@ -1236,6 +1246,16 @@ namespace DS4Windows.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap right_touch {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("right_touch", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Right Click to set presets for a set of controls.
|
||||
/// </summary>
|
@ -694,4 +694,10 @@
|
||||
<data name="ChargeController" xml:space="preserve">
|
||||
<value>Charge the battery</value>
|
||||
</data>
|
||||
<data name="left_touch" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\left touch.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="right_touch" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\right touch.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
BIN
DS4Windows/Resources/left touch.png
Normal file
BIN
DS4Windows/Resources/left touch.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
BIN
DS4Windows/Resources/right touch.png
Normal file
BIN
DS4Windows/Resources/right touch.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
Loading…
x
Reference in New Issue
Block a user