Added profile setting for controller type

This commit is contained in:
Travis Nickles 2019-04-18 01:12:10 -05:00
parent dc5e34f1be
commit 1b58265c28
5 changed files with 1193 additions and 3768 deletions

View File

@ -422,31 +422,37 @@ namespace DS4Windows
if (!getDInputOnly(i) && device.isSynced()) if (!getDInputOnly(i) && device.isSynced())
{ {
LogDebug("Plugging in X360 Controller #" + (i + 1));
useDInputOnly[i] = false; useDInputOnly[i] = false;
DS4OutDevice tempDS4 = new DS4OutDevice(vigemTestClient); OutContType contType = Global.OutContType[i];
outputDevices[i] = tempDS4; if (contType == OutContType.X360)
int devIndex = i;
tempDS4.cont.FeedbackReceived += (sender, args) =>
{ {
SetDevRumble(device, args.LargeMotor, args.SmallMotor, devIndex); LogDebug("Plugging in X360 Controller #" + (i + 1));
}; Xbox360OutDevice tempXbox = new Xbox360OutDevice(vigemTestClient);
outputDevices[i] = tempXbox;
int devIndex = i;
tempXbox.cont.FeedbackReceived += (sender, args) =>
{
SetDevRumble(device, args.LargeMotor, args.SmallMotor, devIndex);
};
tempDS4.Connect(); tempXbox.Connect();
//x360controls[i] = new Xbox360Controller(vigemTestClient); LogDebug("X360 Controller #" + (i + 1) + " connected");
/*Xbox360Controller bacon = new Xbox360Controller(vigemTestClient); }
Xbox360OutDevice tempXbox = new Xbox360OutDevice(vigemTestClient); else if (contType == OutContType.DS4)
outputDevices[i] = tempXbox;
int devIndex = i;
tempXbox.cont.FeedbackReceived += (sender, args) =>
{ {
SetDevRumble(device, args.LargeMotor, args.SmallMotor, devIndex); LogDebug("Plugging in DS4 Controller #" + (i + 1));
}; DS4OutDevice tempDS4 = new DS4OutDevice(vigemTestClient);
outputDevices[i] = tempDS4;
int devIndex = i;
tempDS4.cont.FeedbackReceived += (sender, args) =>
{
SetDevRumble(device, args.LargeMotor, args.SmallMotor, devIndex);
};
tempXbox.Connect(); tempDS4.Connect();
*/ LogDebug("DS4 Controller #" + (i + 1) + " connected");
LogDebug("X360 Controller #" + (i + 1) + " connected"); }
} }
else else
{ {
@ -582,10 +588,8 @@ namespace DS4Windows
} }
CurrentState[i].Battery = PreviousState[i].Battery = 0; // Reset for the next connection's initial status change. CurrentState[i].Battery = PreviousState[i].Battery = 0; // Reset for the next connection's initial status change.
//x360controls[i]?.Disconnect();
outputDevices[i]?.Disconnect(); outputDevices[i]?.Disconnect();
outputDevices[i] = null; outputDevices[i] = null;
//x360controls[i] = null;
useDInputOnly[i] = true; useDInputOnly[i] = true;
DS4Controllers[i] = null; DS4Controllers[i] = null;
touchPad[i] = null; touchPad[i] = null;
@ -695,21 +699,37 @@ namespace DS4Windows
if (!getDInputOnly(Index) && device.isSynced()) if (!getDInputOnly(Index) && device.isSynced())
{ {
LogDebug("Plugging in X360 Controller #" + (Index + 1));
useDInputOnly[Index] = false; useDInputOnly[Index] = false;
//x360controls[Index] = new Xbox360Controller(vigemTestClient); OutContType contType = Global.OutContType[Index];
Xbox360OutDevice tempXbox = new Xbox360OutDevice(vigemTestClient); if (contType == OutContType.X360)
outputDevices[Index] = tempXbox;
int devIndex = Index;
//x360controls[Index].FeedbackReceived += (sender, args) =>
tempXbox.cont.FeedbackReceived += (sender, args) =>
{ {
SetDevRumble(device, args.LargeMotor, args.SmallMotor, devIndex); LogDebug("Plugging in X360 Controller #" + (Index + 1));
}; Xbox360OutDevice tempXbox = new Xbox360OutDevice(vigemTestClient);
outputDevices[Index] = tempXbox;
int devIndex = Index;
tempXbox.cont.FeedbackReceived += (sender, args) =>
{
SetDevRumble(device, args.LargeMotor, args.SmallMotor, devIndex);
};
//x360controls[Index].Connect(); tempXbox.Connect();
tempXbox.Connect(); LogDebug("X360 Controller #" + (Index + 1) + " connected");
LogDebug("X360 Controller #" + (Index + 1) + " connected"); }
else if (contType == OutContType.DS4)
{
LogDebug("Plugging in DS4 Controller #" + (Index + 1));
DS4OutDevice tempDS4 = new DS4OutDevice(vigemTestClient);
outputDevices[Index] = tempDS4;
int devIndex = Index;
tempDS4.cont.FeedbackReceived += (sender, args) =>
{
SetDevRumble(device, args.LargeMotor, args.SmallMotor, devIndex);
};
tempDS4.Connect();
LogDebug("DS4 Controller #" + (Index + 1) + " connected");
}
} }
else else
{ {
@ -1073,33 +1093,43 @@ namespace DS4Windows
outputDevices[ind].Disconnect(); outputDevices[ind].Disconnect();
outputDevices[ind] = null; outputDevices[ind] = null;
useDInputOnly[ind] = true; useDInputOnly[ind] = true;
LogDebug("X360 Controller #" + (ind + 1) + " unplugged"); LogDebug("Controller #" + (ind + 1) + " unplugged");
} }
} }
else else
{ {
if (!getDInputOnly(ind)) if (!getDInputOnly(ind))
{ {
LogDebug("Plugging in X360 Controller #" + (ind + 1)); OutContType conType = Global.OutContType[ind];
Xbox360OutDevice tempXbox = new Xbox360OutDevice(vigemTestClient); if (conType == OutContType.X360)
outputDevices[ind] = tempXbox;
tempXbox.cont.FeedbackReceived += (eventsender, args) =>
{ {
SetDevRumble(device, args.LargeMotor, args.SmallMotor, ind); LogDebug("Plugging in X360 Controller #" + (ind + 1));
}; Xbox360OutDevice tempXbox = new Xbox360OutDevice(vigemTestClient);
outputDevices[ind] = tempXbox;
tempXbox.Connect(); tempXbox.cont.FeedbackReceived += (eventsender, args) =>
{
SetDevRumble(device, args.LargeMotor, args.SmallMotor, ind);
};
/*x360controls[ind] = new Xbox360Controller(vigemTestClient); tempXbox.Connect();
x360controls[ind].FeedbackReceived += (eventsender, args) => LogDebug("X360 Controller #" + (ind + 1) + " connected");
}
else if (conType == OutContType.DS4)
{ {
SetDevRumble(device, args.LargeMotor, args.SmallMotor, ind); LogDebug("Plugging in DS4 Controller #" + (ind + 1));
}; DS4OutDevice tempDS4 = new DS4OutDevice(vigemTestClient);
outputDevices[ind] = tempDS4;
x360controls[ind].Connect(); int devIndex = ind;
*/ tempDS4.cont.FeedbackReceived += (eventsender, args) =>
{
SetDevRumble(device, args.LargeMotor, args.SmallMotor, devIndex);
};
tempDS4.Connect();
LogDebug("DS4 Controller #" + (ind + 1) + " connected");
}
useDInputOnly[ind] = false; useDInputOnly[ind] = false;
LogDebug("X360 Controller #" + (ind + 1) + " connected");
} }
} }
} }

View File

@ -21,6 +21,7 @@ namespace DS4Windows
public enum X360Controls : byte { None, LXNeg, LXPos, LYNeg, LYPos, RXNeg, RXPos, RYNeg, RYPos, LB, LT, LS, RB, RT, RS, X, Y, B, A, DpadUp, DpadRight, DpadDown, DpadLeft, Guide, Back, Start, LeftMouse, RightMouse, MiddleMouse, FourthMouse, FifthMouse, WUP, WDOWN, MouseUp, MouseDown, MouseLeft, MouseRight, Unbound }; public enum X360Controls : byte { None, LXNeg, LXPos, LYNeg, LYPos, RXNeg, RXPos, RYNeg, RYPos, LB, LT, LS, RB, RT, RS, X, Y, B, A, DpadUp, DpadRight, DpadDown, DpadLeft, Guide, Back, Start, LeftMouse, RightMouse, MiddleMouse, FourthMouse, FifthMouse, WUP, WDOWN, MouseUp, MouseDown, MouseLeft, MouseRight, Unbound };
public enum SASteeringWheelEmulationAxisType: byte { None = 0, LX, LY, RX, RY, L2R2, VJoy1X, VJoy1Y, VJoy1Z, VJoy2X, VJoy2Y, VJoy2Z }; public enum SASteeringWheelEmulationAxisType: byte { None = 0, LX, LY, RX, RY, L2R2, VJoy1X, VJoy1Y, VJoy1Z, VJoy2X, VJoy2Y, VJoy2Z };
public enum OutContType : uint { None = 0, X360, DS4 }
public class DS4ControlSettings public class DS4ControlSettings
{ {
@ -1148,6 +1149,7 @@ namespace DS4Windows
return m_Config.trackballFriction[index]; return m_Config.trackballFriction[index];
} }
public static OutContType[] OutContType => m_Config.outputDevType;
public static string[] LaunchProgram => m_Config.launchProgram; public static string[] LaunchProgram => m_Config.launchProgram;
public static string[] ProfilePath => m_Config.profilePath; public static string[] ProfilePath => m_Config.profilePath;
public static string[] OlderProfilePath => m_Config.olderProfilePath; public static string[] OlderProfilePath => m_Config.olderProfilePath;
@ -1660,6 +1662,9 @@ namespace DS4Windows
public int[] gyroMouseHorizontalAxis = new int[5] { 0, 0, 0, 0, 0 }; public int[] gyroMouseHorizontalAxis = new int[5] { 0, 0, 0, 0, 0 };
public bool[] trackballMode = new bool[5] { false, false, false, false, false }; public bool[] trackballMode = new bool[5] { false, false, false, false, false };
public double[] trackballFriction = new double[5] { 10.0, 10.0, 10.0, 10.0, 10.0 }; public double[] trackballFriction = new double[5] { 10.0, 10.0, 10.0, 10.0, 10.0 };
public OutContType[] outputDevType = new OutContType[5] { OutContType.None,
OutContType.None, OutContType.None,
OutContType.None, OutContType.None };
bool tempBool = false; bool tempBool = false;
@ -1779,6 +1784,34 @@ namespace DS4Windows
control.touchPad[index].ToggleGyroMouse = value; control.touchPad[index].ToggleGyroMouse = value;
} }
private string OutContDeviceString(OutContType id)
{
string result = "None";
switch (id)
{
case OutContType.None: break;
case OutContType.X360: result = "X360"; break;
case OutContType.DS4: result = "DS4"; break;
default: break;
}
return result;
}
private OutContType OutContDeviceId(string name)
{
OutContType id = OutContType.None;
switch (name)
{
case "None": break;
case "X360": id = OutContType.X360; break;
case "DS4": id = OutContType.DS4; break;
default: break;
}
return id;
}
public bool SaveProfile(int device, string propath) public bool SaveProfile(int device, string propath)
{ {
bool Saved = true; bool Saved = true;
@ -1903,6 +1936,8 @@ namespace DS4Windows
XmlNode xmlTrackBallMode = m_Xdoc.CreateNode(XmlNodeType.Element, "TrackballMode", null); xmlTrackBallMode.InnerText = trackballMode[device].ToString(); Node.AppendChild(xmlTrackBallMode); XmlNode xmlTrackBallMode = m_Xdoc.CreateNode(XmlNodeType.Element, "TrackballMode", null); xmlTrackBallMode.InnerText = trackballMode[device].ToString(); Node.AppendChild(xmlTrackBallMode);
XmlNode xmlTrackBallFriction = m_Xdoc.CreateNode(XmlNodeType.Element, "TrackballFriction", null); xmlTrackBallFriction.InnerText = trackballFriction[device].ToString(); Node.AppendChild(xmlTrackBallFriction); XmlNode xmlTrackBallFriction = m_Xdoc.CreateNode(XmlNodeType.Element, "TrackballFriction", null); xmlTrackBallFriction.InnerText = trackballFriction[device].ToString(); Node.AppendChild(xmlTrackBallFriction);
XmlNode xmlOutContDevice = m_Xdoc.CreateNode(XmlNodeType.Element, "OutputContDevice", null); xmlOutContDevice.InnerText = OutContDeviceString(outputDevType[device]); Node.AppendChild(xmlOutContDevice);
XmlNode NodeControl = m_Xdoc.CreateNode(XmlNodeType.Element, "Control", null); XmlNode NodeControl = m_Xdoc.CreateNode(XmlNodeType.Element, "Control", null);
XmlNode Key = m_Xdoc.CreateNode(XmlNodeType.Element, "Key", null); XmlNode Key = m_Xdoc.CreateNode(XmlNodeType.Element, "Key", null);
XmlNode Macro = m_Xdoc.CreateNode(XmlNodeType.Element, "Macro", null); XmlNode Macro = m_Xdoc.CreateNode(XmlNodeType.Element, "Macro", null);
@ -2376,6 +2411,8 @@ namespace DS4Windows
DS4LightBar.forcedFlash[device] = 0; DS4LightBar.forcedFlash[device] = 0;
} }
OutContType oldContType = outputDevType[device];
// Make sure to reset currently set profile values before parsing // Make sure to reset currently set profile values before parsing
ResetProfile(device); ResetProfile(device);
@ -2697,32 +2734,6 @@ namespace DS4Windows
bool oldUseDInputOnly = Global.useDInputOnly[device]; bool oldUseDInputOnly = Global.useDInputOnly[device];
// Only change xinput devices under certain conditions. Avoid
// performing this upon program startup before loading devices.
if (xinputChange)
{
if (device < 4)
{
DS4Device tempDevice = control.DS4Controllers[device];
bool exists = tempBool = (tempDevice != null);
bool synced = tempBool = exists ? tempDevice.isSynced() : false;
bool isAlive = tempBool = exists ? tempDevice.IsAlive() : false;
if (dinputOnly[device] != oldUseDInputOnly)
{
if (dinputOnly[device] == true)
{
xinputPlug = false;
xinputStatus = true;
}
else if (synced && isAlive)
{
xinputPlug = true;
xinputStatus = true;
}
}
}
}
try try
{ {
Item = m_Xdoc.SelectSingleNode("/" + rootname + "/StartTouchpadOff"); Item = m_Xdoc.SelectSingleNode("/" + rootname + "/StartTouchpadOff");
@ -2841,6 +2852,40 @@ namespace DS4Windows
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/TrackballFriction"); double.TryParse(Item.InnerText, out trackballFriction[device]); } try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/TrackballFriction"); double.TryParse(Item.InnerText, out trackballFriction[device]); }
catch { trackballFriction[device] = 10.0; missingSetting = true; } catch { trackballFriction[device] = 10.0; missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/OutputContDevice"); outputDevType[device] = OutContDeviceId(Item.InnerText); }
catch { outputDevType[device] = OutContType.X360; missingSetting = true; }
// Only change xinput devices under certain conditions. Avoid
// performing this upon program startup before loading devices.
if (xinputChange)
{
if (device < 4)
{
DS4Device tempDevice = control.DS4Controllers[device];
bool exists = tempBool = (tempDevice != null);
bool synced = tempBool = exists ? tempDevice.isSynced() : false;
bool isAlive = tempBool = exists ? tempDevice.IsAlive() : false;
if (dinputOnly[device] != oldUseDInputOnly)
{
if (dinputOnly[device] == true)
{
xinputPlug = false;
xinputStatus = true;
}
else if (synced && isAlive)
{
xinputPlug = true;
xinputStatus = true;
}
}
else if (oldContType != outputDevType[device])
{
xinputPlug = true;
xinputStatus = true;
}
}
}
try try
{ {
Item = m_Xdoc.SelectSingleNode("/" + rootname + "/ProfileActions"); Item = m_Xdoc.SelectSingleNode("/" + rootname + "/ProfileActions");
@ -3091,31 +3136,50 @@ namespace DS4Windows
tempDev.setBTPollRate(btPollRate[device]); tempDev.setBTPollRate(btPollRate[device]);
if (xinputStatus && xinputPlug) if (xinputStatus && xinputPlug)
{ {
Xbox360OutDevice tempXbox = new Xbox360OutDevice(control.vigemTestClient); OutputDevice tempOutDev = control.outputDevices[device];
control.outputDevices[device] = tempXbox; if (tempOutDev != null)
tempXbox.cont.FeedbackReceived += (eventsender, args) =>
{ {
control.SetDevRumble(tempDev, args.LargeMotor, args.SmallMotor, device); AppLogger.LogToGui("Unplug Controller #" + (device + 1), false);
}; tempOutDev.Disconnect();
tempOutDev = null;
control.outputDevices[device] = null;
}
tempXbox.Connect(); OutContType tempContType = outputDevType[device];
/*control.x360controls[device] = new Nefarius.ViGEm.Client.Targets.Xbox360Controller(control.vigemTestClient); if (tempContType == OutContType.X360)
control.x360controls[device].FeedbackReceived += (eventsender, args) =>
{ {
control.SetDevRumble(tempDev, args.LargeMotor, args.SmallMotor, device); Xbox360OutDevice tempXbox = new Xbox360OutDevice(control.vigemTestClient);
}; control.outputDevices[device] = tempXbox;
tempXbox.cont.FeedbackReceived += (eventsender, args) =>
control.x360controls[device].Connect(); {
*/ control.SetDevRumble(tempDev, args.LargeMotor, args.SmallMotor, device);
};
tempXbox.Connect();
AppLogger.LogToGui("X360 Controller #" + (device + 1) + " connected", false);
}
else if (tempContType == OutContType.DS4)
{
DS4OutDevice tempDS4 = new DS4OutDevice(control.vigemTestClient);
control.outputDevices[device] = tempDS4;
tempDS4.cont.FeedbackReceived += (eventsender, args) =>
{
control.SetDevRumble(tempDev, args.LargeMotor, args.SmallMotor, device);
};
tempDS4.Connect();
AppLogger.LogToGui("DS4 Controller #" + (device + 1) + " connected", false);
}
Global.useDInputOnly[device] = false; Global.useDInputOnly[device] = false;
AppLogger.LogToGui("X360 Controller #" + (device + 1) + " connected", false);
} }
else if (xinputStatus && !xinputPlug) else if (xinputStatus && !xinputPlug)
{ {
control.outputDevices[device].Disconnect(); control.outputDevices[device].Disconnect();
control.outputDevices[device] = null; control.outputDevices[device] = null;
Global.useDInputOnly[device] = true; Global.useDInputOnly[device] = true;
AppLogger.LogToGui("X360 Controller #" + (device + 1) + " unplugged", false); AppLogger.LogToGui("Controller #" + (device + 1) + " unplugged", false);
} }
tempDev.setRumble(0, 0); tempDev.setRumble(0, 0);
@ -4062,6 +4126,7 @@ namespace DS4Windows
sxOutCurveMode[device] = szOutCurveMode[device] = 0; sxOutCurveMode[device] = szOutCurveMode[device] = 0;
trackballMode[device] = false; trackballMode[device] = false;
trackballFriction[device] = 10.0; trackballFriction[device] = 10.0;
outputDevType[device] = OutContType.X360;
} }
} }

View File

@ -121,6 +121,8 @@
this.bnSwipeRight = new System.Windows.Forms.Button(); this.bnSwipeRight = new System.Windows.Forms.Button();
this.lbSwipeRight = new System.Windows.Forms.Label(); this.lbSwipeRight = new System.Windows.Forms.Label();
this.gBOther = new System.Windows.Forms.GroupBox(); this.gBOther = new System.Windows.Forms.GroupBox();
this.OutContTypeCb = new System.Windows.Forms.ComboBox();
this.label28 = new System.Windows.Forms.Label();
this.btPollRateLabel = new System.Windows.Forms.Label(); this.btPollRateLabel = new System.Windows.Forms.Label();
this.btPollRateComboBox = new System.Windows.Forms.ComboBox(); this.btPollRateComboBox = new System.Windows.Forms.ComboBox();
this.enableTouchToggleCheckbox = new System.Windows.Forms.CheckBox(); this.enableTouchToggleCheckbox = new System.Windows.Forms.CheckBox();
@ -290,6 +292,9 @@
this.label6 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label();
this.nUDLSMaxZone = new System.Windows.Forms.NumericUpDown(); this.nUDLSMaxZone = new System.Windows.Forms.NumericUpDown();
this.label5 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label();
this.squStickTabPage = new System.Windows.Forms.TabPage();
this.rsSquStickCk = new System.Windows.Forms.CheckBox();
this.lsSquStickCk = new System.Windows.Forms.CheckBox();
this.tPOutCurve = new System.Windows.Forms.TabPage(); this.tPOutCurve = new System.Windows.Forms.TabPage();
this.cBSixaxisZOutputCurve = new System.Windows.Forms.ComboBox(); this.cBSixaxisZOutputCurve = new System.Windows.Forms.ComboBox();
this.cBSixaxisXOutputCurve = new System.Windows.Forms.ComboBox(); this.cBSixaxisXOutputCurve = new System.Windows.Forms.ComboBox();
@ -397,9 +402,6 @@
this.shareTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.shareTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.psTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.psTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.advColorDialog = new DS4Windows.AdvancedColorDialog(); this.advColorDialog = new DS4Windows.AdvancedColorDialog();
this.squStickTabPage = new System.Windows.Forms.TabPage();
this.lsSquStickCk = new System.Windows.Forms.CheckBox();
this.rsSquStickCk = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.nUDRainbow)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDRainbow)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tBBlueBar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tBBlueBar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tBGreenBar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tBGreenBar)).BeginInit();
@ -471,6 +473,7 @@
((System.ComponentModel.ISupportInitialize)(this.nUDL2Maxzone)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDL2Maxzone)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDRSMaxZone)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDRSMaxZone)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDLSMaxZone)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDLSMaxZone)).BeginInit();
this.squStickTabPage.SuspendLayout();
this.tPOutCurve.SuspendLayout(); this.tPOutCurve.SuspendLayout();
this.tPCurve.SuspendLayout(); this.tPCurve.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nUDLSCurve)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDLSCurve)).BeginInit();
@ -494,7 +497,6 @@
((System.ComponentModel.ISupportInitialize)(this.nUDSZS)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDSZS)).BeginInit();
this.cMGyroTriggers.SuspendLayout(); this.cMGyroTriggers.SuspendLayout();
this.cMTouchDisableInvert.SuspendLayout(); this.cMTouchDisableInvert.SuspendLayout();
this.squStickTabPage.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// lowColorChooserButton // lowColorChooserButton
@ -1316,6 +1318,8 @@
// gBOther // gBOther
// //
this.gBOther.BackColor = System.Drawing.SystemColors.Control; this.gBOther.BackColor = System.Drawing.SystemColors.Control;
this.gBOther.Controls.Add(this.OutContTypeCb);
this.gBOther.Controls.Add(this.label28);
this.gBOther.Controls.Add(this.btPollRateLabel); this.gBOther.Controls.Add(this.btPollRateLabel);
this.gBOther.Controls.Add(this.btPollRateComboBox); this.gBOther.Controls.Add(this.btPollRateComboBox);
this.gBOther.Controls.Add(this.enableTouchToggleCheckbox); this.gBOther.Controls.Add(this.enableTouchToggleCheckbox);
@ -1337,6 +1341,21 @@
this.gBOther.Name = "gBOther"; this.gBOther.Name = "gBOther";
this.gBOther.TabStop = false; this.gBOther.TabStop = false;
// //
// OutContTypeCb
//
this.OutContTypeCb.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.OutContTypeCb.FormattingEnabled = true;
this.OutContTypeCb.Items.AddRange(new object[] {
resources.GetString("OutContTypeCb.Items"),
resources.GetString("OutContTypeCb.Items1")});
resources.ApplyResources(this.OutContTypeCb, "OutContTypeCb");
this.OutContTypeCb.Name = "OutContTypeCb";
//
// label28
//
resources.ApplyResources(this.label28, "label28");
this.label28.Name = "label28";
//
// btPollRateLabel // btPollRateLabel
// //
resources.ApplyResources(this.btPollRateLabel, "btPollRateLabel"); resources.ApplyResources(this.btPollRateLabel, "btPollRateLabel");
@ -3186,6 +3205,28 @@
resources.ApplyResources(this.label5, "label5"); resources.ApplyResources(this.label5, "label5");
this.label5.Name = "label5"; this.label5.Name = "label5";
// //
// squStickTabPage
//
this.squStickTabPage.Controls.Add(this.rsSquStickCk);
this.squStickTabPage.Controls.Add(this.lsSquStickCk);
resources.ApplyResources(this.squStickTabPage, "squStickTabPage");
this.squStickTabPage.Name = "squStickTabPage";
this.squStickTabPage.UseVisualStyleBackColor = true;
//
// rsSquStickCk
//
resources.ApplyResources(this.rsSquStickCk, "rsSquStickCk");
this.rsSquStickCk.Name = "rsSquStickCk";
this.rsSquStickCk.UseVisualStyleBackColor = true;
this.rsSquStickCk.Click += new System.EventHandler(this.rsSquStickCk_Click);
//
// lsSquStickCk
//
resources.ApplyResources(this.lsSquStickCk, "lsSquStickCk");
this.lsSquStickCk.Name = "lsSquStickCk";
this.lsSquStickCk.UseVisualStyleBackColor = true;
this.lsSquStickCk.Click += new System.EventHandler(this.lsSquStickCk_Click);
//
// tPOutCurve // tPOutCurve
// //
this.tPOutCurve.BackColor = System.Drawing.SystemColors.Control; this.tPOutCurve.BackColor = System.Drawing.SystemColors.Control;
@ -4232,28 +4273,6 @@
resources.ApplyResources(this.psTouchInvStripMenuItem, "psTouchInvStripMenuItem"); resources.ApplyResources(this.psTouchInvStripMenuItem, "psTouchInvStripMenuItem");
this.psTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged); this.psTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged);
// //
// squStickTabPage
//
this.squStickTabPage.Controls.Add(this.rsSquStickCk);
this.squStickTabPage.Controls.Add(this.lsSquStickCk);
resources.ApplyResources(this.squStickTabPage, "squStickTabPage");
this.squStickTabPage.Name = "squStickTabPage";
this.squStickTabPage.UseVisualStyleBackColor = true;
//
// lsSquStickCk
//
resources.ApplyResources(this.lsSquStickCk, "lsSquStickCk");
this.lsSquStickCk.Name = "lsSquStickCk";
this.lsSquStickCk.UseVisualStyleBackColor = true;
this.lsSquStickCk.Click += new System.EventHandler(this.lsSquStickCk_Click);
//
// rsSquStickCk
//
resources.ApplyResources(this.rsSquStickCk, "rsSquStickCk");
this.rsSquStickCk.Name = "rsSquStickCk";
this.rsSquStickCk.UseVisualStyleBackColor = true;
this.rsSquStickCk.Click += new System.EventHandler(this.rsSquStickCk_Click);
//
// Options // Options
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
@ -4349,6 +4368,7 @@
((System.ComponentModel.ISupportInitialize)(this.nUDL2Maxzone)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDL2Maxzone)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDRSMaxZone)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDRSMaxZone)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDLSMaxZone)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDLSMaxZone)).EndInit();
this.squStickTabPage.ResumeLayout(false);
this.tPOutCurve.ResumeLayout(false); this.tPOutCurve.ResumeLayout(false);
this.tPOutCurve.PerformLayout(); this.tPOutCurve.PerformLayout();
this.tPCurve.ResumeLayout(false); this.tPCurve.ResumeLayout(false);
@ -4378,7 +4398,6 @@
((System.ComponentModel.ISupportInitialize)(this.nUDSZS)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nUDSZS)).EndInit();
this.cMGyroTriggers.ResumeLayout(false); this.cMGyroTriggers.ResumeLayout(false);
this.cMTouchDisableInvert.ResumeLayout(false); this.cMTouchDisableInvert.ResumeLayout(false);
this.squStickTabPage.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -4757,5 +4776,7 @@
private System.Windows.Forms.TabPage squStickTabPage; private System.Windows.Forms.TabPage squStickTabPage;
private System.Windows.Forms.CheckBox rsSquStickCk; private System.Windows.Forms.CheckBox rsSquStickCk;
private System.Windows.Forms.CheckBox lsSquStickCk; private System.Windows.Forms.CheckBox lsSquStickCk;
private System.Windows.Forms.ComboBox OutContTypeCb;
private System.Windows.Forms.Label label28;
} }
} }

View File

@ -34,6 +34,7 @@ namespace DS4Windows
private Bitmap pnlControllerBgImg; private Bitmap pnlControllerBgImg;
private Bitmap btnLightBgImg; private Bitmap btnLightBgImg;
private Bitmap btnLightBg; private Bitmap btnLightBg;
private OutContType devOutContType = OutContType.X360;
int tempInt = 0; int tempInt = 0;
@ -307,6 +308,8 @@ namespace DS4Windows
LoadProfile(device, false, Program.rootHub); LoadProfile(device, false, Program.rootHub);
devOutContType = Global.OutContType[device];
if (Rainbow[device] == 0) if (Rainbow[device] == 0)
{ {
btnRainbow.Image = greyscale; btnRainbow.Image = greyscale;
@ -728,6 +731,15 @@ namespace DS4Windows
int idxSASteeringWheelEmulationRange = cBSteeringWheelEmulationRange.Items.IndexOf(GetSASteeringWheelEmulationRange(device).ToString()); int idxSASteeringWheelEmulationRange = cBSteeringWheelEmulationRange.Items.IndexOf(GetSASteeringWheelEmulationRange(device).ToString());
if (idxSASteeringWheelEmulationRange >= 0) cBSteeringWheelEmulationRange.SelectedIndex = idxSASteeringWheelEmulationRange; if (idxSASteeringWheelEmulationRange >= 0) cBSteeringWheelEmulationRange.SelectedIndex = idxSASteeringWheelEmulationRange;
OutContType tempOutType = Global.OutContType[device];
switch(tempOutType)
{
case OutContType.X360: OutContTypeCb.SelectedIndex = 0; break;
case OutContType.DS4: OutContTypeCb.SelectedIndex = 1; break;
default: break;
}
} }
else else
{ {
@ -853,6 +865,7 @@ namespace DS4Windows
triggerCondAndCombo.SelectedIndex = 0; triggerCondAndCombo.SelectedIndex = 0;
cBSteeringWheelEmulationAxis.SelectedIndex = 0; cBSteeringWheelEmulationAxis.SelectedIndex = 0;
cBSteeringWheelEmulationRange.SelectedIndex = cBSteeringWheelEmulationRange.Items.IndexOf("360"); cBSteeringWheelEmulationRange.SelectedIndex = cBSteeringWheelEmulationRange.Items.IndexOf("360");
OutContTypeCb.SelectedIndex = 0;
Set(); Set();
} }
@ -1334,6 +1347,20 @@ namespace DS4Windows
if (nUDRainbow.Value == 0) btnRainbow.Image = greyscale; if (nUDRainbow.Value == 0) btnRainbow.Image = greyscale;
else btnRainbow.Image = colored; else btnRainbow.Image = colored;
int tempOutCont = OutContTypeCb.SelectedIndex;
OutContType tempType = OutContType.X360;
switch(tempOutCont)
{
case 0: tempType = OutContType.X360; break;
case 1: tempType = OutContType.DS4; break;
default: break;
}
if (devOutContType != tempType)
{
Global.OutContType[device] = tempType;
}
} }
private void Show_ControlsBtn(object sender, EventArgs e) private void Show_ControlsBtn(object sender, EventArgs e)

File diff suppressed because it is too large Load Diff