Version 1.4.157

Experimental: Quick Charge controller by turning off BT when plugged via
USB
Settings a deadzone of .10+ to the sticks or higher now affects the
mouse movement as well
Use DS4 for Mapping checkbox now remembers how it was last set
Fix for starting minimized showing up in task manager and alt+tab, this
also more reliably starts minimized
This commit is contained in:
jays2kings 2014-11-20 14:03:18 -05:00
parent 631172c456
commit d0886879fb
14 changed files with 6784 additions and 6643 deletions

View File

@ -1347,14 +1347,15 @@ namespace DS4Control
int controlnum = DS4ControltoInt(control); int controlnum = DS4ControltoInt(control);
double SXD = Global.getSXDeadzone(device); double SXD = Global.getSXDeadzone(device);
double SZD = Global.getSZDeadzone(device); double SZD = Global.getSZDeadzone(device);
int deadzone = 10; int deadzoneL = Math.Max((byte)10, Global.getLSDeadzone(device));
int deadzoneR = Math.Max((byte)10, Global.getRSDeadzone(device));
double value = 0; double value = 0;
int speed = Global.getButtonMouseSensitivity(device)+15; int speed = Global.getButtonMouseSensitivity(device)+15;
double root = 1.002; double root = 1.002;
double divide = 10000d; double divide = 10000d;
DateTime now = mousenow[mnum]; DateTime now = mousenow[mnum];
bool leftsitcklive = ((cState.LX < 127 - deadzone || 127 + deadzone < cState.LX) || (cState.LY < 127 - deadzone || 127 + deadzone < cState.LY)); bool leftsitcklive = ((cState.LX < 127 - deadzoneL || 127 + deadzoneL < cState.LX) || (cState.LY < 127 - deadzoneL || 127 + deadzoneL < cState.LY));
bool rightsitcklive = ((cState.RX < 127 - deadzone || 127 + deadzone < cState.RX) || (cState.RY < 127 - deadzone || 127 + deadzone < cState.RY)); bool rightsitcklive = ((cState.RX < 127 - deadzoneR || 127 + deadzoneR < cState.RX) || (cState.RY < 127 - deadzoneR || 127 + deadzoneR < cState.RY));
switch (control) switch (control)
{ {
case DS4Controls.LXNeg: case DS4Controls.LXNeg:
@ -1419,10 +1420,10 @@ namespace DS4Control
case DS4Controls.GyroZNeg: return (byte)(eState.GyroZ < -SZD * 7500 ? case DS4Controls.GyroZNeg: return (byte)(eState.GyroZ < -SZD * 7500 ?
Math.Pow(root + speed / divide, -eState.GyroZ / 62) : 0); Math.Pow(root + speed / divide, -eState.GyroZ / 62) : 0);
} }
bool LXChanged = (Math.Abs(127 - cState.LX) < deadzone); bool LXChanged = (Math.Abs(127 - cState.LX) < deadzoneL);
bool LYChanged = (Math.Abs(127 - cState.LY) < deadzone); bool LYChanged = (Math.Abs(127 - cState.LY) < deadzoneL);
bool RXChanged = (Math.Abs(127 - cState.RX) < deadzone); bool RXChanged = (Math.Abs(127 - cState.RX) < deadzoneR);
bool RYChanged = (Math.Abs(127 - cState.RY) < deadzone); bool RYChanged = (Math.Abs(127 - cState.RY) < deadzoneR);
if (LXChanged || LYChanged || RXChanged || RYChanged) if (LXChanged || LYChanged || RXChanged || RYChanged)
now = DateTime.UtcNow; now = DateTime.UtcNow;
if (Global.getMouseAccel(device)) if (Global.getMouseAccel(device))

View File

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
// Runtime Version:4.0.30319.34209 // Runtime Version:4.0.30319.0
// //
// Changes to this file may cause incorrect behavior and will be lost if // Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. // the code is regenerated.

View File

@ -315,7 +315,22 @@ namespace DS4Control
{ {
return m_Config.swipeProfiles; return m_Config.swipeProfiles;
} }
// New settings public static void setDS4Mapping(bool data)
{
m_Config.ds4Mapping = data;
}
public static bool getDS4Mapping()
{
return m_Config.ds4Mapping;
}
public static void setQuickCharge(bool data)
{
m_Config.quickCharge = data;
}
public static bool getQuickCharge()
{
return m_Config.quickCharge;
}
public static void saveLowColor(int device, byte red, byte green, byte blue) public static void saveLowColor(int device, byte red, byte green, byte blue)
{ {
m_Config.m_LowLeds[device][0] = red; m_Config.m_LowLeds[device][0] = red;
@ -792,6 +807,8 @@ namespace DS4Control
public bool notifications = true; public bool notifications = true;
public bool disconnectBTAtStop = false; public bool disconnectBTAtStop = false;
public bool swipeProfiles = true; public bool swipeProfiles = true;
public bool ds4Mapping = true;
public bool quickCharge = false;
public Dictionary<DS4Controls, DS4KeyType>[] customMapKeyTypes = { null, null, null, null, null }; public Dictionary<DS4Controls, DS4KeyType>[] customMapKeyTypes = { null, null, null, null, null };
public Dictionary<DS4Controls, UInt16>[] customMapKeys = { null, null, null, null, null }; public Dictionary<DS4Controls, UInt16>[] customMapKeys = { null, null, null, null, null };
public Dictionary<DS4Controls, String>[] customMapMacros = { null, null, null, null, null }; public Dictionary<DS4Controls, String>[] customMapMacros = { null, null, null, null, null };
@ -1662,7 +1679,6 @@ namespace DS4Control
m_Xdoc.Load(m_Profile); m_Xdoc.Load(m_Profile);
try { Item = m_Xdoc.SelectSingleNode("/Profile/useExclusiveMode"); Boolean.TryParse(Item.InnerText, out useExclusiveMode); } try { Item = m_Xdoc.SelectSingleNode("/Profile/useExclusiveMode"); Boolean.TryParse(Item.InnerText, out useExclusiveMode); }
catch { missingSetting = true; } catch { missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/Profile/startMinimized"); Boolean.TryParse(Item.InnerText, out startMinimized); } try { Item = m_Xdoc.SelectSingleNode("/Profile/startMinimized"); Boolean.TryParse(Item.InnerText, out startMinimized); }
@ -1689,6 +1705,10 @@ namespace DS4Control
catch { missingSetting = true; } catch { missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/Profile/SwipeProfiles"); Boolean.TryParse(Item.InnerText, out swipeProfiles); } try { Item = m_Xdoc.SelectSingleNode("/Profile/SwipeProfiles"); Boolean.TryParse(Item.InnerText, out swipeProfiles); }
catch { missingSetting = true; } catch { missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/Profile/UseDS4ForMapping"); Boolean.TryParse(Item.InnerText, out ds4Mapping); }
catch { missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/Profile/QuickCharge"); Boolean.TryParse(Item.InnerText, out quickCharge); }
catch { missingSetting = true; }
} }
} }
catch { } catch { }
@ -1731,6 +1751,8 @@ namespace DS4Control
XmlNode xmlNotifications = m_Xdoc.CreateNode(XmlNodeType.Element, "Notifications", null); xmlNotifications.InnerText = notifications.ToString(); Node.AppendChild(xmlNotifications); XmlNode xmlNotifications = m_Xdoc.CreateNode(XmlNodeType.Element, "Notifications", null); xmlNotifications.InnerText = notifications.ToString(); Node.AppendChild(xmlNotifications);
XmlNode xmlDisconnectBT = m_Xdoc.CreateNode(XmlNodeType.Element, "DisconnectBTAtStop", null); xmlDisconnectBT.InnerText = disconnectBTAtStop.ToString(); Node.AppendChild(xmlDisconnectBT); XmlNode xmlDisconnectBT = m_Xdoc.CreateNode(XmlNodeType.Element, "DisconnectBTAtStop", null); xmlDisconnectBT.InnerText = disconnectBTAtStop.ToString(); Node.AppendChild(xmlDisconnectBT);
XmlNode xmlSwipeProfiles = m_Xdoc.CreateNode(XmlNodeType.Element, "SwipeProfiles", null); xmlSwipeProfiles.InnerText = swipeProfiles.ToString(); Node.AppendChild(xmlSwipeProfiles); XmlNode xmlSwipeProfiles = m_Xdoc.CreateNode(XmlNodeType.Element, "SwipeProfiles", null); xmlSwipeProfiles.InnerText = swipeProfiles.ToString(); Node.AppendChild(xmlSwipeProfiles);
XmlNode xmlDS4Mapping = m_Xdoc.CreateNode(XmlNodeType.Element, "UseDS4ForMapping", null); xmlDS4Mapping.InnerText = ds4Mapping.ToString(); Node.AppendChild(xmlDS4Mapping);
XmlNode xmlQuickCharge = m_Xdoc.CreateNode(XmlNodeType.Element, "QuickCharge", null); xmlQuickCharge.InnerText = quickCharge.ToString(); Node.AppendChild(xmlQuickCharge);
m_Xdoc.AppendChild(Node); m_Xdoc.AppendChild(Node);
try { m_Xdoc.Save(m_Profile); } try { m_Xdoc.Save(m_Profile); }

View File

@ -512,7 +512,11 @@ namespace DS4Library
try try
{ {
if (!writeOutput()) if (!writeOutput())
{
Console.WriteLine(MacAddress.ToString() + " " + System.DateTime.UtcNow.ToString("o") + "> encountered synchronous write failure: " + Marshal.GetLastWin32Error()); Console.WriteLine(MacAddress.ToString() + " " + System.DateTime.UtcNow.ToString("o") + "> encountered synchronous write failure: " + Marshal.GetLastWin32Error());
ds4Output.Abort();
ds4Output.Join();
}
} }
catch catch
{ {

View File

@ -120,6 +120,7 @@
this.nUDUpdateTime = new System.Windows.Forms.NumericUpDown(); this.nUDUpdateTime = new System.Windows.Forms.NumericUpDown();
this.cBNotifications = new System.Windows.Forms.CheckBox(); this.cBNotifications = new System.Windows.Forms.CheckBox();
this.cBDisconnectBT = new System.Windows.Forms.CheckBox(); this.cBDisconnectBT = new System.Windows.Forms.CheckBox();
this.cBQuickCharge = new System.Windows.Forms.CheckBox();
this.linkProfiles = new System.Windows.Forms.LinkLabel(); this.linkProfiles = new System.Windows.Forms.LinkLabel();
this.lLBUpdate = new System.Windows.Forms.LinkLabel(); this.lLBUpdate = new System.Windows.Forms.LinkLabel();
this.linkSetup = new System.Windows.Forms.LinkLabel(); this.linkSetup = new System.Windows.Forms.LinkLabel();
@ -362,11 +363,13 @@
// //
resources.ApplyResources(this.lbPad1, "lbPad1"); resources.ApplyResources(this.lbPad1, "lbPad1");
this.lbPad1.Name = "lbPad1"; this.lbPad1.Name = "lbPad1";
this.lbPad1.TextChanged += new System.EventHandler(this.lbPad1_TextChanged);
// //
// lbPad2 // lbPad2
// //
resources.ApplyResources(this.lbPad2, "lbPad2"); resources.ApplyResources(this.lbPad2, "lbPad2");
this.lbPad2.Name = "lbPad2"; this.lbPad2.Name = "lbPad2";
this.lbPad2.TextChanged += new System.EventHandler(this.lbPad1_TextChanged);
// //
// bnEditC3 // bnEditC3
// //
@ -388,11 +391,13 @@
// //
resources.ApplyResources(this.lbPad3, "lbPad3"); resources.ApplyResources(this.lbPad3, "lbPad3");
this.lbPad3.Name = "lbPad3"; this.lbPad3.Name = "lbPad3";
this.lbPad3.TextChanged += new System.EventHandler(this.lbPad1_TextChanged);
// //
// lbPad4 // lbPad4
// //
resources.ApplyResources(this.lbPad4, "lbPad4"); resources.ApplyResources(this.lbPad4, "lbPad4");
this.lbPad4.Name = "lbPad4"; this.lbPad4.Name = "lbPad4";
this.lbPad4.TextChanged += new System.EventHandler(this.lbPad1_TextChanged);
// //
// cBController1 // cBController1
// //
@ -743,6 +748,7 @@
this.flowLayoutPanel1.Controls.Add(this.pNUpdate); this.flowLayoutPanel1.Controls.Add(this.pNUpdate);
this.flowLayoutPanel1.Controls.Add(this.cBNotifications); this.flowLayoutPanel1.Controls.Add(this.cBNotifications);
this.flowLayoutPanel1.Controls.Add(this.cBDisconnectBT); this.flowLayoutPanel1.Controls.Add(this.cBDisconnectBT);
this.flowLayoutPanel1.Controls.Add(this.cBQuickCharge);
this.flowLayoutPanel1.Controls.Add(this.linkProfiles); this.flowLayoutPanel1.Controls.Add(this.linkProfiles);
this.flowLayoutPanel1.Controls.Add(this.lLBUpdate); this.flowLayoutPanel1.Controls.Add(this.lLBUpdate);
this.flowLayoutPanel1.Controls.Add(this.linkSetup); this.flowLayoutPanel1.Controls.Add(this.linkSetup);
@ -836,6 +842,13 @@
this.cBDisconnectBT.UseVisualStyleBackColor = true; this.cBDisconnectBT.UseVisualStyleBackColor = true;
this.cBDisconnectBT.CheckedChanged += new System.EventHandler(this.cBDisconnectBT_CheckedChanged); this.cBDisconnectBT.CheckedChanged += new System.EventHandler(this.cBDisconnectBT_CheckedChanged);
// //
// cBQuickCharge
//
resources.ApplyResources(this.cBQuickCharge, "cBQuickCharge");
this.cBQuickCharge.Name = "cBQuickCharge";
this.cBQuickCharge.UseVisualStyleBackColor = true;
this.cBQuickCharge.CheckedChanged += new System.EventHandler(this.cBQuickCharge_CheckedChanged);
//
// linkProfiles // linkProfiles
// //
resources.ApplyResources(this.linkProfiles, "linkProfiles"); resources.ApplyResources(this.linkProfiles, "linkProfiles");
@ -1024,6 +1037,7 @@
private System.Windows.Forms.CheckBox cBSwipeProfiles; private System.Windows.Forms.CheckBox cBSwipeProfiles;
private System.Windows.Forms.ToolStripMenuItem startToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem startToolStripMenuItem;
public System.Windows.Forms.Label lbLastMessage; public System.Windows.Forms.Label lbLastMessage;
private System.Windows.Forms.CheckBox cBQuickCharge;
//private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2; //private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
} }
} }

View File

@ -14,6 +14,7 @@ using System.Diagnostics;
using System.Xml; using System.Xml;
using System.Text; using System.Text;
using System.Globalization; using System.Globalization;
using System.Threading.Tasks;
namespace DS4Windows namespace DS4Windows
{ {
public partial class DS4Form : Form public partial class DS4Form : Form
@ -48,20 +49,7 @@ namespace DS4Windows
ToolTip tt = new ToolTip(); ToolTip tt = new ToolTip();
public String m_Profile = Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName + "\\Profiles.xml"; public String m_Profile = Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName + "\\Profiles.xml";
protected XmlDocument m_Xdoc = new XmlDocument(); protected XmlDocument m_Xdoc = new XmlDocument();
public bool mAllowVisible;
protected void SetupArrays()
{
Pads = new Label[4] { lbPad1, lbPad2, lbPad3, lbPad4 };
Batteries = new Label[4] { lBBatt1, lBBatt2, lBBatt3, lBBatt4 };
cbs = new ComboBox[4] { cBController1, cBController2, cBController3, cBController4 };
ebns = new Button[4] { bnEditC1, bnEditC2, bnEditC3, bnEditC4 };
statPB = new PictureBox[4] { pBStatus1, pBStatus2, pBStatus3, pBStatus4 };
shortcuts = new ToolStripMenuItem[4] { (ToolStripMenuItem)notifyIcon1.ContextMenuStrip.Items[0],
(ToolStripMenuItem)notifyIcon1.ContextMenuStrip.Items[1],
(ToolStripMenuItem)notifyIcon1.ContextMenuStrip.Items[2],
(ToolStripMenuItem)notifyIcon1.ContextMenuStrip.Items[3] };
}
[DllImport("user32.dll")] [DllImport("user32.dll")]
private static extern IntPtr GetForegroundWindow(); private static extern IntPtr GetForegroundWindow();
@ -86,12 +74,22 @@ namespace DS4Windows
InitializeComponent(); InitializeComponent();
arguements = args; arguements = args;
ThemeUtil.SetTheme(lvDebug); ThemeUtil.SetTheme(lvDebug);
SetupArrays(); Pads = new Label[4] { lbPad1, lbPad2, lbPad3, lbPad4 };
Batteries = new Label[4] { lBBatt1, lBBatt2, lBBatt3, lBBatt4 };
cbs = new ComboBox[4] { cBController1, cBController2, cBController3, cBController4 };
ebns = new Button[4] { bnEditC1, bnEditC2, bnEditC3, bnEditC4 };
statPB = new PictureBox[4] { pBStatus1, pBStatus2, pBStatus3, pBStatus4 };
shortcuts = new ToolStripMenuItem[4] { (ToolStripMenuItem)notifyIcon1.ContextMenuStrip.Items[0],
(ToolStripMenuItem)notifyIcon1.ContextMenuStrip.Items[1],
(ToolStripMenuItem)notifyIcon1.ContextMenuStrip.Items[2],
(ToolStripMenuItem)notifyIcon1.ContextMenuStrip.Items[3] };
SystemEvents.PowerModeChanged += OnPowerChange; SystemEvents.PowerModeChanged += OnPowerChange;
tSOptions.Visible = false; tSOptions.Visible = false;
if (File.Exists(appdatapath + "\\Profiles.xml")) if (File.Exists(appdatapath + "\\Profiles.xml"))
tt.SetToolTip(linkUninstall, Properties.Resources.IfRemovingDS4Windows); tt.SetToolTip(linkUninstall, Properties.Resources.IfRemovingDS4Windows);
tt.SetToolTip(cBSwipeProfiles, Properties.Resources.TwoFingerSwipe); tt.SetToolTip(cBSwipeProfiles, Properties.Resources.TwoFingerSwipe);
tt.SetToolTip(cBQuickCharge, Properties.Resources.QuickCharge);
bool firstrun = false; bool firstrun = false;
if (File.Exists(exepath + "\\Auto Profiles.xml") if (File.Exists(exepath + "\\Auto Profiles.xml")
&& File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\DS4Tool\\Auto Profiles.xml")) && File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\DS4Tool\\Auto Profiles.xml"))
@ -177,14 +175,19 @@ namespace DS4Windows
hideDS4CheckBox.Checked = Global.getUseExclusiveMode(); hideDS4CheckBox.Checked = Global.getUseExclusiveMode();
hideDS4CheckBox.CheckedChanged += hideDS4CheckBox_CheckedChanged; hideDS4CheckBox.CheckedChanged += hideDS4CheckBox_CheckedChanged;
cBDisconnectBT.Checked = Global.getDCBTatStop(); cBDisconnectBT.Checked = Global.getDCBTatStop();
cBQuickCharge.Checked = Global.getQuickCharge();
// New settings // New settings
this.Width = Global.getFormWidth(); this.Width = Global.getFormWidth();
this.Height = Global.getFormHeight(); this.Height = Global.getFormHeight();
startMinimizedCheckBox.CheckedChanged -= startMinimizedCheckBox_CheckedChanged; startMinimizedCheckBox.CheckedChanged -= startMinimizedCheckBox_CheckedChanged;
startMinimizedCheckBox.Checked = Global.getStartMinimized(); startMinimizedCheckBox.Checked = Global.getStartMinimized();
startMinimizedCheckBox.CheckedChanged += startMinimizedCheckBox_CheckedChanged; startMinimizedCheckBox.CheckedChanged += startMinimizedCheckBox_CheckedChanged;
if (startMinimizedCheckBox.Checked) if (!startMinimizedCheckBox.Checked)
this.WindowState = FormWindowState.Minimized; {
mAllowVisible = true;
Show();
}
//this.WindowState = FormWindowState.Minimized;
Form_Resize(null, null); Form_Resize(null, null);
RefreshProfiles(); RefreshProfiles();
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
@ -241,6 +244,30 @@ namespace DS4Windows
StartWindowsCheckBox.Checked = File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\DS4Windows.lnk"); StartWindowsCheckBox.Checked = File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\DS4Windows.lnk");
} }
protected override void SetVisibleCore(bool value)
{
if (!mAllowVisible)
{
value = false;
if (!this.IsHandleCreated) CreateHandle();
}
base.SetVisibleCore(value);
}
private void showToolStripMenuItem_Click(object sender, EventArgs e)
{
mAllowVisible = true;
Show();
}
/*private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
mAllowClose = mAllowVisible = true;
if (!mLoadFired) Show();
Close();
}*/
public static string GetTopWindowName() public static string GetTopWindowName()
{ {
IntPtr hWnd = GetForegroundWindow(); IntPtr hWnd = GetForegroundWindow();
@ -559,6 +586,7 @@ namespace DS4Windows
else if (FormWindowState.Normal == this.WindowState) else if (FormWindowState.Normal == this.WindowState)
{ {
//mAllowVisible = true;
this.Show(); this.Show();
this.ShowInTaskbar = true; this.ShowInTaskbar = true;
this.FormBorderStyle = FormBorderStyle.Sizable; this.FormBorderStyle = FormBorderStyle.Sizable;
@ -631,6 +659,12 @@ namespace DS4Windows
for (Int32 Index = 0; Index < Pads.Length; Index++) for (Int32 Index = 0; Index < Pads.Length; Index++)
{ {
Pads[Index].Text = rootHub.getDS4MacAddress(Index); Pads[Index].Text = rootHub.getDS4MacAddress(Index);
DS4Device d = rootHub.DS4Controllers[Index];
if (d != null && Global.getQuickCharge() && d.ConnectionType == ConnectionType.BT && d.Charging)
{
d.DisconnectBT();
return;
}
switch (rootHub.getDS4Status(Index)) switch (rootHub.getDS4Status(Index))
{ {
case "USB": statPB[Index].Image = Properties.Resources.USB; tt.SetToolTip(statPB[Index], ""); break; case "USB": statPB[Index].Image = Properties.Resources.USB; tt.SetToolTip(statPB[Index], ""); break;
@ -672,10 +706,21 @@ namespace DS4Windows
private void pBStatus_MouseClick(object sender, MouseEventArgs e) private void pBStatus_MouseClick(object sender, MouseEventArgs e)
{ {
int i = Int32.Parse(((PictureBox)sender).Tag.ToString()); int i = Int32.Parse(((PictureBox)sender).Tag.ToString());
if (e.Button == System.Windows.Forms.MouseButtons.Right && rootHub.getDS4Status(i) == "BT") if (e.Button == System.Windows.Forms.MouseButtons.Right && rootHub.getDS4Status(i) == "BT" && !rootHub.DS4Controllers[i].Charging)
rootHub.DS4Controllers[i].DisconnectBT(); rootHub.DS4Controllers[i].DisconnectBT();
} }
private async void lbPad1_TextChanged(object sender, EventArgs e)
{
Label lb = ((Label)sender);
int i = int.Parse(lb.Name.Substring(lb.Name.Length-1)) - 1;
if (lb.Text == Properties.Resources.Disconnected && Pads[i].Enabled)
{
await Task.Delay(10);
Enable_Controls(i, false);
}
}
private void Enable_Controls(int device, bool on) private void Enable_Controls(int device, bool on)
{ {
Pads[device].Enabled = on; Pads[device].Enabled = on;
@ -975,6 +1020,7 @@ namespace DS4Windows
private void openToolStripMenuItem_Click(object sender, EventArgs e) private void openToolStripMenuItem_Click(object sender, EventArgs e)
{ {
mAllowVisible = true;
this.Show(); this.Show();
WindowState = FormWindowState.Normal; WindowState = FormWindowState.Normal;
} }
@ -987,6 +1033,7 @@ namespace DS4Windows
{ {
if (e.Button == System.Windows.Forms.MouseButtons.Left) if (e.Button == System.Windows.Forms.MouseButtons.Left)
{ {
mAllowVisible = true;
this.Show(); this.Show();
WindowState = FormWindowState.Normal; WindowState = FormWindowState.Normal;
} }
@ -1335,6 +1382,11 @@ namespace DS4Windows
Global.setSwipeProfiles(cBSwipeProfiles.Checked); Global.setSwipeProfiles(cBSwipeProfiles.Checked);
} }
private void cBQuickCharge_CheckedChanged(object sender, EventArgs e)
{
Global.setQuickCharge(cBQuickCharge.Checked);
}
private void lbLastMessage_MouseHover(object sender, EventArgs e) private void lbLastMessage_MouseHover(object sender, EventArgs e)
{ {
tt.Show(lbLastMessage.Text, lbLastMessage, -3, -3); tt.Show(lbLastMessage.Text, lbLastMessage, -3, -3);

View File

@ -8252,11 +8252,38 @@
<data name="&gt;&gt;cBDisconnectBT.ZOrder" xml:space="preserve"> <data name="&gt;&gt;cBDisconnectBT.ZOrder" xml:space="preserve">
<value>7</value> <value>7</value>
</data> </data>
<data name="cBQuickCharge.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="cBQuickCharge.Location" type="System.Drawing.Point, System.Drawing">
<value>10, 199</value>
</data>
<data name="cBQuickCharge.Size" type="System.Drawing.Size, System.Drawing">
<value>91, 17</value>
</data>
<data name="cBQuickCharge.TabIndex" type="System.Int32, mscorlib">
<value>55</value>
</data>
<data name="cBQuickCharge.Text" xml:space="preserve">
<value>Quick Charge</value>
</data>
<data name="&gt;&gt;cBQuickCharge.Name" xml:space="preserve">
<value>cBQuickCharge</value>
</data>
<data name="&gt;&gt;cBQuickCharge.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cBQuickCharge.Parent" xml:space="preserve">
<value>flowLayoutPanel1</value>
</data>
<data name="&gt;&gt;cBQuickCharge.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="linkProfiles.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="linkProfiles.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
</data> </data>
<data name="linkProfiles.Location" type="System.Drawing.Point, System.Drawing"> <data name="linkProfiles.Location" type="System.Drawing.Point, System.Drawing">
<value>10, 196</value> <value>10, 219</value>
</data> </data>
<data name="linkProfiles.Size" type="System.Drawing.Size, System.Drawing"> <data name="linkProfiles.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 13</value> <value>65, 13</value>
@ -8277,13 +8304,13 @@
<value>flowLayoutPanel1</value> <value>flowLayoutPanel1</value>
</data> </data>
<data name="&gt;&gt;linkProfiles.ZOrder" xml:space="preserve"> <data name="&gt;&gt;linkProfiles.ZOrder" xml:space="preserve">
<value>8</value> <value>9</value>
</data> </data>
<data name="lLBUpdate.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="lLBUpdate.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
</data> </data>
<data name="lLBUpdate.Location" type="System.Drawing.Point, System.Drawing"> <data name="lLBUpdate.Location" type="System.Drawing.Point, System.Drawing">
<value>10, 209</value> <value>10, 232</value>
</data> </data>
<data name="lLBUpdate.Size" type="System.Drawing.Size, System.Drawing"> <data name="lLBUpdate.Size" type="System.Drawing.Size, System.Drawing">
<value>116, 13</value> <value>116, 13</value>
@ -8307,13 +8334,13 @@
<value>flowLayoutPanel1</value> <value>flowLayoutPanel1</value>
</data> </data>
<data name="&gt;&gt;lLBUpdate.ZOrder" xml:space="preserve"> <data name="&gt;&gt;lLBUpdate.ZOrder" xml:space="preserve">
<value>9</value> <value>10</value>
</data> </data>
<data name="linkSetup.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="linkSetup.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
</data> </data>
<data name="linkSetup.Location" type="System.Drawing.Point, System.Drawing"> <data name="linkSetup.Location" type="System.Drawing.Point, System.Drawing">
<value>10, 222</value> <value>10, 245</value>
</data> </data>
<data name="linkSetup.Size" type="System.Drawing.Size, System.Drawing"> <data name="linkSetup.Size" type="System.Drawing.Size, System.Drawing">
<value>115, 13</value> <value>115, 13</value>
@ -8334,13 +8361,13 @@
<value>flowLayoutPanel1</value> <value>flowLayoutPanel1</value>
</data> </data>
<data name="&gt;&gt;linkSetup.ZOrder" xml:space="preserve"> <data name="&gt;&gt;linkSetup.ZOrder" xml:space="preserve">
<value>10</value> <value>11</value>
</data> </data>
<data name="linkUninstall.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="linkUninstall.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
</data> </data>
<data name="linkUninstall.Location" type="System.Drawing.Point, System.Drawing"> <data name="linkUninstall.Location" type="System.Drawing.Point, System.Drawing">
<value>10, 235</value> <value>10, 258</value>
</data> </data>
<data name="linkUninstall.Size" type="System.Drawing.Size, System.Drawing"> <data name="linkUninstall.Size" type="System.Drawing.Size, System.Drawing">
<value>106, 13</value> <value>106, 13</value>
@ -8364,13 +8391,13 @@
<value>flowLayoutPanel1</value> <value>flowLayoutPanel1</value>
</data> </data>
<data name="&gt;&gt;linkUninstall.ZOrder" xml:space="preserve"> <data name="&gt;&gt;linkUninstall.ZOrder" xml:space="preserve">
<value>11</value> <value>12</value>
</data> </data>
<data name="lnkControllers.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="lnkControllers.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
</data> </data>
<data name="lnkControllers.Location" type="System.Drawing.Point, System.Drawing"> <data name="lnkControllers.Location" type="System.Drawing.Point, System.Drawing">
<value>10, 248</value> <value>10, 271</value>
</data> </data>
<data name="lnkControllers.Size" type="System.Drawing.Size, System.Drawing"> <data name="lnkControllers.Size" type="System.Drawing.Size, System.Drawing">
<value>70, 13</value> <value>70, 13</value>
@ -8391,7 +8418,7 @@
<value>flowLayoutPanel1</value> <value>flowLayoutPanel1</value>
</data> </data>
<data name="&gt;&gt;lnkControllers.ZOrder" xml:space="preserve"> <data name="&gt;&gt;lnkControllers.ZOrder" xml:space="preserve">
<value>12</value> <value>13</value>
</data> </data>
<data name="flowLayoutPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="flowLayoutPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value> <value>Fill</value>

File diff suppressed because it is too large Load Diff

View File

@ -194,6 +194,7 @@ namespace DS4Windows
olddinputcheck = cBDinput.Checked; olddinputcheck = cBDinput.Checked;
cbStartTouchpadOff.Checked = Global.getStartTouchpadOff(device); cbStartTouchpadOff.Checked = Global.getStartTouchpadOff(device);
cBTPforControls.Checked = Global.getUseTPforControls(device); cBTPforControls.Checked = Global.getUseTPforControls(device);
cBControllerInput.Checked = Global.getDS4Mapping();
} }
else else
{ {
@ -448,6 +449,8 @@ namespace DS4Windows
Global.setDinputOnly(device, cBDinput.Checked); Global.setDinputOnly(device, cBDinput.Checked);
Global.setStartTouchpadOff(device, cbStartTouchpadOff.Checked); Global.setStartTouchpadOff(device, cbStartTouchpadOff.Checked);
Global.setUseTPforControls(device, cBTPforControls.Checked); Global.setUseTPforControls(device, cBTPforControls.Checked);
Global.setDS4Mapping(cBControllerInput.Checked);
gBTouchpad.Enabled = !cBTPforControls.Checked; gBTouchpad.Enabled = !cBTPforControls.Checked;
if (cBTPforControls.Checked) if (cBTPforControls.Checked)
tabControls.Size = new Size(tabControls.Size.Width, (int)(282 * dpiy)); tabControls.Size = new Size(tabControls.Size.Width, (int)(282 * dpiy));
@ -1547,5 +1550,10 @@ namespace DS4Windows
lBShiftControls.Items.RemoveAt(33); lBShiftControls.Items.RemoveAt(33);
} }
} }
private void cBControllerInput_CheckedChanged(object sender, EventArgs e)
{
Global.setDS4Mapping(cBControllerInput.Checked);
}
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -117,6 +117,7 @@ namespace DS4Windows
else else
{ {
WinProgs wp = (WinProgs)frm; WinProgs wp = (WinProgs)frm;
wp.form.mAllowVisible = true;
wp.ShowMainWindow(); wp.ShowMainWindow();
SetForegroundWindow(wp.form.Handle); SetForegroundWindow(wp.form.Handle);
} }

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.156")] [assembly: AssemblyVersion("1.4.157")]
[assembly: AssemblyFileVersion("1.4.156")] [assembly: AssemblyFileVersion("1.4.157")]

View File

@ -577,4 +577,7 @@
<data name="FullLightText" xml:space="preserve"> <data name="FullLightText" xml:space="preserve">
<value>Plein:</value> <value>Plein:</value>
</data> </data>
<data name="QuickCharge" xml:space="preserve">
<value>EXPERIMENTAL: Auto-Disable BT when conencting to USB</value>
</data>
</root> </root>

View File

@ -917,6 +917,15 @@ namespace DS4Windows.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to EXPERIMENTAL: Auto-Disable BT when conencting to USB.
/// </summary>
internal static string QuickCharge {
get {
return ResourceManager.GetString("QuickCharge", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to You must quit other applications like Steam, Uplay before activating the &apos;Hide DS4 Controller&apos; option.&quot;. /// Looks up a localized string similar to You must quit other applications like Steam, Uplay before activating the &apos;Hide DS4 Controller&apos; option.&quot;.
/// </summary> /// </summary>