Merge branch 'jay' into vigem-udpserver

# Conflicts:
#	DS4Windows/DS4Control/ScpUtil.cs
This commit is contained in:
Travis Nickles 2018-10-03 16:38:20 -05:00
commit 1215d32ae5
14 changed files with 224 additions and 77 deletions

View File

@ -210,7 +210,7 @@ namespace DS4Windows
var errMsg = String.Format("Couldn't start UDP server on port {0}, outside applications won't be able to access pad data ({1})", UDP_SERVER_PORT, ex.SocketErrorCode);
LogDebug(errMsg, true);
Log.LogToTray(errMsg, true, true);
AppLogger.LogToTray(errMsg, true, true);
}
udpChangeStatus = false;
@ -223,7 +223,7 @@ namespace DS4Windows
udpChangeStatus = true;
_udpServer.Stop();
_udpServer = null;
Log.LogToGui("Closed UDP server", false);
AppLogger.LogToGui("Closed UDP server", false);
udpChangeStatus = false;
});
}
@ -288,7 +288,7 @@ namespace DS4Windows
var errMsg = String.Format("Couldn't start UDP server on port {0}, outside applications won't be able to access pad data ({1})", UDP_SERVER_PORT, ex.SocketErrorCode);
LogDebug(errMsg, true);
Log.LogToTray(errMsg, true, true);
AppLogger.LogToTray(errMsg, true, true);
}
changingUDPPort = false;
@ -301,7 +301,7 @@ namespace DS4Windows
string message = Properties.Resources.CouldNotOpenDS4.Replace("*Mac address*", device.getMacAddress()) + " " +
Properties.Resources.QuitOtherPrograms;
LogDebug(message, true);
Log.LogToTray(message, true);
AppLogger.LogToTray(message, true);
}
}
@ -530,13 +530,13 @@ namespace DS4Windows
{
string prolog = Properties.Resources.UsingProfile.Replace("*number*", (i + 1).ToString()).Replace("*Profile name*", ProfilePath[i]);
LogDebug(prolog);
Log.LogToTray(prolog);
AppLogger.LogToTray(prolog);
}
else
{
string prolog = Properties.Resources.NotUsingProfile.Replace("*number*", (i + 1).ToString());
LogDebug(prolog);
Log.LogToTray(prolog);
AppLogger.LogToTray(prolog);
}
}
@ -547,7 +547,7 @@ namespace DS4Windows
catch (Exception e)
{
LogDebug(e.Message);
Log.LogToTray(e.Message);
AppLogger.LogToTray(e.Message);
}
running = true;
@ -567,7 +567,7 @@ namespace DS4Windows
var errMsg = String.Format("Couldn't start UDP server on port {0}, outside applications won't be able to access pad data ({1})", UDP_SERVER_PORT, ex.SocketErrorCode);
LogDebug(errMsg, true);
Log.LogToTray(errMsg, true, true);
AppLogger.LogToTray(errMsg, true, true);
}
}
}
@ -575,7 +575,7 @@ namespace DS4Windows
{
string logMessage = "Could not connect to ViGEm. Please check the status of the System device in Device Manager";
LogDebug(logMessage);
Log.LogToTray(logMessage);
AppLogger.LogToTray(logMessage);
}
runHotPlug = true;
@ -752,13 +752,13 @@ namespace DS4Windows
{
string prolog = Properties.Resources.UsingProfile.Replace("*number*", (Index + 1).ToString()).Replace("*Profile name*", ProfilePath[Index]);
LogDebug(prolog);
Log.LogToTray(prolog);
AppLogger.LogToTray(prolog);
}
else
{
string prolog = Properties.Resources.NotUsingProfile.Replace("*number*", (Index + 1).ToString());
LogDebug(prolog);
Log.LogToTray(prolog);
AppLogger.LogToTray(prolog);
}
break;
@ -1091,6 +1091,13 @@ namespace DS4Windows
LogDebug("X360 Controller # " + (ind + 1) + " unplugged");
}
// Use Task to reset device synth state and commit it
Task.Run(() =>
{
Mapping.deviceState[ind].SavePrevious(true);
Mapping.Commit(ind);
}).Wait();
string removed = Properties.Resources.ControllerWasRemoved.Replace("*Mac address*", (ind + 1).ToString());
if (device.getBattery() <= 20 &&
device.getConnectionType() == ConnectionType.BT && !device.isCharging())
@ -1099,7 +1106,7 @@ namespace DS4Windows
}
LogDebug(removed);
Log.LogToTray(removed);
AppLogger.LogToTray(removed);
/*Stopwatch sw = new Stopwatch();
sw.Start();
while (sw.ElapsedMilliseconds < XINPUT_UNPLUG_SETTLE_TIME)
@ -1237,14 +1244,6 @@ namespace DS4Windows
*/
}
/*if (_udpServer != null)
{
DualShockPadMeta padDetail = new DualShockPadMeta();
GetPadDetailForIdx(ind, ref padDetail);
_udpServer.NewReportIncoming(ref padDetail, CurrentState[ind]);
}
*/
// Output any synthetic events.
Mapping.Commit(ind);
@ -1365,7 +1364,7 @@ namespace DS4Windows
getTouchSensitivity()[deviceID] = 0;
getScrollSensitivity()[deviceID] = 0;
LogDebug(Properties.Resources.TouchpadMovementOff);
Log.LogToTray(Properties.Resources.TouchpadMovementOff);
AppLogger.LogToTray(Properties.Resources.TouchpadMovementOff);
touchreleased[deviceID] = false;
}
else if (touchreleased[deviceID])
@ -1373,7 +1372,7 @@ namespace DS4Windows
getTouchSensitivity()[deviceID] = oldtouchvalue[deviceID];
getScrollSensitivity()[deviceID] = oldscrollvalue[deviceID];
LogDebug(Properties.Resources.TouchpadMovementOn);
Log.LogToTray(Properties.Resources.TouchpadMovementOn);
AppLogger.LogToTray(Properties.Resources.TouchpadMovementOn);
touchreleased[deviceID] = false;
}
}

View File

@ -2,7 +2,7 @@
namespace DS4Windows
{
public class Log
public class AppLogger
{
public static event EventHandler<DebugEventArgs> TrayIconLog;
public static event EventHandler<DebugEventArgs> GuiLog;

View File

@ -1940,7 +1940,7 @@ namespace DS4Windows
dets = action.details.Split(',');
if (bool.Parse(dets[1]) && !actionDone[index].dev[device])
{
Log.LogToTray("Controller " + (device + 1) + ": " +
AppLogger.LogToTray("Controller " + (device + 1) + ": " +
ctrl.getDS4Battery(device), true);
}
if (bool.Parse(dets[2]))

View File

@ -66,20 +66,26 @@ namespace DS4Windows
{
s = dev.getCurrentStateRef();
triggeractivated = true;
useReverseRatchet = Global.getGyroTriggerTurns(deviceNum);
int i = 0;
string[] ss = Global.getSATriggers(deviceNum).Split(',');
bool andCond = Global.getSATriggerCond(deviceNum);
triggeractivated = andCond ? true : false;
if (!string.IsNullOrEmpty(ss[0]))
{
string s = string.Empty;
for (int index = 0, arlen = ss.Length;
triggeractivated && index < arlen; index++)
for (int index = 0, arlen = ss.Length; index < arlen; index++)
{
s = ss[index];
if (!(int.TryParse(s, out i) && getDS4ControlsByName(i)))
if (andCond && !(int.TryParse(s, out i) && getDS4ControlsByName(i)))
{
triggeractivated = false;
break;
}
else if (!andCond && int.TryParse(s, out i) && getDS4ControlsByName(i))
{
triggeractivated = true;
break;
}
}
}

View File

@ -707,6 +707,16 @@ namespace DS4Windows
return m_Config.sATriggers[index];
}
public static bool[] SATriggerCond => m_Config.sATriggerCond;
public static bool getSATriggerCond(int index)
{
return m_Config.sATriggerCond[index];
}
public static void SetSaTriggerCond(int index, string text)
{
m_Config.SetSaTriggerCond(index, text);
}
public static int[][] TouchDisInvertTriggers => m_Config.touchDisInvertTriggers;
public static int[] getTouchDisInvertTriggers(int index)
{
@ -1470,6 +1480,7 @@ namespace DS4Windows
public bool[] useTPforControls = new bool[5] { false, false, false, false, false };
public bool[] useSAforMouse = new bool[5] { false, false, false, false, false };
public string[] sATriggers = new string[5] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty };
public bool[] sATriggerCond = new bool[5] { true, true, true, true, true };
public int[][] touchDisInvertTriggers = new int[5][] { new int[1] { -1 }, new int[1] { -1 }, new int[1] { -1 },
new int[1] { -1 }, new int[1] { -1 } };
public int[] lsCurve = new int[5] { 0, 0, 0, 0, 0 };
@ -1604,6 +1615,30 @@ namespace DS4Windows
return id;
}
private bool SaTriggerCondValue(string text)
{
bool result = true;
switch (text)
{
case "and": result = true; break;
case "or": result = false; break;
default: result = true; break;
}
return result;
}
private string SaTriggerCondString(bool value)
{
string result = value ? "and" : "or";
return result;
}
public void SetSaTriggerCond(int index, string text)
{
sATriggerCond[index] = SaTriggerCondValue(text);
}
public bool SaveProfile(int device, string propath)
{
bool Saved = true;
@ -1691,6 +1726,7 @@ namespace DS4Windows
XmlNode xmlUseTPforControls = m_Xdoc.CreateNode(XmlNodeType.Element, "UseTPforControls", null); xmlUseTPforControls.InnerText = useTPforControls[device].ToString(); Node.AppendChild(xmlUseTPforControls);
XmlNode xmlUseSAforMouse = m_Xdoc.CreateNode(XmlNodeType.Element, "UseSAforMouse", null); xmlUseSAforMouse.InnerText = useSAforMouse[device].ToString(); Node.AppendChild(xmlUseSAforMouse);
XmlNode xmlSATriggers = m_Xdoc.CreateNode(XmlNodeType.Element, "SATriggers", null); xmlSATriggers.InnerText = sATriggers[device].ToString(); Node.AppendChild(xmlSATriggers);
XmlNode xmlSATriggerCond = m_Xdoc.CreateNode(XmlNodeType.Element, "SATriggerCond", null); xmlSATriggerCond.InnerText = SaTriggerCondString(sATriggerCond[device]); Node.AppendChild(xmlSATriggerCond);
XmlNode xmlTouchDisInvTriggers = m_Xdoc.CreateNode(XmlNodeType.Element, "TouchDisInvTriggers", null);
string tempTouchDisInv = string.Join(",", touchDisInvertTriggers[device]);
@ -2571,6 +2607,9 @@ namespace DS4Windows
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SATriggers"); sATriggers[device] = Item.InnerText; }
catch { sATriggers[device] = ""; missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SATriggerCond"); sATriggerCond[device] = SaTriggerCondValue(Item.InnerText); }
catch { sATriggerCond[device] = true; missingSetting = true; }
try {
Item = m_Xdoc.SelectSingleNode("/" + rootname + "/TouchDisInvTriggers");
string[] triggers = Item.InnerText.Split(',');
@ -2897,13 +2936,13 @@ namespace DS4Windows
{
control.x360controls[device] = new Nefarius.ViGEm.Client.Targets.Xbox360Controller(control.vigemTestClient);
control.x360controls[device].Connect();
Log.LogToGui("X360 Controller # " + (device + 1) + " connected", false);
AppLogger.LogToGui("X360 Controller # " + (device + 1) + " connected", false);
}
else if (xinputStatus && !xinputPlug)
{
control.x360controls[device].Disconnect();
control.x360controls[device] = null;
Log.LogToGui("X360 Controller # " + (device + 1) + " unplugged", false);
AppLogger.LogToGui("X360 Controller # " + (device + 1) + " unplugged", false);
}
tempDev.setRumble(0, 0);
@ -3338,7 +3377,7 @@ namespace DS4Windows
m_Xdoc.AppendChild(Node);
try { m_Xdoc.Save(m_linkedProfiles); }
catch (UnauthorizedAccessException) { Log.LogToGui("Unauthorized Access - Save failed to path: " + m_linkedProfiles, false); saved = false; }
catch (UnauthorizedAccessException) { AppLogger.LogToGui("Unauthorized Access - Save failed to path: " + m_linkedProfiles, false); saved = false; }
return saved;
}
@ -3369,7 +3408,7 @@ namespace DS4Windows
}
else
{
Log.LogToGui("LinkedProfiles.xml can't be found.", false);
AppLogger.LogToGui("LinkedProfiles.xml can't be found.", false);
loaded = false;
}
@ -3407,7 +3446,7 @@ namespace DS4Windows
}
try { linkedXdoc.Save(m_linkedProfiles); }
catch (UnauthorizedAccessException) { Log.LogToGui("Unauthorized Access - Save failed to path: " + m_linkedProfiles, false); saved = false; }
catch (UnauthorizedAccessException) { AppLogger.LogToGui("Unauthorized Access - Save failed to path: " + m_linkedProfiles, false); saved = false; }
}
else
{
@ -3730,6 +3769,7 @@ namespace DS4Windows
useTPforControls[device] = false;
useSAforMouse[device] = false;
sATriggers[device] = string.Empty;
sATriggerCond[device] = true;
touchDisInvertTriggers[device] = new int[1] { -1 };
lsCurve[device] = rsCurve[device] = 0;
gyroSensitivity[device] = 100;

View File

@ -69,6 +69,7 @@ namespace DS4Windows
private uint serverId;
private bool running;
private byte[] recvBuffer = new byte[1024];
private Stack<SocketAsyncEventArgs> argsStack;
public delegate void GetPadDetail(int padIdx, ref DualShockPadMeta meta);
@ -77,6 +78,13 @@ namespace DS4Windows
public UdpServer(GetPadDetail getPadDetailDel)
{
portInfoGet = getPadDetailDel;
argsStack = new Stack<SocketAsyncEventArgs>(20);
for (int num = 0; num <= 19; num++)
{
SocketAsyncEventArgs args = new SocketAsyncEventArgs();
args.Completed += ClearSentData;
argsStack.Push(args);
}
}
enum MessageType
@ -174,10 +182,9 @@ namespace DS4Windows
FinishPacket(packetData);
//try { udpSock.SendTo(packetData, clientEP); }
SocketAsyncEventArgs args = new SocketAsyncEventArgs();
SocketAsyncEventArgs args = argsStack.Pop();
args.RemoteEndPoint = clientEP;
args.SetBuffer(packetData, 0, packetData.Length);
args.Completed += ClearSentData;
try { udpSock.SendToAsync(args); }
catch (Exception e) { }
}
@ -632,11 +639,10 @@ namespace DS4Windows
foreach (var cl in clientsList)
{
//try { udpSock.SendTo(outputData, cl); }
SocketAsyncEventArgs args = new SocketAsyncEventArgs();
SocketAsyncEventArgs args = argsStack.Pop();
args.RemoteEndPoint = cl;
args.SetBuffer(outputData, 0, outputData.Length);
args.Completed += ClearSentData;
try { udpSock.SendToAsync(args); }
try { bool result = udpSock.SendToAsync(args); if (!result) argsStack.Push(args); }
catch (SocketException ex) { }
}
}
@ -647,8 +653,9 @@ namespace DS4Windows
private void ClearSentData(object sender, SocketAsyncEventArgs args)
{
args.Dispose();
args = null;
argsStack.Push(args);
//args.Dispose();
//args = null;
}
}
}

View File

@ -149,8 +149,8 @@ namespace DS4Windows
Program.rootHub.Debug += On_Debug;
Log.GuiLog += On_Debug;
Log.TrayIconLog += ShowNotification;
AppLogger.GuiLog += On_Debug;
AppLogger.TrayIconLog += ShowNotification;
Directory.CreateDirectory(appdatapath);
if (!Save()) //if can't write to file
@ -252,7 +252,7 @@ namespace DS4Windows
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
string version = fvi.FileVersion;
Log.LogToGui("DS4Windows version " + version, false);
AppLogger.LogToGui("DS4Windows version " + version, false);
LoadP();
LoadLinkedProfiles();
@ -398,7 +398,7 @@ namespace DS4Windows
}
if (btnStartStop.Enabled && start)
TaskRunner.Delay(10).ContinueWith((t) => this.BeginInvoke((System.Action)(() => BtnStartStop_Clicked())));
TaskRunner.Delay(50).ContinueWith((t) => this.BeginInvoke((System.Action)(() => BtnStartStop_Clicked())));
}
private void populateHoverTextDict()
@ -2493,7 +2493,7 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
{
RegistryKey key = Registry.LocalMachine.CreateSubKey(@"SYSTEM\CurrentControlSet\Services\HidGuardian\Parameters");
key.SetValue("AffectedDevices", Program.rootHub.affectedDevs.ToArray(), RegistryValueKind.MultiString);
Log.LogToGui("Wrote HidGuardian Device List to Registry", false);
AppLogger.LogToGui("Wrote HidGuardian Device List to Registry", false);
}
catch { }
}
@ -2503,7 +2503,7 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
try
{
Registry.LocalMachine.DeleteSubKeyTree(@"SYSTEM\CurrentControlSet\Services\HidGuardian\Parameters\Whitelist");
Log.LogToGui("Cleared HidGuardian Whitelist", false);
AppLogger.LogToGui("Cleared HidGuardian Whitelist", false);
Program.rootHub.CreateHidGuardKey();
}
catch { }

View File

@ -386,6 +386,8 @@
this.optionsTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.shareTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.psTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.triggerCondAndCombo = new System.Windows.Forms.ComboBox();
this.label26 = new System.Windows.Forms.Label();
this.advColorDialog = new DS4Windows.AdvancedColorDialog();
((System.ComponentModel.ISupportInitialize)(this.nUDRainbow)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tBBlueBar)).BeginInit();
@ -3360,8 +3362,8 @@
this.gBGyro.BackColor = System.Drawing.SystemColors.Control;
this.gBGyro.Controls.Add(this.rBSAControls);
this.gBGyro.Controls.Add(this.rBSAMouse);
this.gBGyro.Controls.Add(this.fLPTiltControls);
this.gBGyro.Controls.Add(this.pnlSAMouse);
this.gBGyro.Controls.Add(this.fLPTiltControls);
resources.ApplyResources(this.gBGyro, "gBGyro");
this.gBGyro.Name = "gBGyro";
this.gBGyro.TabStop = false;
@ -3384,6 +3386,8 @@
//
// pnlSAMouse
//
this.pnlSAMouse.Controls.Add(this.label26);
this.pnlSAMouse.Controls.Add(this.triggerCondAndCombo);
this.pnlSAMouse.Controls.Add(this.cBGyroMouseXAxis);
this.pnlSAMouse.Controls.Add(this.label16);
this.pnlSAMouse.Controls.Add(this.lbGyroSmooth);
@ -4106,6 +4110,21 @@
resources.ApplyResources(this.psTouchInvStripMenuItem, "psTouchInvStripMenuItem");
this.psTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged);
//
// triggerCondAndCombo
//
this.triggerCondAndCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.triggerCondAndCombo.FormattingEnabled = true;
this.triggerCondAndCombo.Items.AddRange(new object[] {
resources.GetString("triggerCondAndCombo.Items"),
resources.GetString("triggerCondAndCombo.Items1")});
resources.ApplyResources(this.triggerCondAndCombo, "triggerCondAndCombo");
this.triggerCondAndCombo.Name = "triggerCondAndCombo";
//
// label26
//
resources.ApplyResources(this.label26, "label26");
this.label26.Name = "label26";
//
// Options
//
resources.ApplyResources(this, "$this");
@ -4593,5 +4612,7 @@
private System.Windows.Forms.Label trackFrictionLb;
private System.Windows.Forms.NumericUpDown trackFrictionNUD;
private System.Windows.Forms.CheckBox trackballCk;
private System.Windows.Forms.Label label26;
private System.Windows.Forms.ComboBox triggerCondAndCombo;
}
}

View File

@ -126,6 +126,8 @@ namespace DS4Windows
sixaxisTimer.Tick += ControllerReadout_Tick;
sixaxisTimer.Interval = 1000 / 60;
triggerCondAndCombo.SelectedIndexChanged += TriggerCondAndCombo_SelectedIndexChanged;
bnGyroZN.Text = Properties.Resources.TiltUp;
bnGyroZP.Text = Properties.Resources.TiltDown;
bnGyroXP.Text = Properties.Resources.TiltLeft;
@ -142,6 +144,15 @@ namespace DS4Windows
populateHoverLabelDict();
}
private void TriggerCondAndCombo_SelectedIndexChanged(object sender, EventArgs e)
{
if (!loading)
{
string temp = triggerCondAndCombo.SelectedItem.ToString().ToLower();
SetSaTriggerCond(device, triggerCondAndCombo.SelectedItem.ToString().ToLower());
}
}
public void SetFlowAutoScroll()
{
fLPSettings.AutoScroll = false;
@ -706,6 +717,7 @@ namespace DS4Windows
cBGyroSmooth.Checked = nUDGyroSmoothWeight.Enabled = GyroSmoothing[device];
nUDGyroSmoothWeight.Value = (decimal)(GyroSmoothingWeight[device]);
cBGyroMouseXAxis.SelectedIndex = GyroMouseHorizontalAxis[device];
triggerCondAndCombo.SelectedIndex = SATriggerCond[device] ? 0 : 1;
}
else
{
@ -823,6 +835,7 @@ namespace DS4Windows
cBGyroSmooth.Checked = false;
nUDGyroSmoothWeight.Value = 0.5m;
cBGyroMouseXAxis.SelectedIndex = 0;
triggerCondAndCombo.SelectedIndex = 0;
Set();
}
@ -1342,6 +1355,7 @@ namespace DS4Windows
ints.Add(-1);
SATriggers[device] = string.Join(",", ints);
SetSaTriggerCond(device, triggerCondAndCombo.SelectedItem.ToString().ToLower());
ints.Clear();
for (int i = 0, trigLen = cMTouchDisableInvert.Items.Count; i < trigLen; i++)

View File

@ -4058,7 +4058,7 @@ with profile</value>
<value>7</value>
</data>
<data name="fLPTiltControls.Location" type="System.Drawing.Point, System.Drawing">
<value>6, 51</value>
<value>4, 43</value>
</data>
<data name="fLPTiltControls.Size" type="System.Drawing.Size, System.Drawing">
<value>271, 167</value>
@ -4076,7 +4076,7 @@ with profile</value>
<value>gBGyro</value>
</data>
<data name="&gt;&gt;fLPTiltControls.ZOrder" xml:space="preserve">
<value>2</value>
<value>3</value>
</data>
<data name="tPControls.AutoScroll" type="System.Boolean, mscorlib">
<value>True</value>
@ -7717,6 +7717,63 @@ with profile</value>
<data name="&gt;&gt;rBSAMouse.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="label26.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label26.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label26.Location" type="System.Drawing.Point, System.Drawing">
<value>184, 43</value>
</data>
<data name="label26.Size" type="System.Drawing.Size, System.Drawing">
<value>59, 13</value>
</data>
<data name="label26.TabIndex" type="System.Int32, mscorlib">
<value>273</value>
</data>
<data name="label26.Text" xml:space="preserve">
<value>Eval Cond:</value>
</data>
<data name="&gt;&gt;label26.Name" xml:space="preserve">
<value>label26</value>
</data>
<data name="&gt;&gt;label26.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label26.Parent" xml:space="preserve">
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;label26.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="triggerCondAndCombo.Items" xml:space="preserve">
<value>And</value>
</data>
<data name="triggerCondAndCombo.Items1" xml:space="preserve">
<value>Or</value>
</data>
<data name="triggerCondAndCombo.Location" type="System.Drawing.Point, System.Drawing">
<value>165, 67</value>
</data>
<data name="triggerCondAndCombo.Size" type="System.Drawing.Size, System.Drawing">
<value>73, 21</value>
</data>
<data name="triggerCondAndCombo.TabIndex" type="System.Int32, mscorlib">
<value>272</value>
</data>
<data name="&gt;&gt;triggerCondAndCombo.Name" xml:space="preserve">
<value>triggerCondAndCombo</value>
</data>
<data name="&gt;&gt;triggerCondAndCombo.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;triggerCondAndCombo.Parent" xml:space="preserve">
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;triggerCondAndCombo.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="cBGyroMouseXAxis.Items" xml:space="preserve">
<value>Yaw</value>
</data>
@ -7724,7 +7781,7 @@ with profile</value>
<value>Roll</value>
</data>
<data name="cBGyroMouseXAxis.Location" type="System.Drawing.Point, System.Drawing">
<value>170, 93</value>
<value>170, 114</value>
</data>
<data name="cBGyroMouseXAxis.Size" type="System.Drawing.Size, System.Drawing">
<value>74, 21</value>
@ -7742,7 +7799,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;cBGyroMouseXAxis.ZOrder" xml:space="preserve">
<value>0</value>
<value>2</value>
</data>
<data name="label16.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -7751,7 +7808,7 @@ with profile</value>
<value>NoControl</value>
</data>
<data name="label16.Location" type="System.Drawing.Point, System.Drawing">
<value>167, 74</value>
<value>167, 95</value>
</data>
<data name="label16.Size" type="System.Drawing.Size, System.Drawing">
<value>39, 13</value>
@ -7772,7 +7829,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;label16.ZOrder" xml:space="preserve">
<value>1</value>
<value>3</value>
</data>
<data name="lbGyroSmooth.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -7802,7 +7859,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;lbGyroSmooth.ZOrder" xml:space="preserve">
<value>2</value>
<value>4</value>
</data>
<data name="cBGyroSmooth.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -7832,7 +7889,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;cBGyroSmooth.ZOrder" xml:space="preserve">
<value>3</value>
<value>5</value>
</data>
<data name="lbSmoothWeight.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -7862,7 +7919,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;lbSmoothWeight.ZOrder" xml:space="preserve">
<value>4</value>
<value>6</value>
</data>
<data name="nUDGyroSmoothWeight.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
@ -7886,7 +7943,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;nUDGyroSmoothWeight.ZOrder" xml:space="preserve">
<value>5</value>
<value>7</value>
</data>
<data name="label12.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -7916,7 +7973,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;label12.ZOrder" xml:space="preserve">
<value>6</value>
<value>8</value>
</data>
<data name="nUDGyroMouseVertScale.Location" type="System.Drawing.Point, System.Drawing">
<value>96, 93</value>
@ -7937,7 +7994,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;nUDGyroMouseVertScale.ZOrder" xml:space="preserve">
<value>7</value>
<value>9</value>
</data>
<data name="label11.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -7967,7 +8024,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;label11.ZOrder" xml:space="preserve">
<value>8</value>
<value>10</value>
</data>
<data name="gyroTriggerBehavior.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -8000,7 +8057,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;gyroTriggerBehavior.ZOrder" xml:space="preserve">
<value>9</value>
<value>11</value>
</data>
<data name="cBGyroInvertY.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -8033,7 +8090,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;cBGyroInvertY.ZOrder" xml:space="preserve">
<value>10</value>
<value>12</value>
</data>
<data name="cBGyroInvertX.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -8066,7 +8123,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;cBGyroInvertX.ZOrder" xml:space="preserve">
<value>11</value>
<value>13</value>
</data>
<data name="lbGyroInvert.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -8099,7 +8156,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;lbGyroInvert.ZOrder" xml:space="preserve">
<value>12</value>
<value>14</value>
</data>
<data name="lbGyroTriggers.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -8132,7 +8189,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;lbGyroTriggers.ZOrder" xml:space="preserve">
<value>13</value>
<value>15</value>
</data>
<data name="btnGyroTriggers.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -8162,7 +8219,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;btnGyroTriggers.ZOrder" xml:space="preserve">
<value>14</value>
<value>16</value>
</data>
<data name="nUDGyroSensitivity.Location" type="System.Drawing.Point, System.Drawing">
<value>96, 67</value>
@ -8183,7 +8240,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;nUDGyroSensitivity.ZOrder" xml:space="preserve">
<value>15</value>
<value>17</value>
</data>
<data name="lbGyroSens.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -8216,7 +8273,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;lbGyroSens.ZOrder" xml:space="preserve">
<value>16</value>
<value>18</value>
</data>
<data name="pnlSAMouse.Location" type="System.Drawing.Point, System.Drawing">
<value>6, 43</value>
@ -8240,7 +8297,7 @@ with profile</value>
<value>gBGyro</value>
</data>
<data name="&gt;&gt;pnlSAMouse.ZOrder" xml:space="preserve">
<value>3</value>
<value>2</value>
</data>
<data name="gBGyro.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 253</value>
@ -8914,6 +8971,9 @@ with profile</value>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>1011, 481</value>
</data>
<data name="$this.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="$this.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
</data>
@ -9332,7 +9392,7 @@ with profile</value>
<value>advColorDialog</value>
</data>
<data name="&gt;&gt;advColorDialog.Type" xml:space="preserve">
<value>DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.5.0.0, Culture=neutral, PublicKeyToken=null</value>
<value>DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.5.8.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>Options</value>

View File

@ -1225,7 +1225,7 @@ namespace DS4Windows
private void lVMacros_MouseDoubleClick(object sender, MouseEventArgs e)
{
if (lVMacros.SelectedIndices[0] >= 0)
if (lVMacros.SelectedIndices.Count != 0)
{
if (lVMacros.SelectedItems[0].ImageIndex == 2)
{

View File

@ -503,7 +503,7 @@ namespace DS4Windows
bool validCrc = recvCrc32 == calcCrc32;
if (!validCrc && tries >= 5)
{
Log.LogToGui("Gyro Calibration Failed", true);
AppLogger.LogToGui("Gyro Calibration Failed", true);
continue;
}
else if (validCrc)
@ -786,7 +786,7 @@ namespace DS4Windows
{
if (res == HidDevice.ReadStatus.WaitTimedOut)
{
Log.LogToGui(Mac.ToString() + " disconnected due to timeout", true);
AppLogger.LogToGui(Mac.ToString() + " disconnected due to timeout", true);
}
else
{
@ -814,7 +814,7 @@ namespace DS4Windows
{
if (res == HidDevice.ReadStatus.WaitTimedOut)
{
Log.LogToGui(Mac.ToString() + " disconnected due to timeout", true);
AppLogger.LogToGui(Mac.ToString() + " disconnected due to timeout", true);
}
else
{
@ -1051,7 +1051,7 @@ namespace DS4Windows
if (shouldDisconnect)
{
Log.LogToGui(Mac.ToString() + " disconnecting due to idle disconnect", false);
AppLogger.LogToGui(Mac.ToString() + " disconnecting due to idle disconnect", false);
if (conType == ConnectionType.BT)
{

View File

@ -104,7 +104,7 @@ namespace DS4Windows
startInfo.Arguments = "re-enabledevice " + devicePathToInstanceId(hDevice.DevicePath);
Process child = Process.Start(startInfo);
if (!child.WaitForExit(5000))
if (!child.WaitForExit(15000))
{
child.Kill();
}

View File

@ -13,7 +13,7 @@ website at [ds4windows.com](http://ds4windows.com).
- **[Main builds of DS4Windows](https://github.com/Ryochan7/DS4Windows/releases)**
- Alternative builds:
- [UdpServer ViGEm build](http://ryochan7.xyz/ds4windows/test/DS4Windows_1.5.6_ViGEm_UdpServer_x64.zip)
- [UdpServer ViGEm build](http://ryochan7.xyz/ds4windows/test/DS4Windows_1.5.8_ViGEm_UdpServer_x64.zip)
## Requirements