mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-01-23 13:41:15 +01:00
merge master branch
This commit is contained in:
commit
4678e14408
@ -147,7 +147,7 @@ namespace DS4Windows
|
|||||||
Monitor.Wait(busThrLck);
|
Monitor.Wait(busThrLck);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
tempThread.Priority = ThreadPriority.AboveNormal;
|
tempThread.Priority = ThreadPriority.Normal;
|
||||||
tempThread.IsBackground = true;
|
tempThread.IsBackground = true;
|
||||||
tempThread.Start();
|
tempThread.Start();
|
||||||
//while (_udpServer == null)
|
//while (_udpServer == null)
|
||||||
|
@ -781,28 +781,28 @@ namespace DS4Windows
|
|||||||
|
|
||||||
if (absX <= 0.4)
|
if (absX <= 0.4)
|
||||||
{
|
{
|
||||||
outputX = 0.49 * absX;
|
outputX = 0.544 * absX;
|
||||||
}
|
}
|
||||||
else if (absX <= 0.75)
|
else if (absX <= 0.75)
|
||||||
{
|
{
|
||||||
outputX = absX - 0.204;
|
outputX = absX - 0.1824;
|
||||||
}
|
}
|
||||||
else if (absX > 0.75)
|
else if (absX > 0.75)
|
||||||
{
|
{
|
||||||
outputX = (absX * 1.816) - 0.816;
|
outputX = (absX * 1.7296) - 0.7296;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (absY <= 0.4)
|
if (absY <= 0.4)
|
||||||
{
|
{
|
||||||
outputY = 0.49 * absY;
|
outputY = 0.544 * absY;
|
||||||
}
|
}
|
||||||
else if (absY <= 0.75)
|
else if (absY <= 0.75)
|
||||||
{
|
{
|
||||||
outputY = absY - 0.204;
|
outputY = absY - 0.1824;
|
||||||
}
|
}
|
||||||
else if (absY > 0.75)
|
else if (absY > 0.75)
|
||||||
{
|
{
|
||||||
outputY = (absY * 1.816) - 0.816;
|
outputY = (absY * 1.7296) - 0.7296;
|
||||||
}
|
}
|
||||||
|
|
||||||
dState.LX = (byte)(outputX * signX * 127.5 + 127.5);
|
dState.LX = (byte)(outputX * signX * 127.5 + 127.5);
|
||||||
@ -841,28 +841,28 @@ namespace DS4Windows
|
|||||||
|
|
||||||
if (absX <= 0.4)
|
if (absX <= 0.4)
|
||||||
{
|
{
|
||||||
outputX = 0.49 * absX;
|
outputX = 0.544 * absX;
|
||||||
}
|
}
|
||||||
else if (absX <= 0.75)
|
else if (absX <= 0.75)
|
||||||
{
|
{
|
||||||
outputX = absX - 0.204;
|
outputX = absX - 0.1824;
|
||||||
}
|
}
|
||||||
else if (absX > 0.75)
|
else if (absX > 0.75)
|
||||||
{
|
{
|
||||||
outputX = (absX * 1.816) - 0.816;
|
outputX = (absX * 1.7296) - 0.7296;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (absY <= 0.4)
|
if (absY <= 0.4)
|
||||||
{
|
{
|
||||||
outputY = 0.49 * absY;
|
outputY = 0.544 * absY;
|
||||||
}
|
}
|
||||||
else if (absY <= 0.75)
|
else if (absY <= 0.75)
|
||||||
{
|
{
|
||||||
outputY = absY - 0.204;
|
outputY = absY - 0.1824;
|
||||||
}
|
}
|
||||||
else if (absY > 0.75)
|
else if (absY > 0.75)
|
||||||
{
|
{
|
||||||
outputY = (absY * 1.816) - 0.816;
|
outputY = (absY * 1.7296) - 0.7296;
|
||||||
}
|
}
|
||||||
|
|
||||||
dState.RX = (byte)(outputX * signX * 127.5 + 127.5);
|
dState.RX = (byte)(outputX * signX * 127.5 + 127.5);
|
||||||
|
@ -37,7 +37,6 @@ namespace DS4Windows
|
|||||||
private ToolStripMenuItem[] shortcuts;
|
private ToolStripMenuItem[] shortcuts;
|
||||||
private ToolStripMenuItem[] disconnectShortcuts;
|
private ToolStripMenuItem[] disconnectShortcuts;
|
||||||
protected CheckBox[] linkedProfileCB;
|
protected CheckBox[] linkedProfileCB;
|
||||||
WebClient wc = new WebClient();
|
|
||||||
NonFormTimer hotkeysTimer = new NonFormTimer();
|
NonFormTimer hotkeysTimer = new NonFormTimer();
|
||||||
NonFormTimer autoProfilesTimer = new NonFormTimer();
|
NonFormTimer autoProfilesTimer = new NonFormTimer();
|
||||||
string tempProfileProgram = string.Empty;
|
string tempProfileProgram = string.Empty;
|
||||||
@ -151,11 +150,6 @@ namespace DS4Windows
|
|||||||
|
|
||||||
blankControllerTab();
|
blankControllerTab();
|
||||||
|
|
||||||
Program.rootHub.Debug += On_Debug;
|
|
||||||
|
|
||||||
AppLogger.GuiLog += On_Debug;
|
|
||||||
AppLogger.TrayIconLog += ShowNotification;
|
|
||||||
|
|
||||||
Directory.CreateDirectory(appdatapath);
|
Directory.CreateDirectory(appdatapath);
|
||||||
if (!Save()) //if can't write to file
|
if (!Save()) //if can't write to file
|
||||||
{
|
{
|
||||||
@ -254,10 +248,9 @@ namespace DS4Windows
|
|||||||
|
|
||||||
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
|
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
|
||||||
string version = fvi.FileVersion;
|
string version = fvi.FileVersion;
|
||||||
AppLogger.LogToGui("DS4Windows version " + version, false);
|
LogDebug(DateTime.Now, "DS4Windows version " + version, false);
|
||||||
|
|
||||||
LoadP();
|
LoadP();
|
||||||
LoadLinkedProfiles();
|
|
||||||
|
|
||||||
Global.BatteryStatusChange += BatteryStatusUpdate;
|
Global.BatteryStatusChange += BatteryStatusUpdate;
|
||||||
Global.ControllerRemoved += ControllerRemovedChange;
|
Global.ControllerRemoved += ControllerRemovedChange;
|
||||||
@ -298,6 +291,7 @@ namespace DS4Windows
|
|||||||
|
|
||||||
if (checkwhen > 0 && DateTime.Now >= LastChecked + TimeSpan.FromHours(checkwhen))
|
if (checkwhen > 0 && DateTime.Now >= LastChecked + TimeSpan.FromHours(checkwhen))
|
||||||
{
|
{
|
||||||
|
WebClient wc = new WebClient();
|
||||||
wc.DownloadFileAsync(url, appdatapath + "\\version.txt");
|
wc.DownloadFileAsync(url, appdatapath + "\\version.txt");
|
||||||
wc.DownloadFileCompleted += (sender, e) => { TaskRunner.Run(() => Check_Version(sender, e)); };
|
wc.DownloadFileCompleted += (sender, e) => { TaskRunner.Run(() => Check_Version(sender, e)); };
|
||||||
LastChecked = DateTime.Now;
|
LastChecked = DateTime.Now;
|
||||||
@ -351,8 +345,6 @@ namespace DS4Windows
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TaskRunner.Run(() => { UpdateTheUpdater(); });
|
|
||||||
|
|
||||||
StartWindowsCheckBox.CheckedChanged += new EventHandler(StartWindowsCheckBox_CheckedChanged);
|
StartWindowsCheckBox.CheckedChanged += new EventHandler(StartWindowsCheckBox_CheckedChanged);
|
||||||
new ToolTip().SetToolTip(StartWindowsCheckBox, Properties.Resources.RunAtStartup);
|
new ToolTip().SetToolTip(StartWindowsCheckBox, Properties.Resources.RunAtStartup);
|
||||||
|
|
||||||
@ -398,9 +390,26 @@ namespace DS4Windows
|
|||||||
instance = this;
|
instance = this;
|
||||||
this.Resize += Form_Resize;
|
this.Resize += Form_Resize;
|
||||||
this.LocationChanged += TrackLocationChanged;
|
this.LocationChanged += TrackLocationChanged;
|
||||||
|
if (!(StartMinimized || mini))
|
||||||
Form_Resize(null, null);
|
Form_Resize(null, null);
|
||||||
|
|
||||||
|
Program.rootHub.Debug += On_Debug;
|
||||||
|
|
||||||
|
AppLogger.GuiLog += On_Debug;
|
||||||
|
AppLogger.TrayIconLog += ShowNotification;
|
||||||
|
LoadLinkedProfiles();
|
||||||
|
|
||||||
|
TaskRunner.Delay(50).ContinueWith((t) =>
|
||||||
|
{
|
||||||
|
UpdateTheUpdater();
|
||||||
|
});
|
||||||
|
|
||||||
if (btnStartStop.Enabled && start)
|
if (btnStartStop.Enabled && start)
|
||||||
TaskRunner.Delay(50).ContinueWith((t) => this.BeginInvoke((System.Action)(() => BtnStartStop_Clicked())));
|
{
|
||||||
|
TaskRunner.Delay(50).ContinueWith((t) => {
|
||||||
|
this.BeginInvoke((System.Action)(() => BtnStartStop_Clicked()));
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void populateHoverTextDict()
|
private void populateHoverTextDict()
|
||||||
@ -548,6 +557,8 @@ namespace DS4Windows
|
|||||||
|
|
||||||
void Hotkeys(object sender, EventArgs e)
|
void Hotkeys(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
hotkeysTimer.Stop();
|
||||||
|
|
||||||
if (SwipeProfiles)
|
if (SwipeProfiles)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
@ -599,6 +610,8 @@ namespace DS4Windows
|
|||||||
|
|
||||||
private void CheckAutoProfiles(object sender, EventArgs e)
|
private void CheckAutoProfiles(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
autoProfilesTimer.Stop();
|
||||||
|
|
||||||
//Check for process for auto profiles
|
//Check for process for auto profiles
|
||||||
if (string.IsNullOrEmpty(tempProfileProgram))
|
if (string.IsNullOrEmpty(tempProfileProgram))
|
||||||
{
|
{
|
||||||
@ -747,14 +760,14 @@ namespace DS4Windows
|
|||||||
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
|
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
|
||||||
string version = fvi.FileVersion;
|
string version = fvi.FileVersion;
|
||||||
string newversion = File.ReadAllText(appdatapath + "\\version.txt").Trim();
|
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<DialogResult>(() => {
|
if ((DialogResult)this.Invoke(new Func<DialogResult>(() => {
|
||||||
return MessageBox.Show(Properties.Resources.DownloadVersion.Replace("*number*", newversion),
|
return MessageBox.Show(Properties.Resources.DownloadVersion.Replace("*number*", newversion),
|
||||||
Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question); })) == DialogResult.Yes)
|
Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question); })) == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
if (!File.Exists(exepath + "\\DS4Updater.exe") || (File.Exists(exepath + "\\DS4Updater.exe")
|
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}");
|
Uri url2 = new Uri($"http://23.239.26.40/ds4windows/files/{updaterExe}");
|
||||||
WebClient wc2 = new WebClient();
|
WebClient wc2 = new WebClient();
|
||||||
@ -2064,7 +2077,7 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
|
|||||||
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
|
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
|
||||||
string version2 = fvi.FileVersion;
|
string version2 = fvi.FileVersion;
|
||||||
string newversion2 = File.ReadAllText(appdatapath + "\\version.txt").Trim();
|
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<DialogResult>(() =>
|
if ((DialogResult)this.Invoke(new Func<DialogResult>(() =>
|
||||||
{
|
{
|
||||||
@ -2073,7 +2086,7 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
|
|||||||
})) == DialogResult.Yes)
|
})) == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
if (!File.Exists(exepath + "\\DS4Updater.exe") || (File.Exists(exepath + "\\DS4Updater.exe")
|
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}");
|
Uri url2 = new Uri($"http://23.239.26.40/ds4windows/files/{updaterExe}");
|
||||||
WebClient wc2 = new WebClient();
|
WebClient wc2 = new WebClient();
|
||||||
|
@ -1072,20 +1072,11 @@
|
|||||||
<EmbeddedResource Include="Properties\Resources.zh-Hant.resx" />
|
<EmbeddedResource Include="Properties\Resources.zh-Hant.resx" />
|
||||||
<None Include="app.manifest" />
|
<None Include="app.manifest" />
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
<None Include="Properties\Settings.settings">
|
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
|
||||||
</None>
|
|
||||||
<Compile Include="Properties\Resources.Designer.cs">
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
<DependentUpon>Resources.resx</DependentUpon>
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Properties\Settings.Designer.cs">
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DependentUpon>Settings.settings</DependentUpon>
|
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
|
||||||
</Compile>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="App.config" />
|
<None Include="App.config" />
|
||||||
|
@ -33,7 +33,7 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.5.18")]
|
[assembly: AssemblyVersion("1.6.0")]
|
||||||
[assembly: AssemblyFileVersion("1.5.18")]
|
[assembly: AssemblyFileVersion("1.6.0")]
|
||||||
[assembly: NeutralResourcesLanguage("en")]
|
[assembly: NeutralResourcesLanguage("en")]
|
||||||
|
|
||||||
|
26
DS4Windows/Properties/Settings.Designer.cs
generated
26
DS4Windows/Properties/Settings.Designer.cs
generated
@ -1,26 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// 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.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
|
||||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
|
||||||
<Profiles>
|
|
||||||
<Profile Name="(Default)" />
|
|
||||||
</Profiles>
|
|
||||||
<Settings />
|
|
||||||
</SettingsFile>
|
|
@ -6,7 +6,7 @@
|
|||||||
// The PropertyChanged event is raised after 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 SettingsLoaded event is raised after the setting values are loaded.
|
||||||
// The SettingsSaving event is raised before the setting values are saved.
|
// The SettingsSaving event is raised before the setting values are saved.
|
||||||
internal sealed partial class Settings {
|
public sealed partial class Settings {
|
||||||
|
|
||||||
public Settings() {
|
public Settings() {
|
||||||
// // To add event handlers for saving and changing settings, uncomment the lines below:
|
// // To add event handlers for saving and changing settings, uncomment the lines below:
|
||||||
|
14
README.md
14
README.md
@ -27,6 +27,7 @@ you've used a 360 controller before)
|
|||||||
- Bluetooth 2.1+ (via an
|
- Bluetooth 2.1+ (via an
|
||||||
[adapter like this](https://www.newegg.com/Product/Product.aspx?Item=N82E16833166126)
|
[adapter like this](https://www.newegg.com/Product/Product.aspx?Item=N82E16833166126)
|
||||||
or built in pc). Toshiba's adapters currently do not work.
|
or built in pc). Toshiba's adapters currently do not work.
|
||||||
|
- Disable Steam Controller Mapping support in Steam
|
||||||
|
|
||||||
## Device Detection Issue
|
## 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
|
from the menu. That will re-enable the device and be seen by applications
|
||||||
again.
|
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
|
||||||
|
|
||||||
Pull requests for DS4Windows are welcome. Before making a pull request, please
|
Pull requests for DS4Windows are welcome. Before making a pull request, please
|
||||||
|
Loading…
x
Reference in New Issue
Block a user