2014-03-28 02:50:40 +01:00
using System ;
using System.Windows.Forms ;
using System.Runtime.InteropServices ;
2014-04-27 21:32:09 +02:00
using System.IO ;
using System.Reflection ;
using System.Collections.Generic ;
2014-05-14 09:12:15 +02:00
using System.Net ;
2014-05-30 22:39:39 +02:00
using System.Drawing ;
2014-05-21 19:39:56 +02:00
using Microsoft.Win32 ;
2014-05-28 21:47:25 +02:00
using System.Diagnostics ;
2014-06-06 22:38:52 +02:00
using System.Xml ;
2014-06-09 01:41:36 +02:00
using System.Text ;
2017-04-20 07:54:09 +02:00
using Microsoft.Win32.TaskScheduler ;
using System.Security.Principal ;
2017-08-25 23:38:17 +02:00
using System.Threading ;
2017-08-26 07:49:39 +02:00
using System.Drawing.Drawing2D ;
2017-08-26 11:25:42 +02:00
using TaskRunner = System . Threading . Tasks . Task ;
2017-08-30 04:57:31 +02:00
using NonFormTimer = System . Timers . Timer ;
2017-05-14 01:47:04 +02:00
using static DS4Windows . Global ;
2018-10-17 06:34:29 +02:00
using System.Security ;
2017-04-20 07:54:09 +02:00
2014-11-18 22:23:41 +01:00
namespace DS4Windows
2014-03-28 02:50:40 +01:00
{
2018-10-17 06:34:29 +02:00
[SuppressUnmanagedCodeSecurity]
2014-11-14 20:44:50 +01:00
public partial class DS4Form : Form
2014-03-28 02:50:40 +01:00
{
2017-08-23 09:51:09 +02:00
public string [ ] cmdArguments ;
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
delegate void LogDebugDelegate ( DateTime Time , String Data , bool warning ) ;
2017-04-25 03:26:34 +02:00
delegate void NotificationDelegate ( object sender , DebugEventArgs args ) ;
2017-04-29 10:19:45 +02:00
delegate void DeviceStatusChangedDelegate ( object sender , DeviceStatusChangeEventArgs args ) ;
2017-05-25 11:51:28 +02:00
delegate void DeviceSerialChangedDelegate ( object sender , SerialChangeArgs args ) ;
2017-08-30 04:57:31 +02:00
private Label [ ] Pads , Batteries ;
private ComboBox [ ] cbs ;
private Button [ ] ebns ;
private Button [ ] lights ;
private PictureBox [ ] statPB ;
private ToolStripMenuItem [ ] shortcuts ;
2018-05-26 06:52:41 +02:00
private ToolStripMenuItem [ ] disconnectShortcuts ;
2017-10-19 21:16:09 +02:00
protected CheckBox [ ] linkedProfileCB ;
2014-05-14 09:12:15 +02:00
WebClient wc = new WebClient ( ) ;
2017-08-30 04:57:31 +02:00
NonFormTimer hotkeysTimer = new NonFormTimer ( ) ;
NonFormTimer autoProfilesTimer = new NonFormTimer ( ) ;
2017-08-23 09:51:09 +02:00
string tempProfileProgram = string . Empty ;
2017-08-30 04:57:31 +02:00
double dpix , dpiy ;
2015-02-08 22:51:52 +01:00
List < string > profilenames = new List < string > ( ) ;
2014-06-06 22:38:52 +02:00
List < string > programpaths = new List < string > ( ) ;
List < string > [ ] proprofiles ;
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
List < bool > turnOffTempProfiles ;
2017-08-30 04:57:31 +02:00
private bool systemShutdown = false ;
2014-08-23 22:52:20 +02:00
private bool wasrunning = false ;
2014-06-06 22:38:52 +02:00
Options opt ;
2017-12-06 13:49:23 +01:00
private bool optPop ;
2017-05-14 01:47:04 +02:00
public Size oldsize ;
2014-12-13 21:12:03 +01:00
public bool mAllowVisible ;
bool contextclose ;
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
bool turnOffTemp ;
2015-08-13 05:53:43 +02:00
bool runningBat ;
2017-10-02 20:38:39 +02:00
private bool changingService ;
2018-10-12 09:24:55 +02:00
private static DS4Form instance ;
2017-05-05 05:15:22 +02:00
Dictionary < Control , string > hoverTextDict = new Dictionary < Control , string > ( ) ;
2017-06-05 10:29:02 +02:00
// 0 index is used for application version text. 1 - 4 indices are used for controller status
2017-08-30 04:57:31 +02:00
string [ ] notifyText = new string [ 5 ]
{ "DS4Windows v" + FileVersionInfo . GetVersionInfo ( Assembly . GetExecutingAssembly ( ) . Location ) . FileVersion ,
2017-06-05 10:29:02 +02:00
string . Empty , string . Empty , string . Empty , string . Empty } ;
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
2018-10-17 06:06:39 +02:00
private const string UPDATER_VERSION = "1.2.8.0" ;
private const int WM_QUERYENDSESSION = 0x11 ;
private const int WM_CLOSE = 0x10 ;
2017-11-10 18:49:38 +01:00
internal string updaterExe = Environment . Is64BitProcess ? "DS4Updater.exe" : "DS4Updater_x86.exe" ;
2017-04-24 11:43:56 +02:00
2014-06-09 01:41:36 +02:00
[DllImport("user32.dll")]
private static extern IntPtr GetForegroundWindow ( ) ;
[DllImport("user32.dll")]
private static extern uint GetWindowThreadProcessId ( IntPtr hWnd , out uint lpdwProcessId ) ;
[DllImport("kernel32.dll")]
private static extern IntPtr OpenProcess ( uint dwDesiredAccess , bool bInheritHandle , uint dwProcessId ) ;
[DllImport("kernel32.dll")]
private static extern bool CloseHandle ( IntPtr handle ) ;
[DllImport("psapi.dll")]
private static extern uint GetModuleFileNameEx ( IntPtr hWnd , IntPtr hModule , StringBuilder lpFileName , int nSize ) ;
2014-11-14 20:44:50 +01:00
public DS4Form ( string [ ] args )
2014-05-30 22:39:39 +02:00
{
2018-01-31 05:20:46 +01:00
Global . FindConfigLocation ( ) ;
2017-05-14 01:47:04 +02:00
2018-01-31 05:20:46 +01:00
if ( Global . firstRun )
2014-11-04 05:43:38 +01:00
{
2018-01-31 05:20:46 +01:00
new SaveWhere ( Global . multisavespots ) . ShowDialog ( ) ;
2014-11-04 05:43:38 +01:00
}
2017-04-29 10:19:45 +02:00
2018-01-30 04:01:23 +01:00
Global . Load ( ) ;
2018-01-31 05:20:46 +01:00
Global . SetCulture ( UseLang ) ;
2018-01-30 04:01:23 +01:00
InitializeComponent ( ) ;
bnEditC1 . Tag = 0 ;
bnEditC2 . Tag = 1 ;
bnEditC3 . Tag = 2 ;
bnEditC4 . Tag = 3 ;
StartWindowsCheckBox . CheckedChanged - = StartWindowsCheckBox_CheckedChanged ;
saveProfiles . Filter = Properties . Resources . XMLFiles + "|*.xml" ;
openProfiles . Filter = Properties . Resources . XMLFiles + "|*.xml" ;
cmdArguments = args ;
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 } ;
lights = new Button [ 4 ] { bnLight1 , bnLight2 , bnLight3 , bnLight4 } ;
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 ] } ;
2018-05-26 06:52:41 +02:00
disconnectShortcuts = new ToolStripMenuItem [ 4 ]
{
discon1toolStripMenuItem , discon2ToolStripMenuItem ,
discon3ToolStripMenuItem , discon4ToolStripMenuItem
} ;
2018-01-30 04:01:23 +01:00
linkedProfileCB = new CheckBox [ 4 ] { linkCB1 , linkCB2 , linkCB3 , linkCB4 } ;
SystemEvents . PowerModeChanged + = OnPowerChange ;
tSOptions . Visible = false ;
2017-08-27 10:45:35 +02:00
TaskRunner . Run ( ( ) = > CheckDrivers ( ) ) ;
2014-10-14 20:54:42 +02:00
2017-05-14 01:47:04 +02:00
if ( string . IsNullOrEmpty ( appdatapath ) )
2014-11-04 05:43:38 +01:00
{
Close ( ) ;
return ;
}
2017-04-29 10:19:45 +02:00
2017-08-30 04:57:31 +02:00
Graphics g = CreateGraphics ( ) ;
2014-11-04 05:43:38 +01:00
try
{
2014-11-14 20:44:50 +01:00
dpix = g . DpiX / 100f * 1.041666666667f ;
dpiy = g . DpiY / 100f * 1.041666666667f ;
2014-11-04 05:43:38 +01:00
}
finally
{
g . Dispose ( ) ;
}
2017-04-29 10:19:45 +02:00
blankControllerTab ( ) ;
2014-12-13 21:12:03 +01:00
Program . rootHub . Debug + = On_Debug ;
2015-02-08 22:51:52 +01:00
2018-09-29 11:42:22 +02:00
AppLogger . GuiLog + = On_Debug ;
AppLogger . TrayIconLog + = ShowNotification ;
2014-10-14 20:54:42 +02:00
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
Directory . CreateDirectory ( appdatapath ) ;
if ( ! Save ( ) ) //if can't write to file
2017-04-29 10:19:45 +02:00
{
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
if ( MessageBox . Show ( "Cannot write at current location\nCopy Settings to appdata?" , "DS4Windows" ,
2017-07-15 15:50:38 +02:00
MessageBoxButtons . YesNo , MessageBoxIcon . Warning ) = = DialogResult . Yes )
2014-11-04 05:43:38 +01:00
{
try
2014-10-14 20:54:42 +02:00
{
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
Directory . CreateDirectory ( appDataPpath ) ;
File . Copy ( exepath + "\\Profiles.xml" , appDataPpath + "\\Profiles.xml" ) ;
File . Copy ( exepath + "\\Auto Profiles.xml" , appDataPpath + "\\Auto Profiles.xml" ) ;
Directory . CreateDirectory ( appDataPpath + "\\Profiles" ) ;
2014-11-04 05:43:38 +01:00
foreach ( string s in Directory . GetFiles ( exepath + "\\Profiles" ) )
2014-10-14 20:54:42 +02:00
{
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
File . Copy ( s , appDataPpath + "\\Profiles\\" + Path . GetFileName ( s ) ) ;
2014-10-14 20:54:42 +02:00
}
}
2014-11-04 05:43:38 +01:00
catch { }
MessageBox . Show ( "Copy complete, please relaunch DS4Windows and remove settings from Program Directory" , "DS4Windows" ) ;
2014-10-14 20:54:42 +02:00
}
2014-11-04 05:43:38 +01:00
else
2014-10-14 20:54:42 +02:00
{
2014-11-04 05:43:38 +01:00
MessageBox . Show ( "DS4Windows cannot edit settings here, This will now close" , "DS4Windows" ) ;
2014-10-14 20:54:42 +02:00
}
2018-08-17 09:40:04 +02:00
appdatapath = null ;
Close ( ) ;
return ;
2017-04-29 10:19:45 +02:00
}
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
cBUseWhiteIcon . Checked = UseWhiteIcon ;
Icon = Properties . Resources . DS4W ;
notifyIcon1 . Icon = UseWhiteIcon ? Properties . Resources . DS4W___White : Properties . Resources . DS4W ;
2014-11-04 05:43:38 +01:00
foreach ( ToolStripMenuItem t in shortcuts )
t . DropDownItemClicked + = Profile_Changed_Menu ;
2017-04-29 10:19:45 +02:00
2015-08-13 05:53:43 +02:00
hideDS4CheckBox . CheckedChanged - = hideDS4CheckBox_CheckedChanged ;
hideDS4CheckBox . Checked = UseExclusiveMode ;
hideDS4CheckBox . CheckedChanged + = hideDS4CheckBox_CheckedChanged ;
2017-04-29 10:19:45 +02:00
2015-08-13 05:53:43 +02:00
cBDisconnectBT . Checked = DCBTatStop ;
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
cBQuickCharge . Checked = QuickCharge ;
nUDXIPorts . Value = FirstXinputPort ;
Program . rootHub . x360Bus . FirstController = FirstXinputPort ;
2014-11-04 05:43:38 +01:00
// New settings
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
this . Width = FormWidth ;
this . Height = FormHeight ;
2017-11-06 08:56:48 +01:00
Location = new Point ( FormLocationX , FormLocationY ) ;
2014-11-04 05:43:38 +01:00
startMinimizedCheckBox . CheckedChanged - = startMinimizedCheckBox_CheckedChanged ;
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
startMinimizedCheckBox . Checked = StartMinimized ;
2014-11-04 05:43:38 +01:00
startMinimizedCheckBox . CheckedChanged + = startMinimizedCheckBox_CheckedChanged ;
2018-06-01 23:45:58 +02:00
mintoTaskCheckBox . Checked = Global . MinToTaskbar ;
mintoTaskCheckBox . CheckedChanged + = MintoTaskCheckBox_CheckedChanged ;
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
cBCloseMini . Checked = CloseMini ;
2017-04-29 10:19:45 +02:00
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
cBFlashWhenLate . Checked = FlashWhenLate ;
nUDLatency . Value = FlashWhenLateAt ;
if ( ! LoadActions ( ) ) //if first no actions have been made yet, create PS+Option to D/C and save it to every profile
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
{
2018-08-17 09:20:53 +02:00
Global . CreateStdActions ( ) ;
2015-02-08 22:51:52 +01:00
}
2017-04-29 10:19:45 +02:00
2014-12-13 21:12:03 +01:00
bool start = true ;
bool mini = false ;
2017-08-23 09:51:09 +02:00
for ( int i = 0 , argslen = cmdArguments . Length ; i < argslen ; i + + )
2014-12-13 21:12:03 +01:00
{
2017-08-23 09:51:09 +02:00
if ( cmdArguments [ i ] = = "-stop" )
2014-12-13 21:12:03 +01:00
start = false ;
2017-08-23 09:51:09 +02:00
else if ( cmdArguments [ i ] = = "-m" )
2014-12-13 21:12:03 +01:00
mini = true ;
2017-08-23 09:51:09 +02:00
2014-12-13 21:12:03 +01:00
if ( mini & & start )
break ;
}
2017-04-29 10:19:45 +02:00
2014-12-13 21:12:03 +01:00
if ( ! ( startMinimizedCheckBox . Checked | | mini ) )
2014-11-20 20:03:18 +01:00
{
mAllowVisible = true ;
Show ( ) ;
}
2017-04-29 10:19:45 +02:00
2014-11-04 05:43:38 +01:00
Form_Resize ( null , null ) ;
RefreshProfiles ( ) ;
2017-12-06 13:49:23 +01:00
/ * opt = new Options ( this ) ;
2015-11-30 22:15:17 +01:00
opt . Icon = this . Icon ;
opt . TopLevel = false ;
2017-12-06 13:49:23 +01:00
opt . Dock = DockStyle . None ;
2017-07-15 15:50:38 +02:00
opt . FormBorderStyle = FormBorderStyle . None ;
2017-12-06 13:49:23 +01:00
* /
//tabProfiles.Controls.Add(opt);
2017-05-14 01:47:04 +02:00
2018-08-24 22:17:13 +02:00
//autoProfilesTimer.Elapsed += CheckAutoProfiles;
2017-05-09 16:24:46 +02:00
autoProfilesTimer . Interval = 1000 ;
2018-08-11 03:09:37 +02:00
autoProfilesTimer . AutoReset = false ;
2017-05-09 16:24:46 +02:00
2017-11-09 09:09:13 +01:00
FileVersionInfo fvi = FileVersionInfo . GetVersionInfo ( Assembly . GetExecutingAssembly ( ) . Location ) ;
string version = fvi . FileVersion ;
2018-09-29 11:42:22 +02:00
AppLogger . LogToGui ( "DS4Windows version " + version , false ) ;
2017-11-09 09:09:13 +01:00
2014-11-04 05:43:38 +01:00
LoadP ( ) ;
2017-10-19 21:16:09 +02:00
LoadLinkedProfiles ( ) ;
2017-05-14 01:47:04 +02:00
2017-04-25 11:24:14 +02:00
Global . BatteryStatusChange + = BatteryStatusUpdate ;
2017-04-26 10:00:05 +02:00
Global . ControllerRemoved + = ControllerRemovedChange ;
2017-04-29 10:19:45 +02:00
Global . DeviceStatusChange + = DeviceStatusChanged ;
2017-05-25 11:51:28 +02:00
Global . DeviceSerialChange + = DeviceSerialChanged ;
2014-12-03 23:36:54 +01:00
Enable_Controls ( 0 , false ) ;
Enable_Controls ( 1 , false ) ;
Enable_Controls ( 2 , false ) ;
Enable_Controls ( 3 , false ) ;
2015-04-21 21:00:09 +02:00
btnStartStop . Text = Properties . Resources . StartText ;
2017-05-09 16:24:46 +02:00
2018-08-24 22:17:13 +02:00
//hotkeysTimer.Elapsed += Hotkeys;
2018-08-11 04:43:11 +02:00
hotkeysTimer . AutoReset = false ;
2017-05-09 16:24:46 +02:00
if ( SwipeProfiles )
{
2018-08-24 22:17:13 +02:00
ChangeHotkeysStatus ( true ) ;
//hotkeysTimer.Start();
2017-05-09 16:24:46 +02:00
}
2014-11-04 05:43:38 +01:00
startToolStripMenuItem . Text = btnStartStop . Text ;
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
cBoxNotifications . SelectedIndex = Notifications ;
cBSwipeProfiles . Checked = SwipeProfiles ;
int checkwhen = CheckWhen ;
2014-11-04 05:43:38 +01:00
cBUpdate . Checked = checkwhen > 0 ;
if ( checkwhen > 23 )
{
cBUpdateTime . SelectedIndex = 1 ;
nUDUpdateTime . Value = checkwhen / 24 ;
}
else
{
cBUpdateTime . SelectedIndex = 0 ;
nUDUpdateTime . Value = checkwhen ;
}
2017-04-25 03:26:34 +02:00
2017-06-27 10:57:38 +02:00
Uri url = new Uri ( "http://23.239.26.40/ds4windows/files/builds/newest.txt" ) ; // Sorry other devs, gonna have to find your own server
2014-10-14 20:54:42 +02:00
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
if ( checkwhen > 0 & & DateTime . Now > = LastChecked + TimeSpan . FromHours ( checkwhen ) )
2014-11-04 05:43:38 +01:00
{
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
wc . DownloadFileAsync ( url , appdatapath + "\\version.txt" ) ;
2018-02-08 06:34:01 +01:00
wc . DownloadFileCompleted + = ( sender , e ) = > { TaskRunner . Run ( ( ) = > Check_Version ( sender , e ) ) ; } ;
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
LastChecked = DateTime . Now ;
2014-11-04 05:43:38 +01:00
}
2014-10-14 20:54:42 +02:00
2014-11-04 05:43:38 +01:00
if ( File . Exists ( exepath + "\\Updater.exe" ) )
{
2017-08-25 23:38:17 +02:00
Thread . Sleep ( 2000 ) ;
2014-11-04 05:43:38 +01:00
File . Delete ( exepath + "\\Updater.exe" ) ;
2014-10-14 20:54:42 +02:00
}
2017-04-29 10:19:45 +02:00
2015-12-13 22:30:54 +01:00
if ( ! Directory . Exists ( appdatapath + "\\Virtual Bus Driver" ) )
2014-11-04 05:43:38 +01:00
linkUninstall . Visible = false ;
2017-04-20 07:54:09 +02:00
2017-08-30 04:57:31 +02:00
bool isElevated = IsAdministrator ( ) ;
2017-05-02 07:05:58 +02:00
if ( ! isElevated )
{
Image tempImg = new Bitmap ( uacPictureBox . Width , uacPictureBox . Height ) ;
AddUACShieldToImage ( tempImg ) ;
uacPictureBox . BackgroundImage = tempImg ;
uacPictureBox . Visible = true ;
2017-05-05 05:15:22 +02:00
new ToolTip ( ) . SetToolTip ( uacPictureBox , Properties . Resources . UACTask ) ;
2017-05-02 07:05:58 +02:00
runStartTaskRadio . Enabled = false ;
2018-01-25 22:40:59 +01:00
hidGuardWhiteList . Visible = false ;
2018-01-26 00:43:22 +01:00
clrHidGuardWlistLinkLabel . Visible = false ;
2018-01-26 03:05:49 +01:00
hidGuardRegLinkLabel . Visible = false ;
linkSplitLabel . Visible = false ;
2017-05-02 07:05:58 +02:00
}
else
{
runStartTaskRadio . Enabled = true ;
}
2014-12-13 21:12:03 +01:00
if ( File . Exists ( Environment . GetFolderPath ( Environment . SpecialFolder . Startup ) + "\\DS4Windows.lnk" ) )
{
StartWindowsCheckBox . Checked = true ;
2017-04-20 07:54:09 +02:00
runStartupPanel . Visible = true ;
2017-04-24 11:43:56 +02:00
2014-12-13 21:12:03 +01:00
string lnkpath = WinProgs . ResolveShortcutAndArgument ( Environment . GetFolderPath ( Environment . SpecialFolder . Startup ) + "\\DS4Windows.lnk" ) ;
2017-04-20 07:54:09 +02:00
string onlylnkpath = WinProgs . ResolveShortcut ( Environment . GetFolderPath ( Environment . SpecialFolder . Startup ) + "\\DS4Windows.lnk" ) ;
if ( ! lnkpath . EndsWith ( "-runtask" ) )
{
runStartProgRadio . Checked = true ;
}
else
{
runStartTaskRadio . Checked = true ;
}
if ( onlylnkpath ! = Process . GetCurrentProcess ( ) . MainModule . FileName )
2014-12-13 21:12:03 +01:00
{
File . Delete ( Environment . GetFolderPath ( Environment . SpecialFolder . Startup ) + "\\DS4Windows.lnk" ) ;
appShortcutToStartup ( ) ;
2017-04-20 07:54:09 +02:00
changeStartupRoutine ( ) ;
2014-12-13 21:12:03 +01:00
}
}
2017-04-20 07:54:09 +02:00
2017-08-26 11:25:42 +02:00
TaskRunner . Run ( ( ) = > { UpdateTheUpdater ( ) ; } ) ;
2017-04-20 07:54:09 +02:00
2017-08-30 04:57:31 +02:00
StartWindowsCheckBox . CheckedChanged + = new EventHandler ( StartWindowsCheckBox_CheckedChanged ) ;
2017-05-05 05:15:22 +02:00
new ToolTip ( ) . SetToolTip ( StartWindowsCheckBox , Properties . Resources . RunAtStartup ) ;
2018-08-08 10:54:19 +02:00
ckUdpServ . Checked = nUDUdpPortNum . Enabled = isUsingUDPServer ( ) ;
2018-08-06 12:00:37 +02:00
nUDUdpPortNum . Value = getUDPServerPortNum ( ) ;
2018-08-08 10:54:19 +02:00
ckUdpServ . CheckedChanged + = CkUdpServ_CheckedChanged ;
nUDUdpPortNum . Leave + = NUDUdpPortNum_Leave ;
2017-05-05 05:15:22 +02:00
populateHoverTextDict ( ) ;
2017-05-13 07:54:29 +02:00
2018-06-19 08:09:52 +02:00
cBController1 . KeyPress + = CBController_KeyPress ;
cBController2 . KeyPress + = CBController_KeyPress ;
cBController3 . KeyPress + = CBController_KeyPress ;
cBController4 . KeyPress + = CBController_KeyPress ;
2017-05-13 07:54:29 +02:00
foreach ( Control control in fLPSettings . Controls )
{
2018-08-01 11:03:42 +02:00
string tempst ;
2017-05-13 07:54:29 +02:00
if ( control . HasChildren )
{
foreach ( Control ctrl in control . Controls )
2018-08-01 11:03:42 +02:00
{
if ( hoverTextDict . TryGetValue ( ctrl , out tempst ) )
{
ctrl . MouseHover + = Items_MouseHover ;
}
else
{
ctrl . MouseHover + = ClearLastMessage ;
}
}
}
else
{
if ( hoverTextDict . TryGetValue ( control , out tempst ) )
control . MouseEnter + = Items_MouseHover ;
else
control . MouseHover + = ClearLastMessage ;
2017-05-13 07:54:29 +02:00
}
}
2018-08-17 22:11:46 +02:00
2018-10-12 09:24:55 +02:00
instance = this ;
2018-08-17 22:11:46 +02:00
if ( btnStartStop . Enabled & & start )
2018-09-30 04:54:25 +02:00
TaskRunner . Delay ( 50 ) . ContinueWith ( ( t ) = > this . BeginInvoke ( ( System . Action ) ( ( ) = > BtnStartStop_Clicked ( ) ) ) ) ;
2017-05-05 05:15:22 +02:00
}
private void populateHoverTextDict ( )
{
hoverTextDict . Clear ( ) ;
hoverTextDict [ linkUninstall ] = Properties . Resources . IfRemovingDS4Windows ;
hoverTextDict [ cBSwipeProfiles ] = Properties . Resources . TwoFingerSwipe ;
hoverTextDict [ cBQuickCharge ] = Properties . Resources . QuickCharge ;
hoverTextDict [ pnlXIPorts ] = Properties . Resources . XinputPorts ;
hoverTextDict [ lbUseXIPorts ] = Properties . Resources . XinputPorts ;
hoverTextDict [ nUDXIPorts ] = Properties . Resources . XinputPorts ;
hoverTextDict [ lbLastXIPort ] = Properties . Resources . XinputPorts ;
hoverTextDict [ cBCloseMini ] = Properties . Resources . CloseMinimize ;
hoverTextDict [ uacPictureBox ] = Properties . Resources . UACTask ;
hoverTextDict [ StartWindowsCheckBox ] = Properties . Resources . RunAtStartup ;
2015-08-13 05:53:43 +02:00
}
2017-08-26 07:49:39 +02:00
private void AddUACShieldToImage ( Image image )
2017-05-02 07:05:58 +02:00
{
Bitmap shield = SystemIcons . Shield . ToBitmap ( ) ;
shield . MakeTransparent ( ) ;
Graphics g = Graphics . FromImage ( image ) ;
2017-08-26 07:49:39 +02:00
g . CompositingMode = CompositingMode . SourceOver ;
2017-05-02 07:05:58 +02:00
double aspectRatio = shield . Width / ( double ) shield . Height ;
int finalWidth = Convert . ToInt32 ( image . Height * aspectRatio ) ;
int finalHeight = Convert . ToInt32 ( image . Width / aspectRatio ) ;
g . DrawImage ( shield , new Rectangle ( 0 , 0 , finalWidth , finalHeight ) ) ;
}
2018-08-01 11:03:42 +02:00
private void ClearLastMessage ( object sender , EventArgs e )
{
lbLastMessage . Text = "" ;
lbLastMessage . ForeColor = SystemColors . GrayText ;
}
2018-08-24 22:17:13 +02:00
private void ChangeAutoProfilesStatus ( bool state )
{
if ( state )
{
autoProfilesTimer . Elapsed + = CheckAutoProfiles ;
autoProfilesTimer . Start ( ) ;
}
else
{
autoProfilesTimer . Stop ( ) ;
autoProfilesTimer . Elapsed - = CheckAutoProfiles ;
}
}
private void ChangeHotkeysStatus ( bool state )
{
if ( state )
{
hotkeysTimer . Elapsed + = Hotkeys ;
hotkeysTimer . Start ( ) ;
}
else
{
hotkeysTimer . Stop ( ) ;
hotkeysTimer . Elapsed - = Hotkeys ;
}
}
2017-04-29 10:19:45 +02:00
private void blankControllerTab ( )
{
2017-08-26 11:25:42 +02:00
for ( int Index = 0 , PadsLen = Pads . Length ;
Index < PadsLen ; Index + + )
2017-04-29 10:19:45 +02:00
{
if ( Index < ControlService . DS4_CONTROLLER_COUNT )
{
2018-06-19 07:04:30 +02:00
statPB [ Index ] . Visible = false ;
toolTip1 . SetToolTip ( statPB [ Index ] , "" ) ;
2017-04-29 10:19:45 +02:00
Batteries [ Index ] . Text = Properties . Resources . NA ;
Pads [ Index ] . Text = Properties . Resources . Disconnected ;
Enable_Controls ( Index , false ) ;
}
}
2017-08-26 11:25:42 +02:00
lbNoControllers . Visible = true ;
tLPControllers . Visible = false ;
2017-04-29 10:19:45 +02:00
}
2017-08-25 04:50:03 +02:00
private void UpdateTheUpdater ( )
2015-08-13 05:53:43 +02:00
{
if ( File . Exists ( exepath + "\\Update Files\\DS4Updater.exe" ) )
{
Process [ ] processes = Process . GetProcessesByName ( "DS4Updater" ) ;
while ( processes . Length > 0 )
{
2017-08-25 23:38:17 +02:00
Thread . Sleep ( 500 ) ;
2015-08-13 05:53:43 +02:00
}
2017-05-14 01:47:04 +02:00
2015-08-13 05:53:43 +02:00
File . Delete ( exepath + "\\DS4Updater.exe" ) ;
File . Move ( exepath + "\\Update Files\\DS4Updater.exe" , exepath + "\\DS4Updater.exe" ) ;
Directory . Delete ( exepath + "\\Update Files" ) ;
}
2014-06-09 01:41:36 +02:00
}
2014-11-20 20:03:18 +01:00
protected override void SetVisibleCore ( bool value )
{
if ( ! mAllowVisible )
{
value = false ;
2017-08-30 04:57:31 +02:00
if ( ! IsHandleCreated ) CreateHandle ( ) ;
2014-11-20 20:03:18 +01:00
}
2017-05-09 16:24:46 +02:00
2014-11-20 20:03:18 +01:00
base . SetVisibleCore ( value ) ;
}
2014-06-09 01:41:36 +02:00
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 ( ) ;
2014-05-31 06:37:02 +02:00
}
2014-06-06 22:38:52 +02:00
2018-10-12 09:24:55 +02:00
private static void OnPowerChange ( object s , PowerModeChangedEventArgs e )
2014-06-06 22:38:52 +02:00
{
switch ( e . Mode )
{
case PowerModes . Resume :
2017-05-09 16:24:46 +02:00
{
2018-10-12 09:24:55 +02:00
if ( instance . btnStartStop . Text = = Properties . Resources . StartText & & instance . wasrunning )
2014-08-23 22:52:20 +02:00
{
DS4LightBar . shuttingdown = false ;
2018-10-12 09:24:55 +02:00
instance . wasrunning = false ;
2018-02-26 10:51:24 +01:00
Program . rootHub . suspending = false ;
2018-10-12 09:24:55 +02:00
instance . BtnStartStop_Clicked ( ) ;
2014-08-23 22:52:20 +02:00
}
2014-06-06 22:38:52 +02:00
break ;
2017-05-09 16:24:46 +02:00
}
2014-06-06 22:38:52 +02:00
case PowerModes . Suspend :
2017-05-09 16:24:46 +02:00
{
2018-10-12 09:24:55 +02:00
if ( instance . btnStartStop . Text = = Properties . Resources . StopText )
2014-08-23 22:52:20 +02:00
{
DS4LightBar . shuttingdown = true ;
2018-02-26 10:51:24 +01:00
Program . rootHub . suspending = true ;
2018-10-12 09:24:55 +02:00
instance . BtnStartStop_Clicked ( ) ;
instance . wasrunning = true ;
2014-08-23 22:52:20 +02:00
}
2014-06-06 22:38:52 +02:00
break ;
2017-05-09 16:24:46 +02:00
}
default : break ;
2014-06-06 22:38:52 +02:00
}
}
2014-06-02 05:19:04 +02:00
void Hotkeys ( object sender , EventArgs e )
2014-05-28 21:47:25 +02:00
{
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
if ( SwipeProfiles )
2017-04-25 03:26:34 +02:00
{
2014-06-21 20:00:28 +02:00
for ( int i = 0 ; i < 4 ; i + + )
{
2014-12-13 21:12:03 +01:00
string slide = Program . rootHub . TouchpadSlide ( i ) ;
2014-06-21 20:00:28 +02:00
if ( slide = = "left" )
2017-04-25 03:26:34 +02:00
{
2018-08-19 21:03:55 +02:00
int ind = i ;
2018-08-17 21:36:35 +02:00
this . BeginInvoke ( ( System . Action ) ( ( ) = >
{
2018-08-19 21:03:55 +02:00
if ( cbs [ ind ] . SelectedIndex < = 0 )
cbs [ ind ] . SelectedIndex = cbs [ ind ] . Items . Count - 2 ;
2018-08-17 21:36:35 +02:00
else
2018-08-19 21:03:55 +02:00
cbs [ ind ] . SelectedIndex - - ;
2018-08-17 21:36:35 +02:00
} ) ) ;
2017-04-25 03:26:34 +02:00
}
2014-06-21 20:00:28 +02:00
else if ( slide = = "right" )
2017-04-25 03:26:34 +02:00
{
2018-08-19 21:03:55 +02:00
int ind = i ;
2018-08-17 21:36:35 +02:00
this . BeginInvoke ( ( System . Action ) ( ( ) = >
{
2018-08-19 21:03:55 +02:00
if ( cbs [ ind ] . SelectedIndex = = cbs [ ind ] . Items . Count - 2 )
cbs [ ind ] . SelectedIndex = 0 ;
2018-08-17 21:36:35 +02:00
else
2018-08-19 21:03:55 +02:00
cbs [ ind ] . SelectedIndex + + ;
2018-08-17 21:36:35 +02:00
} ) ) ;
2017-04-25 03:26:34 +02:00
}
2014-06-21 20:00:28 +02:00
if ( slide . Contains ( "t" ) )
2018-08-17 21:36:35 +02:00
{
2018-08-19 21:03:55 +02:00
int ind = i ;
2018-08-17 21:36:35 +02:00
this . BeginInvoke ( ( System . Action ) ( ( ) = >
{
2018-08-19 21:03:55 +02:00
ShowNotification ( this , Properties . Resources . UsingProfile . Replace ( "*number*" , ( ind + 1 ) . ToString ( ) ) . Replace ( "*Profile name*" , cbs [ ind ] . Text ) ) ;
2018-08-17 21:36:35 +02:00
} ) ) ;
}
2014-06-21 20:00:28 +02:00
}
2017-04-25 03:26:34 +02:00
}
2014-06-06 22:38:52 +02:00
2017-05-09 16:24:46 +02:00
if ( bat ! = null & & bat . HasExited & & runningBat )
{
Process . Start ( "explorer.exe" ) ;
bat = null ;
runningBat = false ;
}
2018-08-11 04:43:11 +02:00
hotkeysTimer . Start ( ) ;
2017-05-09 16:24:46 +02:00
}
private void CheckAutoProfiles ( object sender , EventArgs e )
{
2014-06-06 22:38:52 +02:00
//Check for process for auto profiles
2017-08-23 09:51:09 +02:00
if ( string . IsNullOrEmpty ( tempProfileProgram ) )
2017-04-25 03:26:34 +02:00
{
2017-05-09 16:24:46 +02:00
string windowName = GetTopWindowName ( ) . ToLower ( ) . Replace ( '/' , '\\' ) ;
for ( int i = 0 , pathsLen = programpaths . Count ; i < pathsLen ; i + + )
2014-06-09 01:41:36 +02:00
{
Rest of DS4Windows has been upped to .NET 4.5 (If you have .net 4/already can run DS4Windows, this won't affect you), thanks to this update, you can now...
Add delay to macros from one millisecond to 60 seconds, macros with delays only run once until pressed again. Without delays, the macro can be repeated while held down.
Profiles and settings are now back inside the application folder to help portability. It will remain in appdata as previous versions if DS4Windows is in a admin folder, I may try to add a setting for location saving.
Import profile option will automatically go to the appdata profile folder, auto profiles and settings will automatically copy over.
Option to delete the appdata folder if not in use in the settings tab, this way it helps with cleanup.
Another fix for auto profiles startup bug
Better reading of autoprofile program path names
Now only one instance of DS4Windows is possible, if another DS4Tool or DS4Windows that is not this version is started, this DS4Windows comes back into focus.
UI fixes
2014-06-10 21:45:09 +02:00
string name = programpaths [ i ] . ToLower ( ) . Replace ( '/' , '\\' ) ;
2017-05-09 16:24:46 +02:00
if ( name = = windowName )
2014-06-09 01:41:36 +02:00
{
for ( int j = 0 ; j < 4 ; j + + )
2017-04-25 03:26:34 +02:00
{
2014-08-17 00:09:15 +02:00
if ( proprofiles [ j ] [ i ] ! = "(none)" & & proprofiles [ j ] [ i ] ! = Properties . Resources . noneProfile )
2014-07-26 01:17:45 +02:00
{
2017-06-03 12:20:46 +02:00
LoadTempProfile ( j , proprofiles [ j ] [ i ] , true , Program . rootHub ) ; // j is controller index, i is filename
//if (LaunchProgram[j] != string.Empty) Process.Start(LaunchProgram[j]);
2014-07-26 01:17:45 +02:00
}
2017-04-25 03:26:34 +02:00
}
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
if ( turnOffTempProfiles [ i ] )
{
turnOffTemp = true ;
if ( btnStartStop . Text = = Properties . Resources . StopText )
{
2018-08-24 22:17:13 +02:00
//autoProfilesTimer.Stop();
//hotkeysTimer.Stop();
ChangeAutoProfilesStatus ( false ) ;
ChangeHotkeysStatus ( false ) ;
2018-06-19 07:04:30 +02:00
this . Invoke ( ( System . Action ) ( ( ) = > {
this . changingService = true ;
BtnStartStop_Clicked ( ) ;
} ) ) ;
while ( this . changingService )
{
Thread . SpinWait ( 500 ) ;
}
this . Invoke ( ( System . Action ) ( ( ) = >
{
2018-08-24 22:17:13 +02:00
//hotkeysTimer.Start();
ChangeHotkeysStatus ( true ) ;
ChangeAutoProfilesStatus ( true ) ;
//autoProfilesTimer.Start();
2018-06-19 07:04:30 +02:00
} ) ) ;
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
}
}
2017-04-25 03:26:34 +02:00
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
tempProfileProgram = name ;
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
break ;
2014-06-09 01:41:36 +02:00
}
}
2017-04-25 03:26:34 +02:00
}
2014-06-09 01:41:36 +02:00
else
{
2017-05-09 16:24:46 +02:00
string windowName = GetTopWindowName ( ) . ToLower ( ) . Replace ( '/' , '\\' ) ;
if ( tempProfileProgram ! = windowName )
2014-06-09 01:41:36 +02:00
{
2017-08-23 09:51:09 +02:00
tempProfileProgram = string . Empty ;
2014-06-09 01:41:36 +02:00
for ( int j = 0 ; j < 4 ; j + + )
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
LoadProfile ( j , false , Program . rootHub ) ;
2017-04-25 03:26:34 +02:00
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
if ( turnOffTemp )
{
turnOffTemp = false ;
if ( btnStartStop . Text = = Properties . Resources . StartText )
{
2018-06-19 07:04:30 +02:00
this . BeginInvoke ( ( System . Action ) ( ( ) = >
{
BtnStartStop_Clicked ( ) ;
} ) ) ;
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
}
}
2014-06-09 01:41:36 +02:00
}
}
2017-04-25 03:26:34 +02:00
2018-08-11 03:09:37 +02:00
autoProfilesTimer . Start ( ) ;
2017-05-09 16:24:46 +02:00
//GC.Collect();
2014-06-06 22:38:52 +02:00
}
2015-02-08 22:51:52 +01:00
2014-06-06 22:38:52 +02:00
public void LoadP ( )
{
XmlDocument doc = new XmlDocument ( ) ;
proprofiles = new List < string > [ 4 ] { new List < string > ( ) , new List < string > ( ) ,
new List < string > ( ) , new List < string > ( ) } ;
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
turnOffTempProfiles = new List < bool > ( ) ;
2014-06-06 22:38:52 +02:00
programpaths . Clear ( ) ;
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
if ( ! File . Exists ( appdatapath + "\\Auto Profiles.xml" ) )
2014-06-06 22:38:52 +02:00
return ;
2017-05-14 01:47:04 +02:00
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
doc . Load ( appdatapath + "\\Auto Profiles.xml" ) ;
2014-06-06 22:38:52 +02:00
XmlNodeList programslist = doc . SelectNodes ( "Programs/Program" ) ;
foreach ( XmlNode x in programslist )
2015-02-08 22:51:52 +01:00
programpaths . Add ( x . Attributes [ "path" ] . Value ) ;
2017-05-14 01:47:04 +02:00
2014-06-06 22:38:52 +02:00
foreach ( string s in programpaths )
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
{
2014-06-06 22:38:52 +02:00
for ( int i = 0 ; i < 4 ; i + + )
{
proprofiles [ i ] . Add ( doc . SelectSingleNode ( "/Programs/Program[@path=\"" + s + "\"]"
+ "/Controller" + ( i + 1 ) ) . InnerText ) ;
}
2017-05-14 01:47:04 +02:00
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
XmlNode item = doc . SelectSingleNode ( "/Programs/Program[@path=\"" + s + "\"]"
+ "/TurnOff" ) ;
bool turnOff ;
if ( item ! = null & & bool . TryParse ( item . InnerText , out turnOff ) )
turnOffTempProfiles . Add ( turnOff ) ;
else
turnOffTempProfiles . Add ( false ) ;
}
2017-05-09 16:24:46 +02:00
int pathCount = programpaths . Count ;
bool timerEnabled = autoProfilesTimer . Enabled ;
if ( pathCount > 0 & & ! timerEnabled )
{
2018-08-24 22:17:13 +02:00
ChangeAutoProfilesStatus ( true ) ;
//autoProfilesTimer.Start();
2017-05-09 16:24:46 +02:00
}
else if ( pathCount = = 0 & & timerEnabled )
{
2018-08-24 22:17:13 +02:00
//autoProfilesTimer.Stop();
ChangeAutoProfilesStatus ( false ) ;
2017-05-09 16:24:46 +02:00
}
2014-05-28 04:49:58 +02:00
}
2017-05-09 16:24:46 +02:00
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
string originalsettingstext ;
2014-05-21 07:36:05 +02:00
private void CheckDrivers ( )
{
2015-03-15 19:16:01 +01:00
originalsettingstext = tabSettings . Text ;
2014-05-21 07:36:05 +02:00
bool deriverinstalled = false ;
2018-01-28 09:25:35 +01:00
deriverinstalled = Global . IsScpVBusInstalled ( ) ;
if ( ! deriverinstalled )
{
Process p = new Process ( ) ;
p . StartInfo . FileName = Assembly . GetExecutingAssembly ( ) . Location ;
p . StartInfo . Arguments = "driverinstall" ;
p . StartInfo . Verb = "runas" ;
try { p . Start ( ) ; }
catch { }
2014-05-21 07:36:05 +02:00
}
2014-05-14 09:12:15 +02:00
}
2014-05-30 22:39:39 +02:00
2014-05-14 09:12:15 +02:00
private void Check_Version ( object sender , System . ComponentModel . AsyncCompletedEventArgs e )
{
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
FileVersionInfo fvi = FileVersionInfo . GetVersionInfo ( Assembly . GetExecutingAssembly ( ) . Location ) ;
string version = fvi . FileVersion ;
2017-05-13 07:54:29 +02:00
string newversion = File . ReadAllText ( appdatapath + "\\version.txt" ) . Trim ( ) ;
2017-08-30 04:57:31 +02:00
if ( version . Replace ( ',' , '.' ) . CompareTo ( newversion ) = = - 1 )
2017-05-13 07:54:29 +02:00
{
2018-02-08 06:34:01 +01:00
if ( ( DialogResult ) this . Invoke ( new Func < DialogResult > ( ( ) = > {
return MessageBox . Show ( Properties . Resources . DownloadVersion . Replace ( "*number*" , newversion ) ,
Properties . Resources . DS4Update , MessageBoxButtons . YesNo , MessageBoxIcon . Question ) ; } ) ) = = DialogResult . Yes )
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
{
2014-08-18 07:18:46 +02:00
if ( ! File . Exists ( exepath + "\\DS4Updater.exe" ) | | ( File . Exists ( exepath + "\\DS4Updater.exe" )
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
& & ( FileVersionInfo . GetVersionInfo ( exepath + "\\DS4Updater.exe" ) . FileVersion . CompareTo ( "1.1.0.0" ) = = - 1 ) ) )
{
2017-11-10 18:49:38 +01:00
Uri url2 = new Uri ( $"http://23.239.26.40/ds4windows/files/{updaterExe}" ) ;
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
WebClient wc2 = new WebClient ( ) ;
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
if ( appdatapath = = exepath )
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
wc2 . DownloadFile ( url2 , exepath + "\\DS4Updater.exe" ) ;
else
2014-05-16 00:10:17 +02:00
{
2018-02-08 08:20:33 +01:00
this . BeginInvoke ( ( System . Action ) ( ( ) = > MessageBox . Show ( Properties . Resources . PleaseDownloadUpdater ) ) ) ;
2017-11-10 18:49:38 +01:00
Process . Start ( $"http://23.239.26.40/ds4windows/files/{updaterExe}" ) ;
2014-05-16 00:10:17 +02:00
}
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
}
2017-05-13 07:54:29 +02:00
2014-08-18 07:18:46 +02:00
Process p = new Process ( ) ;
p . StartInfo . FileName = exepath + "\\DS4Updater.exe" ;
2018-02-12 07:40:34 +01:00
p . StartInfo . Arguments = "-autolaunch" ;
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
if ( AdminNeeded ( ) )
2014-08-18 07:18:46 +02:00
p . StartInfo . Verb = "runas" ;
2017-05-13 07:54:29 +02:00
2014-12-02 01:07:29 +01:00
try { p . Start ( ) ; Close ( ) ; }
catch { }
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
}
2014-05-14 09:12:15 +02:00
else
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
File . Delete ( appdatapath + "\\version.txt" ) ;
2017-05-13 07:54:29 +02:00
}
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
else
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
File . Delete ( appdatapath + "\\version.txt" ) ;
2014-03-28 02:50:40 +01:00
}
2014-06-09 01:41:36 +02:00
2014-04-27 21:32:09 +02:00
public void RefreshProfiles ( )
{
try
{
2014-05-28 21:47:25 +02:00
profilenames . Clear ( ) ;
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
string [ ] profiles = Directory . GetFiles ( appdatapath + @"\Profiles\" ) ;
2017-05-14 01:47:04 +02:00
foreach ( string s in profiles )
2017-05-13 07:54:29 +02:00
{
2014-04-29 03:14:01 +02:00
if ( s . EndsWith ( ".xml" ) )
2014-05-21 07:36:05 +02:00
profilenames . Add ( Path . GetFileNameWithoutExtension ( s ) ) ;
2017-05-13 07:54:29 +02:00
}
2014-05-30 22:39:39 +02:00
lBProfiles . Items . Clear ( ) ;
lBProfiles . Items . AddRange ( profilenames . ToArray ( ) ) ;
2014-09-15 04:37:14 +02:00
if ( lBProfiles . Items . Count = = 0 )
{
2015-12-18 07:25:51 +01:00
SaveProfile ( 0 , "Default" ) ;
2018-02-20 07:05:52 +01:00
ProfilePath [ 0 ] = OlderProfilePath [ 0 ] = "Default" ;
2014-09-15 04:37:14 +02:00
RefreshProfiles ( ) ;
return ;
}
2014-04-27 21:32:09 +02:00
for ( int i = 0 ; i < 4 ; i + + )
{
cbs [ i ] . Items . Clear ( ) ;
2014-04-29 03:14:01 +02:00
shortcuts [ i ] . DropDownItems . Clear ( ) ;
cbs [ i ] . Items . AddRange ( profilenames . ToArray ( ) ) ;
foreach ( string s in profilenames )
2014-09-15 04:37:14 +02:00
shortcuts [ i ] . DropDownItems . Add ( s ) ;
2017-05-13 07:54:29 +02:00
for ( int j = 0 , itemCount = cbs [ i ] . Items . Count ; j < itemCount ; j + + )
{
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
if ( cbs [ i ] . Items [ j ] . ToString ( ) = = Path . GetFileNameWithoutExtension ( ProfilePath [ i ] ) )
2014-04-27 21:32:09 +02:00
{
cbs [ i ] . SelectedIndex = j ;
2014-04-29 03:14:01 +02:00
( ( ToolStripMenuItem ) shortcuts [ i ] . DropDownItems [ j ] ) . Checked = true ;
2018-02-20 07:05:52 +01:00
ProfilePath [ i ] = OlderProfilePath [ i ] = cbs [ i ] . Text ;
2014-08-17 00:09:15 +02:00
shortcuts [ i ] . Text = Properties . Resources . ContextEdit . Replace ( "*number*" , ( i + 1 ) . ToString ( ) ) ;
ebns [ i ] . Text = Properties . Resources . EditProfile ;
2014-04-27 21:32:09 +02:00
break ;
2014-04-29 03:14:01 +02:00
}
2014-05-06 20:49:18 +02:00
else
{
2014-08-17 00:09:15 +02:00
cbs [ i ] . Text = "(" + Properties . Resources . NoProfileLoaded + ")" ;
shortcuts [ i ] . Text = Properties . Resources . ContextNew . Replace ( "*number*" , ( i + 1 ) . ToString ( ) ) ;
ebns [ i ] . Text = Properties . Resources . New ;
2014-05-06 20:49:18 +02:00
}
2017-05-13 07:54:29 +02:00
}
2014-04-27 21:32:09 +02:00
}
}
catch ( DirectoryNotFoundException )
{
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
Directory . CreateDirectory ( appdatapath + @"\Profiles\" ) ;
2015-12-18 07:25:51 +01:00
SaveProfile ( 0 , "Default" ) ;
2018-02-20 07:05:52 +01:00
ProfilePath [ 0 ] = OlderProfilePath [ 0 ] = "Default" ;
2014-09-15 04:37:14 +02:00
RefreshProfiles ( ) ;
return ;
}
finally
{
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
if ( ! ( cbs [ 0 ] . Items . Count > 0 & & cbs [ 0 ] . Items [ cbs [ 0 ] . Items . Count - 1 ] . ToString ( ) = = "+" + Properties . Resources . PlusNewProfile ) )
Rest of DS4Windows has been upped to .NET 4.5 (If you have .net 4/already can run DS4Windows, this won't affect you), thanks to this update, you can now...
Add delay to macros from one millisecond to 60 seconds, macros with delays only run once until pressed again. Without delays, the macro can be repeated while held down.
Profiles and settings are now back inside the application folder to help portability. It will remain in appdata as previous versions if DS4Windows is in a admin folder, I may try to add a setting for location saving.
Import profile option will automatically go to the appdata profile folder, auto profiles and settings will automatically copy over.
Option to delete the appdata folder if not in use in the settings tab, this way it helps with cleanup.
Another fix for auto profiles startup bug
Better reading of autoprofile program path names
Now only one instance of DS4Windows is possible, if another DS4Tool or DS4Windows that is not this version is started, this DS4Windows comes back into focus.
UI fixes
2014-06-10 21:45:09 +02:00
{
for ( int i = 0 ; i < 4 ; i + + )
{
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
cbs [ i ] . Items . Add ( "+" + Properties . Resources . PlusNewProfile ) ;
2014-09-15 04:37:14 +02:00
shortcuts [ i ] . DropDownItems . Add ( "-" ) ;
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
shortcuts [ i ] . DropDownItems . Add ( "+" + Properties . Resources . PlusNewProfile ) ;
Rest of DS4Windows has been upped to .NET 4.5 (If you have .net 4/already can run DS4Windows, this won't affect you), thanks to this update, you can now...
Add delay to macros from one millisecond to 60 seconds, macros with delays only run once until pressed again. Without delays, the macro can be repeated while held down.
Profiles and settings are now back inside the application folder to help portability. It will remain in appdata as previous versions if DS4Windows is in a admin folder, I may try to add a setting for location saving.
Import profile option will automatically go to the appdata profile folder, auto profiles and settings will automatically copy over.
Option to delete the appdata folder if not in use in the settings tab, this way it helps with cleanup.
Another fix for auto profiles startup bug
Better reading of autoprofile program path names
Now only one instance of DS4Windows is possible, if another DS4Tool or DS4Windows that is not this version is started, this DS4Windows comes back into focus.
UI fixes
2014-06-10 21:45:09 +02:00
}
2014-09-15 04:37:14 +02:00
RefreshAutoProfilesPage ( ) ;
2014-06-02 05:19:04 +02:00
}
}
2014-04-27 21:32:09 +02:00
}
2014-05-19 07:55:12 +02:00
2014-06-09 01:41:36 +02:00
2014-06-06 22:38:52 +02:00
public void RefreshAutoProfilesPage ( )
{
tabAutoProfiles . Controls . Clear ( ) ;
2017-08-24 08:34:02 +02:00
WinProgs WP = new WinProgs ( profilenames . ToArray ( ) , this ) ;
2014-06-06 22:38:52 +02:00
WP . TopLevel = false ;
2017-05-13 07:54:29 +02:00
WP . FormBorderStyle = FormBorderStyle . None ;
2014-06-06 22:38:52 +02:00
WP . Visible = true ;
WP . Dock = DockStyle . Fill ;
tabAutoProfiles . Controls . Add ( WP ) ;
}
2017-04-25 03:26:34 +02:00
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
protected void LogDebug ( DateTime Time , String Data , bool warning )
2014-03-28 02:50:40 +01:00
{
2017-12-08 12:04:08 +01:00
if ( this . InvokeRequired )
2014-05-19 07:55:12 +02:00
{
LogDebugDelegate d = new LogDebugDelegate ( LogDebug ) ;
try
{
2017-04-25 03:26:34 +02:00
// Make sure to invoke method asynchronously instead of waiting for result
this . BeginInvoke ( d , new object [ ] { Time , Data , warning } ) ;
//this.Invoke(d, new object[] { Time, Data, warning });
2014-05-19 07:55:12 +02:00
}
catch { }
}
else
{
2014-05-21 07:36:05 +02:00
String Posted = Time . ToString ( "G" ) ;
2014-05-19 07:55:12 +02:00
lvDebug . Items . Add ( new ListViewItem ( new String [ ] { Posted , Data } ) ) . EnsureVisible ( ) ;
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
if ( warning ) lvDebug . Items [ lvDebug . Items . Count - 1 ] . ForeColor = Color . Red ;
2017-04-25 03:26:34 +02:00
// Added alternative
2014-05-19 07:55:12 +02:00
lbLastMessage . Text = Data ;
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
lbLastMessage . ForeColor = ( warning ? Color . Red : SystemColors . GrayText ) ;
2014-05-19 07:55:12 +02:00
}
}
protected void ShowNotification ( object sender , DebugEventArgs args )
{
2017-04-25 03:26:34 +02:00
if ( this . InvokeRequired )
2014-05-28 04:49:58 +02:00
{
2017-04-25 03:26:34 +02:00
NotificationDelegate d = new NotificationDelegate ( ShowNotification ) ;
try
{
// Make sure to invoke method asynchronously instead of waiting for result
this . BeginInvoke ( d , new object [ ] { sender , args } ) ;
}
catch { }
}
else
{
if ( Form . ActiveForm ! = this & & ( Notifications = = 2 | | ( Notifications = = 1 & & args . Warning ) | | sender ! = null ) )
{
this . notifyIcon1 . BalloonTipText = args . Data ;
notifyIcon1 . BalloonTipTitle = "DS4Windows" ;
notifyIcon1 . ShowBalloonTip ( 1 ) ;
}
2014-05-28 04:49:58 +02:00
}
2014-05-19 07:55:12 +02:00
}
2014-05-30 22:39:39 +02:00
protected void ShowNotification ( object sender , string text )
{
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
if ( Form . ActiveForm ! = this & & Notifications = = 2 )
2014-05-30 22:39:39 +02:00
{
this . notifyIcon1 . BalloonTipText = text ;
notifyIcon1 . BalloonTipTitle = "DS4Windows" ;
notifyIcon1 . ShowBalloonTip ( 1 ) ;
}
}
2014-05-19 07:55:12 +02:00
protected void Form_Resize ( object sender , EventArgs e )
{
2018-07-22 08:51:58 +02:00
bool minToTask = GetMinToTaskbar ( ) ;
2018-08-10 02:50:26 +02:00
if ( FormWindowState . Minimized = = WindowState & & ! minToTask )
2014-05-19 07:55:12 +02:00
{
2017-08-28 04:26:36 +02:00
Hide ( ) ;
ShowInTaskbar = false ;
FormBorderStyle = FormBorderStyle . None ;
2014-05-19 07:55:12 +02:00
}
2018-07-22 08:21:23 +02:00
2018-08-10 02:50:26 +02:00
else if ( FormWindowState . Normal = = WindowState & & ! minToTask )
2014-05-19 07:55:12 +02:00
{
2018-07-22 08:21:23 +02:00
//mAllowVisible = true;
2017-08-28 04:26:36 +02:00
Show ( ) ;
ShowInTaskbar = true ;
FormBorderStyle = FormBorderStyle . Sizable ;
2014-05-19 07:55:12 +02:00
}
2017-05-09 16:24:46 +02:00
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
chData . AutoResize ( ColumnHeaderAutoResizeStyle . HeaderSize ) ;
2014-03-28 02:50:40 +01:00
}
2018-02-26 10:22:06 +01:00
private void BtnStartStop_Click ( object sender , EventArgs e )
2014-03-29 06:29:08 +01:00
{
2018-02-26 09:55:17 +01:00
BtnStartStop_Clicked ( ) ;
2014-03-29 06:29:08 +01:00
}
2017-05-09 16:24:46 +02:00
2018-02-26 10:22:06 +01:00
private void ServiceStartup ( bool log )
2014-03-28 02:50:40 +01:00
{
2017-08-26 11:25:42 +02:00
var uiContext = SynchronizationContext . Current ;
2017-10-02 20:38:39 +02:00
changingService = true ;
2017-08-26 11:25:42 +02:00
TaskRunner . Run ( ( ) = >
2014-05-24 01:44:30 +02:00
{
2017-08-27 10:45:35 +02:00
//Thread.CurrentThread.Priority = ThreadPriority.AboveNormal;
2017-08-26 11:25:42 +02:00
Program . rootHub . Start ( uiContext , log ) ;
2018-02-26 10:22:06 +01:00
Invoke ( ( System . Action ) ( ( ) = > { ServiceStartupFinish ( ) ; } ) ) ;
2017-10-02 20:38:39 +02:00
changingService = false ;
2017-08-26 11:25:42 +02:00
} ) ;
}
2017-05-09 16:24:46 +02:00
2018-02-26 10:22:06 +01:00
private void ServiceStartupFinish ( )
2017-08-26 11:25:42 +02:00
{
if ( SwipeProfiles & & ! hotkeysTimer . Enabled )
{
2018-08-24 22:17:13 +02:00
ChangeHotkeysStatus ( true ) ;
//hotkeysTimer.Start();
2017-08-26 11:25:42 +02:00
}
2017-05-09 16:24:46 +02:00
2017-08-26 11:25:42 +02:00
if ( programpaths . Count > 0 & & ! autoProfilesTimer . Enabled )
{
2018-08-24 22:17:13 +02:00
ChangeAutoProfilesStatus ( true ) ;
//autoProfilesTimer.Start();
2014-05-24 01:44:30 +02:00
}
2017-08-26 11:25:42 +02:00
2017-10-04 01:14:12 +02:00
startToolStripMenuItem . Text = btnStartStop . Text = Properties . Resources . StopText ;
2017-08-26 11:25:42 +02:00
}
2018-02-26 10:51:24 +01:00
private void ServiceShutdown ( bool log )
2017-08-26 11:25:42 +02:00
{
2017-10-02 20:38:39 +02:00
changingService = true ;
2017-08-26 11:25:42 +02:00
TaskRunner . Run ( ( ) = >
2015-02-08 22:51:52 +01:00
{
2018-02-26 10:51:24 +01:00
Program . rootHub . Stop ( log ) ;
2018-02-26 10:22:06 +01:00
Invoke ( ( System . Action ) ( ( ) = > { ServiceShutdownFinish ( ) ; } ) ) ;
2017-10-02 20:38:39 +02:00
changingService = false ;
2017-08-26 11:25:42 +02:00
} ) ;
}
2018-02-26 10:22:06 +01:00
private void ServiceShutdownFinish ( )
2017-08-26 11:25:42 +02:00
{
2018-08-24 22:17:13 +02:00
ChangeAutoProfilesStatus ( false ) ;
ChangeHotkeysStatus ( false ) ;
//hotkeysTimer.Stop();
//autoProfilesTimer.Stop();
2017-10-04 01:14:12 +02:00
startToolStripMenuItem . Text = btnStartStop . Text = Properties . Resources . StartText ;
2017-08-26 11:25:42 +02:00
blankControllerTab ( ) ;
populateFullNotifyText ( ) ;
}
2018-02-26 10:51:24 +01:00
public void BtnStartStop_Clicked ( bool log = true )
2017-08-26 11:25:42 +02:00
{
if ( btnStartStop . Text = = Properties . Resources . StartText )
{
2018-02-26 10:22:06 +01:00
ServiceStartup ( log ) ;
2017-08-26 11:25:42 +02:00
}
else if ( btnStartStop . Text = = Properties . Resources . StopText )
{
2017-05-09 12:11:50 +02:00
blankControllerTab ( ) ;
2018-02-26 10:51:24 +01:00
ServiceShutdown ( log ) ;
2014-03-28 02:50:40 +01:00
}
}
2017-05-09 16:24:46 +02:00
2018-02-26 09:55:17 +01:00
protected void BtnClear_Click ( object sender , EventArgs e )
2014-03-28 02:50:40 +01:00
{
lvDebug . Items . Clear ( ) ;
lbLastMessage . Text = string . Empty ;
}
2017-06-11 17:15:45 +02:00
private bool inHotPlug = false ;
private int hotplugCounter = 0 ;
private object hotplugCounterLock = new object ( ) ;
2018-07-17 00:29:05 +02:00
private const int DBT_DEVNODES_CHANGED = 0x0007 ;
2018-10-16 21:35:41 +02:00
private const int DBT_DEVICEARRIVAL = 0x8000 ;
private const int DBT_DEVICEREMOVECOMPLETE = 0x8004 ;
2014-03-28 02:50:40 +01:00
protected override void WndProc ( ref Message m )
{
2018-10-17 06:06:39 +02:00
switch ( m . Msg )
2018-10-16 21:35:41 +02:00
{
2018-10-17 06:06:39 +02:00
case ScpDevice . WM_CREATE :
2018-10-16 21:35:41 +02:00
{
2018-10-17 06:06:39 +02:00
Guid hidGuid = new Guid ( ) ;
NativeMethods . HidD_GetHidGuid ( ref hidGuid ) ;
IntPtr outHandle = new IntPtr ( ) ;
bool result = ScpDevice . RegisterNotify ( this . Handle , hidGuid , ref outHandle ) ;
if ( ! result )
{
ScpForm_Closing ( this ,
new FormClosingEventArgs ( CloseReason . ApplicationExitCall , false ) ) ;
}
break ;
2018-10-16 21:35:41 +02:00
}
2018-10-17 06:06:39 +02:00
case ScpDevice . WM_DEVICECHANGE :
2014-03-28 02:50:40 +01:00
{
2018-10-17 06:06:39 +02:00
if ( runHotPlug )
2014-03-28 02:50:40 +01:00
{
2018-10-17 06:06:39 +02:00
Int32 Type = m . WParam . ToInt32 ( ) ;
if ( Type = = DBT_DEVICEARRIVAL | |
Type = = DBT_DEVICEREMOVECOMPLETE )
2017-06-11 17:15:45 +02:00
{
2018-10-17 06:06:39 +02:00
lock ( hotplugCounterLock )
{
hotplugCounter + + ;
}
2017-06-11 17:15:45 +02:00
2018-10-17 06:06:39 +02:00
if ( ! inHotPlug )
{
inHotPlug = true ;
TaskRunner . Run ( ( ) = > { Thread . Sleep ( 1500 ) ; InnerHotplug2 ( ) ; } ) ;
}
2017-06-11 17:15:45 +02:00
}
2014-03-28 02:50:40 +01:00
}
2018-10-17 06:06:39 +02:00
break ;
}
case WM_CLOSE :
{
ScpDevice . UnregisterNotify ( Handle ) ;
break ;
2014-03-28 02:50:40 +01:00
}
2018-10-17 06:06:39 +02:00
case WM_QUERYENDSESSION :
{
systemShutdown = true ;
break ;
}
default : break ;
2014-03-28 02:50:40 +01:00
}
2018-07-17 00:29:05 +02:00
2014-06-02 19:29:38 +02:00
// If this is WM_QUERYENDSESSION, the closing event should be
// raised in the base WndProc.
2018-07-17 00:29:05 +02:00
base . WndProc ( ref m ) ;
2014-03-28 02:50:40 +01:00
}
2015-02-08 22:51:52 +01:00
2018-08-20 11:35:41 +02:00
private void InnerHotplug2 ( )
2017-05-01 20:28:07 +02:00
{
2017-08-01 09:42:59 +02:00
inHotPlug = true ;
2017-08-26 13:28:42 +02:00
2017-08-01 09:42:59 +02:00
bool loopHotplug = false ;
lock ( hotplugCounterLock )
2017-05-01 20:28:07 +02:00
{
2017-08-01 09:42:59 +02:00
loopHotplug = hotplugCounter > 0 ;
2017-05-01 20:28:07 +02:00
}
2017-08-01 09:42:59 +02:00
while ( loopHotplug = = true )
2017-05-01 20:28:07 +02:00
{
2018-08-20 11:35:41 +02:00
Program . rootHub . HotPlug ( ) ;
2017-08-26 11:25:42 +02:00
//TaskRunner.Run(() => { Program.rootHub.HotPlug(uiContext); });
2017-06-11 17:15:45 +02:00
lock ( hotplugCounterLock )
{
2017-08-01 09:42:59 +02:00
hotplugCounter - - ;
loopHotplug = hotplugCounter > 0 ;
2017-06-11 17:15:45 +02:00
}
2017-05-01 20:28:07 +02:00
}
2017-08-01 09:42:59 +02:00
inHotPlug = false ;
2017-05-01 20:28:07 +02:00
}
2017-04-25 11:24:14 +02:00
protected void BatteryStatusUpdate ( object sender , BatteryReportArgs args )
{
2017-08-21 12:25:18 +02:00
string battery ;
int level = args . getLevel ( ) ;
bool charging = args . isCharging ( ) ;
int Index = args . getIndex ( ) ;
if ( charging )
2017-04-25 11:24:14 +02:00
{
2017-08-21 12:25:18 +02:00
if ( level > = 100 )
battery = Properties . Resources . Full ;
else
battery = level + "%+" ;
2017-04-25 11:24:14 +02:00
}
else
{
2017-08-21 12:25:18 +02:00
battery = level + "%" ;
}
2017-04-25 11:24:14 +02:00
2017-08-21 12:25:18 +02:00
Batteries [ args . getIndex ( ) ] . Text = battery ;
2017-06-05 04:13:14 +02:00
2017-08-21 12:25:18 +02:00
// Update device battery level display for tray icon
generateDeviceNotifyText ( args . getIndex ( ) ) ;
populateNotifyText ( ) ;
2017-06-05 04:13:14 +02:00
}
2017-06-05 10:29:02 +02:00
protected void populateFullNotifyText ( )
2017-06-05 04:13:14 +02:00
{
2017-06-05 10:29:02 +02:00
for ( int i = 0 ; i < ControlService . DS4_CONTROLLER_COUNT ; i + + )
{
string temp = Program . rootHub . getShortDS4ControllerInfo ( i ) ;
if ( temp ! = Properties . Resources . NoneText )
{
2017-06-30 16:01:54 +02:00
notifyText [ i + 1 ] = ( i + 1 ) + ": " + temp ; // Carefully stay under the 63 character limit.
2017-06-05 10:29:02 +02:00
}
else
{
notifyText [ i + 1 ] = string . Empty ;
}
}
populateNotifyText ( ) ;
}
protected void generateDeviceNotifyText ( int index )
{
string temp = Program . rootHub . getShortDS4ControllerInfo ( index ) ;
if ( temp ! = Properties . Resources . NoneText )
{
2017-06-30 16:01:54 +02:00
notifyText [ index + 1 ] = ( index + 1 ) + ": " + temp ; // Carefully stay under the 63 character limit.
2017-06-05 10:29:02 +02:00
}
else
{
notifyText [ index + 1 ] = string . Empty ;
}
}
protected void populateNotifyText ( )
{
string tooltip = notifyText [ 0 ] ;
for ( int i = 1 ; i < 5 ; i + + )
{
string temp = notifyText [ i ] ;
if ( ! string . IsNullOrEmpty ( temp ) )
{
tooltip + = "\n" + notifyText [ i ] ; // Carefully stay under the 63 character limit.
}
}
2017-06-05 04:13:14 +02:00
if ( tooltip . Length > 63 )
notifyIcon1 . Text = tooltip . Substring ( 0 , 63 ) ;
else
notifyIcon1 . Text = tooltip ;
2017-04-25 11:24:14 +02:00
}
2017-05-25 11:51:28 +02:00
protected void DeviceSerialChanged ( object sender , SerialChangeArgs args )
{
2017-12-08 12:04:08 +01:00
if ( this . InvokeRequired )
2017-05-25 11:51:28 +02:00
{
DeviceSerialChangedDelegate d = new DeviceSerialChangedDelegate ( DeviceSerialChanged ) ;
this . BeginInvoke ( d , new object [ ] { sender , args } ) ;
}
else
{
int devIndex = args . getIndex ( ) ;
string serial = args . getSerial ( ) ;
2017-10-19 21:16:09 +02:00
DS4Device device = ( devIndex > = 0 & & devIndex < ControlService . DS4_CONTROLLER_COUNT ) ?
Program . rootHub . DS4Controllers [ devIndex ] : null ;
if ( device ! = null )
2017-05-25 11:51:28 +02:00
{
Pads [ devIndex ] . Text = serial ;
2017-10-19 21:16:09 +02:00
if ( device . isSynced ( ) )
{
linkedProfileCB [ devIndex ] . Enabled = true ;
}
else
{
linkedProfileCB [ devIndex ] . Enabled = false ;
}
if ( device . isValidSerial ( ) & & containsLinkedProfile ( device . getMacAddress ( ) ) )
{
ProfilePath [ devIndex ] = getLinkedProfile ( device . getMacAddress ( ) ) ;
int profileIndex = cbs [ devIndex ] . FindString ( ProfilePath [ devIndex ] ) ;
if ( profileIndex > = 0 )
{
cbs [ devIndex ] . SelectedIndex = profileIndex ;
}
}
else
{
ProfilePath [ devIndex ] = OlderProfilePath [ devIndex ] ;
}
linkedProfileCB [ devIndex ] . Checked = false ;
2017-05-25 11:51:28 +02:00
}
}
}
2017-04-29 10:19:45 +02:00
protected void DeviceStatusChanged ( object sender , DeviceStatusChangeEventArgs args )
{
if ( this . InvokeRequired )
{
DeviceStatusChangedDelegate d = new DeviceStatusChangedDelegate ( DeviceStatusChanged ) ;
this . BeginInvoke ( d , new object [ ] { sender , args } ) ;
}
else
{
bool nocontrollers = true ;
for ( int i = 0 , arlen = Program . rootHub . DS4Controllers . Length ; nocontrollers & & i < arlen ; i + + )
{
DS4Device dev = Program . rootHub . DS4Controllers [ i ] ;
if ( dev ! = null )
{
nocontrollers = false ;
}
}
2017-06-05 10:31:29 +02:00
//string tooltip = "DS4Windows v" + FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion;
2017-04-29 10:19:45 +02:00
int Index = args . getIndex ( ) ;
if ( Index > = 0 & & Index < ControlService . DS4_CONTROLLER_COUNT )
{
Pads [ Index ] . Text = Program . rootHub . getDS4MacAddress ( Index ) ;
2017-10-19 21:16:09 +02:00
linkedProfileCB [ Index ] . CheckedChanged - = linkCB_CheckedChanged ;
if ( DS4Device . isValidSerial ( Pads [ Index ] . Text ) )
{
linkedProfileCB [ Index ] . Checked = containsLinkedProfile ( Pads [ Index ] . Text ) ;
linkedProfileCB [ Index ] . Enabled = true ;
}
else
{
linkedProfileCB [ Index ] . Checked = false ;
linkedProfileCB [ Index ] . Enabled = false ;
}
linkedProfileCB [ Index ] . CheckedChanged + = linkCB_CheckedChanged ;
2017-04-29 10:19:45 +02:00
switch ( Program . rootHub . getDS4Status ( Index ) )
{
case "USB" : statPB [ Index ] . Visible = true ; statPB [ Index ] . Image = Properties . Resources . USB ; toolTip1 . SetToolTip ( statPB [ Index ] , "" ) ; break ;
case "BT" : statPB [ Index ] . Visible = true ; statPB [ Index ] . Image = Properties . Resources . BT ; toolTip1 . SetToolTip ( statPB [ Index ] , "Right click to disconnect" ) ; break ;
case "SONYWA" : statPB [ Index ] . Visible = true ; statPB [ Index ] . Image = Properties . Resources . BT ; toolTip1 . SetToolTip ( statPB [ Index ] , "Right click to disconnect" ) ; break ;
default : statPB [ Index ] . Visible = false ; toolTip1 . SetToolTip ( statPB [ Index ] , "" ) ; break ;
}
Batteries [ Index ] . Text = Program . rootHub . getDS4Battery ( Index ) ;
2017-10-19 21:16:09 +02:00
int profileIndex = cbs [ Index ] . FindString ( ProfilePath [ Index ] ) ;
if ( profileIndex > = 0 )
{
cbs [ Index ] . SelectedValueChanged - = Profile_Changed ;
cbs [ Index ] . SelectedIndex = profileIndex ;
cbs [ Index ] . SelectedValueChanged + = Profile_Changed ;
}
2017-10-19 10:21:33 +02:00
if ( UseCustomLed [ Index ] )
lights [ Index ] . BackColor = CustomColor [ Index ] . ToColorA ;
else
lights [ Index ] . BackColor = MainColor [ Index ] . ToColorA ;
2017-04-29 10:19:45 +02:00
if ( Pads [ Index ] . Text ! = String . Empty )
{
if ( runningBat )
{
SendKeys . Send ( "A" ) ;
runningBat = false ;
}
Pads [ Index ] . Enabled = true ;
if ( Pads [ Index ] . Text ! = Properties . Resources . Connecting )
{
Enable_Controls ( Index , true ) ;
}
}
else
{
Pads [ Index ] . Text = Properties . Resources . Disconnected ;
Enable_Controls ( Index , false ) ;
}
2017-06-05 10:29:02 +02:00
generateDeviceNotifyText ( Index ) ;
populateNotifyText ( ) ;
2017-04-29 10:19:45 +02:00
}
lbNoControllers . Visible = nocontrollers ;
tLPControllers . Visible = ! nocontrollers ;
}
}
2017-04-26 10:00:05 +02:00
protected void ControllerRemovedChange ( object sender , ControllerRemovedArgs args )
{
2017-08-18 09:40:09 +02:00
int devIndex = args . getIndex ( ) ;
Pads [ devIndex ] . Text = Properties . Resources . Disconnected ;
Enable_Controls ( devIndex , false ) ;
statPB [ devIndex ] . Visible = false ;
toolTip1 . SetToolTip ( statPB [ devIndex ] , "" ) ;
2017-04-26 10:00:05 +02:00
2017-04-24 11:43:56 +02:00
DS4Device [ ] devices = Program . rootHub . DS4Controllers ;
int controllerLen = devices . Length ;
2017-08-18 09:40:09 +02:00
bool nocontrollers = true ;
for ( Int32 i = 0 , PadsLen = Pads . Length ; nocontrollers & & i < PadsLen ; i + + )
2014-03-28 02:50:40 +01:00
{
2017-08-18 09:40:09 +02:00
DS4Device d = devices [ i ] ;
if ( d ! = null )
2014-05-30 22:39:39 +02:00
{
2017-08-18 09:40:09 +02:00
nocontrollers = false ;
2014-03-28 02:50:40 +01:00
}
}
2017-04-22 16:00:12 +02:00
2015-02-08 22:51:52 +01:00
lbNoControllers . Visible = nocontrollers ;
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
tLPControllers . Visible = ! nocontrollers ;
2017-08-18 09:40:09 +02:00
// Update device battery level display for tray icon
generateDeviceNotifyText ( devIndex ) ;
populateNotifyText ( ) ;
2014-03-28 02:50:40 +01:00
}
2015-02-08 22:51:52 +01:00
2014-09-02 01:23:02 +02:00
private void pBStatus_MouseClick ( object sender , MouseEventArgs e )
{
2017-07-15 15:50:38 +02:00
int i = Convert . ToInt32 ( ( ( PictureBox ) sender ) . Tag ) ;
2017-05-13 07:54:29 +02:00
DS4Device d = Program . rootHub . DS4Controllers [ i ] ;
if ( d ! = null )
2017-04-06 03:37:38 +02:00
{
2017-05-13 07:54:29 +02:00
if ( e . Button = = MouseButtons . Right & & Program . rootHub . getDS4Status ( i ) = = "BT" & & ! d . Charging )
{
d . DisconnectBT ( ) ;
}
else if ( e . Button = = MouseButtons . Right & &
Program . rootHub . getDS4Status ( i ) = = "SONYWA" & & ! d . Charging )
{
d . DisconnectDongle ( ) ;
}
2017-04-06 03:37:38 +02:00
}
2014-09-02 01:23:02 +02:00
}
2014-05-31 06:37:02 +02:00
private void Enable_Controls ( int device , bool on )
{
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
Pads [ device ] . Visible = on ;
ebns [ device ] . Visible = on ;
2015-11-28 06:47:26 +01:00
lights [ device ] . Visible = on ;
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
cbs [ device ] . Visible = on ;
shortcuts [ device ] . Visible = on ;
Batteries [ device ] . Visible = on ;
2017-10-19 21:16:09 +02:00
linkedProfileCB [ device ] . Visible = on ;
2018-05-26 06:52:41 +02:00
disconnectShortcuts [ device ] . Visible = on & &
Program . rootHub . DS4Controllers [ device ] . ConnectionType ! = ConnectionType . USB ;
2014-05-31 06:37:02 +02:00
}
2015-02-08 22:51:52 +01:00
protected void On_Debug ( object sender , DebugEventArgs e )
2014-03-28 02:50:40 +01:00
{
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
LogDebug ( e . Time , e . Data , e . Warning ) ;
2014-03-28 02:50:40 +01:00
}
2014-05-30 22:39:39 +02:00
private void lBProfiles_MouseDoubleClick ( object sender , MouseEventArgs e )
{
if ( lBProfiles . SelectedIndex > = 0 )
2015-02-08 22:51:52 +01:00
ShowOptions ( 4 , lBProfiles . SelectedItem . ToString ( ) ) ;
2014-05-30 22:39:39 +02:00
}
2014-05-31 06:37:02 +02:00
private void lBProfiles_KeyDown ( object sender , KeyEventArgs e )
{
2017-12-06 13:49:23 +01:00
if ( lBProfiles . SelectedIndex > = 0 & & optPop & & ! opt . Visible )
2014-05-31 06:37:02 +02:00
{
if ( e . KeyValue = = 13 )
ShowOptions ( 4 , lBProfiles . SelectedItem . ToString ( ) ) ;
2017-05-13 07:54:29 +02:00
else if ( e . KeyValue = = 46 )
2014-05-31 06:37:02 +02:00
tsBDeleteProfle_Click ( this , e ) ;
2017-05-13 07:54:29 +02:00
else if ( e . KeyValue = = 68 & & e . Modifiers = = Keys . Control )
2014-05-31 06:37:02 +02:00
tSBDupProfile_Click ( this , e ) ;
}
}
2014-05-31 19:27:43 +02:00
private void assignToController1ToolStripMenuItem_Click ( object sender , EventArgs e )
{
cbs [ 0 ] . SelectedIndex = lBProfiles . SelectedIndex ;
}
private void assignToController2ToolStripMenuItem_Click ( object sender , EventArgs e )
{
cbs [ 1 ] . SelectedIndex = lBProfiles . SelectedIndex ;
}
private void assignToController3ToolStripMenuItem_Click ( object sender , EventArgs e )
{
cbs [ 2 ] . SelectedIndex = lBProfiles . SelectedIndex ;
}
private void assignToController4ToolStripMenuItem_Click ( object sender , EventArgs e )
{
cbs [ 3 ] . SelectedIndex = lBProfiles . SelectedIndex ;
}
private void tsBNewProfile_Click ( object sender , EventArgs e ) //Also used for context menu
2014-05-30 22:39:39 +02:00
{
ShowOptions ( 4 , "" ) ;
}
private void tsBNEditProfile_Click ( object sender , EventArgs e )
{
if ( lBProfiles . SelectedIndex > = 0 )
ShowOptions ( 4 , lBProfiles . SelectedItem . ToString ( ) ) ;
}
private void tsBDeleteProfle_Click ( object sender , EventArgs e )
{
if ( lBProfiles . SelectedIndex > = 0 )
{
string filename = lBProfiles . SelectedItem . ToString ( ) ;
2017-05-13 07:54:29 +02:00
if ( MessageBox . Show ( Properties . Resources . ProfileCannotRestore . Replace ( "*Profile name*" , "\"" + filename + "\"" ) ,
Properties . Resources . DeleteProfile ,
MessageBoxButtons . YesNo , MessageBoxIcon . Question ) = = DialogResult . Yes )
2014-05-30 22:39:39 +02:00
{
2017-05-13 07:54:29 +02:00
File . Delete ( appdatapath + @"\Profiles\" + filename + ".xml" ) ;
2014-05-30 22:39:39 +02:00
RefreshProfiles ( ) ;
}
}
}
2015-02-08 22:51:52 +01:00
2014-05-30 22:39:39 +02:00
private void tSBDupProfile_Click ( object sender , EventArgs e )
{
string filename = "" ;
if ( lBProfiles . SelectedIndex > = 0 )
2015-02-08 22:51:52 +01:00
{
2014-05-30 22:39:39 +02:00
filename = lBProfiles . SelectedItem . ToString ( ) ;
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
DupBox MTB = new DupBox ( filename , this ) ;
2014-05-30 22:39:39 +02:00
MTB . TopLevel = false ;
MTB . Dock = DockStyle . Top ;
MTB . Visible = true ;
2017-05-13 07:54:29 +02:00
MTB . FormBorderStyle = FormBorderStyle . None ;
2014-05-30 22:39:39 +02:00
tabProfiles . Controls . Add ( MTB ) ;
lBProfiles . SendToBack ( ) ;
toolStrip1 . SendToBack ( ) ;
toolStrip1 . Enabled = false ;
lBProfiles . Enabled = false ;
MTB . FormClosed + = delegate { toolStrip1 . Enabled = true ; lBProfiles . Enabled = true ; } ;
}
}
2014-05-31 06:37:02 +02:00
private void tSBImportProfile_Click ( object sender , EventArgs e )
{
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
if ( appdatapath = = Directory . GetParent ( Assembly . GetExecutingAssembly ( ) . Location ) . FullName )
Rest of DS4Windows has been upped to .NET 4.5 (If you have .net 4/already can run DS4Windows, this won't affect you), thanks to this update, you can now...
Add delay to macros from one millisecond to 60 seconds, macros with delays only run once until pressed again. Without delays, the macro can be repeated while held down.
Profiles and settings are now back inside the application folder to help portability. It will remain in appdata as previous versions if DS4Windows is in a admin folder, I may try to add a setting for location saving.
Import profile option will automatically go to the appdata profile folder, auto profiles and settings will automatically copy over.
Option to delete the appdata folder if not in use in the settings tab, this way it helps with cleanup.
Another fix for auto profiles startup bug
Better reading of autoprofile program path names
Now only one instance of DS4Windows is possible, if another DS4Tool or DS4Windows that is not this version is started, this DS4Windows comes back into focus.
UI fixes
2014-06-10 21:45:09 +02:00
openProfiles . InitialDirectory = Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) + "\\DS4Tool" + @"\Profiles\" ;
else
openProfiles . InitialDirectory = Directory . GetParent ( Assembly . GetExecutingAssembly ( ) . Location ) . FullName + @"\Profiles\" ;
2017-05-13 07:54:29 +02:00
if ( openProfiles . ShowDialog ( ) = = DialogResult . OK )
2014-05-31 06:37:02 +02:00
{
string [ ] files = openProfiles . FileNames ;
2017-05-13 07:54:29 +02:00
for ( int i = 0 , arlen = files . Length ; i < arlen ; i + + )
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
File . Copy ( openProfiles . FileNames [ i ] , appdatapath + "\\Profiles\\" + Path . GetFileName ( files [ i ] ) , true ) ;
2017-05-13 07:54:29 +02:00
2014-05-31 06:37:02 +02:00
RefreshProfiles ( ) ;
}
}
private void tSBExportProfile_Click ( object sender , EventArgs e )
{
if ( lBProfiles . SelectedIndex > = 0 )
{
Stream stream ;
2015-11-28 06:47:26 +01:00
Stream profile = new StreamReader ( appdatapath + "\\Profiles\\" + lBProfiles . SelectedItem . ToString ( ) + ".xml" ) . BaseStream ;
2017-05-13 07:54:29 +02:00
if ( saveProfiles . ShowDialog ( ) = = DialogResult . OK )
2017-04-28 20:57:33 +02:00
{
2014-05-31 06:37:02 +02:00
if ( ( stream = saveProfiles . OpenFile ( ) ) ! = null )
{
profile . CopyTo ( stream ) ;
profile . Close ( ) ;
stream . Close ( ) ;
}
2017-04-28 20:57:33 +02:00
}
2014-05-31 06:37:02 +02:00
}
}
2014-06-21 20:00:28 +02:00
2014-05-12 07:48:50 +02:00
private void ShowOptions ( int devID , string profile )
2014-03-28 02:50:40 +01:00
{
2014-06-21 20:00:28 +02:00
Show ( ) ;
2017-08-24 11:29:08 +02:00
lBProfiles . Visible = false ;
2014-06-21 20:00:28 +02:00
WindowState = FormWindowState . Normal ;
toolStrip1 . Enabled = false ;
tSOptions . Visible = true ;
toolStrip1 . Visible = false ;
if ( profile ! = "" )
tSTBProfile . Text = profile ;
else
2014-08-17 00:09:15 +02:00
tSTBProfile . Text = "<" + Properties . Resources . TypeProfileName + ">" ;
2017-05-11 17:13:51 +02:00
2017-12-06 13:49:23 +01:00
opt = new Options ( this ) ;
opt . Icon = this . Icon ;
opt . TopLevel = false ;
opt . Dock = DockStyle . Fill ;
opt . FormBorderStyle = FormBorderStyle . None ;
2018-07-29 10:16:24 +02:00
2017-12-06 13:49:23 +01:00
tabProfiles . Controls . Add ( opt ) ;
optPop = true ;
//opt.Dock = DockStyle.Fill;
//lBProfiles.SendToBack();
//toolStrip1.SendToBack();
2018-06-04 08:55:21 +02:00
//tSOptions.SendToBack();
2015-11-30 22:15:17 +01:00
opt . BringToFront ( ) ;
oldsize = Size ;
2014-06-21 20:00:28 +02:00
{
2015-11-30 22:15:17 +01:00
if ( Size . Height < ( int ) ( 90 * dpiy ) + Options . mSize . Height )
2017-05-13 07:54:29 +02:00
Size = new Size ( Size . Width , ( int ) ( 90 * dpiy ) + Options . mSize . Height ) ;
2015-11-30 22:15:17 +01:00
if ( Size . Width < ( int ) ( 20 * dpix ) + Options . mSize . Width )
2017-05-13 07:54:29 +02:00
Size = new Size ( ( int ) ( 20 * dpix ) + Options . mSize . Width , Size . Height ) ;
2014-06-21 20:00:28 +02:00
}
2017-05-11 17:13:51 +02:00
2015-11-30 22:15:17 +01:00
opt . Reload ( devID , profile ) ;
2018-07-29 10:16:24 +02:00
2017-05-11 17:13:51 +02:00
opt . inputtimer . Start ( ) ;
2015-11-30 22:15:17 +01:00
opt . Visible = true ;
2018-07-29 10:16:24 +02:00
2017-08-24 11:29:08 +02:00
tabMain . SelectedIndex = 1 ;
2018-07-29 10:16:24 +02:00
opt . SetFlowAutoScroll ( ) ;
2014-04-29 03:14:01 +02:00
}
2014-06-06 22:38:52 +02:00
2015-11-30 22:15:17 +01:00
public void OptionsClosed ( )
{
RefreshProfiles ( ) ;
2017-08-24 11:29:08 +02:00
if ( ! lbNoControllers . Visible )
tabMain . SelectedIndex = 0 ;
2015-11-30 22:15:17 +01:00
Size = oldsize ;
oldsize = new Size ( 0 , 0 ) ;
tSBKeepSize . Text = Properties . Resources . KeepThisSize ;
tSBKeepSize . Image = Properties . Resources . size ;
tSBKeepSize . Enabled = true ;
tSOptions . Visible = false ;
toolStrip1 . Visible = true ;
toolStrip1 . Enabled = true ;
lbLastMessage . ForeColor = SystemColors . GrayText ;
2017-05-08 16:29:38 +02:00
2017-12-06 13:49:23 +01:00
opt . Dock = DockStyle . None ;
tabProfiles . Controls . Remove ( opt ) ;
2018-08-13 08:09:11 +02:00
optPop = false ; opt = null ;
2017-08-24 11:29:08 +02:00
lBProfiles . Visible = true ;
2015-11-30 22:15:17 +01:00
}
2017-04-26 10:00:05 +02:00
2014-05-12 07:48:50 +02:00
private void editButtons_Click ( object sender , EventArgs e )
{
Button bn = ( Button ) sender ;
2017-05-13 07:54:29 +02:00
//int i = Int32.Parse(bn.Tag.ToString());
int i = Convert . ToInt32 ( bn . Tag ) ;
string profileText = cbs [ i ] . Text ;
if ( profileText ! = "(" + Properties . Resources . NoProfileLoaded + ")" )
ShowOptions ( i , profileText ) ;
2015-02-08 22:51:52 +01:00
else
2017-05-13 07:54:29 +02:00
ShowOptions ( i , "" ) ;
2014-05-12 07:48:50 +02:00
}
2014-06-06 22:38:52 +02:00
2014-04-29 03:14:01 +02:00
private void editMenu_Click ( object sender , EventArgs e )
{
2014-12-13 21:12:03 +01:00
mAllowVisible = true ;
2017-08-30 04:57:31 +02:00
Show ( ) ;
2014-12-13 21:12:03 +01:00
WindowState = FormWindowState . Normal ;
2014-04-29 03:14:01 +02:00
ToolStripMenuItem em = ( ToolStripMenuItem ) sender ;
2017-07-15 15:50:38 +02:00
int i = Convert . ToInt32 ( em . Tag ) ;
2015-02-08 22:51:52 +01:00
if ( em . Text = = Properties . Resources . ContextNew . Replace ( "*number*" , ( i + 1 ) . ToString ( ) ) )
ShowOptions ( i , "" ) ;
else
2017-04-28 20:57:33 +02:00
{
2017-05-13 07:54:29 +02:00
for ( int t = 0 , itemCount = em . DropDownItems . Count - 2 ; t < itemCount ; t + + )
2017-04-28 20:57:33 +02:00
{
2015-02-08 22:51:52 +01:00
if ( ( ( ToolStripMenuItem ) em . DropDownItems [ t ] ) . Checked )
ShowOptions ( i , ( ( ToolStripMenuItem ) em . DropDownItems [ t ] ) . Text ) ;
2017-04-28 20:57:33 +02:00
}
}
2014-04-29 03:14:01 +02:00
}
2015-02-08 22:51:52 +01:00
2014-03-28 02:50:40 +01:00
private void lnkControllers_LinkClicked ( object sender , LinkLabelLinkClickedEventArgs e )
{
2017-05-13 07:54:29 +02:00
Process . Start ( "control" , "joy.cpl" ) ;
2014-03-28 02:50:40 +01:00
}
private void hideDS4CheckBox_CheckedChanged ( object sender , EventArgs e )
{
// Prevent the Game Controllers window from throwing an error when controllers are un/hidden
2017-05-13 07:54:29 +02:00
Process [ ] rundll64 = Process . GetProcessesByName ( "rundll64" ) ;
foreach ( Process rundll64Instance in rundll64 )
2017-04-28 20:57:33 +02:00
{
2017-05-13 07:54:29 +02:00
foreach ( ProcessModule module in rundll64Instance . Modules )
2017-04-28 20:57:33 +02:00
{
2014-03-28 02:50:40 +01:00
if ( module . FileName . Contains ( "joy.cpl" ) )
module . Dispose ( ) ;
2017-04-28 20:57:33 +02:00
}
}
2014-03-28 02:50:40 +01:00
2017-04-28 20:57:33 +02:00
bool exclusiveMode = hideDS4CheckBox . Checked ;
UseExclusiveMode = exclusiveMode ;
2017-10-13 04:15:42 +02:00
hideDS4CheckBox . Enabled = false ;
Save ( ) ;
2018-02-26 09:55:17 +01:00
BtnStartStop_Clicked ( false ) ;
2017-10-13 08:27:21 +02:00
finishHideDS4Check ( ) ;
2017-10-13 04:15:42 +02:00
}
2017-10-13 08:27:21 +02:00
private async void finishHideDS4Check ( )
2017-10-13 04:15:42 +02:00
{
await TaskRunner . Factory . StartNew ( ( ) = >
{
while ( changingService )
{
Thread . Sleep ( 10 ) ;
}
} ) ;
2018-02-26 09:55:17 +01:00
BtnStartStop_Clicked ( false ) ;
2017-10-13 04:15:42 +02:00
await TaskRunner . Factory . StartNew ( ( ) = >
{
while ( changingService )
{
Thread . Sleep ( 10 ) ;
}
} ) ;
hideDS4CheckBox . Enabled = true ;
2014-03-28 02:50:40 +01:00
}
2014-06-06 22:38:52 +02:00
2014-03-28 02:50:40 +01:00
private void startMinimizedCheckBox_CheckedChanged ( object sender , EventArgs e )
{
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
StartMinimized = startMinimizedCheckBox . Checked ;
Save ( ) ;
2014-03-28 02:50:40 +01:00
}
private void lvDebug_ItemActivate ( object sender , EventArgs e )
{
2014-04-30 02:58:18 +02:00
MessageBox . Show ( ( ( ListView ) sender ) . FocusedItem . SubItems [ 1 ] . Text , "Log" ) ;
2014-03-28 02:50:40 +01:00
}
2014-04-27 21:32:09 +02:00
2014-06-02 05:19:04 +02:00
private void Profile_Changed ( object sender , EventArgs e ) //cbs[i] changed
2014-04-27 21:32:09 +02:00
{
2014-04-29 03:14:01 +02:00
ComboBox cb = ( ComboBox ) sender ;
2017-07-15 15:50:38 +02:00
int tdevice = Convert . ToInt32 ( cb . Tag ) ;
2015-02-13 21:19:59 +01:00
if ( cb . Items [ cb . Items . Count - 1 ] . ToString ( ) = = "+" + Properties . Resources . PlusNewProfile )
2014-04-27 21:32:09 +02:00
{
if ( cb . SelectedIndex < cb . Items . Count - 1 )
{
2017-08-17 01:00:44 +02:00
for ( int i = 0 , arlen = shortcuts [ tdevice ] . DropDownItems . Count ; i < arlen ; i + + )
{
2014-04-29 10:01:13 +02:00
if ( ! ( shortcuts [ tdevice ] . DropDownItems [ i ] is ToolStripSeparator ) )
2014-04-30 02:58:18 +02:00
( ( ToolStripMenuItem ) shortcuts [ tdevice ] . DropDownItems [ i ] ) . Checked = false ;
2017-08-17 01:00:44 +02:00
}
2014-04-29 03:14:01 +02:00
( ( ToolStripMenuItem ) shortcuts [ tdevice ] . DropDownItems [ cb . SelectedIndex ] ) . Checked = true ;
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
LogDebug ( DateTime . Now , Properties . Resources . UsingProfile . Replace ( "*number*" , ( tdevice + 1 ) . ToString ( ) ) . Replace ( "*Profile name*" , cb . Text ) , false ) ;
2014-08-17 00:09:15 +02:00
shortcuts [ tdevice ] . Text = Properties . Resources . ContextEdit . Replace ( "*number*" , ( tdevice + 1 ) . ToString ( ) ) ;
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
ProfilePath [ tdevice ] = cb . Items [ cb . SelectedIndex ] . ToString ( ) ;
Save ( ) ;
LoadProfile ( tdevice , true , Program . rootHub ) ;
2015-11-28 06:47:26 +01:00
if ( UseCustomLed [ tdevice ] )
lights [ tdevice ] . BackColor = CustomColor [ tdevice ] . ToColorA ;
else
lights [ tdevice ] . BackColor = MainColor [ tdevice ] . ToColorA ;
2017-10-19 21:16:09 +02:00
if ( linkedProfileCB [ tdevice ] . Checked )
{
DS4Device device = Program . rootHub . DS4Controllers [ tdevice ] ;
if ( device ! = null & & device . isValidSerial ( ) )
{
changeLinkedProfile ( device . getMacAddress ( ) , ProfilePath [ tdevice ] ) ;
SaveLinkedProfiles ( ) ;
}
}
else
{
OlderProfilePath [ tdevice ] = ProfilePath [ tdevice ] ;
}
2014-04-27 21:32:09 +02:00
}
else if ( cb . SelectedIndex = = cb . Items . Count - 1 & & cb . Items . Count > 1 ) //if +New Profile selected
2014-05-12 07:48:50 +02:00
ShowOptions ( tdevice , "" ) ;
2017-08-17 01:00:44 +02:00
2014-08-17 00:09:15 +02:00
if ( cb . Text = = "(" + Properties . Resources . NoProfileLoaded + ")" )
ebns [ tdevice ] . Text = Properties . Resources . New ;
2014-04-29 03:14:01 +02:00
else
2014-08-17 00:09:15 +02:00
ebns [ tdevice ] . Text = Properties . Resources . EditProfile ;
2014-04-27 21:32:09 +02:00
}
2017-04-28 20:57:33 +02:00
2017-04-29 10:19:45 +02:00
OnDeviceStatusChanged ( this , tdevice ) ; //to update profile name in notify icon
2014-04-29 03:14:01 +02:00
}
private void Profile_Changed_Menu ( object sender , ToolStripItemClickedEventArgs e )
{
ToolStripMenuItem tS = ( ToolStripMenuItem ) sender ;
2017-07-12 15:04:37 +02:00
int tdevice = Convert . ToInt32 ( tS . Tag ) ;
2014-04-29 10:01:13 +02:00
if ( ! ( e . ClickedItem is ToolStripSeparator ) )
2017-04-28 20:57:33 +02:00
{
2014-05-12 07:48:50 +02:00
if ( e . ClickedItem ! = tS . DropDownItems [ tS . DropDownItems . Count - 1 ] ) //if +New Profile not selected
2014-06-02 05:19:04 +02:00
cbs [ tdevice ] . SelectedIndex = tS . DropDownItems . IndexOf ( e . ClickedItem ) ;
2014-05-12 07:48:50 +02:00
else //if +New Profile selected
ShowOptions ( tdevice , "" ) ;
2017-04-28 20:57:33 +02:00
}
2014-04-29 03:14:01 +02:00
}
private void exitToolStripMenuItem_Click ( object sender , EventArgs e )
{
2014-12-13 21:12:03 +01:00
contextclose = true ;
2017-08-30 04:57:31 +02:00
Close ( ) ;
2014-04-29 03:14:01 +02:00
}
private void openToolStripMenuItem_Click ( object sender , EventArgs e )
{
2014-11-20 20:03:18 +01:00
mAllowVisible = true ;
2017-08-30 04:57:31 +02:00
Show ( ) ;
2015-02-08 22:51:52 +01:00
Focus ( ) ;
2014-04-29 03:14:01 +02:00
WindowState = FormWindowState . Normal ;
2014-09-02 01:23:02 +02:00
}
2015-02-08 22:51:52 +01:00
2014-09-02 01:23:02 +02:00
private void startToolStripMenuItem_Click ( object sender , EventArgs e )
{
2018-02-26 09:55:17 +01:00
BtnStartStop_Clicked ( ) ;
2014-09-02 01:23:02 +02:00
}
2017-04-28 20:57:33 +02:00
2014-05-30 22:39:39 +02:00
private void notifyIcon1_MouseClick ( object sender , MouseEventArgs e )
2014-05-16 00:10:17 +02:00
{
2017-05-13 07:54:29 +02:00
if ( e . Button = = MouseButtons . Middle )
2014-12-13 21:12:03 +01:00
{
contextclose = true ;
2017-08-30 04:57:31 +02:00
Close ( ) ;
2014-12-13 21:12:03 +01:00
}
2014-05-30 22:39:39 +02:00
}
2017-04-28 20:57:33 +02:00
2014-05-30 22:39:39 +02:00
private void notifyIcon1_BalloonTipClicked ( object sender , EventArgs e )
{
2017-08-30 04:57:31 +02:00
Show ( ) ;
2014-05-30 22:39:39 +02:00
WindowState = FormWindowState . Normal ;
2014-05-16 00:10:17 +02:00
}
private void llbHelp_LinkClicked ( object sender , LinkLabelLinkClickedEventArgs e )
{
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
Hotkeys hotkeysForm = new Hotkeys ( ) ;
2014-05-16 00:10:17 +02:00
hotkeysForm . Icon = this . Icon ;
2015-02-08 22:51:52 +01:00
hotkeysForm . Text = llbHelp . Text ;
2014-05-16 00:10:17 +02:00
hotkeysForm . ShowDialog ( ) ;
}
2014-05-21 19:39:56 +02:00
private void StartWindowsCheckBox_CheckedChanged ( object sender , EventArgs e )
{
2017-04-20 07:54:09 +02:00
bool isChecked = StartWindowsCheckBox . Checked ;
2014-05-21 19:39:56 +02:00
RegistryKey KeyLoc = Registry . CurrentUser . OpenSubKey ( "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run" , true ) ;
2017-04-20 07:54:09 +02:00
if ( isChecked & & ! File . Exists ( Environment . GetFolderPath ( Environment . SpecialFolder . Startup ) + "\\DS4Windows.lnk" ) )
{
2014-06-13 21:52:25 +02:00
appShortcutToStartup ( ) ;
2017-04-20 07:54:09 +02:00
}
else if ( ! isChecked )
{
2014-06-13 21:52:25 +02:00
File . Delete ( Environment . GetFolderPath ( Environment . SpecialFolder . Startup ) + "\\DS4Windows.lnk" ) ;
2017-04-20 07:54:09 +02:00
}
2014-06-13 21:52:25 +02:00
KeyLoc . DeleteValue ( "DS4Tool" , false ) ;
2017-04-20 07:54:09 +02:00
if ( isChecked )
{
runStartupPanel . Visible = true ;
}
else
{
runStartupPanel . Visible = false ;
runStartTaskRadio . Checked = false ;
runStartProgRadio . Checked = true ;
}
changeStartupRoutine ( ) ;
2014-06-13 21:52:25 +02:00
}
private void appShortcutToStartup ( )
{
2017-05-13 07:54:29 +02:00
Type t = Type . GetTypeFromCLSID ( new Guid ( "72C24DD5-D70A-438B-8A42-98424B88AFB8" ) ) ; // Windows Script Host Shell Object
2014-06-13 21:52:25 +02:00
dynamic shell = Activator . CreateInstance ( t ) ;
try
{
var lnk = shell . CreateShortcut ( Environment . GetFolderPath ( Environment . SpecialFolder . Startup ) + "\\DS4Windows.lnk" ) ;
try
{
string app = Assembly . GetExecutingAssembly ( ) . Location ;
2017-04-23 11:22:31 +02:00
lnk . TargetPath = Assembly . GetExecutingAssembly ( ) . Location ;
2017-04-20 07:54:09 +02:00
if ( runStartProgRadio . Checked )
{
lnk . Arguments = "-m" ;
}
else if ( runStartTaskRadio . Checked )
{
lnk . Arguments = "-runtask" ;
}
//lnk.TargetPath = Assembly.GetExecutingAssembly().Location;
//lnk.Arguments = "-m";
2014-06-13 21:52:25 +02:00
lnk . IconLocation = app . Replace ( '\\' , '/' ) ;
lnk . Save ( ) ;
}
finally
{
Marshal . FinalReleaseComObject ( lnk ) ;
}
}
finally
{
Marshal . FinalReleaseComObject ( shell ) ;
}
2014-05-21 19:39:56 +02:00
}
2014-05-31 06:37:02 +02:00
private void tabMain_SelectedIndexChanged ( object sender , EventArgs e )
2014-05-30 22:39:39 +02:00
{
2017-05-13 07:54:29 +02:00
TabPage currentTab = tabMain . SelectedTab ;
lbLastMessage . Visible = currentTab ! = tabLog ;
if ( currentTab = = tabLog )
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
chData . AutoResize ( ColumnHeaderAutoResizeStyle . HeaderSize ) ;
2017-05-13 07:54:29 +02:00
if ( currentTab = = tabSettings )
2014-12-03 23:36:54 +01:00
{
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
lbLastMessage . ForeColor = SystemColors . GrayText ;
lbLastMessage . Text = Properties . Resources . HoverOverItems ;
2014-12-03 23:36:54 +01:00
}
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
else if ( lvDebug . Items . Count > 0 )
2017-05-13 07:54:29 +02:00
lbLastMessage . Text = lvDebug . Items [ lvDebug . Items . Count - 1 ] . SubItems [ 1 ] . Text ;
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
else
lbLastMessage . Text = "" ;
2014-05-30 22:39:39 +02:00
}
2014-12-03 23:36:54 +01:00
private void Items_MouseHover ( object sender , EventArgs e )
{
2017-05-05 05:15:22 +02:00
string hoverText = Properties . Resources . HoverOverItems ;
string temp = "" ;
if ( hoverTextDict . TryGetValue ( ( Control ) sender , out temp ) )
2014-12-03 23:36:54 +01:00
{
2017-05-05 05:15:22 +02:00
hoverText = temp ;
}
2014-12-03 23:36:54 +01:00
2017-05-05 05:15:22 +02:00
lbLastMessage . Text = hoverText ;
if ( hoverText ! = Properties . Resources . HoverOverItems )
2014-12-03 23:36:54 +01:00
lbLastMessage . ForeColor = Color . Black ;
else
lbLastMessage . ForeColor = SystemColors . GrayText ;
}
2014-05-31 19:27:43 +02:00
private void lBProfiles_MouseDown ( object sender , MouseEventArgs e )
{
lBProfiles . SelectedIndex = lBProfiles . IndexFromPoint ( e . X , e . Y ) ;
2017-05-13 07:54:29 +02:00
if ( e . Button = = MouseButtons . Right )
2014-05-31 19:27:43 +02:00
{
if ( lBProfiles . SelectedIndex < 0 )
{
2014-06-02 05:19:04 +02:00
cMProfile . ShowImageMargin = false ;
2014-05-31 19:27:43 +02:00
assignToController1ToolStripMenuItem . Visible = false ;
assignToController2ToolStripMenuItem . Visible = false ;
assignToController3ToolStripMenuItem . Visible = false ;
assignToController4ToolStripMenuItem . Visible = false ;
deleteToolStripMenuItem . Visible = false ;
editToolStripMenuItem . Visible = false ;
duplicateToolStripMenuItem . Visible = false ;
exportToolStripMenuItem . Visible = false ;
}
else
{
2014-06-02 05:19:04 +02:00
cMProfile . ShowImageMargin = true ;
2014-05-31 19:27:43 +02:00
assignToController1ToolStripMenuItem . Visible = true ;
assignToController2ToolStripMenuItem . Visible = true ;
assignToController3ToolStripMenuItem . Visible = true ;
assignToController4ToolStripMenuItem . Visible = true ;
2014-06-02 05:19:04 +02:00
ToolStripMenuItem [ ] assigns = { assignToController1ToolStripMenuItem ,
assignToController2ToolStripMenuItem ,
assignToController3ToolStripMenuItem ,
assignToController4ToolStripMenuItem } ;
2017-05-13 07:54:29 +02:00
2014-06-02 05:19:04 +02:00
for ( int i = 0 ; i < 4 ; i + + )
{
if ( lBProfiles . SelectedIndex = = cbs [ i ] . SelectedIndex )
assigns [ i ] . Checked = true ;
else
assigns [ i ] . Checked = false ;
}
2017-05-13 07:54:29 +02:00
2014-05-31 19:27:43 +02:00
deleteToolStripMenuItem . Visible = true ;
editToolStripMenuItem . Visible = true ;
duplicateToolStripMenuItem . Visible = true ;
2015-02-08 22:51:52 +01:00
exportToolStripMenuItem . Visible = true ;
2014-05-31 19:27:43 +02:00
}
}
}
2014-06-02 05:19:04 +02:00
2014-06-02 19:29:38 +02:00
private void tBProfile_TextChanged ( object sender , EventArgs e )
{
2017-05-13 07:54:29 +02:00
if ( tSTBProfile . Text ! = null & & tSTBProfile . Text ! = "" & &
! tSTBProfile . Text . Contains ( "\\" ) & & ! tSTBProfile . Text . Contains ( "/" ) & &
! tSTBProfile . Text . Contains ( ":" ) & & ! tSTBProfile . Text . Contains ( "*" ) & &
! tSTBProfile . Text . Contains ( "?" ) & & ! tSTBProfile . Text . Contains ( "\"" ) & &
! tSTBProfile . Text . Contains ( "<" ) & & ! tSTBProfile . Text . Contains ( ">" ) & &
! tSTBProfile . Text . Contains ( "|" ) )
tSTBProfile . ForeColor = SystemColors . WindowText ;
2014-06-02 19:29:38 +02:00
else
2017-05-13 07:54:29 +02:00
tSTBProfile . ForeColor = SystemColors . GrayText ;
2014-06-02 19:29:38 +02:00
}
private void tBProfile_Enter ( object sender , EventArgs e )
{
2014-08-17 00:09:15 +02:00
if ( tSTBProfile . Text = = "<" + Properties . Resources . TypeProfileName + ">" )
2014-06-02 19:29:38 +02:00
tSTBProfile . Text = "" ;
}
private void tBProfile_Leave ( object sender , EventArgs e )
{
if ( tSTBProfile . Text = = "" )
2014-08-17 00:09:15 +02:00
tSTBProfile . Text = "<" + Properties . Resources . TypeProfileName + ">" ;
2014-06-02 19:29:38 +02:00
}
private void tSBCancel_Click ( object sender , EventArgs e )
{
2017-12-06 13:49:23 +01:00
if ( optPop & & opt . Visible )
2014-06-02 19:29:38 +02:00
opt . Close ( ) ;
}
2014-06-13 21:52:25 +02:00
private void tSBSaveProfile_Click ( object sender , EventArgs e )
2014-06-02 19:29:38 +02:00
{
2017-12-06 13:49:23 +01:00
if ( optPop & & opt . Visible )
2014-06-02 19:29:38 +02:00
{
2014-12-13 21:12:03 +01:00
opt . saving = true ;
2014-06-02 19:29:38 +02:00
opt . Set ( ) ;
2017-05-13 07:54:29 +02:00
if ( tSTBProfile . Text ! = null & & tSTBProfile . Text ! = "" & &
! tSTBProfile . Text . Contains ( "\\" ) & & ! tSTBProfile . Text . Contains ( "/" ) & &
! tSTBProfile . Text . Contains ( ":" ) & & ! tSTBProfile . Text . Contains ( "*" ) & &
! tSTBProfile . Text . Contains ( "?" ) & & ! tSTBProfile . Text . Contains ( "\"" ) & &
! tSTBProfile . Text . Contains ( "<" ) & & ! tSTBProfile . Text . Contains ( ">" ) & &
! tSTBProfile . Text . Contains ( "|" ) )
2014-06-02 19:29:38 +02:00
{
2017-05-08 16:29:38 +02:00
File . Delete ( appdatapath + @"\Profiles\" + opt . filename + ".xml" ) ;
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
ProfilePath [ opt . device ] = tSTBProfile . Text ;
2015-12-18 07:25:51 +01:00
SaveProfile ( opt . device , tSTBProfile . Text ) ;
2017-05-08 16:29:38 +02:00
cacheProfileCustomsFlags ( opt . device ) ;
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
Save ( ) ;
2014-06-02 19:29:38 +02:00
opt . Close ( ) ;
}
else
2014-08-17 00:09:15 +02:00
MessageBox . Show ( Properties . Resources . ValidName , Properties . Resources . NotValid , MessageBoxButtons . OK , MessageBoxIcon . Exclamation ) ;
2014-06-02 19:29:38 +02:00
}
}
2014-06-06 22:38:52 +02:00
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
private void tSBKeepSize_Click ( object sender , EventArgs e )
{
oldsize = Size ;
2014-08-17 00:09:15 +02:00
tSBKeepSize . Text = Properties . Resources . WillKeep ;
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
tSBKeepSize . Image = Properties . Resources . _checked ;
tSBKeepSize . Enabled = false ;
}
2014-06-06 22:38:52 +02:00
private void cBUpdate_CheckedChanged ( object sender , EventArgs e )
{
if ( ! cBUpdate . Checked )
{
nUDUpdateTime . Value = 0 ;
pNUpdate . Enabled = false ;
}
else
{
nUDUpdateTime . Value = 1 ;
cBUpdateTime . SelectedIndex = 0 ;
pNUpdate . Enabled = true ;
}
}
private void nUDUpdateTime_ValueChanged ( object sender , EventArgs e )
{
2017-05-13 07:54:29 +02:00
int currentIndex = cBUpdateTime . SelectedIndex ;
if ( currentIndex = = 0 )
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
CheckWhen = ( int ) nUDUpdateTime . Value ;
2017-05-13 07:54:29 +02:00
else if ( currentIndex = = 1 )
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
CheckWhen = ( int ) nUDUpdateTime . Value * 24 ;
2017-05-13 07:54:29 +02:00
2014-06-06 22:38:52 +02:00
if ( nUDUpdateTime . Value < 1 )
cBUpdate . Checked = false ;
2017-05-13 07:54:29 +02:00
Rest of DS4Windows has been upped to .NET 4.5 (If you have .net 4/already can run DS4Windows, this won't affect you), thanks to this update, you can now...
Add delay to macros from one millisecond to 60 seconds, macros with delays only run once until pressed again. Without delays, the macro can be repeated while held down.
Profiles and settings are now back inside the application folder to help portability. It will remain in appdata as previous versions if DS4Windows is in a admin folder, I may try to add a setting for location saving.
Import profile option will automatically go to the appdata profile folder, auto profiles and settings will automatically copy over.
Option to delete the appdata folder if not in use in the settings tab, this way it helps with cleanup.
Another fix for auto profiles startup bug
Better reading of autoprofile program path names
Now only one instance of DS4Windows is possible, if another DS4Tool or DS4Windows that is not this version is started, this DS4Windows comes back into focus.
UI fixes
2014-06-10 21:45:09 +02:00
if ( nUDUpdateTime . Value = = 1 )
{
2017-05-13 07:54:29 +02:00
int index = currentIndex ;
2018-02-07 23:15:58 +01:00
cBUpdateTime . BeginUpdate ( ) ;
Rest of DS4Windows has been upped to .NET 4.5 (If you have .net 4/already can run DS4Windows, this won't affect you), thanks to this update, you can now...
Add delay to macros from one millisecond to 60 seconds, macros with delays only run once until pressed again. Without delays, the macro can be repeated while held down.
Profiles and settings are now back inside the application folder to help portability. It will remain in appdata as previous versions if DS4Windows is in a admin folder, I may try to add a setting for location saving.
Import profile option will automatically go to the appdata profile folder, auto profiles and settings will automatically copy over.
Option to delete the appdata folder if not in use in the settings tab, this way it helps with cleanup.
Another fix for auto profiles startup bug
Better reading of autoprofile program path names
Now only one instance of DS4Windows is possible, if another DS4Tool or DS4Windows that is not this version is started, this DS4Windows comes back into focus.
UI fixes
2014-06-10 21:45:09 +02:00
cBUpdateTime . Items . Clear ( ) ;
2014-08-17 00:09:15 +02:00
cBUpdateTime . Items . Add ( Properties . Resources . Hour ) ;
cBUpdateTime . Items . Add ( Properties . Resources . Day ) ;
Rest of DS4Windows has been upped to .NET 4.5 (If you have .net 4/already can run DS4Windows, this won't affect you), thanks to this update, you can now...
Add delay to macros from one millisecond to 60 seconds, macros with delays only run once until pressed again. Without delays, the macro can be repeated while held down.
Profiles and settings are now back inside the application folder to help portability. It will remain in appdata as previous versions if DS4Windows is in a admin folder, I may try to add a setting for location saving.
Import profile option will automatically go to the appdata profile folder, auto profiles and settings will automatically copy over.
Option to delete the appdata folder if not in use in the settings tab, this way it helps with cleanup.
Another fix for auto profiles startup bug
Better reading of autoprofile program path names
Now only one instance of DS4Windows is possible, if another DS4Tool or DS4Windows that is not this version is started, this DS4Windows comes back into focus.
UI fixes
2014-06-10 21:45:09 +02:00
cBUpdateTime . SelectedIndex = index ;
2018-02-07 23:15:58 +01:00
cBUpdateTime . EndUpdate ( ) ;
Rest of DS4Windows has been upped to .NET 4.5 (If you have .net 4/already can run DS4Windows, this won't affect you), thanks to this update, you can now...
Add delay to macros from one millisecond to 60 seconds, macros with delays only run once until pressed again. Without delays, the macro can be repeated while held down.
Profiles and settings are now back inside the application folder to help portability. It will remain in appdata as previous versions if DS4Windows is in a admin folder, I may try to add a setting for location saving.
Import profile option will automatically go to the appdata profile folder, auto profiles and settings will automatically copy over.
Option to delete the appdata folder if not in use in the settings tab, this way it helps with cleanup.
Another fix for auto profiles startup bug
Better reading of autoprofile program path names
Now only one instance of DS4Windows is possible, if another DS4Tool or DS4Windows that is not this version is started, this DS4Windows comes back into focus.
UI fixes
2014-06-10 21:45:09 +02:00
}
2014-08-17 00:09:15 +02:00
else if ( cBUpdateTime . Items [ 0 ] . ToString ( ) = = Properties . Resources . Hour )
Rest of DS4Windows has been upped to .NET 4.5 (If you have .net 4/already can run DS4Windows, this won't affect you), thanks to this update, you can now...
Add delay to macros from one millisecond to 60 seconds, macros with delays only run once until pressed again. Without delays, the macro can be repeated while held down.
Profiles and settings are now back inside the application folder to help portability. It will remain in appdata as previous versions if DS4Windows is in a admin folder, I may try to add a setting for location saving.
Import profile option will automatically go to the appdata profile folder, auto profiles and settings will automatically copy over.
Option to delete the appdata folder if not in use in the settings tab, this way it helps with cleanup.
Another fix for auto profiles startup bug
Better reading of autoprofile program path names
Now only one instance of DS4Windows is possible, if another DS4Tool or DS4Windows that is not this version is started, this DS4Windows comes back into focus.
UI fixes
2014-06-10 21:45:09 +02:00
{
2017-05-13 07:54:29 +02:00
int index = currentIndex ;
2018-02-07 23:15:58 +01:00
cBUpdateTime . BeginUpdate ( ) ;
Rest of DS4Windows has been upped to .NET 4.5 (If you have .net 4/already can run DS4Windows, this won't affect you), thanks to this update, you can now...
Add delay to macros from one millisecond to 60 seconds, macros with delays only run once until pressed again. Without delays, the macro can be repeated while held down.
Profiles and settings are now back inside the application folder to help portability. It will remain in appdata as previous versions if DS4Windows is in a admin folder, I may try to add a setting for location saving.
Import profile option will automatically go to the appdata profile folder, auto profiles and settings will automatically copy over.
Option to delete the appdata folder if not in use in the settings tab, this way it helps with cleanup.
Another fix for auto profiles startup bug
Better reading of autoprofile program path names
Now only one instance of DS4Windows is possible, if another DS4Tool or DS4Windows that is not this version is started, this DS4Windows comes back into focus.
UI fixes
2014-06-10 21:45:09 +02:00
cBUpdateTime . Items . Clear ( ) ;
2014-08-17 00:09:15 +02:00
cBUpdateTime . Items . Add ( Properties . Resources . Hours ) ;
cBUpdateTime . Items . Add ( Properties . Resources . Days ) ;
Rest of DS4Windows has been upped to .NET 4.5 (If you have .net 4/already can run DS4Windows, this won't affect you), thanks to this update, you can now...
Add delay to macros from one millisecond to 60 seconds, macros with delays only run once until pressed again. Without delays, the macro can be repeated while held down.
Profiles and settings are now back inside the application folder to help portability. It will remain in appdata as previous versions if DS4Windows is in a admin folder, I may try to add a setting for location saving.
Import profile option will automatically go to the appdata profile folder, auto profiles and settings will automatically copy over.
Option to delete the appdata folder if not in use in the settings tab, this way it helps with cleanup.
Another fix for auto profiles startup bug
Better reading of autoprofile program path names
Now only one instance of DS4Windows is possible, if another DS4Tool or DS4Windows that is not this version is started, this DS4Windows comes back into focus.
UI fixes
2014-06-10 21:45:09 +02:00
cBUpdateTime . SelectedIndex = index ;
2018-02-07 23:15:58 +01:00
cBUpdateTime . EndUpdate ( ) ;
Rest of DS4Windows has been upped to .NET 4.5 (If you have .net 4/already can run DS4Windows, this won't affect you), thanks to this update, you can now...
Add delay to macros from one millisecond to 60 seconds, macros with delays only run once until pressed again. Without delays, the macro can be repeated while held down.
Profiles and settings are now back inside the application folder to help portability. It will remain in appdata as previous versions if DS4Windows is in a admin folder, I may try to add a setting for location saving.
Import profile option will automatically go to the appdata profile folder, auto profiles and settings will automatically copy over.
Option to delete the appdata folder if not in use in the settings tab, this way it helps with cleanup.
Another fix for auto profiles startup bug
Better reading of autoprofile program path names
Now only one instance of DS4Windows is possible, if another DS4Tool or DS4Windows that is not this version is started, this DS4Windows comes back into focus.
UI fixes
2014-06-10 21:45:09 +02:00
}
2014-06-06 22:38:52 +02:00
}
private void cBUpdateTime_SelectedIndexChanged ( object sender , EventArgs e )
{
2017-05-13 07:54:29 +02:00
int index = cBUpdateTime . SelectedIndex ;
if ( index = = 0 )
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
CheckWhen = ( int ) nUDUpdateTime . Value ;
2017-05-13 07:54:29 +02:00
else if ( index = = 1 )
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
CheckWhen = ( int ) nUDUpdateTime . Value * 24 ;
2014-06-06 22:38:52 +02:00
}
private void lLBUpdate_LinkClicked ( object sender , LinkLabelLinkClickedEventArgs e )
{
2017-05-13 07:54:29 +02:00
// Sorry other devs, gonna have to find your own server
2017-06-27 10:57:38 +02:00
Uri url = new Uri ( "http://23.239.26.40/ds4windows/files/builds/newest.txt" ) ;
2014-06-06 22:38:52 +02:00
WebClient wct = new WebClient ( ) ;
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
wct . DownloadFileAsync ( url , appdatapath + "\\version.txt" ) ;
2018-02-08 08:48:12 +01:00
wct . DownloadFileCompleted + = ( sender2 , e2 ) = > TaskRunner . Run ( ( ) = > wct_DownloadFileCompleted ( sender2 , e2 ) ) ;
2014-06-06 22:38:52 +02:00
}
2014-06-21 20:00:28 +02:00
private void cBDisconnectBT_CheckedChanged ( object sender , EventArgs e )
{
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
DCBTatStop = cBDisconnectBT . Checked ;
2014-06-21 20:00:28 +02:00
}
2014-06-06 22:38:52 +02:00
void wct_DownloadFileCompleted ( object sender , System . ComponentModel . AsyncCompletedEventArgs e )
{
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
LastChecked = DateTime . Now ;
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
FileVersionInfo fvi = FileVersionInfo . GetVersionInfo ( Assembly . GetExecutingAssembly ( ) . Location ) ;
string version2 = fvi . FileVersion ;
2017-06-30 03:28:36 +02:00
string newversion2 = File . ReadAllText ( appdatapath + "\\version.txt" ) . Trim ( ) ;
2017-08-30 04:57:31 +02:00
if ( version2 . Replace ( ',' , '.' ) . CompareTo ( newversion2 ) = = - 1 )
2017-05-13 07:54:29 +02:00
{
2018-02-08 08:48:12 +01:00
if ( ( DialogResult ) this . Invoke ( new Func < DialogResult > ( ( ) = >
{
return MessageBox . Show ( Properties . Resources . DownloadVersion . Replace ( "*number*" , newversion2 ) ,
Properties . Resources . DS4Update , MessageBoxButtons . YesNo , MessageBoxIcon . Question ) ;
} ) ) = = DialogResult . Yes )
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
{
if ( ! File . Exists ( exepath + "\\DS4Updater.exe" ) | | ( File . Exists ( exepath + "\\DS4Updater.exe" )
2017-08-30 04:57:31 +02:00
& & ( FileVersionInfo . GetVersionInfo ( exepath + "\\DS4Updater.exe" ) . FileVersion . CompareTo ( UPDATER_VERSION ) = = - 1 ) ) )
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
{
2017-11-10 18:49:38 +01:00
Uri url2 = new Uri ( $"http://23.239.26.40/ds4windows/files/{updaterExe}" ) ;
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
WebClient wc2 = new WebClient ( ) ;
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
if ( appdatapath = = exepath )
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
wc2 . DownloadFile ( url2 , exepath + "\\DS4Updater.exe" ) ;
else
2014-06-06 22:38:52 +02:00
{
2018-02-08 08:48:12 +01:00
this . BeginInvoke ( ( System . Action ) ( ( ) = > MessageBox . Show ( Properties . Resources . PleaseDownloadUpdater ) ) ) ;
2017-11-10 18:49:38 +01:00
Process . Start ( $"http://23.239.26.40/ds4windows/files/{updaterExe}" ) ;
2014-06-06 22:38:52 +02:00
}
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
}
2017-05-13 07:54:29 +02:00
2014-08-18 07:18:46 +02:00
Process p = new Process ( ) ;
p . StartInfo . FileName = exepath + "\\DS4Updater.exe" ;
2018-02-12 07:40:34 +01:00
p . StartInfo . Arguments = "-autolaunch" ;
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
if ( AdminNeeded ( ) )
2014-08-18 07:18:46 +02:00
p . StartInfo . Verb = "runas" ;
2017-05-13 07:54:29 +02:00
2014-12-02 01:07:29 +01:00
try { p . Start ( ) ; Close ( ) ; }
2015-02-08 22:51:52 +01:00
catch { }
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
}
2014-06-06 22:38:52 +02:00
else
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
File . Delete ( appdatapath + "\\version.txt" ) ;
2017-05-13 07:54:29 +02:00
}
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
else
{
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
File . Delete ( appdatapath + "\\version.txt" ) ;
2018-02-08 08:48:12 +01:00
this . BeginInvoke ( ( System . Action ) ( ( ) = > MessageBox . Show ( Properties . Resources . UpToDate , "DS4Windows Updater" ) ) ) ;
2014-06-06 22:38:52 +02:00
}
}
private void linkProfiles_LinkClicked ( object sender , LinkLabelLinkClickedEventArgs e )
{
2017-05-13 07:54:29 +02:00
Process . Start ( appdatapath + "\\Profiles" ) ;
2014-06-06 22:38:52 +02:00
}
private void linkUninstall_LinkClicked ( object sender , LinkLabelLinkClickedEventArgs e )
{
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
if ( File . Exists ( appdatapath + "\\Virtual Bus Driver\\ScpDriver.exe" ) )
2017-05-13 07:54:29 +02:00
{
try { Process . Start ( appdatapath + "\\Virtual Bus Driver\\ScpDriver.exe" ) ; }
catch { Process . Start ( appdatapath + "\\Virtual Bus Driver" ) ; }
}
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
}
private void cBoxNotifications_SelectedIndexChanged ( object sender , EventArgs e )
{
Notifications = cBoxNotifications . SelectedIndex ;
2014-06-06 22:38:52 +02:00
}
2014-06-09 01:41:36 +02:00
private void lLSetup_LinkClicked ( object sender , LinkLabelLinkClickedEventArgs e )
{
2014-12-02 01:07:29 +01:00
Process p = new Process ( ) ;
p . StartInfo . FileName = Assembly . GetExecutingAssembly ( ) . Location ;
2014-12-13 21:12:03 +01:00
p . StartInfo . Arguments = "-driverinstall" ;
2014-12-02 01:07:29 +01:00
p . StartInfo . Verb = "runas" ;
try { p . Start ( ) ; }
catch { }
//WelcomeDialog wd = new WelcomeDialog();
//wd.ShowDialog();
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
tabSettings . Text = originalsettingstext ;
2014-07-08 20:21:09 +02:00
linkSetup . LinkColor = Color . Blue ;
2014-06-09 01:41:36 +02:00
}
Rest of DS4Windows has been upped to .NET 4.5 (If you have .net 4/already can run DS4Windows, this won't affect you), thanks to this update, you can now...
Add delay to macros from one millisecond to 60 seconds, macros with delays only run once until pressed again. Without delays, the macro can be repeated while held down.
Profiles and settings are now back inside the application folder to help portability. It will remain in appdata as previous versions if DS4Windows is in a admin folder, I may try to add a setting for location saving.
Import profile option will automatically go to the appdata profile folder, auto profiles and settings will automatically copy over.
Option to delete the appdata folder if not in use in the settings tab, this way it helps with cleanup.
Another fix for auto profiles startup bug
Better reading of autoprofile program path names
Now only one instance of DS4Windows is possible, if another DS4Tool or DS4Windows that is not this version is started, this DS4Windows comes back into focus.
UI fixes
2014-06-10 21:45:09 +02:00
2017-06-30 15:46:54 +02:00
bool tempBool = false ;
2014-06-13 21:52:25 +02:00
protected void ScpForm_Closing ( object sender , FormClosingEventArgs e )
Rest of DS4Windows has been upped to .NET 4.5 (If you have .net 4/already can run DS4Windows, this won't affect you), thanks to this update, you can now...
Add delay to macros from one millisecond to 60 seconds, macros with delays only run once until pressed again. Without delays, the macro can be repeated while held down.
Profiles and settings are now back inside the application folder to help portability. It will remain in appdata as previous versions if DS4Windows is in a admin folder, I may try to add a setting for location saving.
Import profile option will automatically go to the appdata profile folder, auto profiles and settings will automatically copy over.
Option to delete the appdata folder if not in use in the settings tab, this way it helps with cleanup.
Another fix for auto profiles startup bug
Better reading of autoprofile program path names
Now only one instance of DS4Windows is possible, if another DS4Tool or DS4Windows that is not this version is started, this DS4Windows comes back into focus.
UI fixes
2014-06-10 21:45:09 +02:00
{
2017-12-06 13:49:23 +01:00
if ( opt ! = null & & opt . Visible )
2014-06-13 21:52:25 +02:00
{
opt . Close ( ) ;
e . Cancel = true ;
return ;
Rest of DS4Windows has been upped to .NET 4.5 (If you have .net 4/already can run DS4Windows, this won't affect you), thanks to this update, you can now...
Add delay to macros from one millisecond to 60 seconds, macros with delays only run once until pressed again. Without delays, the macro can be repeated while held down.
Profiles and settings are now back inside the application folder to help portability. It will remain in appdata as previous versions if DS4Windows is in a admin folder, I may try to add a setting for location saving.
Import profile option will automatically go to the appdata profile folder, auto profiles and settings will automatically copy over.
Option to delete the appdata folder if not in use in the settings tab, this way it helps with cleanup.
Another fix for auto profiles startup bug
Better reading of autoprofile program path names
Now only one instance of DS4Windows is possible, if another DS4Tool or DS4Windows that is not this version is started, this DS4Windows comes back into focus.
UI fixes
2014-06-10 21:45:09 +02:00
}
2017-05-01 11:29:19 +02:00
2017-06-30 15:46:54 +02:00
bool closeMini = tempBool = cBCloseMini . Checked ;
2017-07-04 00:33:45 +02:00
bool userClosing = e . CloseReason = = CloseReason . UserClosing ;
2017-06-30 15:46:54 +02:00
DS4Device d = null ;
2017-07-04 00:33:45 +02:00
bool nocontrollers = tempBool = true ;
2017-06-25 20:07:48 +02:00
//in case user accidentally clicks on the close button whilst "Close Minimizes" checkbox is unchecked
2017-07-04 00:33:45 +02:00
if ( userClosing & & ! closeMini & & ! contextclose )
2017-06-25 20:07:48 +02:00
{
2017-06-30 15:46:54 +02:00
for ( int i = 0 , PadsLen = Pads . Length ; tempBool & & i < PadsLen ; i + + )
2017-06-25 20:07:48 +02:00
{
2017-06-30 15:46:54 +02:00
d = Program . rootHub . DS4Controllers [ i ] ;
tempBool = ( d ! = null ) ? false : tempBool ;
2017-06-25 20:07:48 +02:00
}
2017-07-04 00:33:45 +02:00
nocontrollers = tempBool ;
2017-06-25 20:07:48 +02:00
if ( ! nocontrollers )
{
if ( MessageBox . Show ( Properties . Resources . CloseConfirm , Properties . Resources . Confirm ,
MessageBoxButtons . YesNo , MessageBoxIcon . Question ) = = DialogResult . No )
{
e . Cancel = true ;
return ;
}
}
}
2017-07-04 00:33:45 +02:00
else if ( userClosing & & closeMini & & ! contextclose )
2014-12-13 21:12:03 +01:00
{
2017-08-30 04:57:31 +02:00
WindowState = FormWindowState . Minimized ;
2014-12-13 21:12:03 +01:00
e . Cancel = true ;
return ;
}
2017-05-01 11:29:19 +02:00
2014-06-12 20:46:00 +02:00
if ( systemShutdown )
// Reset the variable because the user might cancel the
// shutdown.
{
systemShutdown = false ;
DS4LightBar . shuttingdown = true ;
}
2017-05-01 11:29:19 +02:00
2017-05-13 07:54:29 +02:00
if ( oldsize = = new Size ( 0 , 0 ) )
2014-06-12 20:46:00 +02:00
{
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
FormWidth = this . Width ;
FormHeight = this . Height ;
2014-06-12 20:46:00 +02:00
}
else
{
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
FormWidth = oldsize . Width ;
FormHeight = oldsize . Height ;
2014-06-12 20:46:00 +02:00
}
2017-05-01 11:29:19 +02:00
2017-11-22 09:00:51 +01:00
FormLocationX = Location . X > 0 ? Location . X : 0 ;
FormLocationY = Location . Y > 0 ? Location . Y : 0 ;
2018-08-25 00:35:57 +02:00
Global . ControllerRemoved - = ControllerRemovedChange ;
2017-11-06 03:18:36 +01:00
2017-05-13 07:54:29 +02:00
if ( ! string . IsNullOrEmpty ( appdatapath ) )
2014-06-12 20:46:00 +02:00
{
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
Save ( ) ;
2017-05-01 11:29:19 +02:00
blankControllerTab ( ) ;
2014-06-12 20:46:00 +02:00
}
2017-07-12 15:04:37 +02:00
2018-08-25 00:35:57 +02:00
TaskRunner . Run ( ( ) = > Program . rootHub . Stop ( ) ) . Wait ( ) ;
2017-07-12 15:04:37 +02:00
// Make sure to stop event generation routines. Should fix odd crashes on shutdown
Application . Exit ( ) ;
2014-06-12 20:46:00 +02:00
}
2014-06-21 20:00:28 +02:00
private void cBSwipeProfiles_CheckedChanged ( object sender , EventArgs e )
{
2017-05-09 16:24:46 +02:00
bool swipe = false ;
SwipeProfiles = swipe = cBSwipeProfiles . Checked ;
bool timerEnabled = hotkeysTimer . Enabled ;
if ( swipe & & ! timerEnabled )
{
2018-08-24 22:17:13 +02:00
ChangeHotkeysStatus ( true ) ;
//hotkeysTimer.Start();
2017-05-09 16:24:46 +02:00
}
else if ( ! swipe & & timerEnabled )
{
2018-08-24 22:17:13 +02:00
ChangeHotkeysStatus ( false ) ;
//hotkeysTimer.Stop();
2017-05-09 16:24:46 +02:00
}
2014-06-21 20:00:28 +02:00
}
2014-10-21 04:31:13 +02:00
2014-11-20 20:03:18 +01:00
private void cBQuickCharge_CheckedChanged ( object sender , EventArgs e )
{
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
QuickCharge = cBQuickCharge . Checked ;
2014-11-20 20:03:18 +01:00
}
2014-10-21 04:31:13 +02:00
private void lbLastMessage_MouseHover ( object sender , EventArgs e )
{
2015-02-08 22:51:52 +01:00
toolTip1 . Show ( lbLastMessage . Text , lbLastMessage , - 3 , - 3 ) ;
2014-10-21 04:31:13 +02:00
}
private void pnlButton_MouseLeave ( object sender , EventArgs e )
{
2015-02-08 22:51:52 +01:00
toolTip1 . Hide ( lbLastMessage ) ;
2014-10-21 04:31:13 +02:00
}
2014-12-03 23:36:54 +01:00
private void nUDXIPorts_ValueChanged ( object sender , EventArgs e )
{
lbLastXIPort . Text = "- " + ( ( int ) Math . Round ( nUDXIPorts . Value , 0 ) + 3 ) ;
}
2017-11-11 20:07:26 +01:00
private int oldxiport ;
2014-12-03 23:36:54 +01:00
private void nUDXIPorts_Leave ( object sender , EventArgs e )
{
2015-02-08 22:51:52 +01:00
if ( oldxiport ! = ( int ) Math . Round ( nUDXIPorts . Value , 0 ) )
{
oldxiport = ( int ) Math . Round ( nUDXIPorts . Value , 0 ) ;
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
FirstXinputPort = oldxiport ;
2015-02-08 22:51:52 +01:00
Program . rootHub . x360Bus . FirstController = oldxiport ;
2018-02-26 09:55:17 +01:00
BtnStartStop_Clicked ( false ) ;
2017-11-09 09:27:05 +01:00
finishHideDS4Check ( ) ;
2015-02-08 22:51:52 +01:00
}
2014-12-03 23:36:54 +01:00
}
private void nUDXIPorts_Enter ( object sender , EventArgs e )
{
oldxiport = ( int ) Math . Round ( nUDXIPorts . Value , 0 ) ;
}
2014-12-13 21:12:03 +01:00
private void cBCloseMini_CheckedChanged ( object sender , EventArgs e )
{
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
CloseMini = cBCloseMini . Checked ;
2015-02-08 22:51:52 +01:00
}
private void Pads_MouseHover ( object sender , EventArgs e )
{
Label lb = ( Label ) sender ;
2017-07-15 15:50:38 +02:00
int i = Convert . ToInt32 ( lb . Tag ) ;
2017-05-13 07:54:29 +02:00
DS4Device d = Program . rootHub . DS4Controllers [ i ] ;
2017-10-05 23:06:27 +02:00
if ( d ! = null )
2015-02-08 22:51:52 +01:00
{
2017-05-13 07:54:29 +02:00
double latency = d . Latency ;
2015-02-08 22:51:52 +01:00
toolTip1 . Hide ( Pads [ i ] ) ;
toolTip1 . Show ( Properties . Resources . InputDelay . Replace ( "*number*" , latency . ToString ( ) ) , lb , lb . Size . Width , 0 ) ;
}
}
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
2015-02-08 22:51:52 +01:00
private void Pads_MouseLeave ( object sender , EventArgs e )
{
toolTip1 . Hide ( ( Label ) sender ) ;
}
2017-05-11 17:13:51 +02:00
2015-08-13 05:53:43 +02:00
Process bat ;
2017-05-11 17:13:51 +02:00
2015-11-28 06:47:26 +01:00
int currentCustomLed ;
private void EditCustomLed ( object sender , EventArgs e )
{
2017-07-15 15:50:38 +02:00
Button btn = ( Button ) sender ;
currentCustomLed = Convert . ToInt32 ( btn . Tag ) ;
bool customLedChecked = UseCustomLed [ currentCustomLed ] ;
useCustomColorToolStripMenuItem . Checked = customLedChecked ;
useProfileColorToolStripMenuItem . Checked = ! customLedChecked ;
cMCustomLed . Show ( btn , new Point ( 0 , btn . Height ) ) ;
2015-11-28 06:47:26 +01:00
}
private void useProfileColorToolStripMenuItem_Click ( object sender , EventArgs e )
{
UseCustomLed [ currentCustomLed ] = false ;
lights [ currentCustomLed ] . BackColor = MainColor [ currentCustomLed ] . ToColorA ;
Global . Save ( ) ;
}
private void useCustomColorToolStripMenuItem_Click ( object sender , EventArgs e )
{
advColorDialog . Color = CustomColor [ currentCustomLed ] . ToColor ;
2017-11-23 02:23:23 +01:00
AdvancedColorDialog . ColorUpdateHandler tempDel =
new AdvancedColorDialog . ColorUpdateHandler ( advColor_CustomColorUpdate ) ;
advColorDialog . OnUpdateColor + = tempDel ;
2015-11-28 06:47:26 +01:00
if ( advColorDialog . ShowDialog ( ) = = DialogResult . OK )
{
lights [ currentCustomLed ] . BackColor = new DS4Color ( advColorDialog . Color ) . ToColorA ;
CustomColor [ currentCustomLed ] = new DS4Color ( advColorDialog . Color ) ;
UseCustomLed [ currentCustomLed ] = true ;
Global . Save ( ) ;
}
2017-05-11 17:13:51 +02:00
2017-11-23 02:23:23 +01:00
advColorDialog . OnUpdateColor - = tempDel ;
2015-11-28 06:47:26 +01:00
DS4LightBar . forcedFlash [ currentCustomLed ] = 0 ;
DS4LightBar . forcelight [ currentCustomLed ] = false ;
}
2017-11-23 02:23:23 +01:00
private void advColor_CustomColorUpdate ( object sender , EventArgs e )
{
if ( sender is Color & & currentCustomLed < 4 )
{
Color color = ( Color ) sender ;
DS4Color dcolor = new DS4Color { red = color . R , green = color . G , blue = color . B } ;
DS4LightBar . forcedColor [ currentCustomLed ] = dcolor ;
DS4LightBar . forcedFlash [ currentCustomLed ] = 0 ;
DS4LightBar . forcelight [ currentCustomLed ] = true ;
}
}
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
private void cBUseWhiteIcon_CheckedChanged ( object sender , EventArgs e )
{
UseWhiteIcon = cBUseWhiteIcon . Checked ;
notifyIcon1 . Icon = UseWhiteIcon ? Properties . Resources . DS4W___White : Properties . Resources . DS4W ;
}
2015-11-28 06:47:26 +01:00
private void advColorDialog_OnUpdateColor ( object sender , EventArgs e )
{
if ( sender is Color )
{
Color color = ( Color ) sender ;
DS4Color dcolor = new DS4Color ( color ) ;
Console . WriteLine ( dcolor ) ;
DS4LightBar . forcedColor [ currentCustomLed ] = dcolor ;
DS4LightBar . forcedFlash [ currentCustomLed ] = 0 ;
DS4LightBar . forcelight [ currentCustomLed ] = true ;
}
}
2015-02-08 22:51:52 +01:00
2017-04-04 05:07:56 +02:00
private void lBProfiles_SelectedIndexChanged ( object sender , EventArgs e )
{
int index = lBProfiles . SelectedIndex ;
if ( index > = 0 )
{
tsBNewProfle . Enabled = true ;
tsBEditProfile . Enabled = true ;
tsBDeleteProfile . Enabled = true ;
tSBDupProfile . Enabled = true ;
tSBImportProfile . Enabled = true ;
tSBExportProfile . Enabled = true ;
}
else
{
tsBNewProfle . Enabled = true ;
tsBEditProfile . Enabled = false ;
tsBDeleteProfile . Enabled = false ;
tSBDupProfile . Enabled = false ;
2017-05-17 11:10:15 +02:00
tSBImportProfile . Enabled = true ;
2017-04-04 05:07:56 +02:00
tSBExportProfile . Enabled = false ;
}
}
2017-04-20 07:54:09 +02:00
private void runStartProgRadio_Click ( object sender , EventArgs e )
{
appShortcutToStartup ( ) ;
changeStartupRoutine ( ) ;
}
private void runStartTaskRadio_Click ( object sender , EventArgs e )
{
appShortcutToStartup ( ) ;
changeStartupRoutine ( ) ;
}
private void changeStartupRoutine ( )
{
if ( runStartTaskRadio . Checked )
{
WindowsIdentity identity = WindowsIdentity . GetCurrent ( ) ;
WindowsPrincipal principal = new WindowsPrincipal ( identity ) ;
if ( principal . IsInRole ( WindowsBuiltInRole . Administrator ) )
{
TaskService ts = new TaskService ( ) ;
2017-07-15 15:50:38 +02:00
Task tasker = ts . FindTask ( "RunDS4Windows" ) ;
2017-04-20 07:54:09 +02:00
if ( tasker ! = null )
{
ts . RootFolder . DeleteTask ( "RunDS4Windows" ) ;
}
TaskDefinition td = ts . NewTask ( ) ;
td . Actions . Add ( new ExecAction ( @"%windir%\System32\cmd.exe" ,
"/c start \"RunDS4Windows\" \"" + Process . GetCurrentProcess ( ) . MainModule . FileName + "\" -m" ,
new FileInfo ( Process . GetCurrentProcess ( ) . MainModule . FileName ) . DirectoryName ) ) ;
td . Principal . RunLevel = TaskRunLevel . Highest ;
ts . RootFolder . RegisterTaskDefinition ( "RunDS4Windows" , td ) ;
}
}
else
{
WindowsIdentity identity = WindowsIdentity . GetCurrent ( ) ;
WindowsPrincipal principal = new WindowsPrincipal ( identity ) ;
if ( principal . IsInRole ( WindowsBuiltInRole . Administrator ) )
{
TaskService ts = new TaskService ( ) ;
2017-07-15 15:50:38 +02:00
Task tasker = ts . FindTask ( "RunDS4Windows" ) ;
2017-04-20 07:54:09 +02:00
if ( tasker ! = null )
{
ts . RootFolder . DeleteTask ( "RunDS4Windows" ) ;
}
}
}
}
2017-10-19 21:16:09 +02:00
private void linkCB_CheckedChanged ( object sender , EventArgs e )
{
CheckBox linkCb = ( CheckBox ) sender ;
int i = Convert . ToInt32 ( linkCb . Tag ) ;
bool check = linkCb . Checked ;
Global . linkedProfileCheck [ i ] = check ;
DS4Device device = Program . rootHub . DS4Controllers [ i ] ;
if ( device ! = null & & device . isSynced ( ) )
{
if ( check )
{
if ( device . isValidSerial ( ) )
{
changeLinkedProfile ( device . getMacAddress ( ) , ProfilePath [ i ] ) ;
}
}
else
{
removeLinkedProfile ( device . getMacAddress ( ) ) ;
ProfilePath [ i ] = OlderProfilePath [ i ] ;
int profileIndex = cbs [ i ] . FindString ( ProfilePath [ i ] ) ;
if ( profileIndex > = 0 )
{
cbs [ i ] . SelectedIndex = profileIndex ;
}
}
SaveLinkedProfiles ( ) ;
}
}
2017-11-09 05:31:56 +01:00
private void exportLogTxtBtn_Click ( object sender , EventArgs e )
{
SaveFileDialog dialog = new SaveFileDialog ( ) ;
dialog . AddExtension = true ;
dialog . DefaultExt = ".txt" ;
dialog . Filter = "Text Documents (*.txt)|*.txt" ;
dialog . Title = "Select Export File" ;
dialog . InitialDirectory = Global . appdatapath ;
if ( dialog . ShowDialog ( ) = = DialogResult . OK )
{
string outputFile = dialog . FileName ;
List < string > outputLines = new List < string > ( ) ;
ListViewItem item = null ;
for ( int i = 0 , len = lvDebug . Items . Count ; i < len ; i + + )
{
item = lvDebug . Items [ i ] ;
outputLines . Add ( item . SubItems [ 0 ] . Text + ": " + item . SubItems [ 1 ] . Text ) ;
}
try
{
StreamWriter stream = new StreamWriter ( outputFile ) ;
string line = string . Empty ;
for ( int i = 0 , len = outputLines . Count ; i < len ; i + + )
{
line = outputLines [ i ] ;
stream . WriteLine ( line ) ;
}
stream . Close ( ) ;
}
catch { }
}
}
2017-12-12 21:52:13 +01:00
private void languagePackComboBox1_SelectedValueChanged ( object sender , EventArgs e )
{
2017-12-20 07:29:16 +01:00
string newValue = ( ( DS4Forms . LanguagePackComboBox ) sender ) . SelectedValue . ToString ( ) ;
if ( newValue ! = UseLang )
{
UseLang = newValue ;
Save ( ) ;
MessageBox . Show ( Properties . Resources . LanguagePackApplyRestartRequired , Text , MessageBoxButtons . OK , MessageBoxIcon . Information ) ;
}
2017-12-12 21:52:13 +01:00
}
2018-01-25 22:40:59 +01:00
private void HidGuardWhiteList_LinkClicked ( object sender , LinkLabelLinkClickedEventArgs e )
{
try
{
RegistryKey key = Registry . LocalMachine . CreateSubKey ( @"SYSTEM\CurrentControlSet\Services\HidGuardian\Parameters" ) ;
key . SetValue ( "AffectedDevices" , Program . rootHub . affectedDevs . ToArray ( ) , RegistryValueKind . MultiString ) ;
2018-09-29 11:42:22 +02:00
AppLogger . LogToGui ( "Wrote HidGuardian Device List to Registry" , false ) ;
2018-01-25 22:40:59 +01:00
}
catch { }
}
2018-01-26 00:43:22 +01:00
private void ClrHidGuardWlistLinkLabel_LinkClicked ( object sender , LinkLabelLinkClickedEventArgs e )
{
try
{
Registry . LocalMachine . DeleteSubKeyTree ( @"SYSTEM\CurrentControlSet\Services\HidGuardian\Parameters\Whitelist" ) ;
2018-09-29 11:42:22 +02:00
AppLogger . LogToGui ( "Cleared HidGuardian Whitelist" , false ) ;
2018-07-16 07:21:34 +02:00
Program . rootHub . CreateHidGuardKey ( ) ;
2018-01-26 00:43:22 +01:00
}
catch { }
}
2018-01-26 03:05:49 +01:00
private void HidGuardRegLinkLabel_LinkClicked ( object sender , LinkLabelLinkClickedEventArgs e )
{
try
{
RegistryKey key = Registry . CurrentUser . CreateSubKey ( @"Software\Microsoft\Windows\CurrentVersion\Applets\Regedit" ) ;
key . SetValue ( "LastKey" , @"Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HidGuardian\Parameters" , RegistryValueKind . String ) ;
Process temp = new Process ( ) ;
temp . StartInfo . FileName = "regedit" ;
temp . Start ( ) ;
}
catch { }
}
2018-01-26 23:03:14 +01:00
private void OpenProgramFolderToolStripMenuItem_Click ( object sender , EventArgs e )
{
Process temp = new Process ( ) ;
temp . StartInfo . FileName = "explorer.exe" ;
temp . StartInfo . Arguments = @"/select, " + Assembly . GetExecutingAssembly ( ) . Location ;
try { temp . Start ( ) ; }
catch { }
}
2018-05-26 06:52:41 +02:00
private void DiscontoolStripMenuItem_Click ( object sender , EventArgs e )
{
ToolStripMenuItem item = ( ToolStripMenuItem ) sender ;
int i = Convert . ToInt32 ( item . Tag ) ;
DS4Device d = Program . rootHub . DS4Controllers [ i ] ;
if ( d ! = null )
{
if ( d . ConnectionType = = ConnectionType . BT & & ! d . Charging )
{
d . DisconnectBT ( ) ;
}
else if ( d . ConnectionType = = ConnectionType . SONYWA & & ! d . Charging )
{
d . DisconnectDongle ( ) ;
}
}
}
2018-06-01 23:45:58 +02:00
private void MintoTaskCheckBox_CheckedChanged ( object sender , EventArgs e )
{
MinToTaskbar = mintoTaskCheckBox . Checked ;
Save ( ) ;
}
2018-06-19 08:09:52 +02:00
private void CBController_KeyPress ( object sender , KeyPressEventArgs e )
{
e . Handled = true ;
}
2018-08-06 12:00:37 +02:00
private async void CkUdpServ_CheckedChanged ( object sender , EventArgs e )
{
bool state = ckUdpServ . Checked ;
setUsingUDPServer ( state ) ;
if ( ! state )
{
Program . rootHub . ChangeMotionEventStatus ( state ) ;
await TaskRunner . Delay ( 100 ) ;
Program . rootHub . ChangeUDPStatus ( state ) ;
}
else
{
Program . rootHub . ChangeUDPStatus ( state ) ;
Program . rootHub . ChangeMotionEventStatus ( state ) ;
}
nUDUdpPortNum . Enabled = state ;
}
private void NUDUdpPortNum_Leave ( object sender , EventArgs e )
{
2018-08-08 10:54:19 +02:00
int curValue = ( int ) nUDUdpPortNum . Value ;
if ( curValue ! = getUDPServerPortNum ( ) )
{
setUDPServerPort ( curValue ) ;
nUDUdpPortNum . Enabled = false ;
WaitUDPPortChange ( ) ;
}
2018-08-06 12:00:37 +02:00
}
private async void WaitUDPPortChange ( )
{
2018-08-11 08:22:33 +02:00
await TaskRunner . Delay ( 100 ) ;
if ( isUsingUDPServer ( ) )
{
await TaskRunner . Run ( ( ) = > Program . rootHub . UseUDPPort ( ) ) ;
nUDUdpPortNum . Enabled = true ;
}
2018-08-06 12:00:37 +02:00
}
2015-03-15 19:16:01 +01:00
private void cBFlashWhenLate_CheckedChanged ( object sender , EventArgs e )
{
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
FlashWhenLate = cBFlashWhenLate . Checked ;
nUDLatency . Enabled = cBFlashWhenLate . Checked ;
lbMsLatency . Enabled = cBFlashWhenLate . Checked ;
}
private void nUDLatency_ValueChanged ( object sender , EventArgs e )
{
FlashWhenLateAt = ( int ) Math . Round ( nUDLatency . Value ) ;
2015-03-15 19:16:01 +01:00
}
2014-03-28 02:50:40 +01:00
}
}