From 899b816f81a1be9acd36e81535f8aefce328b413 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Mon, 10 Dec 2018 18:45:27 -0600 Subject: [PATCH 01/24] Add Settings class --- DS4Windows/Settings.cs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 DS4Windows/Settings.cs diff --git a/DS4Windows/Settings.cs b/DS4Windows/Settings.cs new file mode 100644 index 0000000..ac0570e --- /dev/null +++ b/DS4Windows/Settings.cs @@ -0,0 +1,28 @@ +namespace DS4Windows.Properties { + + + // This class allows you to handle specific events on the settings class: + // The SettingChanging event is raised before a setting's value is changed. + // The PropertyChanged event is raised after a setting's value is changed. + // The SettingsLoaded event is raised after the setting values are loaded. + // The SettingsSaving event is raised before the setting values are saved. + internal sealed partial class Settings { + + public Settings() { + // // To add event handlers for saving and changing settings, uncomment the lines below: + // + // this.SettingChanging += this.SettingChangingEventHandler; + // + // this.SettingsSaving += this.SettingsSavingEventHandler; + // + } + + private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) { + // Add code to handle the SettingChangingEvent event here. + } + + private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) { + // Add code to handle the SettingsSaving event here. + } + } +} From bad54b3d4bcf3548d50023e7f155b20c50890a84 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Mon, 10 Dec 2018 21:33:14 -0600 Subject: [PATCH 02/24] Remove Settings class --- DS4Windows/DS4Windows.csproj | 10 +-------- DS4Windows/Properties/Settings.Designer.cs | 26 ---------------------- DS4Windows/Properties/Settings.settings | 7 ------ DS4Windows/Settings.cs | 2 +- 4 files changed, 2 insertions(+), 43 deletions(-) delete mode 100644 DS4Windows/Properties/Settings.Designer.cs delete mode 100644 DS4Windows/Properties/Settings.settings diff --git a/DS4Windows/DS4Windows.csproj b/DS4Windows/DS4Windows.csproj index b86cc0c..207e232 100644 --- a/DS4Windows/DS4Windows.csproj +++ b/DS4Windows/DS4Windows.csproj @@ -230,6 +230,7 @@ + DS4Form.cs Designer @@ -1070,20 +1071,11 @@ - - SettingsSingleFileGenerator - Settings.Designer.cs - True True Resources.resx - - True - Settings.settings - True - diff --git a/DS4Windows/Properties/Settings.Designer.cs b/DS4Windows/Properties/Settings.Designer.cs deleted file mode 100644 index 8249a9b..0000000 --- a/DS4Windows/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace DS4Windows.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/DS4Windows/Properties/Settings.settings b/DS4Windows/Properties/Settings.settings deleted file mode 100644 index 3964565..0000000 --- a/DS4Windows/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/DS4Windows/Settings.cs b/DS4Windows/Settings.cs index ac0570e..f2827e0 100644 --- a/DS4Windows/Settings.cs +++ b/DS4Windows/Settings.cs @@ -6,7 +6,7 @@ // The PropertyChanged event is raised after a setting's value is changed. // The SettingsLoaded event is raised after the setting values are loaded. // The SettingsSaving event is raised before the setting values are saved. - internal sealed partial class Settings { + public sealed partial class Settings { public Settings() { // // To add event handlers for saving and changing settings, uncomment the lines below: From a97af009485dad924cf25a8232d111ffd0da16e4 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Tue, 11 Dec 2018 01:41:04 -0600 Subject: [PATCH 03/24] Lowered enhanced precision curve --- DS4Windows/DS4Control/Mapping.cs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs index 7636042..ef67660 100644 --- a/DS4Windows/DS4Control/Mapping.cs +++ b/DS4Windows/DS4Control/Mapping.cs @@ -779,28 +779,28 @@ namespace DS4Windows if (absX <= 0.4) { - outputX = 0.49 * absX; + outputX = 0.489 * absX; } else if (absX <= 0.75) { - outputX = absX - 0.204; + outputX = absX - 0.2044; } else if (absX > 0.75) { - outputX = (absX * 1.816) - 0.816; + outputX = (absX * 1.8176) - 0.8176; } if (absY <= 0.4) { - outputY = 0.49 * absY; + outputY = 0.489 * absY; } else if (absY <= 0.75) { - outputY = absY - 0.204; + outputY = absY - 0.2044; } else if (absY > 0.75) { - outputY = (absY * 1.816) - 0.816; + outputY = (absY * 1.8176) - 0.8176; } dState.LX = (byte)(outputX * signX * 127.5 + 127.5); @@ -839,28 +839,28 @@ namespace DS4Windows if (absX <= 0.4) { - outputX = 0.49 * absX; + outputX = 0.489 * absX; } else if (absX <= 0.75) { - outputX = absX - 0.204; + outputX = absX - 0.2044; } else if (absX > 0.75) { - outputX = (absX * 1.816) - 0.816; + outputX = (absX * 1.8176) - 0.8176; } if (absY <= 0.4) { - outputY = 0.49 * absY; + outputY = 0.489 * absY; } else if (absY <= 0.75) { - outputY = absY - 0.204; + outputY = absY - 0.2044; } else if (absY > 0.75) { - outputY = (absY * 1.816) - 0.816; + outputY = (absY * 1.8176) - 0.8176; } dState.RX = (byte)(outputX * signX * 127.5 + 127.5); From 8783f199aa0da9f4920b1fb9cdaea21c0a862e07 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Tue, 11 Dec 2018 02:27:57 -0600 Subject: [PATCH 04/24] Revert "Lowered enhanced precision curve" This reverts commit a97af009485dad924cf25a8232d111ffd0da16e4. --- DS4Windows/DS4Control/Mapping.cs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs index ef67660..7636042 100644 --- a/DS4Windows/DS4Control/Mapping.cs +++ b/DS4Windows/DS4Control/Mapping.cs @@ -779,28 +779,28 @@ namespace DS4Windows if (absX <= 0.4) { - outputX = 0.489 * absX; + outputX = 0.49 * absX; } else if (absX <= 0.75) { - outputX = absX - 0.2044; + outputX = absX - 0.204; } else if (absX > 0.75) { - outputX = (absX * 1.8176) - 0.8176; + outputX = (absX * 1.816) - 0.816; } if (absY <= 0.4) { - outputY = 0.489 * absY; + outputY = 0.49 * absY; } else if (absY <= 0.75) { - outputY = absY - 0.2044; + outputY = absY - 0.204; } else if (absY > 0.75) { - outputY = (absY * 1.8176) - 0.8176; + outputY = (absY * 1.816) - 0.816; } dState.LX = (byte)(outputX * signX * 127.5 + 127.5); @@ -839,28 +839,28 @@ namespace DS4Windows if (absX <= 0.4) { - outputX = 0.489 * absX; + outputX = 0.49 * absX; } else if (absX <= 0.75) { - outputX = absX - 0.2044; + outputX = absX - 0.204; } else if (absX > 0.75) { - outputX = (absX * 1.8176) - 0.8176; + outputX = (absX * 1.816) - 0.816; } if (absY <= 0.4) { - outputY = 0.489 * absY; + outputY = 0.49 * absY; } else if (absY <= 0.75) { - outputY = absY - 0.2044; + outputY = absY - 0.204; } else if (absY > 0.75) { - outputY = (absY * 1.8176) - 0.8176; + outputY = (absY * 1.816) - 0.816; } dState.RX = (byte)(outputX * signX * 127.5 + 127.5); From e1bb1ac0424547c52c298b91d0592fb53225bec7 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Tue, 11 Dec 2018 05:47:44 -0600 Subject: [PATCH 05/24] Raised enhanced precision curve --- DS4Windows/DS4Control/Mapping.cs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs index 7636042..7a6fae8 100644 --- a/DS4Windows/DS4Control/Mapping.cs +++ b/DS4Windows/DS4Control/Mapping.cs @@ -779,28 +779,28 @@ namespace DS4Windows if (absX <= 0.4) { - outputX = 0.49 * absX; + outputX = 0.51 * absX; } else if (absX <= 0.75) { - outputX = absX - 0.204; + outputX = absX - 0.196; } else if (absX > 0.75) { - outputX = (absX * 1.816) - 0.816; + outputX = (absX * 1.784) - 0.784; } if (absY <= 0.4) { - outputY = 0.49 * absY; + outputY = 0.51 * absY; } else if (absY <= 0.75) { - outputY = absY - 0.204; + outputY = absY - 0.196; } else if (absY > 0.75) { - outputY = (absY * 1.816) - 0.816; + outputY = (absY * 1.784) - 0.784; } dState.LX = (byte)(outputX * signX * 127.5 + 127.5); @@ -839,28 +839,28 @@ namespace DS4Windows if (absX <= 0.4) { - outputX = 0.49 * absX; + outputX = 0.51 * absX; } else if (absX <= 0.75) { - outputX = absX - 0.204; + outputX = absX - 0.196; } else if (absX > 0.75) { - outputX = (absX * 1.816) - 0.816; + outputX = (absX * 1.784) - 0.784; } if (absY <= 0.4) { - outputY = 0.49 * absY; + outputY = 0.51 * absY; } else if (absY <= 0.75) { - outputY = absY - 0.204; + outputY = absY - 0.196; } else if (absY > 0.75) { - outputY = (absY * 1.816) - 0.816; + outputY = (absY * 1.784) - 0.784; } dState.RX = (byte)(outputX * signX * 127.5 + 127.5); From d5fa84c52c43dbeb0f1105b564d1ca46924820b9 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Tue, 11 Dec 2018 22:34:23 -0600 Subject: [PATCH 06/24] Raised enhanced precision curve --- DS4Windows/DS4Control/Mapping.cs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs index 7a6fae8..3dff2c2 100644 --- a/DS4Windows/DS4Control/Mapping.cs +++ b/DS4Windows/DS4Control/Mapping.cs @@ -779,28 +779,28 @@ namespace DS4Windows if (absX <= 0.4) { - outputX = 0.51 * absX; + outputX = 0.53 * absX; } else if (absX <= 0.75) { - outputX = absX - 0.196; + outputX = absX - 0.188; } else if (absX > 0.75) { - outputX = (absX * 1.784) - 0.784; + outputX = (absX * 1.752) - 0.752; } if (absY <= 0.4) { - outputY = 0.51 * absY; + outputY = 0.53 * absY; } else if (absY <= 0.75) { - outputY = absY - 0.196; + outputY = absY - 0.188; } else if (absY > 0.75) { - outputY = (absY * 1.784) - 0.784; + outputY = (absY * 1.752) - 0.752; } dState.LX = (byte)(outputX * signX * 127.5 + 127.5); @@ -839,28 +839,28 @@ namespace DS4Windows if (absX <= 0.4) { - outputX = 0.51 * absX; + outputX = 0.53 * absX; } else if (absX <= 0.75) { - outputX = absX - 0.196; + outputX = absX - 0.188; } else if (absX > 0.75) { - outputX = (absX * 1.784) - 0.784; + outputX = (absX * 1.752) - 0.752; } if (absY <= 0.4) { - outputY = 0.51 * absY; + outputY = 0.53 * absY; } else if (absY <= 0.75) { - outputY = absY - 0.196; + outputY = absY - 0.188; } else if (absY > 0.75) { - outputY = (absY * 1.784) - 0.784; + outputY = (absY * 1.752) - 0.752; } dState.RX = (byte)(outputX * signX * 127.5 + 127.5); From 461c7936c2c7bb7795b19dd4e8bb9566a728fd41 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Wed, 12 Dec 2018 03:19:41 -0600 Subject: [PATCH 07/24] Raised enhanced precision curve --- DS4Windows/DS4Control/Mapping.cs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs index 3dff2c2..6e15704 100644 --- a/DS4Windows/DS4Control/Mapping.cs +++ b/DS4Windows/DS4Control/Mapping.cs @@ -779,28 +779,28 @@ namespace DS4Windows if (absX <= 0.4) { - outputX = 0.53 * absX; + outputX = 0.54 * absX; } else if (absX <= 0.75) { - outputX = absX - 0.188; + outputX = absX - 0.184; } else if (absX > 0.75) { - outputX = (absX * 1.752) - 0.752; + outputX = (absX * 1.736) - 0.736; } if (absY <= 0.4) { - outputY = 0.53 * absY; + outputY = 0.54 * absY; } else if (absY <= 0.75) { - outputY = absY - 0.188; + outputY = absY - 0.184; } else if (absY > 0.75) { - outputY = (absY * 1.752) - 0.752; + outputY = (absY * 1.736) - 0.736; } dState.LX = (byte)(outputX * signX * 127.5 + 127.5); @@ -839,28 +839,28 @@ namespace DS4Windows if (absX <= 0.4) { - outputX = 0.53 * absX; + outputX = 0.54 * absX; } else if (absX <= 0.75) { - outputX = absX - 0.188; + outputX = absX - 0.184; } else if (absX > 0.75) { - outputX = (absX * 1.752) - 0.752; + outputX = (absX * 1.736) - 0.736; } if (absY <= 0.4) { - outputY = 0.53 * absY; + outputY = 0.54 * absY; } else if (absY <= 0.75) { - outputY = absY - 0.188; + outputY = absY - 0.184; } else if (absY > 0.75) { - outputY = (absY * 1.752) - 0.752; + outputY = (absY * 1.736) - 0.736; } dState.RX = (byte)(outputX * signX * 127.5 + 127.5); From 957f01ee055652b7aed6ba51da4598e60535c22a Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Wed, 12 Dec 2018 05:03:18 -0600 Subject: [PATCH 08/24] Loosen enhanced precision curve --- DS4Windows/DS4Control/Mapping.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs index 6e15704..b4f7219 100644 --- a/DS4Windows/DS4Control/Mapping.cs +++ b/DS4Windows/DS4Control/Mapping.cs @@ -839,28 +839,28 @@ namespace DS4Windows if (absX <= 0.4) { - outputX = 0.54 * absX; + outputX = 0.545 * absX; } else if (absX <= 0.75) { - outputX = absX - 0.184; + outputX = absX - 0.182; } else if (absX > 0.75) { - outputX = (absX * 1.736) - 0.736; + outputX = (absX * 1.728) - 0.728; } if (absY <= 0.4) { - outputY = 0.54 * absY; + outputY = 0.545 * absY; } else if (absY <= 0.75) { - outputY = absY - 0.184; + outputY = absY - 0.182; } else if (absY > 0.75) { - outputY = (absY * 1.736) - 0.736; + outputY = (absY * 1.728) - 0.728; } dState.RX = (byte)(outputX * signX * 127.5 + 127.5); From ffca9ec60e0372fcfb2775d33b3894a0d55f26fa Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Thu, 13 Dec 2018 03:43:28 -0600 Subject: [PATCH 09/24] Made a note about Steam now interfering with DS4Windows --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 12b88a9..fc90714 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ you've used a 360 controller before) - Bluetooth 2.1+ (via an [adapter like this](https://www.newegg.com/Product/Product.aspx?Item=N82E16833166126) or built in pc). Toshiba's adapters currently do not work. +- Disable Steam Controller Mapping support in Steam ## Device Detection Issue @@ -50,6 +51,19 @@ DualShock 4 device. Right click the device item and select "Enable device" from the menu. That will re-enable the device and be seen by applications again. +## Disable Steam Controller Mapping Support + +With recent updates to the Steam client at the time writing this (2018-12-13), +Steam has enabled Xbox Configuration Support in the Steam client by default. +What this means is that Steam will automatically map a detected Xbox 360 +controller to KB+M bindings initially (Desktop Mode) before launching Steam +Big Picture Mode or launching a game. This presents a problem for DS4Windows +since the created virtual Xbox 360 controller will be mapped to KB+M actions +for desktop mode and games launched outside of the Steam client. In order to +use DS4Windows properly, you have to open Steam Big Picture Mode, navigate to +Settings > Controller> Controller Settings and uncheck **Xbox Configuration +Support** along with **PlayStation Configuration Support**. + ## Pull Requests Pull requests for DS4Windows are welcome. Before making a pull request, please From 86fb3c2a0b67a6cb5b68e1720e8c54ea1841be38 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Thu, 13 Dec 2018 05:44:04 -0600 Subject: [PATCH 10/24] Hook log routines later in init --- DS4Windows/DS4Forms/DS4Form.cs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index 8229016..a264e38 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -151,11 +151,6 @@ namespace DS4Windows blankControllerTab(); - Program.rootHub.Debug += On_Debug; - - AppLogger.GuiLog += On_Debug; - AppLogger.TrayIconLog += ShowNotification; - Directory.CreateDirectory(appdatapath); if (!Save()) //if can't write to file { @@ -254,7 +249,7 @@ namespace DS4Windows FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location); string version = fvi.FileVersion; - AppLogger.LogToGui("DS4Windows version " + version, false); + LogDebug(DateTime.Now, "DS4Windows version " + version, false); LoadP(); LoadLinkedProfiles(); @@ -351,8 +346,6 @@ namespace DS4Windows } } - TaskRunner.Run(() => { UpdateTheUpdater(); }); - StartWindowsCheckBox.CheckedChanged += new EventHandler(StartWindowsCheckBox_CheckedChanged); new ToolTip().SetToolTip(StartWindowsCheckBox, Properties.Resources.RunAtStartup); @@ -399,8 +392,17 @@ namespace DS4Windows this.Resize += Form_Resize; this.LocationChanged += TrackLocationChanged; Form_Resize(null, null); + + Program.rootHub.Debug += On_Debug; + + AppLogger.GuiLog += On_Debug; + AppLogger.TrayIconLog += ShowNotification; + if (btnStartStop.Enabled && start) - TaskRunner.Delay(50).ContinueWith((t) => this.BeginInvoke((System.Action)(() => BtnStartStop_Clicked()))); + TaskRunner.Delay(50).ContinueWith((t) => { + UpdateTheUpdater(); + this.BeginInvoke((System.Action)(() => BtnStartStop_Clicked())); + }); } private void populateHoverTextDict() From b28a6cb446dcc50ac234778fccc65c151b8406e2 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Thu, 13 Dec 2018 05:55:38 -0600 Subject: [PATCH 11/24] Moved updating updater call --- DS4Windows/DS4Forms/DS4Form.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index a264e38..854cc83 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -398,11 +398,17 @@ namespace DS4Windows AppLogger.GuiLog += On_Debug; AppLogger.TrayIconLog += ShowNotification; + TaskRunner.Delay(50).ContinueWith((t) => + { + UpdateTheUpdater(); + }); + if (btnStartStop.Enabled && start) + { TaskRunner.Delay(50).ContinueWith((t) => { - UpdateTheUpdater(); this.BeginInvoke((System.Action)(() => BtnStartStop_Clicked())); }); + } } private void populateHoverTextDict() From f7da78090ff652dc1f72ec5cb4b23e75b6a88f81 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Thu, 13 Dec 2018 13:49:46 -0600 Subject: [PATCH 12/24] Make sure to add timer stop when event is called I know that I added the call at some point during testing before. --- DS4Windows/DS4Forms/DS4Form.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index 854cc83..487435c 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -556,6 +556,8 @@ namespace DS4Windows void Hotkeys(object sender, EventArgs e) { + hotkeysTimer.Stop(); + if (SwipeProfiles) { for (int i = 0; i < 4; i++) @@ -607,6 +609,8 @@ namespace DS4Windows private void CheckAutoProfiles(object sender, EventArgs e) { + autoProfilesTimer.Stop(); + //Check for process for auto profiles if (string.IsNullOrEmpty(tempProfileProgram)) { From f6bb47451ecfadbc4ae5c72267bdf7272da61a59 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Thu, 13 Dec 2018 14:53:49 -0600 Subject: [PATCH 13/24] Moved linked profiles loading further in init --- DS4Windows/DS4Forms/DS4Form.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index 487435c..73beee8 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -252,7 +252,6 @@ namespace DS4Windows LogDebug(DateTime.Now, "DS4Windows version " + version, false); LoadP(); - LoadLinkedProfiles(); Global.BatteryStatusChange += BatteryStatusUpdate; Global.ControllerRemoved += ControllerRemovedChange; @@ -397,6 +396,7 @@ namespace DS4Windows AppLogger.GuiLog += On_Debug; AppLogger.TrayIconLog += ShowNotification; + LoadLinkedProfiles(); TaskRunner.Delay(50).ContinueWith((t) => { From 4d5ff945d8befd48fdcd60e4c9bcb9fa9c7675e1 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Fri, 14 Dec 2018 01:45:05 -0600 Subject: [PATCH 14/24] Make WebClient instance local --- DS4Windows/DS4Forms/DS4Form.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index 73beee8..f7f0149 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -37,7 +37,6 @@ namespace DS4Windows private ToolStripMenuItem[] shortcuts; private ToolStripMenuItem[] disconnectShortcuts; protected CheckBox[] linkedProfileCB; - WebClient wc = new WebClient(); NonFormTimer hotkeysTimer = new NonFormTimer(); NonFormTimer autoProfilesTimer = new NonFormTimer(); string tempProfileProgram = string.Empty; @@ -292,6 +291,7 @@ namespace DS4Windows if (checkwhen > 0 && DateTime.Now >= LastChecked + TimeSpan.FromHours(checkwhen)) { + WebClient wc = new WebClient(); wc.DownloadFileAsync(url, appdatapath + "\\version.txt"); wc.DownloadFileCompleted += (sender, e) => { TaskRunner.Run(() => Check_Version(sender, e)); }; LastChecked = DateTime.Now; From c2d26f30ce68dc13d38d2dd373706914126d2032 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Fri, 14 Dec 2018 02:04:45 -0600 Subject: [PATCH 15/24] Make sure to not show main window if app should start minimized Not a great fix. Related to issue #514. --- DS4Windows/DS4Forms/DS4Form.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index f7f0149..7fea5d9 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -390,7 +390,8 @@ namespace DS4Windows instance = this; this.Resize += Form_Resize; this.LocationChanged += TrackLocationChanged; - Form_Resize(null, null); + if (!(StartMinimized || mini)) + Form_Resize(null, null); Program.rootHub.Debug += On_Debug; From d54f449b02d6b610c11a645ba357caa847028f0e Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Fri, 14 Dec 2018 03:54:26 -0600 Subject: [PATCH 16/24] Experiment with new enhanced precision values --- DS4Windows/DS4Control/Mapping.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs index b4f7219..aa4b0f8 100644 --- a/DS4Windows/DS4Control/Mapping.cs +++ b/DS4Windows/DS4Control/Mapping.cs @@ -839,28 +839,28 @@ namespace DS4Windows if (absX <= 0.4) { - outputX = 0.545 * absX; + outputX = 0.544 * absX; } else if (absX <= 0.75) { - outputX = absX - 0.182; + outputX = absX - 0.1824; } else if (absX > 0.75) { - outputX = (absX * 1.728) - 0.728; + outputX = (absX * 1.7296) - 0.7296; } if (absY <= 0.4) { - outputY = 0.545 * absY; + outputY = 0.544 * absY; } else if (absY <= 0.75) { - outputY = absY - 0.182; + outputY = absY - 0.1824; } else if (absY > 0.75) { - outputY = (absY * 1.728) - 0.728; + outputY = (absY * 1.7296) - 0.7296; } dState.RX = (byte)(outputX * signX * 127.5 + 127.5); From bd2a2fe4f05ca0875b13ed6c01f354b8c26c5cc6 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Fri, 14 Dec 2018 05:08:32 -0600 Subject: [PATCH 17/24] Lowered mouse stick offset --- DS4Windows/DS4Control/Mapping.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs index aa4b0f8..facecb4 100644 --- a/DS4Windows/DS4Control/Mapping.cs +++ b/DS4Windows/DS4Control/Mapping.cs @@ -166,7 +166,7 @@ namespace DS4Windows public static int prevmouseaccel = 0; private static double horizontalRemainder = 0.0, verticalRemainder = 0.0; private const int MOUSESPEEDFACTOR = 48; - private const double MOUSESTICKOFFSET = 0.049; + private const double MOUSESTICKOFFSET = 0.048; public static void Commit(int device) { From 1019790e25ecb6b1e2b711054eb66c6efdddaed3 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Fri, 14 Dec 2018 05:40:20 -0600 Subject: [PATCH 18/24] Revert mouse stick offset --- DS4Windows/DS4Control/Mapping.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs index facecb4..aa4b0f8 100644 --- a/DS4Windows/DS4Control/Mapping.cs +++ b/DS4Windows/DS4Control/Mapping.cs @@ -166,7 +166,7 @@ namespace DS4Windows public static int prevmouseaccel = 0; private static double horizontalRemainder = 0.0, verticalRemainder = 0.0; private const int MOUSESPEEDFACTOR = 48; - private const double MOUSESTICKOFFSET = 0.048; + private const double MOUSESTICKOFFSET = 0.049; public static void Commit(int device) { From 59dbee7c35fa5bc4f95d195fbe75fffb1a5eb9d9 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Sat, 15 Dec 2018 12:26:52 -0600 Subject: [PATCH 19/24] Use current enhanced precision settings for LS --- DS4Windows/DS4Control/Mapping.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs index aa4b0f8..b98d700 100644 --- a/DS4Windows/DS4Control/Mapping.cs +++ b/DS4Windows/DS4Control/Mapping.cs @@ -779,28 +779,28 @@ namespace DS4Windows if (absX <= 0.4) { - outputX = 0.54 * absX; + outputX = 0.544 * absX; } else if (absX <= 0.75) { - outputX = absX - 0.184; + outputX = absX - 0.1824; } else if (absX > 0.75) { - outputX = (absX * 1.736) - 0.736; + outputX = (absX * 1.7296) - 0.7296; } if (absY <= 0.4) { - outputY = 0.54 * absY; + outputY = 0.544 * absY; } else if (absY <= 0.75) { - outputY = absY - 0.184; + outputY = absY - 0.1824; } else if (absY > 0.75) { - outputY = (absY * 1.736) - 0.736; + outputY = (absY * 1.7296) - 0.7296; } dState.LX = (byte)(outputX * signX * 127.5 + 127.5); From de601582629e452cab46585a66c67a4ecab545c3 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Sat, 15 Dec 2018 12:31:07 -0600 Subject: [PATCH 20/24] Version 1.5.19 --- DS4Windows/Properties/AssemblyInfo.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DS4Windows/Properties/AssemblyInfo.cs b/DS4Windows/Properties/AssemblyInfo.cs index c9c88e6..2a2b621 100644 --- a/DS4Windows/Properties/AssemblyInfo.cs +++ b/DS4Windows/Properties/AssemblyInfo.cs @@ -33,7 +33,7 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.5.18")] -[assembly: AssemblyFileVersion("1.5.18")] +[assembly: AssemblyVersion("1.5.19")] +[assembly: AssemblyFileVersion("1.5.19")] [assembly: NeutralResourcesLanguage("en")] From accd6c01d69e298cdad5234de027b46068918637 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Mon, 17 Dec 2018 21:19:18 -0600 Subject: [PATCH 21/24] Fixes invalid string compare. Just check if both strings are the same now --- DS4Windows/DS4Forms/DS4Form.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index 7fea5d9..1b7fa66 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -760,14 +760,14 @@ namespace DS4Windows FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location); string version = fvi.FileVersion; string newversion = File.ReadAllText(appdatapath + "\\version.txt").Trim(); - if (version.Replace(',', '.').CompareTo(newversion) == -1) + if (version.Replace(',', '.').CompareTo(newversion) != 0) { if ((DialogResult)this.Invoke(new Func(() => { return MessageBox.Show(Properties.Resources.DownloadVersion.Replace("*number*", newversion), Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question); })) == DialogResult.Yes) { if (!File.Exists(exepath + "\\DS4Updater.exe") || (File.Exists(exepath + "\\DS4Updater.exe") - && (FileVersionInfo.GetVersionInfo(exepath + "\\DS4Updater.exe").FileVersion.CompareTo("1.1.0.0") == -1))) + && (FileVersionInfo.GetVersionInfo(exepath + "\\DS4Updater.exe").FileVersion.CompareTo("1.1.0.0") != 0))) { Uri url2 = new Uri($"http://23.239.26.40/ds4windows/files/{updaterExe}"); WebClient wc2 = new WebClient(); @@ -2077,7 +2077,7 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location); string version2 = fvi.FileVersion; string newversion2 = File.ReadAllText(appdatapath + "\\version.txt").Trim(); - if (version2.Replace(',', '.').CompareTo(newversion2) == -1) + if (version2.Replace(',', '.').CompareTo(newversion2) != 0) { if ((DialogResult)this.Invoke(new Func(() => { @@ -2086,7 +2086,7 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question })) == DialogResult.Yes) { if (!File.Exists(exepath + "\\DS4Updater.exe") || (File.Exists(exepath + "\\DS4Updater.exe") - && (FileVersionInfo.GetVersionInfo(exepath + "\\DS4Updater.exe").FileVersion.CompareTo(UPDATER_VERSION) == -1))) + && (FileVersionInfo.GetVersionInfo(exepath + "\\DS4Updater.exe").FileVersion.CompareTo(UPDATER_VERSION) != 0))) { Uri url2 = new Uri($"http://23.239.26.40/ds4windows/files/{updaterExe}"); WebClient wc2 = new WebClient(); From a52008cb5318f7bba9b3095d58b2da3893d22c58 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Tue, 18 Dec 2018 13:36:35 -0600 Subject: [PATCH 22/24] Version 1.5.20 --- DS4Windows/Properties/AssemblyInfo.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DS4Windows/Properties/AssemblyInfo.cs b/DS4Windows/Properties/AssemblyInfo.cs index 2a2b621..a8e0fb2 100644 --- a/DS4Windows/Properties/AssemblyInfo.cs +++ b/DS4Windows/Properties/AssemblyInfo.cs @@ -33,7 +33,7 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.5.19")] -[assembly: AssemblyFileVersion("1.5.19")] +[assembly: AssemblyVersion("1.5.20")] +[assembly: AssemblyFileVersion("1.5.20")] [assembly: NeutralResourcesLanguage("en")] From f642371e4de7d8fce8bbac725c2715d99d5e7d24 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Tue, 18 Dec 2018 15:54:09 -0600 Subject: [PATCH 23/24] Version 1.6.0 --- DS4Windows/Properties/AssemblyInfo.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DS4Windows/Properties/AssemblyInfo.cs b/DS4Windows/Properties/AssemblyInfo.cs index a8e0fb2..d00ff11 100644 --- a/DS4Windows/Properties/AssemblyInfo.cs +++ b/DS4Windows/Properties/AssemblyInfo.cs @@ -33,7 +33,7 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.5.20")] -[assembly: AssemblyFileVersion("1.5.20")] +[assembly: AssemblyVersion("1.6.0")] +[assembly: AssemblyFileVersion("1.6.0")] [assembly: NeutralResourcesLanguage("en")] From 8be9e66f22c0502ef40f1ac9fd30ba8de31daef6 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Sat, 22 Dec 2018 16:41:36 -0600 Subject: [PATCH 24/24] Change priority of bus thread. Lower priority seems better --- DS4Windows/DS4Control/ControlService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DS4Windows/DS4Control/ControlService.cs b/DS4Windows/DS4Control/ControlService.cs index 2b425de..3bb0c16 100644 --- a/DS4Windows/DS4Control/ControlService.cs +++ b/DS4Windows/DS4Control/ControlService.cs @@ -147,7 +147,7 @@ namespace DS4Windows Monitor.Wait(busThrLck); } }); - tempThread.Priority = ThreadPriority.AboveNormal; + tempThread.Priority = ThreadPriority.Normal; tempThread.IsBackground = true; tempThread.Start(); //while (_udpServer == null)