DS4Windows no longer crashes if no source games are installed (ie shinra's crash)

Auto profile has more ways to add programs, add origin games if installed, and start menu programs
You can also add by shortcuts (.lnk)
Auto Profiles now work by the foreground program
DS4Windows no longer checks for driver at start, will help speed up DS4's connection when starting up with windows.
Welcome to DS4Windows Window is now an option in the Settings Tab, will automatically show up if mine or DSDCS was never started before.
Touchpad scrolling reworked via electrobrains newest build
Idle Timeout has a checkbox, also small UI fixes
This commit is contained in:
jays2kings 2014-06-08 19:41:36 -04:00
parent 107d71ef04
commit d11b15d073
12 changed files with 834 additions and 440 deletions

View File

@ -33,7 +33,6 @@ namespace DS4Control
public virtual void touchesMoved(object sender, TouchpadEventArgs arg)
{
cursor.touchesMoved(arg);
if (Math.Abs(firstTouch.hwY - arg.touches[0].hwY) > 5)
wheel.touchesMoved(arg);
if (Math.Abs(firstTouch.hwY - arg.touches[0].hwY) < 50)
if (arg.touches.Length == 2)

View File

@ -33,8 +33,8 @@ namespace DS4Control
Touch T1 = arg.touches[1];
//mouse wheel 120 == 1 wheel click according to Windows API
int lastMidX = (lastT0.hwX + lastT1.hwX) / 2, lastMidY = (lastT0.hwY + lastT1.hwY) / 2,
currentMidX = (T0.hwX + T1.hwX) / 2, currentMidY = (T0.hwY + T1.hwY) / 2;
double lastMidX = (lastT0.hwX + lastT1.hwX) / 2d, lastMidY = (lastT0.hwY + lastT1.hwY) / 2d,
currentMidX = (T0.hwX + T1.hwX) / 2d, currentMidY = (T0.hwY + T1.hwY) / 2d;
double coefficient = Global.getScrollSensitivity(deviceNumber);
// Adjust for touch distance: "standard" distance is 960 pixels, i.e. half the width. Scroll farther if fingers are farther apart, and vice versa, in linear proportion.
double touchXDistance = T1.hwX - T0.hwX, touchYDistance = T1.hwY - T0.hwY, touchDistance = Math.Sqrt(touchXDistance * touchXDistance + touchYDistance * touchYDistance);

View File

@ -81,6 +81,7 @@ namespace DS4Control
{
protected static BackingStore m_Config = new BackingStore();
protected static Int32 m_IdleTimeout = 600000;
//public static string appdatapath = Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName;
public static string appdatapath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\DS4Tool";
public static event EventHandler<EventArgs> ControllerStatusChange; // called when a controller is added/removed/battery or touchpad mode changes/etc.
public static void ControllerStatusChanged(object sender)
@ -533,7 +534,7 @@ namespace DS4Control
public class BackingStore
{
protected String m_Profile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\DS4Tool\\Profiles.xml";
protected String m_Profile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\DS4Tool" + "\\Profiles.xml";
protected XmlDocument m_Xdoc = new XmlDocument();
//fifth value used to for options, not fifth controller
public int[] buttonMouseSensitivity = { 25, 25, 25, 25, 25 };

View File

@ -250,6 +250,17 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<COMReference Include="IWshRuntimeLibrary">
<Guid>{F935DC20-1CF0-11D0-ADB9-00C04FD58A0B}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@ -68,7 +68,7 @@
this.lBControlTip = new System.Windows.Forms.Label();
this.lBControls = new System.Windows.Forms.ListBox();
this.lowColorChooserButton = new System.Windows.Forms.Button();
this.numUDRainbow = new System.Windows.Forms.NumericUpDown();
this.nUDRainbow = new System.Windows.Forms.NumericUpDown();
this.pBRainbow = new System.Windows.Forms.PictureBox();
this.blueBar = new System.Windows.Forms.TrackBar();
this.greenBar = new System.Windows.Forms.TrackBar();
@ -80,20 +80,19 @@
this.lBRed = new System.Windows.Forms.Label();
this.cBDoubleTap = new System.Windows.Forms.CheckBox();
this.cBTap = new System.Windows.Forms.CheckBox();
this.numUDTap = new System.Windows.Forms.NumericUpDown();
this.nUDTap = new System.Windows.Forms.NumericUpDown();
this.cBScroll = new System.Windows.Forms.CheckBox();
this.cBSlide = new System.Windows.Forms.CheckBox();
this.numUDScroll = new System.Windows.Forms.NumericUpDown();
this.numUDTouch = new System.Windows.Forms.NumericUpDown();
this.nUDScroll = new System.Windows.Forms.NumericUpDown();
this.nUDTouch = new System.Windows.Forms.NumericUpDown();
this.lBButtonMouseSens = new System.Windows.Forms.Label();
this.cBlowerRCOn = new System.Windows.Forms.CheckBox();
this.touchpadJitterCompensation = new System.Windows.Forms.CheckBox();
this.lBL2 = new System.Windows.Forms.Label();
this.lBR2 = new System.Windows.Forms.Label();
this.lBControllerOff = new System.Windows.Forms.Label();
this.lBIdleMinutes = new System.Windows.Forms.Label();
this.idleDisconnectTimeout = new System.Windows.Forms.NumericUpDown();
this.numUDR2 = new System.Windows.Forms.NumericUpDown();
this.nUDIdleDisconnect = new System.Windows.Forms.NumericUpDown();
this.nUDR2 = new System.Windows.Forms.NumericUpDown();
this.tBsixaxisAccelZ = new System.Windows.Forms.TrackBar();
this.flushHIDQueue = new System.Windows.Forms.CheckBox();
this.tBsixaxisAccelY = new System.Windows.Forms.TrackBar();
@ -104,11 +103,11 @@
this.rumbleBoostLabel = new System.Windows.Forms.Label();
this.tBsixaxisGyroY = new System.Windows.Forms.TrackBar();
this.tBsixaxisGyroX = new System.Windows.Forms.TrackBar();
this.rumbleBoostBar = new System.Windows.Forms.NumericUpDown();
this.nUDRumbleBoost = new System.Windows.Forms.NumericUpDown();
this.lB6Accel = new System.Windows.Forms.Label();
this.numUDHeavyRumble = new System.Windows.Forms.NumericUpDown();
this.nUDHeavyRumble = new System.Windows.Forms.NumericUpDown();
this.lB6Gryo = new System.Windows.Forms.Label();
this.numUDLightRumble = new System.Windows.Forms.NumericUpDown();
this.nUDLightRumble = new System.Windows.Forms.NumericUpDown();
this.btnRumbleTest = new System.Windows.Forms.Button();
this.lbFull = new System.Windows.Forms.Label();
this.lBLowRed = new System.Windows.Forms.Label();
@ -126,14 +125,18 @@
this.btnSaveProfile = new System.Windows.Forms.Button();
this.lbRS = new System.Windows.Forms.Label();
this.lbLS = new System.Windows.Forms.Label();
this.numUDRS = new System.Windows.Forms.NumericUpDown();
this.nUDRS = new System.Windows.Forms.NumericUpDown();
this.numUDMouseSens = new System.Windows.Forms.NumericUpDown();
this.numUDLS = new System.Windows.Forms.NumericUpDown();
this.numUDL2 = new System.Windows.Forms.NumericUpDown();
this.nUDLS = new System.Windows.Forms.NumericUpDown();
this.nUDL2 = new System.Windows.Forms.NumericUpDown();
this.gBTouchpad = new System.Windows.Forms.GroupBox();
this.gBOther = new System.Windows.Forms.GroupBox();
this.nUDSixaxis = new System.Windows.Forms.NumericUpDown();
this.cBControllerInput = new System.Windows.Forms.CheckBox();
this.nUDHideMouse = new System.Windows.Forms.NumericUpDown();
this.cBHideCursor = new System.Windows.Forms.CheckBox();
this.cBIdleDisconnect = new System.Windows.Forms.CheckBox();
this.lBMouseMins = new System.Windows.Forms.Label();
this.gBLightbar = new System.Windows.Forms.GroupBox();
this.btnChargingColor = new System.Windows.Forms.Button();
this.rBColor = new System.Windows.Forms.RadioButton();
@ -152,38 +155,39 @@
((System.ComponentModel.ISupportInitialize)(this.pBController)).BeginInit();
this.SticksPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pBSticks)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numUDRainbow)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDRainbow)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pBRainbow)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.blueBar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.greenBar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.redBar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numUDTap)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numUDScroll)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numUDTouch)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.idleDisconnectTimeout)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numUDR2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDTap)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDScroll)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDTouch)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDIdleDisconnect)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDR2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisAccelZ)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisAccelY)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisAccelX)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisGyroZ)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisGyroY)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisGyroX)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rumbleBoostBar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numUDHeavyRumble)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numUDLightRumble)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDRumbleBoost)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDHeavyRumble)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDLightRumble)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.lowRedBar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.lowGreenBar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.lowBlueBar)).BeginInit();
this.FullPanel.SuspendLayout();
this.lowBatteryPanel.SuspendLayout();
this.SixaxisPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numUDRS)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDRS)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numUDMouseSens)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numUDLS)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numUDL2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDLS)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDL2)).BeginInit();
this.gBTouchpad.SuspendLayout();
this.gBOther.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nUDSixaxis)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDHideMouse)).BeginInit();
this.gBLightbar.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nUDflashLED)).BeginInit();
this.gBRumble.SuspendLayout();
@ -952,18 +956,18 @@
this.lowColorChooserButton.UseVisualStyleBackColor = false;
this.lowColorChooserButton.Click += new System.EventHandler(this.lowColorChooserButton_Click);
//
// numUDRainbow
// nUDRainbow
//
this.numUDRainbow.Location = new System.Drawing.Point(181, 16);
this.numUDRainbow.Maximum = new decimal(new int[] {
this.nUDRainbow.Location = new System.Drawing.Point(181, 16);
this.nUDRainbow.Maximum = new decimal(new int[] {
60,
0,
0,
0});
this.numUDRainbow.Name = "numUDRainbow";
this.numUDRainbow.Size = new System.Drawing.Size(39, 20);
this.numUDRainbow.TabIndex = 167;
this.numUDRainbow.ValueChanged += new System.EventHandler(this.numUDRainbow_ValueChanged);
this.nUDRainbow.Name = "nUDRainbow";
this.nUDRainbow.Size = new System.Drawing.Size(39, 20);
this.nUDRainbow.TabIndex = 167;
this.nUDRainbow.ValueChanged += new System.EventHandler(this.numUDRainbow_ValueChanged);
//
// pBRainbow
//
@ -1076,12 +1080,12 @@
this.cBDoubleTap.AutoSize = true;
this.cBDoubleTap.Checked = true;
this.cBDoubleTap.CheckState = System.Windows.Forms.CheckState.Checked;
this.cBDoubleTap.Location = new System.Drawing.Point(360, 12);
this.cBDoubleTap.Location = new System.Drawing.Point(357, 17);
this.cBDoubleTap.Name = "cBDoubleTap";
this.cBDoubleTap.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.cBDoubleTap.Size = new System.Drawing.Size(60, 30);
this.cBDoubleTap.Size = new System.Drawing.Size(82, 17);
this.cBDoubleTap.TabIndex = 226;
this.cBDoubleTap.Text = "Double\r\nTap";
this.cBDoubleTap.Text = "Double Tap";
this.cBDoubleTap.UseVisualStyleBackColor = true;
this.cBDoubleTap.CheckedChanged += new System.EventHandler(this.cBDoubleTap_CheckedChanged);
//
@ -1090,7 +1094,7 @@
this.cBTap.AutoSize = true;
this.cBTap.Checked = true;
this.cBTap.CheckState = System.Windows.Forms.CheckState.Checked;
this.cBTap.Location = new System.Drawing.Point(329, 47);
this.cBTap.Location = new System.Drawing.Point(326, 47);
this.cBTap.Name = "cBTap";
this.cBTap.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.cBTap.Size = new System.Drawing.Size(45, 17);
@ -1099,23 +1103,23 @@
this.cBTap.UseVisualStyleBackColor = true;
this.cBTap.CheckedChanged += new System.EventHandler(this.cBTap_CheckedChanged);
//
// numUDTap
// nUDTap
//
this.numUDTap.Location = new System.Drawing.Point(380, 46);
this.numUDTap.Maximum = new decimal(new int[] {
this.nUDTap.Location = new System.Drawing.Point(377, 46);
this.nUDTap.Maximum = new decimal(new int[] {
200,
0,
0,
0});
this.numUDTap.Name = "numUDTap";
this.numUDTap.Size = new System.Drawing.Size(40, 20);
this.numUDTap.TabIndex = 227;
this.numUDTap.Value = new decimal(new int[] {
this.nUDTap.Name = "nUDTap";
this.nUDTap.Size = new System.Drawing.Size(40, 20);
this.nUDTap.TabIndex = 227;
this.nUDTap.Value = new decimal(new int[] {
100,
0,
0,
0});
this.numUDTap.ValueChanged += new System.EventHandler(this.numUDTap_ValueChanged);
this.nUDTap.ValueChanged += new System.EventHandler(this.numUDTap_ValueChanged);
//
// cBScroll
//
@ -1145,51 +1149,51 @@
this.cBSlide.UseVisualStyleBackColor = true;
this.cBSlide.CheckedChanged += new System.EventHandler(this.cBSlide_CheckedChanged);
//
// numUDScroll
// nUDScroll
//
this.numUDScroll.Location = new System.Drawing.Point(234, 46);
this.numUDScroll.Maximum = new decimal(new int[] {
this.nUDScroll.Location = new System.Drawing.Point(234, 46);
this.nUDScroll.Maximum = new decimal(new int[] {
10,
0,
0,
0});
this.numUDScroll.Minimum = new decimal(new int[] {
this.nUDScroll.Minimum = new decimal(new int[] {
10,
0,
0,
-2147483648});
this.numUDScroll.Name = "numUDScroll";
this.numUDScroll.Size = new System.Drawing.Size(40, 20);
this.numUDScroll.TabIndex = 228;
this.numUDScroll.Value = new decimal(new int[] {
this.nUDScroll.Name = "nUDScroll";
this.nUDScroll.Size = new System.Drawing.Size(40, 20);
this.nUDScroll.TabIndex = 228;
this.nUDScroll.Value = new decimal(new int[] {
5,
0,
0,
0});
this.numUDScroll.ValueChanged += new System.EventHandler(this.numUDScroll_ValueChanged);
this.nUDScroll.ValueChanged += new System.EventHandler(this.numUDScroll_ValueChanged);
//
// numUDTouch
// nUDTouch
//
this.numUDTouch.Location = new System.Drawing.Point(62, 46);
this.numUDTouch.Maximum = new decimal(new int[] {
this.nUDTouch.Location = new System.Drawing.Point(62, 46);
this.nUDTouch.Maximum = new decimal(new int[] {
150,
0,
0,
0});
this.numUDTouch.Name = "numUDTouch";
this.numUDTouch.Size = new System.Drawing.Size(40, 20);
this.numUDTouch.TabIndex = 229;
this.numUDTouch.Value = new decimal(new int[] {
this.nUDTouch.Name = "nUDTouch";
this.nUDTouch.Size = new System.Drawing.Size(40, 20);
this.nUDTouch.TabIndex = 229;
this.nUDTouch.Value = new decimal(new int[] {
100,
0,
0,
0});
this.numUDTouch.ValueChanged += new System.EventHandler(this.numUDTouch_ValueChanged);
this.nUDTouch.ValueChanged += new System.EventHandler(this.numUDTouch_ValueChanged);
//
// lBButtonMouseSens
//
this.lBButtonMouseSens.AutoSize = true;
this.lBButtonMouseSens.Location = new System.Drawing.Point(11, 16);
this.lBButtonMouseSens.Location = new System.Drawing.Point(5, 18);
this.lBButtonMouseSens.Name = "lBButtonMouseSens";
this.lBButtonMouseSens.Size = new System.Drawing.Size(92, 13);
this.lBButtonMouseSens.TabIndex = 206;
@ -1199,7 +1203,7 @@
// cBlowerRCOn
//
this.cBlowerRCOn.AutoSize = true;
this.cBlowerRCOn.Location = new System.Drawing.Point(218, 12);
this.cBlowerRCOn.Location = new System.Drawing.Point(218, 10);
this.cBlowerRCOn.Name = "cBlowerRCOn";
this.cBlowerRCOn.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.cBlowerRCOn.Size = new System.Drawing.Size(100, 30);
@ -1213,12 +1217,12 @@
this.touchpadJitterCompensation.AutoSize = true;
this.touchpadJitterCompensation.Checked = true;
this.touchpadJitterCompensation.CheckState = System.Windows.Forms.CheckState.Checked;
this.touchpadJitterCompensation.Location = new System.Drawing.Point(42, 12);
this.touchpadJitterCompensation.Location = new System.Drawing.Point(42, 17);
this.touchpadJitterCompensation.Name = "touchpadJitterCompensation";
this.touchpadJitterCompensation.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.touchpadJitterCompensation.Size = new System.Drawing.Size(93, 30);
this.touchpadJitterCompensation.Size = new System.Drawing.Size(118, 17);
this.touchpadJitterCompensation.TabIndex = 224;
this.touchpadJitterCompensation.Text = "Jitter\r\nCompensation";
this.touchpadJitterCompensation.Text = "Jitter Compensation";
this.touchpadJitterCompensation.UseVisualStyleBackColor = true;
this.touchpadJitterCompensation.CheckedChanged += new System.EventHandler(this.touchpadJitterCompensation_CheckedChanged);
//
@ -1240,56 +1244,47 @@
this.lBR2.TabIndex = 197;
this.lBR2.Text = "R2";
//
// lBControllerOff
//
this.lBControllerOff.AutoSize = true;
this.lBControllerOff.Location = new System.Drawing.Point(11, 44);
this.lBControllerOff.Name = "lBControllerOff";
this.lBControllerOff.Size = new System.Drawing.Size(84, 13);
this.lBControllerOff.TabIndex = 199;
this.lBControllerOff.Text = "Idle Disconnect:";
//
// lBIdleMinutes
//
this.lBIdleMinutes.AutoSize = true;
this.lBIdleMinutes.Location = new System.Drawing.Point(165, 46);
this.lBIdleMinutes.Location = new System.Drawing.Point(164, 49);
this.lBIdleMinutes.Name = "lBIdleMinutes";
this.lBIdleMinutes.Size = new System.Drawing.Size(106, 13);
this.lBIdleMinutes.Size = new System.Drawing.Size(28, 13);
this.lBIdleMinutes.TabIndex = 200;
this.lBIdleMinutes.Text = "minutes (0 to disable)";
this.lBIdleMinutes.Text = "mins";
//
// idleDisconnectTimeout
// nUDIdleDisconnect
//
this.idleDisconnectTimeout.DecimalPlaces = 1;
this.idleDisconnectTimeout.Location = new System.Drawing.Point(109, 44);
this.idleDisconnectTimeout.Maximum = new decimal(new int[] {
this.nUDIdleDisconnect.DecimalPlaces = 1;
this.nUDIdleDisconnect.Location = new System.Drawing.Point(108, 46);
this.nUDIdleDisconnect.Maximum = new decimal(new int[] {
60,
0,
0,
0});
this.idleDisconnectTimeout.Name = "idleDisconnectTimeout";
this.idleDisconnectTimeout.Size = new System.Drawing.Size(50, 20);
this.idleDisconnectTimeout.TabIndex = 201;
this.idleDisconnectTimeout.ValueChanged += new System.EventHandler(this.idleDisconnectTimeout_ValueChanged);
this.nUDIdleDisconnect.Name = "nUDIdleDisconnect";
this.nUDIdleDisconnect.Size = new System.Drawing.Size(50, 20);
this.nUDIdleDisconnect.TabIndex = 201;
this.nUDIdleDisconnect.ValueChanged += new System.EventHandler(this.nUDIdleDisconnect_ValueChanged);
//
// numUDR2
// nUDR2
//
this.numUDR2.DecimalPlaces = 2;
this.numUDR2.Increment = new decimal(new int[] {
this.nUDR2.DecimalPlaces = 2;
this.nUDR2.Increment = new decimal(new int[] {
1,
0,
0,
65536});
this.numUDR2.Location = new System.Drawing.Point(133, 15);
this.numUDR2.Maximum = new decimal(new int[] {
this.nUDR2.Location = new System.Drawing.Point(133, 15);
this.nUDR2.Maximum = new decimal(new int[] {
1,
0,
0,
0});
this.numUDR2.Name = "numUDR2";
this.numUDR2.Size = new System.Drawing.Size(50, 20);
this.numUDR2.TabIndex = 202;
this.numUDR2.ValueChanged += new System.EventHandler(this.numUDR2_ValueChanged);
this.nUDR2.Name = "nUDR2";
this.nUDR2.Size = new System.Drawing.Size(50, 20);
this.nUDR2.TabIndex = 202;
this.nUDR2.ValueChanged += new System.EventHandler(this.numUDR2_ValueChanged);
//
// tBsixaxisAccelZ
//
@ -1308,12 +1303,12 @@
//
this.flushHIDQueue.AccessibleName = "flushHIDQueue";
this.flushHIDQueue.AutoSize = true;
this.flushHIDQueue.Location = new System.Drawing.Point(302, 39);
this.flushHIDQueue.Location = new System.Drawing.Point(306, 45);
this.flushHIDQueue.Name = "flushHIDQueue";
this.flushHIDQueue.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.flushHIDQueue.Size = new System.Drawing.Size(112, 30);
this.flushHIDQueue.Size = new System.Drawing.Size(73, 17);
this.flushHIDQueue.TabIndex = 198;
this.flushHIDQueue.Text = "Flush HID queue \r\nafter each reading";
this.flushHIDQueue.Text = "Flush HID\r\n";
this.flushHIDQueue.UseVisualStyleBackColor = true;
this.flushHIDQueue.CheckedChanged += new System.EventHandler(this.flushHIDQueue_CheckedChanged);
//
@ -1409,23 +1404,23 @@
this.tBsixaxisGyroX.TabIndex = 222;
this.tBsixaxisGyroX.TickFrequency = 16384;
//
// rumbleBoostBar
// nUDRumbleBoost
//
this.rumbleBoostBar.Location = new System.Drawing.Point(46, 14);
this.rumbleBoostBar.Maximum = new decimal(new int[] {
this.nUDRumbleBoost.Location = new System.Drawing.Point(46, 14);
this.nUDRumbleBoost.Maximum = new decimal(new int[] {
200,
0,
0,
0});
this.rumbleBoostBar.Name = "rumbleBoostBar";
this.rumbleBoostBar.Size = new System.Drawing.Size(52, 20);
this.rumbleBoostBar.TabIndex = 211;
this.rumbleBoostBar.Value = new decimal(new int[] {
this.nUDRumbleBoost.Name = "nUDRumbleBoost";
this.nUDRumbleBoost.Size = new System.Drawing.Size(52, 20);
this.nUDRumbleBoost.TabIndex = 211;
this.nUDRumbleBoost.Value = new decimal(new int[] {
100,
0,
0,
0});
this.rumbleBoostBar.ValueChanged += new System.EventHandler(this.rumbleBoostBar_ValueChanged);
this.nUDRumbleBoost.ValueChanged += new System.EventHandler(this.rumbleBoostBar_ValueChanged);
//
// lB6Accel
//
@ -1436,18 +1431,18 @@
this.lB6Accel.TabIndex = 215;
this.lB6Accel.Text = "Sixaxis Accel:";
//
// numUDHeavyRumble
// nUDHeavyRumble
//
this.numUDHeavyRumble.Location = new System.Drawing.Point(149, 43);
this.numUDHeavyRumble.Maximum = new decimal(new int[] {
this.nUDHeavyRumble.Location = new System.Drawing.Point(149, 43);
this.nUDHeavyRumble.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.numUDHeavyRumble.Name = "numUDHeavyRumble";
this.numUDHeavyRumble.Size = new System.Drawing.Size(52, 20);
this.numUDHeavyRumble.TabIndex = 212;
this.numUDHeavyRumble.ValueChanged += new System.EventHandler(this.numUDHeavyRumble_ValueChanged);
this.nUDHeavyRumble.Name = "nUDHeavyRumble";
this.nUDHeavyRumble.Size = new System.Drawing.Size(52, 20);
this.nUDHeavyRumble.TabIndex = 212;
this.nUDHeavyRumble.ValueChanged += new System.EventHandler(this.numUDHeavyRumble_ValueChanged);
//
// lB6Gryo
//
@ -1458,18 +1453,18 @@
this.lB6Gryo.TabIndex = 216;
this.lB6Gryo.Text = "Sixaxis Gyro:";
//
// numUDLightRumble
// nUDLightRumble
//
this.numUDLightRumble.Location = new System.Drawing.Point(46, 43);
this.numUDLightRumble.Maximum = new decimal(new int[] {
this.nUDLightRumble.Location = new System.Drawing.Point(46, 43);
this.nUDLightRumble.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.numUDLightRumble.Name = "numUDLightRumble";
this.numUDLightRumble.Size = new System.Drawing.Size(52, 20);
this.numUDLightRumble.TabIndex = 213;
this.numUDLightRumble.ValueChanged += new System.EventHandler(this.numUDLightRumble_ValueChanged);
this.nUDLightRumble.Name = "nUDLightRumble";
this.nUDLightRumble.Size = new System.Drawing.Size(52, 20);
this.nUDLightRumble.TabIndex = 213;
this.nUDLightRumble.ValueChanged += new System.EventHandler(this.numUDLightRumble_ValueChanged);
//
// btnRumbleTest
//
@ -1670,29 +1665,29 @@
this.lbLS.TabIndex = 196;
this.lbLS.Text = "LS";
//
// numUDRS
// nUDRS
//
this.numUDRS.DecimalPlaces = 2;
this.numUDRS.Increment = new decimal(new int[] {
this.nUDRS.DecimalPlaces = 2;
this.nUDRS.Increment = new decimal(new int[] {
1,
0,
0,
65536});
this.numUDRS.Location = new System.Drawing.Point(133, 43);
this.numUDRS.Maximum = new decimal(new int[] {
this.nUDRS.Location = new System.Drawing.Point(133, 43);
this.nUDRS.Maximum = new decimal(new int[] {
1,
0,
0,
0});
this.numUDRS.Name = "numUDRS";
this.numUDRS.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.numUDRS.Size = new System.Drawing.Size(50, 20);
this.numUDRS.TabIndex = 203;
this.numUDRS.ValueChanged += new System.EventHandler(this.numUDRS_ValueChanged);
this.nUDRS.Name = "nUDRS";
this.nUDRS.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.nUDRS.Size = new System.Drawing.Size(50, 20);
this.nUDRS.TabIndex = 203;
this.nUDRS.ValueChanged += new System.EventHandler(this.numUDRS_ValueChanged);
//
// numUDMouseSens
//
this.numUDMouseSens.Location = new System.Drawing.Point(109, 14);
this.numUDMouseSens.Location = new System.Drawing.Point(109, 16);
this.numUDMouseSens.Maximum = new decimal(new int[] {
255,
0,
@ -1708,45 +1703,45 @@
0});
this.numUDMouseSens.ValueChanged += new System.EventHandler(this.numUDMouseSens_ValueChanged);
//
// numUDLS
// nUDLS
//
this.numUDLS.DecimalPlaces = 2;
this.numUDLS.Increment = new decimal(new int[] {
this.nUDLS.DecimalPlaces = 2;
this.nUDLS.Increment = new decimal(new int[] {
1,
0,
0,
65536});
this.numUDLS.Location = new System.Drawing.Point(31, 44);
this.numUDLS.Maximum = new decimal(new int[] {
this.nUDLS.Location = new System.Drawing.Point(31, 44);
this.nUDLS.Maximum = new decimal(new int[] {
1,
0,
0,
0});
this.numUDLS.Name = "numUDLS";
this.numUDLS.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.numUDLS.Size = new System.Drawing.Size(50, 20);
this.numUDLS.TabIndex = 203;
this.numUDLS.ValueChanged += new System.EventHandler(this.numUDLS_ValueChanged);
this.nUDLS.Name = "nUDLS";
this.nUDLS.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.nUDLS.Size = new System.Drawing.Size(50, 20);
this.nUDLS.TabIndex = 203;
this.nUDLS.ValueChanged += new System.EventHandler(this.numUDLS_ValueChanged);
//
// numUDL2
// nUDL2
//
this.numUDL2.DecimalPlaces = 2;
this.numUDL2.Increment = new decimal(new int[] {
this.nUDL2.DecimalPlaces = 2;
this.nUDL2.Increment = new decimal(new int[] {
1,
0,
0,
65536});
this.numUDL2.Location = new System.Drawing.Point(31, 15);
this.numUDL2.Maximum = new decimal(new int[] {
this.nUDL2.Location = new System.Drawing.Point(31, 15);
this.nUDL2.Maximum = new decimal(new int[] {
1,
0,
0,
0});
this.numUDL2.Name = "numUDL2";
this.numUDL2.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.numUDL2.Size = new System.Drawing.Size(50, 20);
this.numUDL2.TabIndex = 203;
this.numUDL2.ValueChanged += new System.EventHandler(this.numUDL2_ValueChanged);
this.nUDL2.Name = "nUDL2";
this.nUDL2.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.nUDL2.Size = new System.Drawing.Size(50, 20);
this.nUDL2.TabIndex = 203;
this.nUDL2.ValueChanged += new System.EventHandler(this.numUDL2_ValueChanged);
//
// gBTouchpad
//
@ -1754,10 +1749,10 @@
this.gBTouchpad.Controls.Add(this.cBDoubleTap);
this.gBTouchpad.Controls.Add(this.cBlowerRCOn);
this.gBTouchpad.Controls.Add(this.cBSlide);
this.gBTouchpad.Controls.Add(this.numUDTouch);
this.gBTouchpad.Controls.Add(this.nUDTouch);
this.gBTouchpad.Controls.Add(this.cBTap);
this.gBTouchpad.Controls.Add(this.numUDScroll);
this.gBTouchpad.Controls.Add(this.numUDTap);
this.gBTouchpad.Controls.Add(this.nUDScroll);
this.gBTouchpad.Controls.Add(this.nUDTap);
this.gBTouchpad.Controls.Add(this.cBScroll);
this.gBTouchpad.Location = new System.Drawing.Point(440, 220);
this.gBTouchpad.Name = "gBTouchpad";
@ -1770,12 +1765,15 @@
//
this.gBOther.Controls.Add(this.nUDSixaxis);
this.gBOther.Controls.Add(this.cBControllerInput);
this.gBOther.Controls.Add(this.idleDisconnectTimeout);
this.gBOther.Controls.Add(this.nUDHideMouse);
this.gBOther.Controls.Add(this.nUDIdleDisconnect);
this.gBOther.Controls.Add(this.cBHideCursor);
this.gBOther.Controls.Add(this.cBIdleDisconnect);
this.gBOther.Controls.Add(this.lBButtonMouseSens);
this.gBOther.Controls.Add(this.numUDMouseSens);
this.gBOther.Controls.Add(this.lBMouseMins);
this.gBOther.Controls.Add(this.flushHIDQueue);
this.gBOther.Controls.Add(this.lBIdleMinutes);
this.gBOther.Controls.Add(this.lBControllerOff);
this.gBOther.Location = new System.Drawing.Point(7, 220);
this.gBOther.Name = "gBOther";
this.gBOther.Size = new System.Drawing.Size(421, 70);
@ -1785,7 +1783,7 @@
//
// nUDSixaxis
//
this.nUDSixaxis.Location = new System.Drawing.Point(386, 16);
this.nUDSixaxis.Location = new System.Drawing.Point(385, 16);
this.nUDSixaxis.Maximum = new decimal(new int[] {
4,
0,
@ -1810,14 +1808,66 @@
this.cBControllerInput.AutoSize = true;
this.cBControllerInput.Checked = true;
this.cBControllerInput.CheckState = System.Windows.Forms.CheckState.Checked;
this.cBControllerInput.Location = new System.Drawing.Point(187, 17);
this.cBControllerInput.Location = new System.Drawing.Point(266, 17);
this.cBControllerInput.Name = "cBControllerInput";
this.cBControllerInput.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.cBControllerInput.Size = new System.Drawing.Size(194, 17);
this.cBControllerInput.Size = new System.Drawing.Size(113, 17);
this.cBControllerInput.TabIndex = 242;
this.cBControllerInput.Text = "Use a controller to change mapping";
this.cBControllerInput.Text = "Use a DS4 to map";
this.cBControllerInput.UseVisualStyleBackColor = true;
//
// nUDHideMouse
//
this.nUDHideMouse.DecimalPlaces = 1;
this.nUDHideMouse.Location = new System.Drawing.Point(182, 14);
this.nUDHideMouse.Maximum = new decimal(new int[] {
60,
0,
0,
0});
this.nUDHideMouse.Name = "nUDHideMouse";
this.nUDHideMouse.Size = new System.Drawing.Size(50, 20);
this.nUDHideMouse.TabIndex = 201;
this.nUDHideMouse.Visible = false;
//
// cBHideCursor
//
this.cBHideCursor.AutoSize = true;
this.cBHideCursor.Checked = true;
this.cBHideCursor.CheckState = System.Windows.Forms.CheckState.Checked;
this.cBHideCursor.Location = new System.Drawing.Point(167, 14);
this.cBHideCursor.Name = "cBHideCursor";
this.cBHideCursor.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.cBHideCursor.Size = new System.Drawing.Size(105, 17);
this.cBHideCursor.TabIndex = 232;
this.cBHideCursor.Text = "Hide Cursor after";
this.cBHideCursor.UseVisualStyleBackColor = true;
this.cBHideCursor.Visible = false;
//
// cBIdleDisconnect
//
this.cBIdleDisconnect.AutoSize = true;
this.cBIdleDisconnect.Checked = true;
this.cBIdleDisconnect.CheckState = System.Windows.Forms.CheckState.Checked;
this.cBIdleDisconnect.Location = new System.Drawing.Point(6, 47);
this.cBIdleDisconnect.Name = "cBIdleDisconnect";
this.cBIdleDisconnect.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.cBIdleDisconnect.Size = new System.Drawing.Size(100, 17);
this.cBIdleDisconnect.TabIndex = 232;
this.cBIdleDisconnect.Text = "Idle Disconnect";
this.cBIdleDisconnect.UseVisualStyleBackColor = true;
this.cBIdleDisconnect.CheckedChanged += new System.EventHandler(this.cBIdleDisconnect_CheckedChanged);
//
// lBMouseMins
//
this.lBMouseMins.AutoSize = true;
this.lBMouseMins.Location = new System.Drawing.Point(205, 21);
this.lBMouseMins.Name = "lBMouseMins";
this.lBMouseMins.Size = new System.Drawing.Size(28, 13);
this.lBMouseMins.TabIndex = 200;
this.lBMouseMins.Text = "mins";
this.lBMouseMins.Visible = false;
//
// gBLightbar
//
this.gBLightbar.Controls.Add(this.btnChargingColor);
@ -1831,7 +1881,7 @@
this.gBLightbar.Controls.Add(this.pBRainbow);
this.gBLightbar.Controls.Add(this.lowBatteryPanel);
this.gBLightbar.Controls.Add(this.nUDflashLED);
this.gBLightbar.Controls.Add(this.numUDRainbow);
this.gBLightbar.Controls.Add(this.nUDRainbow);
this.gBLightbar.Controls.Add(this.FullPanel);
this.gBLightbar.Controls.Add(this.lBspc);
this.gBLightbar.Controls.Add(this.batteryLed);
@ -1944,12 +1994,12 @@
// gBRumble
//
this.gBRumble.Controls.Add(this.rumbleBoostLabel);
this.gBRumble.Controls.Add(this.numUDHeavyRumble);
this.gBRumble.Controls.Add(this.nUDHeavyRumble);
this.gBRumble.Controls.Add(this.btnRumbleTest);
this.gBRumble.Controls.Add(this.leftMotorLabel);
this.gBRumble.Controls.Add(this.numUDLightRumble);
this.gBRumble.Controls.Add(this.nUDLightRumble);
this.gBRumble.Controls.Add(this.rightMotorLabel);
this.gBRumble.Controls.Add(this.rumbleBoostBar);
this.gBRumble.Controls.Add(this.nUDRumbleBoost);
this.gBRumble.Location = new System.Drawing.Point(442, 3);
this.gBRumble.Name = "gBRumble";
this.gBRumble.Size = new System.Drawing.Size(213, 67);
@ -1960,13 +2010,13 @@
// gBDeadzone
//
this.gBDeadzone.Controls.Add(this.lBL2);
this.gBDeadzone.Controls.Add(this.numUDL2);
this.gBDeadzone.Controls.Add(this.nUDL2);
this.gBDeadzone.Controls.Add(this.lBR2);
this.gBDeadzone.Controls.Add(this.lbRS);
this.gBDeadzone.Controls.Add(this.lbLS);
this.gBDeadzone.Controls.Add(this.numUDRS);
this.gBDeadzone.Controls.Add(this.numUDR2);
this.gBDeadzone.Controls.Add(this.numUDLS);
this.gBDeadzone.Controls.Add(this.nUDRS);
this.gBDeadzone.Controls.Add(this.nUDR2);
this.gBDeadzone.Controls.Add(this.nUDLS);
this.gBDeadzone.Location = new System.Drawing.Point(684, 3);
this.gBDeadzone.Name = "gBDeadzone";
this.gBDeadzone.Size = new System.Drawing.Size(194, 67);
@ -2025,25 +2075,25 @@
((System.ComponentModel.ISupportInitialize)(this.pBController)).EndInit();
this.SticksPanel.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pBSticks)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numUDRainbow)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDRainbow)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pBRainbow)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.blueBar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.greenBar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.redBar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numUDTap)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numUDScroll)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numUDTouch)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.idleDisconnectTimeout)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numUDR2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDTap)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDScroll)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDTouch)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDIdleDisconnect)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDR2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisAccelZ)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisAccelY)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisAccelX)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisGyroZ)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisGyroY)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tBsixaxisGyroX)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rumbleBoostBar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numUDHeavyRumble)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numUDLightRumble)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDRumbleBoost)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDHeavyRumble)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDLightRumble)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.lowRedBar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.lowGreenBar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.lowBlueBar)).EndInit();
@ -2053,15 +2103,16 @@
this.lowBatteryPanel.PerformLayout();
this.SixaxisPanel.ResumeLayout(false);
this.SixaxisPanel.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numUDRS)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDRS)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numUDMouseSens)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numUDLS)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numUDL2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDLS)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDL2)).EndInit();
this.gBTouchpad.ResumeLayout(false);
this.gBTouchpad.PerformLayout();
this.gBOther.ResumeLayout(false);
this.gBOther.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nUDSixaxis)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDHideMouse)).EndInit();
this.gBLightbar.ResumeLayout(false);
this.gBLightbar.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nUDflashLED)).EndInit();
@ -2117,7 +2168,7 @@
private System.Windows.Forms.Button bnR3;
private System.Windows.Forms.Button btnFullView;
public System.Windows.Forms.ListBox lBControls;
private System.Windows.Forms.NumericUpDown numUDRainbow;
private System.Windows.Forms.NumericUpDown nUDRainbow;
private System.Windows.Forms.PictureBox pBRainbow;
private System.Windows.Forms.Button lowColorChooserButton;
private System.Windows.Forms.TrackBar blueBar;
@ -2130,20 +2181,19 @@
private System.Windows.Forms.Label lBRed;
private System.Windows.Forms.CheckBox cBDoubleTap;
private System.Windows.Forms.CheckBox cBTap;
private System.Windows.Forms.NumericUpDown numUDTap;
private System.Windows.Forms.NumericUpDown nUDTap;
private System.Windows.Forms.CheckBox cBScroll;
private System.Windows.Forms.CheckBox cBSlide;
private System.Windows.Forms.NumericUpDown numUDScroll;
private System.Windows.Forms.NumericUpDown numUDTouch;
private System.Windows.Forms.NumericUpDown nUDScroll;
private System.Windows.Forms.NumericUpDown nUDTouch;
private System.Windows.Forms.Label lBButtonMouseSens;
private System.Windows.Forms.CheckBox cBlowerRCOn;
private System.Windows.Forms.CheckBox touchpadJitterCompensation;
private System.Windows.Forms.Label lBL2;
private System.Windows.Forms.Label lBR2;
private System.Windows.Forms.Label lBControllerOff;
private System.Windows.Forms.Label lBIdleMinutes;
private System.Windows.Forms.NumericUpDown idleDisconnectTimeout;
private System.Windows.Forms.NumericUpDown numUDR2;
private System.Windows.Forms.NumericUpDown nUDIdleDisconnect;
private System.Windows.Forms.NumericUpDown nUDR2;
private System.Windows.Forms.TrackBar tBsixaxisAccelZ;
private System.Windows.Forms.CheckBox flushHIDQueue;
private System.Windows.Forms.TrackBar tBsixaxisAccelY;
@ -2154,11 +2204,11 @@
private System.Windows.Forms.Label rumbleBoostLabel;
private System.Windows.Forms.TrackBar tBsixaxisGyroY;
private System.Windows.Forms.TrackBar tBsixaxisGyroX;
private System.Windows.Forms.NumericUpDown rumbleBoostBar;
private System.Windows.Forms.NumericUpDown nUDRumbleBoost;
private System.Windows.Forms.Label lB6Accel;
private System.Windows.Forms.NumericUpDown numUDHeavyRumble;
private System.Windows.Forms.NumericUpDown nUDHeavyRumble;
private System.Windows.Forms.Label lB6Gryo;
private System.Windows.Forms.NumericUpDown numUDLightRumble;
private System.Windows.Forms.NumericUpDown nUDLightRumble;
private System.Windows.Forms.Button btnRumbleTest;
private System.Windows.Forms.Label lbFull;
private System.Windows.Forms.Label lBLowRed;
@ -2177,10 +2227,10 @@
private System.Windows.Forms.Label lBControlTip;
private System.Windows.Forms.Label lbRS;
private System.Windows.Forms.Label lbLS;
private System.Windows.Forms.NumericUpDown numUDRS;
private System.Windows.Forms.NumericUpDown nUDRS;
private System.Windows.Forms.NumericUpDown numUDMouseSens;
private System.Windows.Forms.NumericUpDown numUDL2;
private System.Windows.Forms.NumericUpDown numUDLS;
private System.Windows.Forms.NumericUpDown nUDL2;
private System.Windows.Forms.NumericUpDown nUDLS;
private System.Windows.Forms.GroupBox gBTouchpad;
private System.Windows.Forms.GroupBox gBOther;
private System.Windows.Forms.GroupBox gBLightbar;
@ -2198,6 +2248,10 @@
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btnChargingColor;
private System.Windows.Forms.RadioButton rBColor;
private System.Windows.Forms.CheckBox cBIdleDisconnect;
private System.Windows.Forms.NumericUpDown nUDHideMouse;
private System.Windows.Forms.CheckBox cBHideCursor;
private System.Windows.Forms.Label lBMouseMins;
}
}


View File

@ -58,20 +58,21 @@ namespace ScpServer
DS4Color cColor = Global.loadChargingColor(device);
btnChargingColor.BackColor = Color.FromArgb(cColor.red, cColor.green, cColor.blue);
rumbleBoostBar.Value = Global.loadRumbleBoost(device);
numUDTouch.Value = Global.getTouchSensitivity(device);
nUDRumbleBoost.Value = Global.loadRumbleBoost(device);
nUDTouch.Value = Global.getTouchSensitivity(device);
cBSlide.Checked = Global.getTouchSensitivity(device) > 0;
numUDScroll.Value = Global.getScrollSensitivity(device);
nUDScroll.Value = Global.getScrollSensitivity(device);
cBScroll.Checked = Global.getScrollSensitivity(device) >0;
numUDTap.Value = Global.getTapSensitivity(device);
nUDTap.Value = Global.getTapSensitivity(device);
cBTap.Checked = Global.getTapSensitivity(device) > 0;
cBDoubleTap.Checked = Global.getDoubleTap(device);
numUDL2.Value = (decimal)Global.getLeftTriggerMiddle(device)/255;
numUDR2.Value = (decimal)Global.getRightTriggerMiddle(device)/255;
nUDL2.Value = (decimal)Global.getLeftTriggerMiddle(device)/255;
nUDR2.Value = (decimal)Global.getRightTriggerMiddle(device)/255;
touchpadJitterCompensation.Checked = Global.getTouchpadJitterCompensation(device);
cBlowerRCOn.Checked = Global.getLowerRCOn(device);
flushHIDQueue.Checked = Global.getFlushHIDQueue(device);
idleDisconnectTimeout.Value = Math.Round((decimal)(Global.getIdleDisconnectTimeout(device) / 60d), 1);
nUDIdleDisconnect.Value = Math.Round((decimal)(Global.getIdleDisconnectTimeout(device) / 60d), 1);
cBIdleDisconnect.Checked = Global.getIdleDisconnectTimeout(device) > 0;
numUDMouseSens.Value = Global.getButtonMouseSensitivity(device);
// Force update of color choosers
alphacolor = Math.Max(redBar.Value, Math.Max(greenBar.Value, blueBar.Value));
@ -83,7 +84,7 @@ namespace ScpServer
reg = Color.FromArgb(lowColor.red, lowColor.green, lowColor.blue);
full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), reg);
lowColorChooserButton.BackColor = Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full);
numUDRainbow.Value = (decimal)Global.getRainbow(device);
nUDRainbow.Value = (decimal)Global.getRainbow(device);
switch (Global.getChargingType(deviceNum))
{
case 1: rBFade.Checked = true; break;
@ -101,8 +102,8 @@ namespace ScpServer
pBRainbow.Image = colored;
ToggleRainbow(true);
}
numUDLS.Value = Math.Round((decimal)(Global.getLSDeadzone(device) / 127d ), 3);
numUDRS.Value = Math.Round((decimal)(Global.getRSDeadzone(device) / 127d ), 3);
nUDLS.Value = Math.Round((decimal)(Global.getLSDeadzone(device) / 127d ), 3);
nUDRS.Value = Math.Round((decimal)(Global.getRSDeadzone(device) / 127d ), 3);
}
else
Set();
@ -242,22 +243,22 @@ namespace ScpServer
FullPanel.Location = (batteryLed.Checked ? new Point(FullPanel.Location.X, 42) : new Point(FullPanel.Location.X, 48));
Global.saveColor(device, (byte)redBar.Value, (byte)greenBar.Value, (byte)blueBar.Value);
Global.saveLowColor(device, (byte)lowRedBar.Value, (byte)lowGreenBar.Value, (byte)lowBlueBar.Value);
Global.setLeftTriggerMiddle(device, (byte)Math.Round((numUDL2.Value * 255), 0));
Global.setRightTriggerMiddle(device, (byte)Math.Round((numUDR2.Value * 255), 0));
Global.saveRumbleBoost(device, (byte)rumbleBoostBar.Value);
Global.setTouchSensitivity(device, (byte)numUDTouch.Value);
Global.setLeftTriggerMiddle(device, (byte)Math.Round((nUDL2.Value * 255), 0));
Global.setRightTriggerMiddle(device, (byte)Math.Round((nUDR2.Value * 255), 0));
Global.saveRumbleBoost(device, (byte)nUDRumbleBoost.Value);
Global.setTouchSensitivity(device, (byte)nUDTouch.Value);
Global.setTouchpadJitterCompensation(device, touchpadJitterCompensation.Checked);
Global.setLowerRCOn(device, cBlowerRCOn.Checked);
Global.setScrollSensitivity(device, (byte)numUDScroll.Value);
Global.setScrollSensitivity(device, (byte)nUDScroll.Value);
Global.setDoubleTap(device, cBDoubleTap.Checked);
Global.setTapSensitivity(device, (byte)numUDTap.Value);
Global.setIdleDisconnectTimeout(device, (int)(idleDisconnectTimeout.Value * 60));
Global.setRainbow(device, (int)numUDRainbow.Value);
Global.setRSDeadzone(device, (byte)Math.Round((numUDRS.Value * 127), 0));
Global.setLSDeadzone(device, (byte)Math.Round((numUDLS.Value * 127), 0));
Global.setTapSensitivity(device, (byte)nUDTap.Value);
Global.setIdleDisconnectTimeout(device, (int)(nUDIdleDisconnect.Value * 60));
Global.setRainbow(device, (int)nUDRainbow.Value);
Global.setRSDeadzone(device, (byte)Math.Round((nUDRS.Value * 127), 0));
Global.setLSDeadzone(device, (byte)Math.Round((nUDLS.Value * 127), 0));
Global.setButtonMouseSensitivity(device, (int)numUDMouseSens.Value);
Global.setFlashAt(device, (int)nUDflashLED.Value);
if (numUDRainbow.Value == 0) pBRainbow.Image = greyscale;
if (nUDRainbow.Value == 0) pBRainbow.Image = greyscale;
else pBRainbow.Image = colored;
}
@ -517,27 +518,27 @@ namespace ScpServer
}
private void rumbleBoostBar_ValueChanged(object sender, EventArgs e)
{
Global.saveRumbleBoost(device, (byte)rumbleBoostBar.Value);
scpDevice.setRumble((byte)numUDHeavyRumble.Value, (byte)numUDLightRumble.Value, device);
Global.saveRumbleBoost(device, (byte)nUDRumbleBoost.Value);
scpDevice.setRumble((byte)nUDHeavyRumble.Value, (byte)nUDLightRumble.Value, device);
}
private void numUDLightRumble_ValueChanged(object sender, EventArgs e)
{
if (btnRumbleTest.Text == "Stop")
scpDevice.setRumble((byte)numUDHeavyRumble.Value, (byte)numUDLightRumble.Value, device);
scpDevice.setRumble((byte)nUDHeavyRumble.Value, (byte)nUDLightRumble.Value, device);
}
private void numUDHeavyRumble_ValueChanged(object sender, EventArgs e)
{
if (btnRumbleTest.Text == "Stop")
scpDevice.setRumble((byte)numUDHeavyRumble.Value, (byte)numUDLightRumble.Value, device);
scpDevice.setRumble((byte)nUDHeavyRumble.Value, (byte)nUDLightRumble.Value, device);
}
private void btnRumbleTest_Click(object sender, EventArgs e)
{
if (((Button)sender).Text == "Test")
{
scpDevice.setRumble((byte)numUDHeavyRumble.Value, (byte)numUDLightRumble.Value, (int)nUDSixaxis.Value - 1);
scpDevice.setRumble((byte)nUDHeavyRumble.Value, (byte)nUDLightRumble.Value, (int)nUDSixaxis.Value - 1);
((Button)sender).Text = "Stop";
}
else
@ -549,17 +550,17 @@ namespace ScpServer
private void numUDTouch_ValueChanged(object sender, EventArgs e)
{
Global.setTouchSensitivity(device, (byte)numUDTouch.Value);
Global.setTouchSensitivity(device, (byte)nUDTouch.Value);
}
private void numUDTap_ValueChanged(object sender, EventArgs e)
{
Global.setTapSensitivity(device, (byte)numUDTap.Value);
Global.setTapSensitivity(device, (byte)nUDTap.Value);
}
private void numUDScroll_ValueChanged(object sender, EventArgs e)
{
Global.setScrollSensitivity(device, (int)numUDScroll.Value);
Global.setScrollSensitivity(device, (int)nUDScroll.Value);
}
private void ledAsBatteryIndicator_CheckedChanged(object sender, EventArgs e)
{
@ -584,9 +585,20 @@ namespace ScpServer
Global.setFlushHIDQueue(device, flushHIDQueue.Checked);
}
private void idleDisconnectTimeout_ValueChanged(object sender, EventArgs e)
private void nUDIdleDisconnect_ValueChanged(object sender, EventArgs e)
{
Global.setIdleDisconnectTimeout(device, (int)(idleDisconnectTimeout.Value * 60));
Global.setIdleDisconnectTimeout(device, (int)(nUDIdleDisconnect.Value * 60));
//if (nUDIdleDisconnect.Value == 0)
//cBIdleDisconnect.Checked = false;
}
private void cBIdleDisconnect_CheckedChanged(object sender, EventArgs e)
{
if (cBIdleDisconnect.Checked)
nUDIdleDisconnect.Value = 5;
else
nUDIdleDisconnect.Value = 0;
nUDIdleDisconnect.Enabled = cBIdleDisconnect.Checked;
}
private void Options_Closed(object sender, FormClosedEventArgs e)
@ -622,28 +634,28 @@ namespace ScpServer
private void cBSlide_CheckedChanged(object sender, EventArgs e)
{
if (cBSlide.Checked)
numUDTouch.Value = 100;
nUDTouch.Value = 100;
else
numUDTouch.Value = 0;
numUDTouch.Enabled = cBSlide.Checked;
nUDTouch.Value = 0;
nUDTouch.Enabled = cBSlide.Checked;
}
private void cBScroll_CheckedChanged(object sender, EventArgs e)
{
if (cBScroll.Checked)
numUDScroll.Value = 5;
nUDScroll.Value = 5;
else
numUDScroll.Value = 0;
numUDScroll.Enabled = cBScroll.Checked;
nUDScroll.Value = 0;
nUDScroll.Enabled = cBScroll.Checked;
}
private void cBTap_CheckedChanged(object sender, EventArgs e)
{
if (cBTap.Checked)
numUDTap.Value = 100;
nUDTap.Value = 100;
else
numUDTap.Value = 0;
numUDTap.Enabled = cBTap.Checked;
nUDTap.Value = 0;
nUDTap.Enabled = cBTap.Checked;
cBDoubleTap.Enabled = cBTap.Checked;
}
@ -739,12 +751,12 @@ namespace ScpServer
private void numUDRainbow_ValueChanged(object sender, EventArgs e)
{
Global.setRainbow(device, (double)numUDRainbow.Value);
if ((double)numUDRainbow.Value <= 0.5)
Global.setRainbow(device, (double)nUDRainbow.Value);
if ((double)nUDRainbow.Value <= 0.5)
{
pBRainbow.Image = greyscale;
ToggleRainbow(false);
numUDRainbow.Value = 0;
nUDRainbow.Value = 0;
}
}
@ -754,19 +766,19 @@ namespace ScpServer
{
pBRainbow.Image = colored;
ToggleRainbow(true);
numUDRainbow.Value = 5;
nUDRainbow.Value = 5;
}
else
{
pBRainbow.Image = greyscale;
ToggleRainbow(false);
numUDRainbow.Value = 0;
nUDRainbow.Value = 0;
}
}
private void ToggleRainbow(bool on)
{
numUDRainbow.Enabled = on;
nUDRainbow.Enabled = on;
if (on)
{
//pBRainbow.Location = new Point(216 - 78, pBRainbow.Location.Y);
@ -805,12 +817,12 @@ namespace ScpServer
private void numUDL2_ValueChanged(object sender, EventArgs e)
{
Global.setLeftTriggerMiddle(device, (byte)(numUDL2.Value * 255));
Global.setLeftTriggerMiddle(device, (byte)(nUDL2.Value * 255));
}
private void numUDR2_ValueChanged(object sender, EventArgs e)
{
Global.setRightTriggerMiddle(device, (byte)(numUDR2.Value * 255));
Global.setRightTriggerMiddle(device, (byte)(nUDR2.Value * 255));
}
private void flashLed_CheckedChanged(object sender, EventArgs e)
@ -848,12 +860,12 @@ namespace ScpServer
private void numUDRS_ValueChanged(object sender, EventArgs e)
{
Global.setRSDeadzone(device, (byte)Math.Round((numUDRS.Value * 127),0));
Global.setRSDeadzone(device, (byte)Math.Round((nUDRS.Value * 127),0));
}
private void numUDLS_ValueChanged(object sender, EventArgs e)
{
Global.setLSDeadzone(device, (byte)Math.Round((numUDLS.Value * 127),0));
Global.setLSDeadzone(device, (byte)Math.Round((nUDLS.Value * 127),0));
}
private void numUDMouseSens_ValueChanged(object sender, EventArgs e)
@ -911,5 +923,6 @@ namespace ScpServer
}
}
}

View File

@ -36,10 +36,10 @@
this.tmrUpdate = new System.Windows.Forms.Timer(this.components);
this.pnlButton = new System.Windows.Forms.Panel();
this.lBTest = new System.Windows.Forms.Label();
this.llbHelp = new System.Windows.Forms.LinkLabel();
this.btnStartStop = new System.Windows.Forms.Button();
this.lnkControllers = new System.Windows.Forms.LinkLabel();
this.lbLastMessage = new System.Windows.Forms.Label();
this.llbHelp = new System.Windows.Forms.LinkLabel();
this.lnkControllers = new System.Windows.Forms.LinkLabel();
this.StartWindowsCheckBox = new System.Windows.Forms.CheckBox();
this.startMinimizedCheckBox = new System.Windows.Forms.CheckBox();
this.hideDS4CheckBox = new System.Windows.Forms.CheckBox();
@ -111,16 +111,17 @@
this.tabAutoProfiles = new System.Windows.Forms.TabPage();
this.tabSettings = new System.Windows.Forms.TabPage();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.cBNotifications = new System.Windows.Forms.CheckBox();
this.cBUpdate = new System.Windows.Forms.CheckBox();
this.saveProfiles = new System.Windows.Forms.SaveFileDialog();
this.nUDUpdateTime = new System.Windows.Forms.NumericUpDown();
this.pNUpdate = new System.Windows.Forms.Panel();
this.lBCheckEvery = new System.Windows.Forms.Label();
this.cBUpdateTime = new System.Windows.Forms.ComboBox();
this.lBCheckEvery = new System.Windows.Forms.Label();
this.nUDUpdateTime = new System.Windows.Forms.NumericUpDown();
this.linkProfiles = new System.Windows.Forms.LinkLabel();
this.lLBUpdate = new System.Windows.Forms.LinkLabel();
this.linkUninstall = new System.Windows.Forms.LinkLabel();
this.linkProfiles = new System.Windows.Forms.LinkLabel();
this.cBNotifications = new System.Windows.Forms.CheckBox();
this.saveProfiles = new System.Windows.Forms.SaveFileDialog();
this.lLSetup = new System.Windows.Forms.LinkLabel();
this.pnlButton.SuspendLayout();
this.cMTaskbar.SuspendLayout();
this.tabMain.SuspendLayout();
@ -137,8 +138,8 @@
this.tabLog.SuspendLayout();
this.tabSettings.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nUDUpdateTime)).BeginInit();
this.pNUpdate.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nUDUpdateTime)).BeginInit();
this.SuspendLayout();
//
// lvDebug
@ -195,6 +196,27 @@
this.lBTest.Text = "Used to test values";
this.lBTest.Visible = false;
//
// btnStartStop
//
this.btnStartStop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnStartStop.Location = new System.Drawing.Point(729, 4);
this.btnStartStop.Name = "btnStartStop";
this.btnStartStop.Size = new System.Drawing.Size(58, 23);
this.btnStartStop.TabIndex = 1;
this.btnStartStop.Text = "Start";
this.btnStartStop.UseVisualStyleBackColor = true;
this.btnStartStop.Click += new System.EventHandler(this.btnStartStop_Click);
//
// lbLastMessage
//
this.lbLastMessage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lbLastMessage.ForeColor = System.Drawing.SystemColors.GrayText;
this.lbLastMessage.Location = new System.Drawing.Point(4, 9);
this.lbLastMessage.Name = "lbLastMessage";
this.lbLastMessage.Size = new System.Drawing.Size(724, 18);
this.lbLastMessage.TabIndex = 41;
//
// llbHelp
//
this.llbHelp.Anchor = System.Windows.Forms.AnchorStyles.None;
@ -207,17 +229,6 @@
this.llbHelp.Text = "Hotkeys/About";
this.llbHelp.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llbHelp_LinkClicked);
//
// btnStartStop
//
this.btnStartStop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnStartStop.Location = new System.Drawing.Point(729, 4);
this.btnStartStop.Name = "btnStartStop";
this.btnStartStop.Size = new System.Drawing.Size(58, 23);
this.btnStartStop.TabIndex = 1;
this.btnStartStop.Text = "Start";
this.btnStartStop.UseVisualStyleBackColor = true;
this.btnStartStop.Click += new System.EventHandler(this.btnStartStop_Click);
//
// lnkControllers
//
this.lnkControllers.Anchor = System.Windows.Forms.AnchorStyles.None;
@ -230,16 +241,6 @@
this.lnkControllers.Text = "Control Panel Controllers";
this.lnkControllers.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkControllers_LinkClicked);
//
// lbLastMessage
//
this.lbLastMessage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lbLastMessage.ForeColor = System.Drawing.SystemColors.GrayText;
this.lbLastMessage.Location = new System.Drawing.Point(4, 9);
this.lbLastMessage.Name = "lbLastMessage";
this.lbLastMessage.Size = new System.Drawing.Size(724, 18);
this.lbLastMessage.TabIndex = 41;
//
// StartWindowsCheckBox
//
this.StartWindowsCheckBox.Anchor = System.Windows.Forms.AnchorStyles.None;
@ -407,7 +408,7 @@
this.tLPControllers.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 23.34039F));
this.tLPControllers.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25.31077F));
this.tLPControllers.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 117F));
this.tLPControllers.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 50F));
this.tLPControllers.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 47F));
this.tLPControllers.Controls.Add(this.pBStatus1, 1, 1);
this.tLPControllers.Controls.Add(this.lbPad1, 0, 1);
this.tLPControllers.Controls.Add(this.lbPad2, 0, 2);
@ -449,7 +450,7 @@
this.pBStatus1.Anchor = System.Windows.Forms.AnchorStyles.None;
this.pBStatus1.Image = ((System.Drawing.Image)(resources.GetObject("pBStatus1.Image")));
this.pBStatus1.InitialImage = global::ScpServer.Properties.Resources.BT;
this.pBStatus1.Location = new System.Drawing.Point(369, 19);
this.pBStatus1.Location = new System.Drawing.Point(372, 19);
this.pBStatus1.Name = "pBStatus1";
this.pBStatus1.Size = new System.Drawing.Size(39, 20);
this.pBStatus1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
@ -481,7 +482,7 @@
// bnEditC3
//
this.bnEditC3.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.bnEditC3.Location = new System.Drawing.Point(737, 76);
this.bnEditC3.Location = new System.Drawing.Point(741, 76);
this.bnEditC3.Name = "bnEditC3";
this.bnEditC3.Size = new System.Drawing.Size(40, 23);
this.bnEditC3.TabIndex = 43;
@ -493,7 +494,7 @@
// bnEditC4
//
this.bnEditC4.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.bnEditC4.Location = new System.Drawing.Point(737, 105);
this.bnEditC4.Location = new System.Drawing.Point(741, 105);
this.bnEditC4.Name = "bnEditC4";
this.bnEditC4.Size = new System.Drawing.Size(40, 23);
this.bnEditC4.TabIndex = 43;
@ -529,7 +530,7 @@
this.cBController1.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.cBController1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cBController1.FormattingEnabled = true;
this.cBController1.Location = new System.Drawing.Point(620, 19);
this.cBController1.Location = new System.Drawing.Point(624, 19);
this.cBController1.Name = "cBController1";
this.cBController1.Size = new System.Drawing.Size(111, 21);
this.cBController1.TabIndex = 42;
@ -539,7 +540,7 @@
// bnEditC2
//
this.bnEditC2.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.bnEditC2.Location = new System.Drawing.Point(737, 47);
this.bnEditC2.Location = new System.Drawing.Point(741, 47);
this.bnEditC2.Name = "bnEditC2";
this.bnEditC2.Size = new System.Drawing.Size(40, 23);
this.bnEditC2.TabIndex = 43;
@ -553,7 +554,7 @@
this.cBController2.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.cBController2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cBController2.FormattingEnabled = true;
this.cBController2.Location = new System.Drawing.Point(620, 48);
this.cBController2.Location = new System.Drawing.Point(624, 48);
this.cBController2.Name = "cBController2";
this.cBController2.Size = new System.Drawing.Size(111, 21);
this.cBController2.TabIndex = 42;
@ -565,7 +566,7 @@
this.cBController3.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.cBController3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cBController3.FormattingEnabled = true;
this.cBController3.Location = new System.Drawing.Point(620, 77);
this.cBController3.Location = new System.Drawing.Point(624, 77);
this.cBController3.Name = "cBController3";
this.cBController3.Size = new System.Drawing.Size(111, 21);
this.cBController3.TabIndex = 42;
@ -575,7 +576,7 @@
// bnEditC1
//
this.bnEditC1.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.bnEditC1.Location = new System.Drawing.Point(737, 18);
this.bnEditC1.Location = new System.Drawing.Point(741, 18);
this.bnEditC1.Name = "bnEditC1";
this.bnEditC1.Size = new System.Drawing.Size(40, 23);
this.bnEditC1.TabIndex = 43;
@ -589,7 +590,7 @@
this.cBController4.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.cBController4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cBController4.FormattingEnabled = true;
this.cBController4.Location = new System.Drawing.Point(620, 106);
this.cBController4.Location = new System.Drawing.Point(624, 106);
this.cBController4.Name = "cBController4";
this.cBController4.Size = new System.Drawing.Size(111, 21);
this.cBController4.TabIndex = 42;
@ -601,7 +602,7 @@
this.lBSelectedProfile.Anchor = System.Windows.Forms.AnchorStyles.None;
this.lBSelectedProfile.AutoSize = true;
this.lBSelectedProfile.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lBSelectedProfile.Location = new System.Drawing.Point(621, 0);
this.lBSelectedProfile.Location = new System.Drawing.Point(625, 0);
this.lBSelectedProfile.Name = "lBSelectedProfile";
this.lBSelectedProfile.Size = new System.Drawing.Size(109, 15);
this.lBSelectedProfile.TabIndex = 45;
@ -623,7 +624,7 @@
this.lBStatus.Anchor = System.Windows.Forms.AnchorStyles.None;
this.lBStatus.AutoSize = true;
this.lBStatus.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lBStatus.Location = new System.Drawing.Point(365, 0);
this.lBStatus.Location = new System.Drawing.Point(368, 0);
this.lBStatus.Name = "lBStatus";
this.lBStatus.Size = new System.Drawing.Size(47, 15);
this.lBStatus.TabIndex = 45;
@ -634,7 +635,7 @@
this.lBBattery.Anchor = System.Windows.Forms.AnchorStyles.None;
this.lBBattery.AutoSize = true;
this.lBBattery.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lBBattery.Location = new System.Drawing.Point(513, 0);
this.lBBattery.Location = new System.Drawing.Point(517, 0);
this.lBBattery.Name = "lBBattery";
this.lBBattery.Size = new System.Drawing.Size(51, 15);
this.lBBattery.TabIndex = 45;
@ -645,7 +646,7 @@
this.lBBatt1.Anchor = System.Windows.Forms.AnchorStyles.None;
this.lBBatt1.AutoSize = true;
this.lBBatt1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lBBatt1.Location = new System.Drawing.Point(519, 22);
this.lBBatt1.Location = new System.Drawing.Point(523, 22);
this.lBBatt1.Name = "lBBatt1";
this.lBBatt1.Size = new System.Drawing.Size(39, 15);
this.lBBatt1.TabIndex = 44;
@ -656,7 +657,7 @@
this.lBBatt2.Anchor = System.Windows.Forms.AnchorStyles.None;
this.lBBatt2.AutoSize = true;
this.lBBatt2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lBBatt2.Location = new System.Drawing.Point(519, 51);
this.lBBatt2.Location = new System.Drawing.Point(523, 51);
this.lBBatt2.Name = "lBBatt2";
this.lBBatt2.Size = new System.Drawing.Size(39, 15);
this.lBBatt2.TabIndex = 44;
@ -667,7 +668,7 @@
this.lBBatt3.Anchor = System.Windows.Forms.AnchorStyles.None;
this.lBBatt3.AutoSize = true;
this.lBBatt3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lBBatt3.Location = new System.Drawing.Point(519, 80);
this.lBBatt3.Location = new System.Drawing.Point(523, 80);
this.lBBatt3.Name = "lBBatt3";
this.lBBatt3.Size = new System.Drawing.Size(39, 15);
this.lBBatt3.TabIndex = 44;
@ -678,7 +679,7 @@
this.lBBatt4.Anchor = System.Windows.Forms.AnchorStyles.None;
this.lBBatt4.AutoSize = true;
this.lBBatt4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lBBatt4.Location = new System.Drawing.Point(519, 109);
this.lBBatt4.Location = new System.Drawing.Point(523, 109);
this.lBBatt4.Name = "lBBatt4";
this.lBBatt4.Size = new System.Drawing.Size(39, 15);
this.lBBatt4.TabIndex = 44;
@ -689,7 +690,7 @@
this.pBStatus2.Anchor = System.Windows.Forms.AnchorStyles.None;
this.pBStatus2.Image = ((System.Drawing.Image)(resources.GetObject("pBStatus2.Image")));
this.pBStatus2.InitialImage = global::ScpServer.Properties.Resources.BT;
this.pBStatus2.Location = new System.Drawing.Point(369, 48);
this.pBStatus2.Location = new System.Drawing.Point(372, 48);
this.pBStatus2.Name = "pBStatus2";
this.pBStatus2.Size = new System.Drawing.Size(39, 20);
this.pBStatus2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
@ -701,7 +702,7 @@
this.pBStatus3.Anchor = System.Windows.Forms.AnchorStyles.None;
this.pBStatus3.Image = ((System.Drawing.Image)(resources.GetObject("pBStatus3.Image")));
this.pBStatus3.InitialImage = global::ScpServer.Properties.Resources.BT;
this.pBStatus3.Location = new System.Drawing.Point(369, 77);
this.pBStatus3.Location = new System.Drawing.Point(372, 77);
this.pBStatus3.Name = "pBStatus3";
this.pBStatus3.Size = new System.Drawing.Size(39, 20);
this.pBStatus3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
@ -713,7 +714,7 @@
this.pBStatus4.Anchor = System.Windows.Forms.AnchorStyles.None;
this.pBStatus4.Image = ((System.Drawing.Image)(resources.GetObject("pBStatus4.Image")));
this.pBStatus4.InitialImage = global::ScpServer.Properties.Resources.BT;
this.pBStatus4.Location = new System.Drawing.Point(369, 106);
this.pBStatus4.Location = new System.Drawing.Point(372, 106);
this.pBStatus4.Name = "pBStatus4";
this.pBStatus4.Size = new System.Drawing.Size(39, 20);
this.pBStatus4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
@ -987,7 +988,7 @@
this.tabAutoProfiles.Name = "tabAutoProfiles";
this.tabAutoProfiles.Size = new System.Drawing.Size(786, 313);
this.tabAutoProfiles.TabIndex = 2;
this.tabAutoProfiles.Text = "Auto Profiles (Beta)";
this.tabAutoProfiles.Text = "Auto Profiles";
this.tabAutoProfiles.UseVisualStyleBackColor = true;
//
// tabSettings
@ -1015,12 +1016,24 @@
this.flowLayoutPanel1.Controls.Add(this.lnkControllers);
this.flowLayoutPanel1.Controls.Add(this.lLBUpdate);
this.flowLayoutPanel1.Controls.Add(this.linkUninstall);
this.flowLayoutPanel1.Controls.Add(this.lLSetup);
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(780, 307);
this.flowLayoutPanel1.TabIndex = 0;
//
// cBNotifications
//
this.cBNotifications.AutoSize = true;
this.cBNotifications.Location = new System.Drawing.Point(332, 3);
this.cBNotifications.Name = "cBNotifications";
this.cBNotifications.Size = new System.Drawing.Size(114, 17);
this.cBNotifications.TabIndex = 51;
this.cBNotifications.Text = "Show Notifications";
this.cBNotifications.UseVisualStyleBackColor = true;
this.cBNotifications.CheckedChanged += new System.EventHandler(this.cBNotifications_CheckedChanged);
//
// cBUpdate
//
this.cBUpdate.Anchor = System.Windows.Forms.AnchorStyles.None;
@ -1033,9 +1046,39 @@
this.cBUpdate.UseVisualStyleBackColor = true;
this.cBUpdate.CheckedChanged += new System.EventHandler(this.cBUpdate_CheckedChanged);
//
// saveProfiles
// pNUpdate
//
this.saveProfiles.Filter = "XML Files (*.xml)|*.xml";
this.pNUpdate.Controls.Add(this.cBUpdateTime);
this.pNUpdate.Controls.Add(this.lBCheckEvery);
this.pNUpdate.Controls.Add(this.nUDUpdateTime);
this.pNUpdate.Enabled = false;
this.pNUpdate.Location = new System.Drawing.Point(3, 26);
this.pNUpdate.Name = "pNUpdate";
this.pNUpdate.Size = new System.Drawing.Size(189, 22);
this.pNUpdate.TabIndex = 43;
//
// cBUpdateTime
//
this.cBUpdateTime.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cBUpdateTime.FormattingEnabled = true;
this.cBUpdateTime.Items.AddRange(new object[] {
"hours",
"days"});
this.cBUpdateTime.Location = new System.Drawing.Point(126, 0);
this.cBUpdateTime.Name = "cBUpdateTime";
this.cBUpdateTime.Size = new System.Drawing.Size(60, 21);
this.cBUpdateTime.TabIndex = 43;
this.cBUpdateTime.SelectedIndexChanged += new System.EventHandler(this.cBUpdateTime_SelectedIndexChanged);
//
// lBCheckEvery
//
this.lBCheckEvery.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lBCheckEvery.AutoSize = true;
this.lBCheckEvery.Location = new System.Drawing.Point(3, 3);
this.lBCheckEvery.Name = "lBCheckEvery";
this.lBCheckEvery.Size = new System.Drawing.Size(67, 13);
this.lBCheckEvery.TabIndex = 0;
this.lBCheckEvery.Text = "Check every";
//
// nUDUpdateTime
//
@ -1051,39 +1094,17 @@
this.nUDUpdateTime.TabIndex = 42;
this.nUDUpdateTime.ValueChanged += new System.EventHandler(this.nUDUpdateTime_ValueChanged);
//
// pNUpdate
// linkProfiles
//
this.pNUpdate.Controls.Add(this.cBUpdateTime);
this.pNUpdate.Controls.Add(this.lBCheckEvery);
this.pNUpdate.Controls.Add(this.nUDUpdateTime);
this.pNUpdate.Enabled = false;
this.pNUpdate.Location = new System.Drawing.Point(3, 26);
this.pNUpdate.Name = "pNUpdate";
this.pNUpdate.Size = new System.Drawing.Size(189, 22);
this.pNUpdate.TabIndex = 43;
//
// lBCheckEvery
//
this.lBCheckEvery.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lBCheckEvery.AutoSize = true;
this.lBCheckEvery.Location = new System.Drawing.Point(3, 3);
this.lBCheckEvery.Name = "lBCheckEvery";
this.lBCheckEvery.Size = new System.Drawing.Size(67, 13);
this.lBCheckEvery.TabIndex = 0;
this.lBCheckEvery.Text = "Check every";
//
// cBUpdateTime
//
this.cBUpdateTime.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cBUpdateTime.FormattingEnabled = true;
this.cBUpdateTime.Items.AddRange(new object[] {
"hours",
"days"});
this.cBUpdateTime.Location = new System.Drawing.Point(126, 0);
this.cBUpdateTime.Name = "cBUpdateTime";
this.cBUpdateTime.Size = new System.Drawing.Size(60, 21);
this.cBUpdateTime.TabIndex = 43;
this.cBUpdateTime.SelectedIndexChanged += new System.EventHandler(this.cBUpdateTime_SelectedIndexChanged);
this.linkProfiles.Anchor = System.Windows.Forms.AnchorStyles.None;
this.linkProfiles.AutoSize = true;
this.linkProfiles.Location = new System.Drawing.Point(283, 30);
this.linkProfiles.Name = "linkProfiles";
this.linkProfiles.Size = new System.Drawing.Size(94, 13);
this.linkProfiles.TabIndex = 50;
this.linkProfiles.TabStop = true;
this.linkProfiles.Text = "Open Profile folder";
this.linkProfiles.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkProfiles_LinkClicked);
//
// lLBUpdate
//
@ -1109,28 +1130,21 @@
this.linkUninstall.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.linkUninstall.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkUninstall_LinkClicked);
//
// linkProfiles
// saveProfiles
//
this.linkProfiles.Anchor = System.Windows.Forms.AnchorStyles.None;
this.linkProfiles.AutoSize = true;
this.linkProfiles.Location = new System.Drawing.Point(283, 30);
this.linkProfiles.Name = "linkProfiles";
this.linkProfiles.Size = new System.Drawing.Size(94, 13);
this.linkProfiles.TabIndex = 50;
this.linkProfiles.TabStop = true;
this.linkProfiles.Text = "Open Profile folder";
this.linkProfiles.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkProfiles_LinkClicked);
this.saveProfiles.Filter = "XML Files (*.xml)|*.xml";
//
// cBNotifications
// lLSetup
//
this.cBNotifications.AutoSize = true;
this.cBNotifications.Location = new System.Drawing.Point(332, 3);
this.cBNotifications.Name = "cBNotifications";
this.cBNotifications.Size = new System.Drawing.Size(114, 17);
this.cBNotifications.TabIndex = 51;
this.cBNotifications.Text = "Show Notifications";
this.cBNotifications.UseVisualStyleBackColor = true;
this.cBNotifications.CheckedChanged += new System.EventHandler(this.cBNotifications_CheckedChanged);
this.lLSetup.Anchor = System.Windows.Forms.AnchorStyles.None;
this.lLSetup.AutoSize = true;
this.lLSetup.Location = new System.Drawing.Point(3, 51);
this.lLSetup.Name = "lLSetup";
this.lLSetup.Size = new System.Drawing.Size(82, 13);
this.lLSetup.TabIndex = 52;
this.lLSetup.TabStop = true;
this.lLSetup.Text = "Controller Setup";
this.lLSetup.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lLSetup_LinkClicked);
//
// ScpForm
//
@ -1171,9 +1185,9 @@
this.tabSettings.ResumeLayout(false);
this.flowLayoutPanel1.ResumeLayout(false);
this.flowLayoutPanel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nUDUpdateTime)).EndInit();
this.pNUpdate.ResumeLayout(false);
this.pNUpdate.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nUDUpdateTime)).EndInit();
this.ResumeLayout(false);
}
@ -1271,6 +1285,7 @@
private System.Windows.Forms.LinkLabel linkUninstall;
private System.Windows.Forms.LinkLabel linkProfiles;
private System.Windows.Forms.CheckBox cBNotifications;
private System.Windows.Forms.LinkLabel lLSetup;
//private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
}
}

View File

@ -12,11 +12,12 @@ using System.Drawing;
using Microsoft.Win32;
using System.Diagnostics;
using System.Xml;
using System.Text;
namespace ScpServer
{
public partial class ScpForm : Form
{
double version = 9.9;
double version = 10;
private DS4Control.Control rootHub;
delegate void LogDebugDelegate(DateTime Time, String Data);
@ -32,7 +33,7 @@ namespace ScpServer
string filename;
DateTime oldnow = DateTime.UtcNow;
string tempprofile = "null";
List<string> profilenames = new List<string>();
List<string> profilenames= new List<string>();
List<string> programpaths = new List<string>();
List<string>[] proprofiles;
private static int WM_QUERYENDSESSION = 0x11;
@ -41,6 +42,8 @@ namespace ScpServer
delegate void HotKeysDelegate(object sender, EventArgs e);
Options opt;
private System.Drawing.Size oldsize;
WinProgs WP;
protected void SetupArrays()
{
Pads = new Label[4] { lbPad1, lbPad2, lbPad3, lbPad4 };
@ -54,13 +57,49 @@ namespace ScpServer
(ToolStripMenuItem)notifyIcon1.ContextMenuStrip.Items[2],
(ToolStripMenuItem)notifyIcon1.ContextMenuStrip.Items[3] };
}
[DllImport("user32.dll")]
private static extern IntPtr GetForegroundWindow();
[DllImport("user32.dll")]
private static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
//HANDLE WINAPI OpenProcess(
// __in DWORD dwDesiredAccess,
// __in BOOL bInheritHandle,
// __in DWORD dwProcessId
//);
[DllImport("kernel32.dll")]
private static extern IntPtr OpenProcess(uint dwDesiredAccess, bool bInheritHandle, uint dwProcessId);
[DllImport("kernel32.dll")]
private static extern bool CloseHandle(IntPtr handle);
// DWORD WINAPI GetModuleBaseName(
// __in HANDLE hProcess,
// __in_opt HMODULE hModule,
// __out LPTSTR lpBaseName,
// __in DWORD nSize
// );
[DllImport("psapi.dll")]
private static extern uint GetModuleBaseName(IntPtr hWnd, IntPtr hModule, StringBuilder lpFileName, int nSize);
// DWORD WINAPI GetModuleFileNameEx(
// __in HANDLE hProcess,
// __in_opt HMODULE hModule,
// __out LPTSTR lpFilename,
// __in DWORD nSize
// );
[DllImport("psapi.dll")]
private static extern uint GetModuleFileNameEx(IntPtr hWnd, IntPtr hModule, StringBuilder lpFileName, int nSize);
public ScpForm()
{
InitializeComponent();
ThemeUtil.SetTheme(lvDebug);
SetupArrays();
CheckDrivers();
//CheckDrivers();
SystemEvents.PowerModeChanged += OnPowerChange;
tSOptions.Visible = false;
LoadP();
@ -68,6 +107,23 @@ namespace ScpServer
tt.SetToolTip(linkUninstall, "To fully remove DS4Windows, You can delete the profiles by the link to the other side");
if (!System.IO.Directory.Exists(Global.appdatapath + "\\Virtual Bus Driver"))
linkUninstall.Visible = false;
//MessageBox.Show(Path.GetFileNameWithoutExtension(GetTopWindowName()));
}
public static string GetTopWindowName()
{
IntPtr hWnd = GetForegroundWindow();
uint lpdwProcessId;
GetWindowThreadProcessId(hWnd, out lpdwProcessId);
IntPtr hProcess = OpenProcess(0x0410, false, lpdwProcessId);
StringBuilder text = new StringBuilder(1000);
GetModuleFileNameEx(hProcess, IntPtr.Zero, text, text.Capacity);
CloseHandle(hProcess);
return text.ToString();
}
private void OnPowerChange(object s, PowerModeChangedEventArgs e)
@ -152,6 +208,11 @@ namespace ScpServer
nUDUpdateTime.Value = checkwhen;
}
Uri url = new Uri("https://dl.dropboxusercontent.com/u/16364552/DS4Tool/newest%20version.txt"); //Sorry other devs, gonna have to find your own server
if (!Directory.Exists(Global.appdatapath))
{
WelcomeDialog wd = new WelcomeDialog();
wd.ShowDialog();
}
Directory.CreateDirectory(Global.appdatapath);
if (checkwhen > 0 && DateTime.Now >= Global.getLastChecked() + TimeSpan.FromHours(checkwhen))
{
@ -196,7 +257,29 @@ namespace ScpServer
}
//Check for process for auto profiles
DateTime now = DateTime.UtcNow;
if (tempprofile == "null")
for (int i = 0; i < programpaths.Count; i++)
{
string name = Path.GetFileNameWithoutExtension(programpaths[i]);
if (programpaths[i].ToLower() == GetTopWindowName().ToLower())
{
for (int j = 0; j < 4; j++)
if (proprofiles[j][i] != "(none)")
Global.LoadTempProfile(j, proprofiles[j][i]); //j is controller index, i is filename
tempprofile = programpaths[i].ToLower();
}
}
else
{
if (tempprofile != GetTopWindowName().ToLower())
{
tempprofile = "null";
for (int j = 0; j < 4; j++)
Global.LoadProfile(j);
}
}
#region Old Process check
/*DateTime now = DateTime.UtcNow;
if (now >= oldnow + TimeSpan.FromSeconds(2))
{
oldnow = now;
@ -228,7 +311,8 @@ namespace ScpServer
PerformanceCounter.CloseSharedResources();
}
else
PerformanceCounter.CloseSharedResources();
PerformanceCounter.CloseSharedResources();*/
#endregion
GC.Collect();
}
@ -363,20 +447,15 @@ namespace ScpServer
shortcuts[i].DropDownItems.Add("-");
shortcuts[i].DropDownItems.Add("+New Profile");
}
RefreshAutoProfilesPage();
}
tabAutoProfiles.Controls.Clear();
WinProgs WP = new WinProgs(profilenames.ToArray(), this);
WP.TopLevel = false;
WP.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
WP.Visible = true;
WP.Dock = DockStyle.Fill;
tabAutoProfiles.Controls.Add(WP);
}
public void RefreshAutoProfilesPage()
{
tabAutoProfiles.Controls.Clear();
WinProgs WP = new WinProgs(profilenames.ToArray(), this);
WP = new WinProgs(profilenames.ToArray(), this);
WP.TopLevel = false;
WP.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
WP.Visible = true;
@ -1128,6 +1207,12 @@ namespace ScpServer
{
Global.setNotifications(cBNotifications.Checked);
}
private void lLSetup_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
WelcomeDialog wd = new WelcomeDialog();
wd.ShowDialog();
}
}
public class ThemeUtil

View File

@ -72,7 +72,9 @@ namespace ScpServer
try { ZipFile.ExtractToDirectory(Global.appdatapath + "\\VBus.zip", exepath); }
//Made here as starting the scpdriver.exe via process.start, the program looks for file from where it was called, not where the exe is
catch { }
Process.Start(exepath + "\\ScpDriver.exe");
if (File.Exists(exepath + "\\ScpDriver.exe"))
try { Process.Start(exepath + "\\ScpDriver.exe"); }
catch { Process.Start(Global.appdatapath + "\\Virtual Bus Driver"); }
Timer timer = new Timer();
timer.Start();
timer.Tick += timer_Tick;

View File

@ -44,13 +44,18 @@
this.openProgram = new System.Windows.Forms.OpenFileDialog();
this.bnDelete = new System.Windows.Forms.Button();
this.iLIcons = new System.Windows.Forms.ImageList(this.components);
this.bnLoadSteam = new System.Windows.Forms.Button();
this.lVPrograms = new System.Windows.Forms.ListView();
this.nameHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.PathHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.lBTip = new System.Windows.Forms.Label();
this.pBProfilesTip = new System.Windows.Forms.Label();
this.bnHideUnchecked = new System.Windows.Forms.Button();
this.cMSPrograms = new System.Windows.Forms.ContextMenuStrip(this.components);
this.addProgramsFromStartMenuToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addSteamGamesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addOriginGamesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.browseForOtherProgramsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.cMSPrograms.SuspendLayout();
this.SuspendLayout();
//
// bnAddPrograms
@ -60,7 +65,7 @@
this.bnAddPrograms.Name = "bnAddPrograms";
this.bnAddPrograms.Size = new System.Drawing.Size(114, 23);
this.bnAddPrograms.TabIndex = 2;
this.bnAddPrograms.Text = "Add more programs";
this.bnAddPrograms.Text = "Add programs";
this.bnAddPrograms.UseVisualStyleBackColor = true;
this.bnAddPrograms.Click += new System.EventHandler(this.bnAddPrograms_Click);
//
@ -206,18 +211,6 @@
this.iLIcons.ImageSize = new System.Drawing.Size(16, 16);
this.iLIcons.TransparentColor = System.Drawing.Color.Transparent;
//
// bnLoadSteam
//
this.bnLoadSteam.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.bnLoadSteam.Location = new System.Drawing.Point(5, 195);
this.bnLoadSteam.Name = "bnLoadSteam";
this.bnLoadSteam.Size = new System.Drawing.Size(505, 23);
this.bnLoadSteam.TabIndex = 11;
this.bnLoadSteam.Text = "Load Steam Games";
this.bnLoadSteam.UseVisualStyleBackColor = true;
this.bnLoadSteam.Click += new System.EventHandler(this.bnLoadSteam_Click);
//
// lVPrograms
//
this.lVPrograms.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@ -232,7 +225,7 @@
this.lVPrograms.Location = new System.Drawing.Point(5, 6);
this.lVPrograms.MultiSelect = false;
this.lVPrograms.Name = "lVPrograms";
this.lVPrograms.Size = new System.Drawing.Size(505, 187);
this.lVPrograms.Size = new System.Drawing.Size(505, 212);
this.lVPrograms.SmallImageList = this.iLIcons;
this.lVPrograms.TabIndex = 12;
this.lVPrograms.UseCompatibleStateImageBehavior = false;
@ -286,14 +279,54 @@
this.bnHideUnchecked.UseVisualStyleBackColor = true;
this.bnHideUnchecked.Click += new System.EventHandler(this.bnHideUnchecked_Click);
//
// cMSPrograms
//
this.cMSPrograms.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.addProgramsFromStartMenuToolStripMenuItem,
this.addSteamGamesToolStripMenuItem,
this.addOriginGamesToolStripMenuItem,
this.browseForOtherProgramsToolStripMenuItem});
this.cMSPrograms.Name = "contextMenuStrip1";
this.cMSPrograms.ShowImageMargin = false;
this.cMSPrograms.Size = new System.Drawing.Size(193, 92);
//
// addProgramsFromStartMenuToolStripMenuItem
//
this.addProgramsFromStartMenuToolStripMenuItem.Name = "addProgramsFromStartMenuToolStripMenuItem";
this.addProgramsFromStartMenuToolStripMenuItem.Size = new System.Drawing.Size(192, 22);
this.addProgramsFromStartMenuToolStripMenuItem.Text = "Add Start Menu Programs";
this.addProgramsFromStartMenuToolStripMenuItem.Click += new System.EventHandler(this.addProgramsFromStartMenuToolStripMenuItem_Click);
//
// addSteamGamesToolStripMenuItem
//
this.addSteamGamesToolStripMenuItem.Name = "addSteamGamesToolStripMenuItem";
this.addSteamGamesToolStripMenuItem.Size = new System.Drawing.Size(192, 22);
this.addSteamGamesToolStripMenuItem.Text = "Add Steam Games";
this.addSteamGamesToolStripMenuItem.Click += new System.EventHandler(this.addSteamGamesToolStripMenuItem_Click);
//
// addOriginGamesToolStripMenuItem
//
this.addOriginGamesToolStripMenuItem.Name = "addOriginGamesToolStripMenuItem";
this.addOriginGamesToolStripMenuItem.Size = new System.Drawing.Size(192, 22);
this.addOriginGamesToolStripMenuItem.Text = "Add Origin Games";
this.addOriginGamesToolStripMenuItem.Click += new System.EventHandler(this.addOriginGamesToolStripMenuItem_Click);
//
// browseForOtherProgramsToolStripMenuItem
//
this.browseForOtherProgramsToolStripMenuItem.Name = "browseForOtherProgramsToolStripMenuItem";
this.browseForOtherProgramsToolStripMenuItem.Size = new System.Drawing.Size(192, 22);
this.browseForOtherProgramsToolStripMenuItem.Text = "Browse for Other Programs";
this.browseForOtherProgramsToolStripMenuItem.Click += new System.EventHandler(this.browseForOtherProgramsToolStripMenuItem_Click);
//
// WinProgs
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(736, 222);
this.Controls.Add(this.bnHideUnchecked);
this.Controls.Add(this.bnAddPrograms);
this.Controls.Add(this.lVPrograms);
this.Controls.Add(this.bnLoadSteam);
this.Controls.Add(this.lBController4);
this.Controls.Add(this.lBController3);
this.Controls.Add(this.lBController2);
@ -305,13 +338,12 @@
this.Controls.Add(this.lBProgramPath);
this.Controls.Add(this.bnDelete);
this.Controls.Add(this.bnSave);
this.Controls.Add(this.bnHideUnchecked);
this.Controls.Add(this.bnAddPrograms);
this.Controls.Add(this.pBProfilesTip);
this.Controls.Add(this.lBTip);
this.Controls.Add(this.lBBeta);
this.Name = "WinProgs";
this.Text = "Auto-Profiles";
this.cMSPrograms.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
@ -334,12 +366,16 @@
private System.Windows.Forms.OpenFileDialog openProgram;
private System.Windows.Forms.Button bnDelete;
private System.Windows.Forms.ImageList iLIcons;
private System.Windows.Forms.Button bnLoadSteam;
private System.Windows.Forms.ListView lVPrograms;
private System.Windows.Forms.ColumnHeader nameHeader;
private System.Windows.Forms.ColumnHeader PathHeader;
private System.Windows.Forms.Label lBTip;
private System.Windows.Forms.Label pBProfilesTip;
private System.Windows.Forms.Button bnHideUnchecked;
private System.Windows.Forms.ContextMenuStrip cMSPrograms;
private System.Windows.Forms.ToolStripMenuItem addProgramsFromStartMenuToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem addSteamGamesToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem addOriginGamesToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem browseForOtherProgramsToolStripMenuItem;
}
}

View File

@ -13,6 +13,7 @@ using System.Net;
using System.Text.RegularExpressions;
using DS4Control;
using System.Xml;
using System.Runtime.InteropServices;
namespace ScpServer
{
@ -21,8 +22,9 @@ namespace ScpServer
ToolTip tp = new ToolTip();
ComboBox[] cbs;
ScpForm form;
string steamgamesdir;
protected String m_Profile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\DS4Tool\\Auto Profiles.xml";
//C:\ProgramData\Microsoft\Windows\Start Menu\Programs
string steamgamesdir, origingamesdir;
protected String m_Profile = Global.appdatapath + "\\Auto Profiles.xml";
protected XmlDocument m_Xdoc = new XmlDocument();
List<string> programpaths = new List<string>();
List<string> lodsf = new List<string>();
@ -43,15 +45,20 @@ namespace ScpServer
if (!File.Exists(Global.appdatapath + @"\Auto Profiles.xml"))
Create();
LoadP();
RegistryKey regKey = Registry.CurrentUser;
regKey = regKey.OpenSubKey(@"Software\Valve\Steam");
if (regKey != null)
steamgamesdir = Path.GetDirectoryName(regKey.GetValue("SourceModInstallPath").ToString()) + @"\common";
if (!Directory.Exists(steamgamesdir))
{
bnLoadSteam.Visible = false;
lVPrograms.Size = new Size(lVPrograms.Size.Width, lVPrograms.Size.Height + 25);
}
steamgamesdir = regKey.GetValue("SteamPath").ToString() + @"\steamapps\common";
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";
else
cMSPrograms.Items.Remove(addOriginGamesToolStripMenuItem);
}
public bool Create()
@ -107,24 +114,24 @@ namespace ScpServer
private void bnLoadSteam_Click(object sender, EventArgs e)
{
try
{
var AppCollectionThread = new System.Threading.Thread(() => GetApps());
AppCollectionThread.IsBackground = true;
AppCollectionThread.Start();
}
catch { }
bnLoadSteam.Text = "Loading...";
bnLoadSteam.Enabled = false;
Timer appstimer = new Timer();
appstimer.Start();
appstimer.Tick += appstimer_Tick;
}
private void GetApps()
private void GetApps(string path)
{
lodsf.AddRange(Directory.GetFiles(steamgamesdir, "*.exe", SearchOption.AllDirectories));
lodsf.Clear();
lodsf.AddRange(Directory.GetFiles(path, "*.exe", SearchOption.AllDirectories));
appsloaded = true;
}
private void GetShortcuts(string path)
{
lodsf.Clear();
lodsf.AddRange(Directory.GetFiles(path, "*.lnk", SearchOption.AllDirectories));
lodsf.AddRange(Directory.GetFiles(@"C:\ProgramData\Microsoft\Windows\Start Menu\Programs", "*.lnk", SearchOption.AllDirectories));
for (int i = 0; i < lodsf.Count; i++)
lodsf[i] = GetTargetPath(lodsf[i]);
appsloaded = true;
}
@ -132,16 +139,18 @@ namespace ScpServer
{
if (appsloaded)
{
bnLoadSteam.Text = "Adding to list...";
bnAddPrograms.Text = "Adding to list...";
for (int i = lodsf.Count - 1; i >= 0; i--)
if (lodsf[i].Contains("etup") || lodsf[i].Contains("dotnet") || lodsf[i].Contains("SETUP")
|| lodsf[i].Contains("edist") || lodsf[i].Contains("nstall"))
|| lodsf[i].Contains("edist") || lodsf[i].Contains("nstall") || String.IsNullOrEmpty(lodsf[i]))
lodsf.RemoveAt(i);
for (int i = lodsf.Count - 1; i >= 0; i--)
for (int j = programpaths.Count - 1; j >= 0; j--)
if (lodsf[i] == programpaths[j])
lodsf.RemoveAt(i);
foreach (string st in lodsf)
{
if (File.Exists(st))
{
int index = programpaths.IndexOf(st);
iLIcons.Images.Add(Icon.ExtractAssociatedIcon(st));
@ -149,8 +158,9 @@ namespace ScpServer
lvi.SubItems.Add(st);
lVPrograms.Items.Add(lvi);
}
bnLoadSteam.Visible = false;
lVPrograms.Size = new Size(lVPrograms.Size.Width, lVPrograms.Size.Height + 25);
}
bnAddPrograms.Text = "Add programs";
bnAddPrograms.Enabled = true;
appsloaded = false;
((Timer)sender).Stop();
}
@ -256,15 +266,7 @@ namespace ScpServer
private void bnAddPrograms_Click(object sender, EventArgs e)
{
if (openProgram.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
string file = openProgram.FileName;
lBProgramPath.Text = file;
iLIcons.Images.Add(Icon.ExtractAssociatedIcon(file));
ListViewItem lvi = new ListViewItem(Path.GetFileNameWithoutExtension(file), lVPrograms.Items.Count);
lvi.SubItems.Add(file);
lVPrograms.Items.Insert(0, lvi);
}
cMSPrograms.Show(bnAddPrograms, new Point(0, bnAddPrograms.Height));
}
private void lBProgramPath_TextChanged(object sender, EventArgs e)
@ -303,5 +305,178 @@ namespace ScpServer
form.RefreshAutoProfilesPage();
}
private void addSteamGamesToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
var AppCollectionThread = new System.Threading.Thread(() => GetApps(steamgamesdir));
AppCollectionThread.IsBackground = true;
AppCollectionThread.Start();
}
catch { }
bnAddPrograms.Text = "Loading...";
bnAddPrograms.Enabled = false;
cMSPrograms.Items.Remove(addSteamGamesToolStripMenuItem);
Timer appstimer = new Timer();
appstimer.Start();
appstimer.Tick += appstimer_Tick;
}
private void browseForOtherProgramsToolStripMenuItem_Click(object sender, EventArgs e)
{
if (openProgram.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
string file = openProgram.FileName;
if (file.EndsWith(".lnk"))
{
file = GetTargetPath(file);
}
lBProgramPath.Text = file;
iLIcons.Images.Add(Icon.ExtractAssociatedIcon(file));
ListViewItem lvi = new ListViewItem(Path.GetFileNameWithoutExtension(file), lVPrograms.Items.Count);
lvi.SubItems.Add(file);
lVPrograms.Items.Insert(0, lvi);
}
}
private void addOriginGamesToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
var AppCollectionThread = new System.Threading.Thread(() => GetApps(origingamesdir));
AppCollectionThread.IsBackground = true;
AppCollectionThread.Start();
}
catch { }
bnAddPrograms.Text = "Loading...";
bnAddPrograms.Enabled = false;
cMSPrograms.Items.Remove(addOriginGamesToolStripMenuItem);
Timer appstimer = new Timer();
appstimer.Start();
appstimer.Tick += appstimer_Tick;
}
private void addProgramsFromStartMenuToolStripMenuItem_Click(object sender, EventArgs e)
{
//MessageBox.Show(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu) + "\\Programs");
try
{
var AppCollectionThread = new System.Threading.Thread(() => GetShortcuts(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu) + "\\Programs"));
AppCollectionThread.IsBackground = true;
AppCollectionThread.Start();
}
catch { }
bnAddPrograms.Text = "Loading...";
bnAddPrograms.Enabled = false;
cMSPrograms.Items.Remove(addProgramsFromStartMenuToolStripMenuItem);
Timer appstimer = new Timer();
appstimer.Start();
appstimer.Tick += appstimer_Tick;
}
public static string GetTargetPath(string filePath)
{
string targetPath = ResolveMsiShortcut(filePath);
if (targetPath == null)
{
targetPath = ResolveShortcut(filePath);
}
return targetPath;
}
public static string GetInternetShortcut(string filePath)
{
string url = "";
using (TextReader reader = new StreamReader(filePath))
{
string line = "";
while ((line = reader.ReadLine()) != null)
{
if (line.StartsWith("URL="))
{
string[] splitLine = line.Split('=');
if (splitLine.Length > 0)
{
url = splitLine[1];
break;
}
}
}
}
return url;
}
static string ResolveShortcut(string filePath)
{
// IWshRuntimeLibrary is in the COM library "Windows Script Host Object Model"
IWshRuntimeLibrary.WshShell shell = new IWshRuntimeLibrary.WshShell();
try
{
IWshRuntimeLibrary.IWshShortcut shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(filePath);
return shortcut.TargetPath;
}
catch (COMException)
{
// A COMException is thrown if the file is not a valid shortcut (.lnk) file
return null;
}
}
static string ResolveMsiShortcut(string file)
{
StringBuilder product = new StringBuilder(NativeMethods.MaxGuidLength + 1);
StringBuilder feature = new StringBuilder(NativeMethods.MaxFeatureLength + 1);
StringBuilder component = new StringBuilder(NativeMethods.MaxGuidLength + 1);
NativeMethods.MsiGetShortcutTarget(file, product, feature, component);
int pathLength = NativeMethods.MaxPathLength;
StringBuilder path = new StringBuilder(pathLength);
NativeMethods.InstallState installState = NativeMethods.MsiGetComponentPath(product.ToString(), component.ToString(), path, ref pathLength);
if (installState == NativeMethods.InstallState.Local)
{
return path.ToString();
}
else
{
return null;
}
}
}
class NativeMethods
{
[DllImport("msi.dll", CharSet = CharSet.Auto)]
public static extern uint MsiGetShortcutTarget(string targetFile, StringBuilder productCode, StringBuilder featureID, StringBuilder componentCode);
[DllImport("msi.dll", CharSet = CharSet.Auto)]
public static extern InstallState MsiGetComponentPath(string productCode, string componentCode, StringBuilder componentPath, ref int componentPathBufferSize);
public const int MaxFeatureLength = 38;
public const int MaxGuidLength = 38;
public const int MaxPathLength = 1024;
public enum InstallState
{
NotUsed = -7,
BadConfig = -6,
Incomplete = -5,
SourceAbsent = -4,
MoreData = -3,
InvalidArg = -2,
Unknown = -1,
Broken = 0,
Advertised = 1,
Removed = 1,
Absent = 2,
Local = 3,
Source = 4,
Default = 5
}
}
}

View File

@ -123,4 +123,7 @@
<metadata name="iLIcons.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>143, 17</value>
</metadata>
<metadata name="cMSPrograms.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>232, 17</value>
</metadata>
</root>