Merge branch 'jay' into udpserver

This commit is contained in:
Travis Nickles 2018-06-24 21:04:20 -05:00
commit 8d4c7d0c57
13 changed files with 143 additions and 344 deletions

View File

@ -779,28 +779,28 @@ namespace DS4Windows
if (absX <= 0.4)
{
outputX = 0.414 * absX;
outputX = 0.43 * absX;
}
else if (absX <= 0.75)
{
outputX = absX - 0.24;
outputX = absX - 0.228;
}
else if (absX > 0.75)
{
outputX = (absX * 1.9376) - 0.9376;
outputX = (absX * 1.912) - 0.912;
}
if (absY <= 0.4)
{
outputY = 0.414 * absY;
outputY = 0.43 * absY;
}
else if (absY <= 0.75)
{
outputY = absY - 0.24;
outputY = absY - 0.228;
}
else if (absY > 0.75)
{
outputY = (absY * 1.9376) - 0.9376;
outputY = (absY * 1.912) - 0.912;
}
dState.LX = (byte)(outputX * signX * 127.5 + 127.5);
@ -2475,12 +2475,12 @@ namespace DS4Windows
{
int controlnum = DS4ControltoInt(control);
int deadzoneL = 3;
int deadzoneR = 3;
if (getLSDeadzone(device) >= 3)
deadzoneL = 0;
if (getRSDeadzone(device) >= 3)
deadzoneR = 0;
int deadzoneL = 0;
int deadzoneR = 0;
if (getLSDeadzone(device) == 0)
deadzoneL = 3;
if (getRSDeadzone(device) == 0)
deadzoneR = 3;
double value = 0.0;
int speed = ButtonMouseSensitivity[device];
@ -3125,49 +3125,49 @@ namespace DS4Windows
case DS4Controls.LXNeg:
{
double angle = cState.LSAngle;
result = cState.LX < 127 && (angle >= 210 && angle <= 330);
result = cState.LX < 127 && (angle >= 112.5 && angle <= 247.5);
break;
}
case DS4Controls.LYNeg:
{
double angle = cState.LSAngle;
result = cState.LY < 127 && (angle >= 300 || angle <= 60);
result = cState.LY < 127 && (angle >= 22.5 && angle <= 157.5);
break;
}
case DS4Controls.RXNeg:
{
double angle = cState.RSAngle;
result = cState.RX < 127 && (angle >= 210 && angle <= 330);
result = cState.RX < 127 && (angle >= 112.5 && angle <= 247.5);
break;
}
case DS4Controls.RYNeg:
{
double angle = cState.RSAngle;
result = cState.RY < 127 && (angle >= 300 || angle <= 60);
result = cState.RY < 127 && (angle >= 22.5 && angle <= 157.5);
break;
}
case DS4Controls.LXPos:
{
double angle = cState.LSAngle;
result = cState.LX > 127 && (angle >= 30 && angle <= 150);
result = cState.LX > 127 && (angle <= 67.5 || angle >= 292.5);
break;
}
case DS4Controls.LYPos:
{
double angle = cState.LSAngle;
result = cState.LY > 127 && (angle >= 120 && angle <= 240);
result = cState.LY > 127 && (angle >= 202.5 && angle <= 337.5);
break;
}
case DS4Controls.RXPos:
{
double angle = cState.RSAngle;
result = cState.RX > 127 && (angle >= 30 && angle <= 150);
result = cState.RX > 127 && (angle <= 67.5 || angle >= 292.5);
break;
}
case DS4Controls.RYPos:
{
double angle = cState.RSAngle;
result = cState.RY > 127 && (angle >= 120 && angle <= 240);
result = cState.RY > 127 && (angle >= 202.5 && angle <= 337.5);
break;
}
default: break;
@ -3255,7 +3255,7 @@ namespace DS4Windows
if (!analog)
{
double angle = cState.LSAngle;
result = cState.LX < 127 && (angle >= 210 && angle <= 330);
result = cState.LX < 127 && (angle >= 112.5 && angle <= 247.5);
}
else
{
@ -3269,7 +3269,7 @@ namespace DS4Windows
if (!analog)
{
double angle = cState.LSAngle;
result = cState.LY < 127 && (angle >= 300 || angle <= 60);
result = cState.LY < 127 && (angle >= 22.5 && angle <= 157.5);
}
else
{
@ -3283,7 +3283,7 @@ namespace DS4Windows
if (!analog)
{
double angle = cState.RSAngle;
result = cState.RX < 127 && (angle >= 210 && angle <= 330);
result = cState.RX < 127 && (angle >= 112.5 && angle <= 247.5);
}
else
{
@ -3297,7 +3297,7 @@ namespace DS4Windows
if (!analog)
{
double angle = cState.RSAngle;
result = cState.RY < 127 && (angle >= 300 || angle <= 60);
result = cState.RY < 127 && (angle >= 22.5 && angle <= 157.5);
}
else
{
@ -3311,7 +3311,7 @@ namespace DS4Windows
if (!analog)
{
double angle = cState.LSAngle;
result = cState.LX > 127 && (angle >= 30 && angle <= 150);
result = cState.LX > 127 && (angle <= 67.5 || angle >= 292.5);
}
else
{
@ -3325,7 +3325,7 @@ namespace DS4Windows
if (!analog)
{
double angle = cState.LSAngle;
result = cState.LY > 127 && (angle >= 120 && angle <= 240);
result = cState.LY > 127 && (angle >= 202.5 && angle <= 337.5);
}
else
{
@ -3339,7 +3339,7 @@ namespace DS4Windows
if (!analog)
{
double angle = cState.RSAngle;
result = cState.RX > 127 && (angle >= 30 && angle <= 150);
result = cState.RX > 127 && (angle <= 67.5 || angle >= 292.5);
}
else
{
@ -3353,7 +3353,7 @@ namespace DS4Windows
if (!analog)
{
double angle = cState.RSAngle;
result = cState.RY > 127 && (angle >= 120 && angle <= 240);
result = cState.RY > 127 && (angle >= 202.5 && angle <= 337.5);
}
else
{

View File

@ -1,48 +0,0 @@
namespace DS4Windows
{
partial class Alreadyrunning
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// Alreadyrunning
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(226, 43);
this.Name = "Alreadyrunning";
this.ShowInTaskbar = false;
this.Text = "Alreadyrunning";
this.ResumeLayout(false);
}
#endregion
}
}

View File

@ -1,36 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DS4Windows
{
public partial class Alreadyrunning : Form
{
Stopwatch sw;
public Alreadyrunning()
{
InitializeComponent();
this.WindowState = FormWindowState.Minimized;
Hide();
Timer t = new Timer();
t.Start();
t.Tick += t_Tick;
sw = new Stopwatch();
sw.Start();
}
void t_Tick(object sender, EventArgs e)
{
if (sw.ElapsedMilliseconds >= 10)
this.Close();
}
}
}

View File

@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1363,8 +1363,6 @@
this.Controls.Add(this.pnlButton);
this.Name = "DS4Form";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ScpForm_Closing);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.ScpForm_DragDrop);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.ScpForm_DragEnter);
this.Resize += new System.EventHandler(this.Form_Resize);
this.pnlButton.ResumeLayout(false);
this.pnlButton.PerformLayout();

View File

@ -402,6 +402,11 @@ namespace DS4Windows
populateHoverTextDict();
cBController1.KeyPress += CBController_KeyPress;
cBController2.KeyPress += CBController_KeyPress;
cBController3.KeyPress += CBController_KeyPress;
cBController4.KeyPress += CBController_KeyPress;
foreach (Control control in fLPSettings.Controls)
{
if (control.HasChildren)
@ -449,7 +454,8 @@ namespace DS4Windows
{
if (Index < ControlService.DS4_CONTROLLER_COUNT)
{
statPB[Index].Visible = false; toolTip1.SetToolTip(statPB[Index], "");
statPB[Index].Visible = false;
toolTip1.SetToolTip(statPB[Index], "");
Batteries[Index].Text = Properties.Resources.NA;
Pads[Index].Text = Properties.Resources.Disconnected;
Enable_Controls(Index, false);
@ -594,10 +600,24 @@ namespace DS4Windows
turnOffTemp = true;
if (btnStartStop.Text == Properties.Resources.StopText)
{
BtnStartStop_Clicked();
hotkeysTimer.Start();
autoProfilesTimer.Start();
btnStartStop.Text = Properties.Resources.StartText;
autoProfilesTimer.Stop();
hotkeysTimer.Stop();
this.Invoke((System.Action)(() => {
this.changingService = true;
BtnStartStop_Clicked();
}));
while (this.changingService)
{
Thread.SpinWait(500);
}
this.Invoke((System.Action)(() =>
{
hotkeysTimer.Start();
autoProfilesTimer.Start();
}));
}
}
@ -620,8 +640,10 @@ namespace DS4Windows
turnOffTemp = false;
if (btnStartStop.Text == Properties.Resources.StartText)
{
BtnStartStop_Clicked();
btnStartStop.Text = Properties.Resources.StopText;
this.BeginInvoke((System.Action)(() =>
{
BtnStartStop_Clicked();
}));
}
}
}
@ -1836,31 +1858,6 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
}
}
private void ScpForm_DragDrop(object sender, DragEventArgs e)
{
bool therewasanxml = false;
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop, false);
for (int i = 0; i < files.Length; i++)
{
if (files[i].EndsWith(".xml"))
{
File.Copy(files[i], appdatapath + "\\Profiles\\" + Path.GetFileName(files[i]), true);
therewasanxml = true;
}
}
if (therewasanxml)
RefreshProfiles();
}
private void ScpForm_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.Copy; // Okay
else
e.Effect = DragDropEffects.None; // Unknown data, ignore it
}
private void tBProfile_TextChanged(object sender, EventArgs e)
{
if (tSTBProfile.Text != null && tSTBProfile.Text != "" &&
@ -2517,6 +2514,11 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
Save();
}
private void CBController_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
}
private void cBFlashWhenLate_CheckedChanged(object sender, EventArgs e)
{
FlashWhenLate = cBFlashWhenLate.Checked;

View File

@ -445,10 +445,10 @@
<value>NoControl</value>
</data>
<data name="bnLight3.Location" type="System.Drawing.Point, System.Drawing">
<value>780, 89</value>
<value>774, 89</value>
</data>
<data name="bnLight3.Size" type="System.Drawing.Size, System.Drawing">
<value>113, 22</value>
<value>119, 22</value>
</data>
<data name="bnLight3.TabIndex" type="System.Int32, mscorlib">
<value>50</value>
@ -472,7 +472,7 @@
<value>NoControl</value>
</data>
<data name="pBStatus1.Location" type="System.Drawing.Point, System.Drawing">
<value>371, 34</value>
<value>367, 34</value>
</data>
<data name="pBStatus1.Size" type="System.Drawing.Size, System.Drawing">
<value>39, 20</value>
@ -574,7 +574,7 @@
<value>NoControl</value>
</data>
<data name="bnEditC3.Location" type="System.Drawing.Point, System.Drawing">
<value>740, 89</value>
<value>734, 89</value>
</data>
<data name="bnEditC3.Size" type="System.Drawing.Size, System.Drawing">
<value>34, 22</value>
@ -604,7 +604,7 @@
<value>NoControl</value>
</data>
<data name="bnEditC4.Location" type="System.Drawing.Point, System.Drawing">
<value>740, 117</value>
<value>734, 117</value>
</data>
<data name="bnEditC4.Size" type="System.Drawing.Size, System.Drawing">
<value>34, 22</value>
@ -703,7 +703,7 @@
<value>None</value>
</data>
<data name="cBController1.Location" type="System.Drawing.Point, System.Drawing">
<value>623, 33</value>
<value>617, 33</value>
</data>
<data name="cBController1.Size" type="System.Drawing.Size, System.Drawing">
<value>111, 21</value>
@ -730,7 +730,7 @@
<value>NoControl</value>
</data>
<data name="bnEditC2.Location" type="System.Drawing.Point, System.Drawing">
<value>740, 61</value>
<value>734, 61</value>
</data>
<data name="bnEditC2.Size" type="System.Drawing.Size, System.Drawing">
<value>34, 22</value>
@ -757,7 +757,7 @@
<value>None</value>
</data>
<data name="cBController2.Location" type="System.Drawing.Point, System.Drawing">
<value>623, 61</value>
<value>617, 61</value>
</data>
<data name="cBController2.Size" type="System.Drawing.Size, System.Drawing">
<value>111, 21</value>
@ -781,7 +781,7 @@
<value>None</value>
</data>
<data name="cBController3.Location" type="System.Drawing.Point, System.Drawing">
<value>623, 89</value>
<value>617, 89</value>
</data>
<data name="cBController3.Size" type="System.Drawing.Size, System.Drawing">
<value>111, 21</value>
@ -808,7 +808,7 @@
<value>NoControl</value>
</data>
<data name="bnEditC1.Location" type="System.Drawing.Point, System.Drawing">
<value>740, 33</value>
<value>734, 33</value>
</data>
<data name="bnEditC1.Size" type="System.Drawing.Size, System.Drawing">
<value>34, 22</value>
@ -835,7 +835,7 @@
<value>None</value>
</data>
<data name="cBController4.Location" type="System.Drawing.Point, System.Drawing">
<value>623, 117</value>
<value>617, 117</value>
</data>
<data name="cBController4.Size" type="System.Drawing.Size, System.Drawing">
<value>111, 21</value>
@ -868,7 +868,7 @@
<value>NoControl</value>
</data>
<data name="lbSelectedProfile.Location" type="System.Drawing.Point, System.Drawing">
<value>624, 7</value>
<value>618, 7</value>
</data>
<data name="lbSelectedProfile.Size" type="System.Drawing.Size, System.Drawing">
<value>109, 15</value>
@ -940,7 +940,7 @@
<value>NoControl</value>
</data>
<data name="lbStatus.Location" type="System.Drawing.Point, System.Drawing">
<value>367, 7</value>
<value>363, 7</value>
</data>
<data name="lbStatus.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 15</value>
@ -976,7 +976,7 @@
<value>NoControl</value>
</data>
<data name="lbBattery.Location" type="System.Drawing.Point, System.Drawing">
<value>467, 7</value>
<value>461, 7</value>
</data>
<data name="lbBattery.Size" type="System.Drawing.Size, System.Drawing">
<value>51, 15</value>
@ -1012,7 +1012,7 @@
<value>NoControl</value>
</data>
<data name="lbBatt1.Location" type="System.Drawing.Point, System.Drawing">
<value>473, 36</value>
<value>467, 36</value>
</data>
<data name="lbBatt1.Size" type="System.Drawing.Size, System.Drawing">
<value>39, 15</value>
@ -1048,7 +1048,7 @@
<value>NoControl</value>
</data>
<data name="lbBatt2.Location" type="System.Drawing.Point, System.Drawing">
<value>473, 64</value>
<value>467, 64</value>
</data>
<data name="lbBatt2.Size" type="System.Drawing.Size, System.Drawing">
<value>39, 15</value>
@ -1084,7 +1084,7 @@
<value>NoControl</value>
</data>
<data name="lbBatt3.Location" type="System.Drawing.Point, System.Drawing">
<value>473, 92</value>
<value>467, 92</value>
</data>
<data name="lbBatt3.Size" type="System.Drawing.Size, System.Drawing">
<value>39, 15</value>
@ -1120,7 +1120,7 @@
<value>NoControl</value>
</data>
<data name="lbBatt4.Location" type="System.Drawing.Point, System.Drawing">
<value>473, 120</value>
<value>467, 120</value>
</data>
<data name="lbBatt4.Size" type="System.Drawing.Size, System.Drawing">
<value>39, 15</value>
@ -1150,7 +1150,7 @@
<value>NoControl</value>
</data>
<data name="pBStatus2.Location" type="System.Drawing.Point, System.Drawing">
<value>371, 62</value>
<value>367, 62</value>
</data>
<data name="pBStatus2.Size" type="System.Drawing.Size, System.Drawing">
<value>39, 20</value>
@ -1180,7 +1180,7 @@
<value>NoControl</value>
</data>
<data name="pBStatus3.Location" type="System.Drawing.Point, System.Drawing">
<value>371, 90</value>
<value>367, 90</value>
</data>
<data name="pBStatus3.Size" type="System.Drawing.Size, System.Drawing">
<value>39, 20</value>
@ -1210,7 +1210,7 @@
<value>NoControl</value>
</data>
<data name="pBStatus4.Location" type="System.Drawing.Point, System.Drawing">
<value>371, 118</value>
<value>367, 118</value>
</data>
<data name="pBStatus4.Size" type="System.Drawing.Size, System.Drawing">
<value>39, 20</value>
@ -1243,10 +1243,10 @@
<value>NoControl</value>
</data>
<data name="bnLight1.Location" type="System.Drawing.Point, System.Drawing">
<value>780, 33</value>
<value>774, 33</value>
</data>
<data name="bnLight1.Size" type="System.Drawing.Size, System.Drawing">
<value>113, 22</value>
<value>119, 22</value>
</data>
<data name="bnLight1.TabIndex" type="System.Int32, mscorlib">
<value>50</value>
@ -1273,10 +1273,10 @@
<value>NoControl</value>
</data>
<data name="bnLight2.Location" type="System.Drawing.Point, System.Drawing">
<value>780, 61</value>
<value>774, 61</value>
</data>
<data name="bnLight2.Size" type="System.Drawing.Size, System.Drawing">
<value>113, 22</value>
<value>119, 22</value>
</data>
<data name="bnLight2.TabIndex" type="System.Int32, mscorlib">
<value>51</value>
@ -1303,10 +1303,10 @@
<value>NoControl</value>
</data>
<data name="bnLight4.Location" type="System.Drawing.Point, System.Drawing">
<value>780, 117</value>
<value>774, 117</value>
</data>
<data name="bnLight4.Size" type="System.Drawing.Size, System.Drawing">
<value>113, 22</value>
<value>119, 22</value>
</data>
<data name="bnLight4.TabIndex" type="System.Int32, mscorlib">
<value>52</value>
@ -1336,7 +1336,7 @@
<value>NoControl</value>
</data>
<data name="lbLinkProfile.Location" type="System.Drawing.Point, System.Drawing">
<value>546, 0</value>
<value>540, 0</value>
</data>
<data name="lbLinkProfile.Size" type="System.Drawing.Size, System.Drawing">
<value>67, 30</value>
@ -1375,7 +1375,7 @@
<value>NoControl</value>
</data>
<data name="linkCB1.Location" type="System.Drawing.Point, System.Drawing">
<value>572, 37</value>
<value>566, 37</value>
</data>
<data name="linkCB1.Size" type="System.Drawing.Size, System.Drawing">
<value>15, 14</value>
@ -1408,7 +1408,7 @@
<value>NoControl</value>
</data>
<data name="linkCB2.Location" type="System.Drawing.Point, System.Drawing">
<value>572, 65</value>
<value>566, 65</value>
</data>
<data name="linkCB2.Size" type="System.Drawing.Size, System.Drawing">
<value>15, 14</value>
@ -1441,7 +1441,7 @@
<value>NoControl</value>
</data>
<data name="linkCB3.Location" type="System.Drawing.Point, System.Drawing">
<value>572, 93</value>
<value>566, 93</value>
</data>
<data name="linkCB3.Size" type="System.Drawing.Size, System.Drawing">
<value>15, 14</value>
@ -1474,7 +1474,7 @@
<value>NoControl</value>
</data>
<data name="linkCB4.Location" type="System.Drawing.Point, System.Drawing">
<value>572, 121</value>
<value>566, 121</value>
</data>
<data name="linkCB4.Size" type="System.Drawing.Size, System.Drawing">
<value>15, 14</value>
@ -1522,7 +1522,7 @@
<value>0</value>
</data>
<data name="tLPControllers.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms">
<value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="bnLight3" Row="3" RowSpan="1" Column="6" ColumnSpan="1" /&gt;&lt;Control Name="pBStatus1" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="lbPad1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="lbPad2" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="bnEditC3" Row="3" RowSpan="1" Column="5" ColumnSpan="1" /&gt;&lt;Control Name="bnEditC4" Row="4" RowSpan="1" Column="5" ColumnSpan="1" /&gt;&lt;Control Name="lbPad3" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="lbPad4" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="cBController1" Row="1" RowSpan="1" Column="4" ColumnSpan="1" /&gt;&lt;Control Name="bnEditC2" Row="2" RowSpan="1" Column="5" ColumnSpan="1" /&gt;&lt;Control Name="cBController2" Row="2" RowSpan="1" Column="4" ColumnSpan="1" /&gt;&lt;Control Name="cBController3" Row="3" RowSpan="1" Column="4" ColumnSpan="1" /&gt;&lt;Control Name="bnEditC1" Row="1" RowSpan="1" Column="5" ColumnSpan="1" /&gt;&lt;Control Name="cBController4" Row="4" RowSpan="1" Column="4" ColumnSpan="1" /&gt;&lt;Control Name="lbSelectedProfile" Row="0" RowSpan="1" Column="4" ColumnSpan="1" /&gt;&lt;Control Name="lbID" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="lbStatus" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="lbBattery" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;Control Name="lbBatt1" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;Control Name="lbBatt2" Row="2" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;Control Name="lbBatt3" Row="3" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;Control Name="lbBatt4" Row="4" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;Control Name="pBStatus2" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="pBStatus3" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="pBStatus4" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="bnLight1" Row="1" RowSpan="1" Column="6" ColumnSpan="1" /&gt;&lt;Control Name="bnLight2" Row="2" RowSpan="1" Column="6" ColumnSpan="1" /&gt;&lt;Control Name="bnLight4" Row="4" RowSpan="1" Column="6" ColumnSpan="1" /&gt;&lt;Control Name="lbLinkProfile" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /&gt;&lt;Control Name="linkCB1" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /&gt;&lt;Control Name="linkCB2" Row="2" RowSpan="1" Column="3" ColumnSpan="1" /&gt;&lt;Control Name="linkCB3" Row="3" RowSpan="1" Column="3" ColumnSpan="1" /&gt;&lt;Control Name="linkCB4" Row="4" RowSpan="1" Column="3" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="Percent,62.29144,Percent,20.02225,Percent,17.68632,Absolute,80,AutoSize,0,AutoSize,0,Absolute,117" /&gt;&lt;Rows Styles="AutoSize,0,Percent,25,Percent,25,Percent,25,Percent,25" /&gt;&lt;/TableLayoutSettings&gt;</value>
<value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="bnLight3" Row="3" RowSpan="1" Column="6" ColumnSpan="1" /&gt;&lt;Control Name="pBStatus1" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="lbPad1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="lbPad2" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="bnEditC3" Row="3" RowSpan="1" Column="5" ColumnSpan="1" /&gt;&lt;Control Name="bnEditC4" Row="4" RowSpan="1" Column="5" ColumnSpan="1" /&gt;&lt;Control Name="lbPad3" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="lbPad4" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="cBController1" Row="1" RowSpan="1" Column="4" ColumnSpan="1" /&gt;&lt;Control Name="bnEditC2" Row="2" RowSpan="1" Column="5" ColumnSpan="1" /&gt;&lt;Control Name="cBController2" Row="2" RowSpan="1" Column="4" ColumnSpan="1" /&gt;&lt;Control Name="cBController3" Row="3" RowSpan="1" Column="4" ColumnSpan="1" /&gt;&lt;Control Name="bnEditC1" Row="1" RowSpan="1" Column="5" ColumnSpan="1" /&gt;&lt;Control Name="cBController4" Row="4" RowSpan="1" Column="4" ColumnSpan="1" /&gt;&lt;Control Name="lbSelectedProfile" Row="0" RowSpan="1" Column="4" ColumnSpan="1" /&gt;&lt;Control Name="lbID" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="lbStatus" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="lbBattery" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;Control Name="lbBatt1" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;Control Name="lbBatt2" Row="2" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;Control Name="lbBatt3" Row="3" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;Control Name="lbBatt4" Row="4" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;Control Name="pBStatus2" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="pBStatus3" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="pBStatus4" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="bnLight1" Row="1" RowSpan="1" Column="6" ColumnSpan="1" /&gt;&lt;Control Name="bnLight2" Row="2" RowSpan="1" Column="6" ColumnSpan="1" /&gt;&lt;Control Name="bnLight4" Row="4" RowSpan="1" Column="6" ColumnSpan="1" /&gt;&lt;Control Name="lbLinkProfile" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /&gt;&lt;Control Name="linkCB1" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /&gt;&lt;Control Name="linkCB2" Row="2" RowSpan="1" Column="3" ColumnSpan="1" /&gt;&lt;Control Name="linkCB3" Row="3" RowSpan="1" Column="3" ColumnSpan="1" /&gt;&lt;Control Name="linkCB4" Row="4" RowSpan="1" Column="3" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="Percent,62.29144,Percent,20.02225,Percent,17.68632,Absolute,80,AutoSize,0,AutoSize,0,Absolute,124" /&gt;&lt;Rows Styles="AutoSize,0,Percent,25,Percent,25,Percent,25,Percent,25" /&gt;&lt;/TableLayoutSettings&gt;</value>
</data>
<data name="lbNoControllers.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
@ -2833,7 +2833,7 @@
<value>languagePackComboBox1</value>
</data>
<data name="&gt;&gt;languagePackComboBox1.Type" xml:space="preserve">
<value>DS4Windows.DS4Forms.LanguagePackComboBox, DS4Windows, Version=1.4.119.0, Culture=neutral, PublicKeyToken=null</value>
<value>DS4Windows.DS4Forms.LanguagePackComboBox, DS4Windows, Version=1.4.120.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;languagePackComboBox1.Parent" xml:space="preserve">
<value>fLPSettings</value>
@ -3673,7 +3673,7 @@
<value>advColorDialog</value>
</data>
<data name="&gt;&gt;advColorDialog.Type" xml:space="preserve">
<value>DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.4.119.0, Culture=neutral, PublicKeyToken=null</value>
<value>DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.4.120.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>DS4Form</value>

View File

@ -25,6 +25,10 @@ namespace DS4Windows
List<string> programpaths = new List<string>();
List<string> lodsf = new List<string>();
bool appsloaded = false;
const string steamCommx86Loc = @"C:\Program Files (x86)\Steam\steamapps\common";
const string steamCommLoc = @"C:\Program Files\Steam\steamapps\common";
const string originx86Loc = @"C:\Program Files (x86)\Origin Games";
const string originLoc = @"C:\Program Files\Origin Games";
public WinProgs(string[] oc, DS4Form main)
{
@ -44,17 +48,17 @@ namespace DS4Windows
LoadP();
if (Directory.Exists(@"C:\Program Files (x86)\Steam\steamapps\common"))
steamgamesdir = @"C:\Program Files (x86)\Steam\steamapps\common";
else if (Directory.Exists(@"C:\Program Files\Steam\steamapps\common"))
steamgamesdir = @"C:\Program Files\Steam\steamapps\common";
if (Directory.Exists(steamCommx86Loc))
steamgamesdir = steamCommx86Loc;
else if (Directory.Exists(steamCommLoc))
steamgamesdir = steamCommLoc;
else
cMSPrograms.Items.Remove(addSteamGamesToolStripMenuItem);
if (Directory.Exists(@"C:\Program Files (x86)\Origin Games"))
origingamesdir = @"C:\Program Files (x86)\Origin Games";
else if (Directory.Exists(@"C:\Program Files\Origin Games"))
origingamesdir = @"C:\Program Files\Origin Games";
if (Directory.Exists(originx86Loc))
origingamesdir = originx86Loc;
else if (Directory.Exists(originLoc))
origingamesdir = originLoc;
else
cMSPrograms.Items.Remove(addOriginGamesToolStripMenuItem);
}
@ -105,26 +109,26 @@ namespace DS4Windows
programpaths.Add(x.Attributes["path"].Value);
lVPrograms.BeginUpdate();
int index = 0;
foreach (string st in programpaths)
{
if (File.Exists(st))
if (!string.IsNullOrEmpty(st))
{
int index = programpaths.IndexOf(st);
if (string.Empty != st)
if (File.Exists(st))
{
iLIcons.Images.Add(Icon.ExtractAssociatedIcon(st));
ListViewItem lvi = new ListViewItem(Path.GetFileNameWithoutExtension(st), index);
lvi.SubItems.Add(st);
lvi.Checked = true;
lvi.ToolTipText = st;
lVPrograms.Items.Add(lvi);
}
ListViewItem lvi = new ListViewItem(Path.GetFileNameWithoutExtension(st), index);
lvi.Checked = true;
lvi.ToolTipText = st;
lvi.SubItems.Add(st);
lVPrograms.Items.Add(lvi);
}
else
{
RemoveP(st, false, false);
}
index++;
}
lVPrograms.EndUpdate();
}
@ -172,7 +176,7 @@ namespace DS4Windows
appsloaded = true;
}
void addLoadedApps()
void AddLoadedApps()
{
if (appsloaded)
{
@ -298,7 +302,7 @@ namespace DS4Windows
}
}
public void RemoveP(string name, bool uncheck, bool reload = true)
public void RemoveP(string name, bool uncheck)
{
XmlDocument doc = new XmlDocument();
doc.Load(m_Profile);
@ -316,8 +320,6 @@ namespace DS4Windows
cbs[i].SelectedIndex = cbs[i].Items.Count - 1;
bnSave.Enabled = false;
if (reload)
form.LoadP();
}
private void CBProfile_IndexChanged(object sender, EventArgs e)
@ -388,7 +390,7 @@ namespace DS4Windows
bnAddPrograms.Enabled = false;
cMSPrograms.Items.Remove(addSteamGamesToolStripMenuItem);
await Task.Run(() => GetApps(steamgamesdir));
addLoadedApps();
AddLoadedApps();
}
private async void addDirectoryToolStripMenuItem_Click(object sender, EventArgs e)
@ -399,7 +401,7 @@ namespace DS4Windows
bnAddPrograms.Text = Properties.Resources.Loading;
bnAddPrograms.Enabled = false;
await Task.Run(() => GetApps(fbd.SelectedPath));
addLoadedApps();
AddLoadedApps();
}
}
@ -427,7 +429,7 @@ namespace DS4Windows
bnAddPrograms.Enabled = false;
cMSPrograms.Items.Remove(addOriginGamesToolStripMenuItem);
await Task.Run(() => GetApps(origingamesdir));
addLoadedApps();
AddLoadedApps();
}
private async void addProgramsFromStartMenuToolStripMenuItem_Click(object sender, EventArgs e)
@ -436,7 +438,7 @@ namespace DS4Windows
bnAddPrograms.Enabled = false;
cMSPrograms.Items.Remove(addProgramsFromStartMenuToolStripMenuItem);
await Task.Run(() => GetShortcuts(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu) + "\\Programs"));
addLoadedApps();
AddLoadedApps();
}
public static string GetTargetPath(string filePath)

View File

@ -40,7 +40,8 @@ namespace DS4Windows
new VidPidInfo(SONY_VID, 0x09CC),
new VidPidInfo(RAZER_VID, 0x1000),
new VidPidInfo(NACON_VID, 0x0D01),
new VidPidInfo(HORI_VID, 0x00EE) // Hori PS4 Mini Wired Gamepad
new VidPidInfo(HORI_VID, 0x00EE), // Hori PS4 Mini Wired Gamepad
new VidPidInfo(0x7545, 0x0104)
};
private static string devicePathToInstanceId(string devicePath)

View File

@ -183,19 +183,19 @@ namespace DS4Windows
public void calculateStickAngles()
{
double lsangle = Math.Atan2((LX - 127), -(LY - 127));
double lsangle = Math.Atan2(-(LY - 127), (LX - 127));
LSAngleRad = lsangle;
lsangle = (lsangle >= 0 ? lsangle : (2 * Math.PI + lsangle)) * 180 / Math.PI;
LSAngle = lsangle;
LXUnit = Math.Abs(Math.Cos(LSAngleRad));
LYUnit = Math.Abs(Math.Sin(LSAngleRad));
double rsangle = Math.Atan2((RX - 127), -(RY - 127));
double rsangle = Math.Atan2(-(RY - 127), (RX - 127));
RSAngleRad = rsangle;
rsangle = (rsangle >= 0 ? rsangle : (2 * Math.PI + rsangle)) * 180 / Math.PI;
RSAngle = rsangle;
RXUnit = Math.Abs(Math.Cos(RSAngleRad));
RYUnit = Math.Abs(Math.Sin(LSAngleRad));
RYUnit = Math.Abs(Math.Sin(RSAngleRad));
}
public void rotateLSCoordinates(double rotation)

View File

@ -181,12 +181,6 @@
<Compile Include="DS4Library\DS4Touchpad.cs" />
<Compile Include="DS4Forms\AdvancedColorDialog.cs" />
<Compile Include="DS4Forms\AdvancedComboBox.cs" />
<Compile Include="DS4Forms\Alreadyrunning.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="DS4Forms\Alreadyrunning.Designer.cs">
<DependentUpon>Alreadyrunning.cs</DependentUpon>
</Compile>
<Compile Include="DS4Forms\DS4Form.cs">
<SubType>Form</SubType>
</Compile>
@ -262,9 +256,6 @@
<Compile Include="HidLibrary\HidDevices.cs" />
<Compile Include="HidLibrary\NativeMethods.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="DS4Forms\Alreadyrunning.resx">
<DependentUpon>Alreadyrunning.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DS4Forms\DS4Form.ar.resx">
<DependentUpon>DS4Form.cs</DependentUpon>
<SubType>Designer</SubType>

View File

@ -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.4.120")]
[assembly: AssemblyFileVersion("1.4.120")]
[assembly: AssemblyVersion("1.4.121")]
[assembly: AssemblyFileVersion("1.4.121")]
[assembly: NeutralResourcesLanguage("en")]

View File

@ -6,6 +6,15 @@ DS4Windows is an extract anywhere program that allows you to get the best DualSh
You can find the latest and older versions [here](https://github.com/Ryochan7/DS4Windows/releases).
UdpServer builds for using Gyro motion controls in Cemu.
http://ryochan7.xyz/ds4windows/test/DS4Windows_1.4.120_UdpServer_x64.zip
http://ryochan7.xyz/ds4windows/test/DS4Windows_1.4.120_ViGEm_UdpServer_x64.zip
ViGEm build.
http://ryochan7.xyz/ds4windows/test/DS4Windows_1.4.120_ViGEm_x64.zip
This project is a fork of the work of Jays2Kings. You can find the old project
website at [ds4windows.com](http://ds4windows.com).