Merge branch 'jay' into vigem-udpserver

This commit is contained in:
Travis Nickles 2018-05-24 14:49:26 -05:00
commit 241bee82a0
9 changed files with 38 additions and 146 deletions

View File

@ -3123,115 +3123,51 @@ namespace DS4Windows
switch (control) switch (control)
{ {
case DS4Controls.LXNeg: case DS4Controls.LXNeg:
{
if (!analog)
{ {
double angle = cState.LSAngle; double angle = cState.LSAngle;
result = cState.LX < 127 && (angle >= 210 && angle <= 330); result = cState.LX < 127 && (angle >= 210 && angle <= 330);
}
else
{
result = cState.LX < 127;
}
break; break;
} }
case DS4Controls.LYNeg: case DS4Controls.LYNeg:
{
if (!analog)
{ {
double angle = cState.LSAngle; double angle = cState.LSAngle;
result = cState.LY < 127 && (angle >= 300 || angle <= 60); result = cState.LY < 127 && (angle >= 300 || angle <= 60);
}
else
{
result = cState.LY < 127;
}
break; break;
} }
case DS4Controls.RXNeg: case DS4Controls.RXNeg:
{
if (!analog)
{ {
double angle = cState.RSAngle; double angle = cState.RSAngle;
result = cState.RX < 127 && (angle >= 210 && angle <= 330); result = cState.RX < 127 && (angle >= 210 && angle <= 330);
}
else
{
result = cState.RX < 127;
}
break; break;
} }
case DS4Controls.RYNeg: case DS4Controls.RYNeg:
{
if (!analog)
{ {
double angle = cState.RSAngle; double angle = cState.RSAngle;
result = cState.RY < 127 && (angle >= 300 || angle <= 60); result = cState.RY < 127 && (angle >= 300 || angle <= 60);
}
else
{
result = cState.RY < 127;
}
break; break;
} }
case DS4Controls.LXPos: case DS4Controls.LXPos:
{
if (!analog)
{ {
double angle = cState.LSAngle; double angle = cState.LSAngle;
result = cState.LX > 127 && (angle >= 30 && angle <= 150); result = cState.LX > 127 && (angle >= 30 && angle <= 150);
}
else
{
result = cState.LX > 127;
}
break; break;
} }
case DS4Controls.LYPos: case DS4Controls.LYPos:
{
if (!analog)
{ {
double angle = cState.LSAngle; double angle = cState.LSAngle;
result = cState.LY > 127 && (angle >= 120 && angle <= 240); result = cState.LY > 127 && (angle >= 120 && angle <= 240);
}
else
{
result = cState.LY > 127;
}
break; break;
} }
case DS4Controls.RXPos: case DS4Controls.RXPos:
{
if (!analog)
{ {
double angle = cState.RSAngle; double angle = cState.RSAngle;
result = cState.RX > 127 && (angle >= 30 && angle <= 150); result = cState.RX > 127 && (angle >= 30 && angle <= 150);
}
else
{
result = cState.RX > 127;
}
break; break;
} }
case DS4Controls.RYPos: case DS4Controls.RYPos:
{
if (!analog)
{ {
double angle = cState.RSAngle; double angle = cState.RSAngle;
result = cState.RY > 127 && (angle >= 120 && angle <= 240); result = cState.RY > 127 && (angle >= 120 && angle <= 240);
}
else
{
result = cState.RY > 127;
}
break; break;
} }
default: break; default: break;

View File

@ -251,15 +251,15 @@ namespace DS4Windows
if (jitterCompenstation) if (jitterCompenstation)
{ {
double absX = Math.Abs(xMotion); double absX = Math.Abs(xMotion);
if (absX <= normX * 0.34) if (absX <= normX * 0.15)
{ {
xMotion = signX * Math.Pow(absX / 0.34f, 1.44) * 0.34; xMotion = signX * Math.Pow(absX / 0.15f, 1.408) * 0.15;
} }
double absY = Math.Abs(yMotion); double absY = Math.Abs(yMotion);
if (absY <= normY * 0.34) if (absY <= normY * 0.15)
{ {
yMotion = signY * Math.Pow(absY / 0.34f, 1.44) * 0.34; yMotion = signY * Math.Pow(absY / 0.15f, 1.408) * 0.15;
} }
} }

View File

@ -2835,7 +2835,7 @@ namespace DS4Windows
if (postLoad && device < 4) if (postLoad && device < 4)
{ {
DS4Device tempDev = control.DS4Controllers[device]; DS4Device tempDev = control.DS4Controllers[device];
if (tempDev != null) if (tempDev != null && tempDev.isSynced())
{ {
tempDev.queueEvent(() => tempDev.queueEvent(() =>
{ {

View File

@ -40,6 +40,7 @@
this.tPHotkeys = new System.Windows.Forms.TabPage(); this.tPHotkeys = new System.Windows.Forms.TabPage();
this.lbHotkeys = new System.Windows.Forms.Label(); this.lbHotkeys = new System.Windows.Forms.Label();
this.tPCredits = new System.Windows.Forms.TabPage(); this.tPCredits = new System.Windows.Forms.TabPage();
this.linkCurrentSite = new System.Windows.Forms.LinkLabel();
this.linkTeokp = new System.Windows.Forms.LinkLabel(); this.linkTeokp = new System.Windows.Forms.LinkLabel();
this.linkKiliansch = new System.Windows.Forms.LinkLabel(); this.linkKiliansch = new System.Windows.Forms.LinkLabel();
this.linkChamilsaan = new System.Windows.Forms.LinkLabel(); this.linkChamilsaan = new System.Windows.Forms.LinkLabel();
@ -89,8 +90,6 @@
this.coinTP = new System.Windows.Forms.TabPage(); this.coinTP = new System.Windows.Forms.TabPage();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.textBox2 = new System.Windows.Forms.TextBox(); this.textBox2 = new System.Windows.Forms.TextBox();
this.makerSupportLinkLabel = new System.Windows.Forms.LinkLabel();
this.linkCurrentSite = new System.Windows.Forms.LinkLabel();
this.tCAbout.SuspendLayout(); this.tCAbout.SuspendLayout();
this.tPHotkeys.SuspendLayout(); this.tPHotkeys.SuspendLayout();
this.tPCredits.SuspendLayout(); this.tPCredits.SuspendLayout();
@ -186,6 +185,13 @@
this.tPCredits.Name = "tPCredits"; this.tPCredits.Name = "tPCredits";
this.tPCredits.UseVisualStyleBackColor = true; this.tPCredits.UseVisualStyleBackColor = true;
// //
// linkCurrentSite
//
resources.ApplyResources(this.linkCurrentSite, "linkCurrentSite");
this.linkCurrentSite.Name = "linkCurrentSite";
this.linkCurrentSite.TabStop = true;
this.linkCurrentSite.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkCurrentSite_LinkClicked);
//
// linkTeokp // linkTeokp
// //
resources.ApplyResources(this.linkTeokp, "linkTeokp"); resources.ApplyResources(this.linkTeokp, "linkTeokp");
@ -476,7 +482,6 @@
resources.ApplyResources(this.flowLayoutPanel1, "flowLayoutPanel1"); resources.ApplyResources(this.flowLayoutPanel1, "flowLayoutPanel1");
this.flowLayoutPanel1.Controls.Add(this.textBox2); this.flowLayoutPanel1.Controls.Add(this.textBox2);
this.flowLayoutPanel1.Controls.Add(this.linkDonate); this.flowLayoutPanel1.Controls.Add(this.linkDonate);
this.flowLayoutPanel1.Controls.Add(this.makerSupportLinkLabel);
this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.Name = "flowLayoutPanel1";
// //
// textBox2 // textBox2
@ -486,20 +491,6 @@
this.textBox2.Name = "textBox2"; this.textBox2.Name = "textBox2";
this.textBox2.ReadOnly = true; this.textBox2.ReadOnly = true;
// //
// makerSupportLinkLabel
//
resources.ApplyResources(this.makerSupportLinkLabel, "makerSupportLinkLabel");
this.makerSupportLinkLabel.Name = "makerSupportLinkLabel";
this.makerSupportLinkLabel.TabStop = true;
this.makerSupportLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.MakerSupportLinkLabel_LinkClicked);
//
// linkCurrentSite
//
resources.ApplyResources(this.linkCurrentSite, "linkCurrentSite");
this.linkCurrentSite.Name = "linkCurrentSite";
this.linkCurrentSite.TabStop = true;
this.linkCurrentSite.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkCurrentSite_LinkClicked);
//
// Hotkeys // Hotkeys
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
@ -583,7 +574,6 @@
private System.Windows.Forms.Label lbpt; private System.Windows.Forms.Label lbpt;
private System.Windows.Forms.Label lbPortugueseT; private System.Windows.Forms.Label lbPortugueseT;
private System.Windows.Forms.LinkLabel linkTeokp; private System.Windows.Forms.LinkLabel linkTeokp;
private System.Windows.Forms.LinkLabel makerSupportLinkLabel;
private System.Windows.Forms.TabPage coinTP; private System.Windows.Forms.TabPage coinTP;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.TextBox textBox2;

View File

@ -117,11 +117,6 @@ namespace DS4Windows
Process.Start("https://github.com/teokp"); Process.Start("https://github.com/teokp");
} }
private void MakerSupportLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process.Start("https://www.makersupport.com/Ryochan7");
}
private void LinkCurrentSite_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) private void LinkCurrentSite_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{ {
Process.Start("https://ryochan7.github.io/ds4windows-site/"); Process.Start("https://ryochan7.github.io/ds4windows-site/");

View File

@ -1930,33 +1930,6 @@ Monero: 49RvRMiMewaeez1Y2auxHmfMaAUYfhUpBem4ohzRJd9b5acPcxzh1icjnhZfjnYd1S7NQ57r
<data name="&gt;&gt;textBox2.ZOrder" xml:space="preserve"> <data name="&gt;&gt;textBox2.ZOrder" xml:space="preserve">
<value>0</value> <value>0</value>
</data> </data>
<data name="makerSupportLinkLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 108</value>
</data>
<data name="makerSupportLinkLabel.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 0, 3, 3</value>
</data>
<data name="makerSupportLinkLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>74, 14</value>
</data>
<data name="makerSupportLinkLabel.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="makerSupportLinkLabel.Text" xml:space="preserve">
<value>MakerSupport</value>
</data>
<data name="&gt;&gt;makerSupportLinkLabel.Name" xml:space="preserve">
<value>makerSupportLinkLabel</value>
</data>
<data name="&gt;&gt;makerSupportLinkLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;makerSupportLinkLabel.Parent" xml:space="preserve">
<value>flowLayoutPanel1</value>
</data>
<data name="&gt;&gt;makerSupportLinkLabel.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="flowLayoutPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="flowLayoutPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value> <value>Fill</value>
</data> </data>

View File

@ -800,9 +800,6 @@ namespace DS4Windows
Removal?.Invoke(this, EventArgs.Empty); Removal?.Invoke(this, EventArgs.Empty);
}), null); }), null);
//System.Threading.Tasks.Task.Factory.StartNew(() => { Removal?.Invoke(this, EventArgs.Empty); });
//Removal?.Invoke(this, EventArgs.Empty);
timeoutExecuted = true; timeoutExecuted = true;
return; return;
} }
@ -833,9 +830,6 @@ namespace DS4Windows
Removal?.Invoke(this, EventArgs.Empty); Removal?.Invoke(this, EventArgs.Empty);
}), null); }), null);
//System.Threading.Tasks.Task.Factory.StartNew(() => { Removal?.Invoke(this, EventArgs.Empty); });
//Removal?.Invoke(this, EventArgs.Empty);
timeoutExecuted = true; timeoutExecuted = true;
return; return;
} }

View File

@ -31,12 +31,16 @@ namespace DS4Windows
internal const int SONY_VID = 0x054C; internal const int SONY_VID = 0x054C;
internal const int RAZER_VID = 0x1532; internal const int RAZER_VID = 0x1532;
internal const int NACON_VID = 0x146B; internal const int NACON_VID = 0x146B;
internal const int HORI_VID = 0x0F0D;
private static VidPidInfo[] knownDevices = private static VidPidInfo[] knownDevices =
{ {
new VidPidInfo(SONY_VID, 0xBA0), new VidPidInfo(SONY_VID, 0x5C4), new VidPidInfo(SONY_VID, 0xBA0),
new VidPidInfo(SONY_VID, 0x09CC), new VidPidInfo(RAZER_VID, 0x1000), new VidPidInfo(SONY_VID, 0x5C4),
new VidPidInfo(NACON_VID, 0x0D01) 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
}; };
private static string devicePathToInstanceId(string devicePath) private static string devicePathToInstanceId(string devicePath)

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 // 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.4.118")] [assembly: AssemblyVersion("1.4.119")]
[assembly: AssemblyFileVersion("1.4.118")] [assembly: AssemblyFileVersion("1.4.119")]
[assembly: NeutralResourcesLanguage("en")] [assembly: NeutralResourcesLanguage("en")]