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-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 ;
2019-01-04 07:49:55 +01:00
using System.Management ;
2017-04-20 07:54:09 +02:00
2019-04-30 21:29:50 +02:00
namespace DS4Windows.Forms
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 ;
2019-09-06 23:04:07 +02:00
private PictureBox [ ] exclusivePB ;
2017-08-30 04:57:31 +02:00
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 ;
2019-01-08 05:01:43 +01:00
NonFormTimer hotkeysTimer = null ; // new NonFormTimer();
NonFormTimer autoProfilesTimer = null ; // new NonFormTimer();
2017-08-30 04:57:31 +02:00
double dpix , dpiy ;
2019-07-11 22:58:03 +02:00
List < ProgramPathItem > programpaths = new List < ProgramPathItem > ( ) ;
2015-02-08 22:51:52 +01:00
List < string > profilenames = new List < string > ( ) ;
2014-06-06 22:38:52 +02:00
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 ;
2019-07-11 22:58:03 +02:00
ProgramPathItem tempProfileProgram = null ;
public static int autoProfileDebugLogLevel = 0 ; // 0=Dont log debug messages about active process and window titles to GUI Log screen. 1=Show debug log messages
private static IntPtr prevForegroundWnd = IntPtr . Zero ;
private static uint prevForegroundProcessID = 0 ;
private static string prevForegroundWndTitleName = string . Empty ;
private static string prevForegroundProcessName = string . Empty ;
private static StringBuilder autoProfileCheckTextBuilder = null ;
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
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-25 04:41:29 +02:00
private IntPtr regHandle = new IntPtr ( ) ;
2019-01-04 07:49:55 +01:00
private ManagementEventWatcher managementEvWatcher ;
2019-06-04 09:19:19 +02:00
private DS4Forms . LanguagePackComboBox languagePackComboBox1 ;
2019-06-17 08:22:39 +02:00
private AdvancedColorDialog advColorDialog ;
2019-07-02 23:02:29 +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
2019-02-25 08:24:54 +01:00
private const string UPDATER_VERSION = "1.3.1" ;
2018-10-17 06:06:39 +02:00
private const int WM_QUERYENDSESSION = 0x11 ;
private const int WM_CLOSE = 0x10 ;
2019-07-01 12:34:36 +02:00
public const int WM_COPYDATA = 0x004A ;
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 ) ;
2019-07-11 22:58:03 +02:00
[DllImport("user32.dll", CharSet= CharSet.Auto)]
private static extern int GetWindowText ( IntPtr hWnd , StringBuilder lpString , 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
2019-09-29 03:37:42 +02:00
bool firstRun = Global . firstRun ;
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 ( ) ;
2019-06-17 08:22:39 +02:00
advColorDialog = new AdvancedColorDialog ( ) ;
2018-01-30 04:01:23 +01:00
2019-06-04 09:19:19 +02:00
this . languagePackComboBox1 = new DS4Forms . LanguagePackComboBox ( ) ;
this . languagePackComboBox1 . AutoValidate = System . Windows . Forms . AutoValidate . Disable ;
this . languagePackComboBox1 . BackColor = System . Drawing . SystemColors . Window ;
this . languagePackComboBox1 . CausesValidation = false ;
this . languagePackComboBox1 . Name = "languagePackComboBox1" ;
this . languagePackComboBox1 . SelectedValueChanged + = new System . EventHandler ( this . languagePackComboBox1_SelectedValueChanged ) ;
this . langPanel . Controls . Add ( languagePackComboBox1 ) ;
2018-01-30 04:01:23 +01:00
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 } ;
2019-09-06 23:04:07 +02:00
exclusivePB = new PictureBox [ 4 ] { exclusivePB1 , exclusivePB2 , exclusivePB3 , exclusivePB4 } ;
2018-01-30 04:01:23 +01:00
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 } ;
2019-01-04 07:49:55 +01:00
WqlEventQuery q = new WqlEventQuery ( ) ;
ManagementScope scope = new ManagementScope ( "root\\CIMV2" ) ;
q . EventClassName = "Win32_PowerManagementEvent" ;
managementEvWatcher = new ManagementEventWatcher ( scope , q ) ;
managementEvWatcher . EventArrived + = PowerEventArrive ;
managementEvWatcher . Start ( ) ;
2018-01-30 04:01:23 +01:00
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 ( ) ;
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 ) ;
2019-09-29 03:37:42 +02:00
if ( firstRun & & ! 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 ;
2018-12-27 10:03:53 +01:00
populateNotifyText ( ) ;
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 ;
2019-04-20 17:47:08 +02:00
cBCustomSteam . Checked = UseCustomSteamFolder ;
tBSteamFolder . Text = CustomSteamFolder ;
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
2018-11-17 15:57:18 +01:00
if ( startMinimizedCheckBox . Checked | | mini )
2014-11-20 20:03:18 +01:00
{
2018-11-17 15:57:18 +01:00
WindowState = FormWindowState . Minimized ;
2014-11-20 20:03:18 +01:00
}
2017-04-29 10:19:45 +02:00
2014-11-04 05:43:38 +01:00
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
2017-11-09 09:09:13 +01:00
FileVersionInfo fvi = FileVersionInfo . GetVersionInfo ( Assembly . GetExecutingAssembly ( ) . Location ) ;
string version = fvi . FileVersion ;
2018-12-13 12:44:04 +01:00
LogDebug ( DateTime . Now , "DS4Windows version " + version , false ) ;
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
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 ;
2019-01-08 05:01:43 +01:00
//cBSwipeProfiles.Checked = SwipeProfiles;
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
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
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
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 ;
}
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-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 ) ;
2019-05-27 00:07:17 +02:00
ckUdpServ . Checked = nUDUdpPortNum . Enabled = tBUdpListenAddress . Enabled = isUsingUDPServer ( ) ;
2018-08-06 12:00:37 +02:00
nUDUdpPortNum . Value = getUDPServerPortNum ( ) ;
2019-05-27 00:07:17 +02:00
tBUdpListenAddress . Text = getUDPServerListenAddress ( ) ;
new ToolTip ( ) . SetToolTip ( ckUdpServ , Properties . Resources . UdpServer ) ;
2018-08-06 12:00:37 +02:00
2018-08-08 10:54:19 +02:00
ckUdpServ . CheckedChanged + = CkUdpServ_CheckedChanged ;
nUDUdpPortNum . Leave + = NUDUdpPortNum_Leave ;
2019-05-31 00:52:25 +02:00
tBUdpListenAddress . Leave + = TBUdpListenAddress_Leave ;
2019-05-27 00:07:17 +02:00
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 ) )
2018-11-17 15:09:36 +01:00
control . MouseHover + = Items_MouseHover ;
2018-08-01 11:03:42 +02:00
else
control . MouseHover + = ClearLastMessage ;
2017-05-13 07:54:29 +02:00
}
}
2018-08-17 22:11:46 +02:00
2018-12-06 09:57:30 +01:00
this . Resize + = Form_Resize ;
2018-12-06 12:26:44 +01:00
this . LocationChanged + = TrackLocationChanged ;
2018-12-13 12:44:04 +01:00
2019-07-02 23:02:29 +02:00
Program . CreateIPCClassNameMMF ( this . Handle ) ;
2019-07-01 01:45:55 +02:00
2018-12-13 12:44:04 +01:00
Program . rootHub . Debug + = On_Debug ;
AppLogger . GuiLog + = On_Debug ;
AppLogger . TrayIconLog + = ShowNotification ;
2018-12-13 21:53:49 +01:00
LoadLinkedProfiles ( ) ;
2018-12-13 12:44:04 +01:00
2018-12-13 12:55:38 +01:00
TaskRunner . Delay ( 50 ) . ContinueWith ( ( t ) = >
{
2018-12-29 08:20:33 +01:00
if ( checkwhen > 0 & & DateTime . Now > = LastChecked + TimeSpan . FromHours ( checkwhen ) )
{
this . BeginInvoke ( ( System . Action ) ( ( ) = >
{
// Sorry other devs, gonna have to find your own server
Uri url = new Uri ( "https://raw.githubusercontent.com/Ryochan7/DS4Windows/jay/DS4Windows/newest.txt" ) ;
WebClient wc = new WebClient ( ) ;
wc . DownloadFileAsync ( url , appdatapath + "\\version.txt" ) ;
wc . DownloadFileCompleted + = ( sender , e ) = > { TaskRunner . Run ( ( ) = > Check_Version ( sender , e ) ) ; } ;
LastChecked = DateTime . Now ;
} ) ) ;
}
2018-12-13 12:55:38 +01:00
UpdateTheUpdater ( ) ;
} ) ;
2018-08-17 22:11:46 +02:00
if ( btnStartStop . Enabled & & start )
2018-12-13 12:55:38 +01:00
{
2019-01-18 22:38:13 +01:00
TaskRunner . Delay ( 100 ) . ContinueWith ( ( t ) = > {
2018-12-13 12:44:04 +01:00
this . BeginInvoke ( ( System . Action ) ( ( ) = > BtnStartStop_Clicked ( ) ) ) ;
} ) ;
2018-12-13 12:55:38 +01:00
}
2019-01-08 05:01:43 +01:00
Thread timerThread = new Thread ( ( ) = >
{
hotkeysTimer = new NonFormTimer ( ) ;
2019-10-28 02:52:50 +01:00
hotkeysTimer . Interval = 20 ;
2019-01-08 05:01:43 +01:00
//hotkeysTimer.Elapsed += Hotkeys;
hotkeysTimer . AutoReset = false ;
if ( SwipeProfiles )
{
ChangeHotkeysStatus ( true ) ;
//hotkeysTimer.Start();
}
autoProfilesTimer = new NonFormTimer ( ) ;
//autoProfilesTimer.Elapsed += CheckAutoProfiles;
autoProfilesTimer . Interval = 1000 ;
autoProfilesTimer . AutoReset = false ;
LoadP ( ) ;
this . BeginInvoke ( ( System . Action ) ( ( ) = >
{
cBSwipeProfiles . Checked = SwipeProfiles ;
} ) ) ;
} ) ;
timerThread . IsBackground = true ;
timerThread . Priority = ThreadPriority . Lowest ;
timerThread . Start ( ) ;
2019-10-22 08:23:41 +02:00
// Have Form_Resize run to honor minimize setting
Show ( ) ;
2017-05-05 05:15:22 +02:00
}
2019-05-31 00:52:25 +02:00
private void TBUdpListenAddress_Leave ( object sender , EventArgs e )
{
setUDPServerListenAddress ( tBUdpListenAddress . Text . Trim ( ) ) ;
}
2017-05-05 05:15:22 +02:00
private void populateHoverTextDict ( )
{
hoverTextDict . Clear ( ) ;
hoverTextDict [ cBSwipeProfiles ] = Properties . Resources . TwoFingerSwipe ;
hoverTextDict [ cBQuickCharge ] = Properties . Resources . QuickCharge ;
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 ;
2019-09-06 23:04:07 +02:00
exclusivePB [ Index ] . Visible = false ;
2018-06-19 07:04:30 +02:00
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 ) ;
2019-10-28 04:16:07 +01:00
processes = Process . GetProcessesByName ( "DS4Updater" ) ;
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
}
2019-07-11 22:58:03 +02:00
public static bool GetTopWindowName ( out string topProcessName , out string topWndTitleName , bool autoProfileTimerCheck = false )
2014-06-09 01:41:36 +02:00
{
IntPtr hWnd = GetForegroundWindow ( ) ;
2019-07-11 22:58:03 +02:00
if ( hWnd = = IntPtr . Zero )
{
// Top window unknown or cannot acquire a handle. Return FALSE and return unknown process and wndTitle values
prevForegroundWnd = IntPtr . Zero ;
prevForegroundProcessID = 0 ;
topProcessName = topWndTitleName = String . Empty ;
return false ;
}
//
// If this function was called from "auto-profile watcher timer" then check cached "previous hWnd handle". If the current hWnd is the same
// as during the previous check then return cached previous wnd and name values (ie. foreground app and window are assumed to be the same, so no need to re-query names).
// This should optimize the auto-profile timer check process and causes less burden to .NET GC collector because StringBuffer is not re-allocated every second.
//
// Note! hWnd handles may be re-cycled but not during the lifetime of the window. This "cache" optimization still works because when an old window is closed
// then foreground window changes to something else and the cached prevForgroundWnd variable is updated to store the new hWnd handle.
// It doesn't matter even when the previously cached handle is recycled by WinOS to represent some other window (it is no longer used as a cached value anyway).
//
if ( autoProfileTimerCheck )
{
if ( hWnd = = prevForegroundWnd )
{
// The active window is still the same. Return cached process and wndTitle values and FALSE to indicate caller that no changes since the last call of this method
topProcessName = prevForegroundProcessName ;
topWndTitleName = prevForegroundWndTitleName ;
return false ;
}
prevForegroundWnd = hWnd ;
}
IntPtr hProcess = IntPtr . Zero ;
uint lpdwProcessId = 0 ;
2014-06-09 01:41:36 +02:00
GetWindowThreadProcessId ( hWnd , out lpdwProcessId ) ;
2019-07-11 22:58:03 +02:00
if ( autoProfileTimerCheck )
{
if ( autoProfileCheckTextBuilder = = null ) autoProfileCheckTextBuilder = new StringBuilder ( 1000 ) ;
if ( lpdwProcessId = = prevForegroundProcessID )
{
topProcessName = prevForegroundProcessName ;
}
else
{
prevForegroundProcessID = lpdwProcessId ;
2014-06-09 01:41:36 +02:00
2019-07-11 22:58:03 +02:00
hProcess = OpenProcess ( 0x0410 , false , lpdwProcessId ) ;
if ( hProcess ! = IntPtr . Zero ) GetModuleFileNameEx ( hProcess , IntPtr . Zero , autoProfileCheckTextBuilder , autoProfileCheckTextBuilder . Capacity ) ;
else autoProfileCheckTextBuilder . Clear ( ) ;
prevForegroundProcessName = topProcessName = autoProfileCheckTextBuilder . Replace ( '/' , '\\' ) . ToString ( ) . ToLower ( ) ;
}
GetWindowText ( hWnd , autoProfileCheckTextBuilder , autoProfileCheckTextBuilder . Capacity ) ;
prevForegroundWndTitleName = topWndTitleName = autoProfileCheckTextBuilder . ToString ( ) . ToLower ( ) ;
}
else
{
// Caller function was not the autoprofile timer check thread, so create a new buffer to make this call thread safe and always query process and window title names.
// Note! At the moment DS4Win app doesn't call this method with autoProfileTimerCheck=false option, but this is here just for potential future usage.
StringBuilder text = new StringBuilder ( 1000 ) ;
2014-06-09 01:41:36 +02:00
2019-07-11 22:58:03 +02:00
hProcess = OpenProcess ( 0x0410 , false , lpdwProcessId ) ;
if ( hProcess ! = IntPtr . Zero ) GetModuleFileNameEx ( hProcess , IntPtr . Zero , text , text . Capacity ) ;
else text . Clear ( ) ;
topProcessName = text . ToString ( ) ;
2014-06-09 01:41:36 +02:00
2019-07-11 22:58:03 +02:00
GetWindowText ( hWnd , text , text . Capacity ) ;
topWndTitleName = text . ToString ( ) ;
}
if ( hProcess ! = IntPtr . Zero ) CloseHandle ( hProcess ) ;
if ( DS4Form . autoProfileDebugLogLevel > 0 )
AppLogger . LogToGui ( $"DEBUG: Auto-Profile. PID={lpdwProcessId} Path={topProcessName} | WND={hWnd} Title={topWndTitleName}" , false ) ;
return true ;
2014-05-31 06:37:02 +02:00
}
2014-06-06 22:38:52 +02:00
2019-01-04 07:49:55 +01:00
private void PowerEventArrive ( object sender , EventArrivedEventArgs e )
2014-06-06 22:38:52 +02:00
{
2019-01-04 07:49:55 +01:00
short evType = Convert . ToInt16 ( e . NewEvent . GetPropertyValue ( "EventType" ) ) ;
switch ( evType )
2014-06-06 22:38:52 +02:00
{
2019-07-30 11:28:55 +02:00
// Wakeup from Suspend
2019-01-05 07:07:00 +01:00
case 7 :
2017-05-09 16:24:46 +02:00
{
2019-01-04 07:49:55 +01:00
if ( btnStartStop . Text = = Properties . Resources . StartText & & wasrunning )
2014-08-23 22:52:20 +02:00
{
DS4LightBar . shuttingdown = false ;
2019-01-04 07:49:55 +01:00
wasrunning = false ;
2018-02-26 10:51:24 +01:00
Program . rootHub . suspending = false ;
2019-07-30 11:28:55 +02:00
Thread . Sleep ( 16000 ) ;
//this.Invoke((System.Action)(() => BtnStartStop_Clicked()));
changingService = true ;
SynchronizationContext uiContext = null ;
Invoke ( ( System . Action ) ( ( ) = > {
uiContext = SynchronizationContext . Current ;
btnStartStop . Enabled = false ;
} ) ) ;
Program . rootHub . Start ( uiContext ) ;
Invoke ( ( System . Action ) ( ( ) = > {
ServiceStartupFinish ( ) ;
} ) ) ;
changingService = false ;
2014-08-23 22:52:20 +02:00
}
2019-01-04 07:49:55 +01:00
2014-06-06 22:38:52 +02:00
break ;
2017-05-09 16:24:46 +02:00
}
2019-07-30 11:28:55 +02:00
// Entering Suspend
2019-01-05 07:07:00 +01:00
case 4 :
2017-05-09 16:24:46 +02:00
{
2019-01-04 07:49:55 +01:00
if ( 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 ;
2019-07-29 04:53:41 +02:00
changingService = true ;
2019-07-05 22:22:57 +02:00
2019-07-29 04:53:41 +02:00
Program . rootHub . Stop ( true ) ;
Invoke ( ( System . Action ) ( ( ) = > {
ServiceShutdownFinish ( ) ;
btnStartStop . Enabled = false ;
} ) ) ;
changingService = false ;
wasrunning = true ;
2014-08-23 22:52:20 +02:00
}
2019-01-04 07:49:55 +01:00
2014-06-06 22:38:52 +02:00
break ;
2017-05-09 16:24:46 +02:00
}
2019-01-04 07:49:55 +01: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
{
2018-12-13 20:49:46 +01:00
hotkeysTimer . Stop ( ) ;
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 )
{
2019-07-11 22:58:03 +02:00
string topProcessName , topWindowTitle ;
string [ ] newProfileName = new string [ 4 ] { String . Empty , String . Empty , String . Empty , String . Empty } ;
bool turnOffDS4WinApp = false ;
ProgramPathItem matchingProgramPathItem = null ;
2018-12-13 20:49:46 +01:00
autoProfilesTimer . Stop ( ) ;
2019-07-11 22:58:03 +02:00
if ( GetTopWindowName ( out topProcessName , out topWindowTitle , true ) )
2017-04-25 03:26:34 +02:00
{
2019-07-11 22:58:03 +02:00
// Find a profile match based on autoprofile program path and wnd title list.
// The same program may set different profiles for each of the controllers, so we need an array of newProfileName[controllerIdx] values.
2017-05-09 16:24:46 +02:00
for ( int i = 0 , pathsLen = programpaths . Count ; i < pathsLen ; i + + )
2014-06-09 01:41:36 +02:00
{
2019-07-11 22:58:03 +02:00
if ( programpaths [ i ] . IsMatch ( topProcessName , topWindowTitle ) )
2014-06-09 01:41:36 +02:00
{
2019-07-11 22:58:03 +02:00
if ( DS4Form . autoProfileDebugLogLevel > 0 )
AppLogger . LogToGui ( $"DEBUG: Auto-Profile. Rule#{i+1} Path={programpaths[i].path} Title={programpaths[i].title}" , false ) ;
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
{
2019-07-11 22:58:03 +02:00
newProfileName [ j ] = proprofiles [ j ] [ i ] ; // j is controller index, i is filename
2014-07-26 01:17:45 +02:00
}
2017-04-25 03:26:34 +02:00
}
2019-07-11 22:58:03 +02:00
// Matching autoprofile rule found
turnOffDS4WinApp = turnOffTempProfiles [ i ] ;
matchingProgramPathItem = programpaths [ i ] ;
break ;
}
}
if ( matchingProgramPathItem ! = null )
{
// Program match found. Check if the new profile is different than current profile of the controller. Load the new profile only if it is not already loaded.
for ( int j = 0 ; j < 4 ; j + + )
{
if ( newProfileName [ j ] ! = String . Empty )
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
{
2019-07-11 22:58:03 +02:00
if ( ( Global . useTempProfile [ j ] & & newProfileName [ j ] ! = Global . tempprofilename [ j ] ) | | ( ! Global . useTempProfile [ j ] & & newProfileName [ j ] ! = Global . ProfilePath [ j ] ) )
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
{
2019-07-11 22:58:03 +02:00
if ( DS4Form . autoProfileDebugLogLevel > 0 )
AppLogger . LogToGui ( $"DEBUG: Auto-Profile. LoadProfile Controller {j+1}={newProfileName[j]}" , false ) ;
2018-06-19 07:04:30 +02:00
2019-07-11 22:58:03 +02:00
LoadTempProfile ( j , newProfileName [ j ] , true , Program . rootHub ) ; // j is controller index, i is filename
//if (LaunchProgram[j] != string.Empty) Process.Start(LaunchProgram[j]);
}
else
{
if ( DS4Form . autoProfileDebugLogLevel > 0 )
AppLogger . LogToGui ( $"DEBUG: Auto-Profile. LoadProfile Controller {j + 1}={newProfileName[j]} (already loaded)" , false ) ;
}
}
}
if ( turnOffDS4WinApp )
{
turnOffTemp = true ;
if ( btnStartStop . Text = = Properties . Resources . StopText )
{
//autoProfilesTimer.Stop();
//hotkeysTimer.Stop();
ChangeAutoProfilesStatus ( false ) ;
ChangeHotkeysStatus ( false ) ;
2018-06-19 07:04:30 +02:00
2019-07-11 22:58:03 +02:00
this . Invoke ( ( System . Action ) ( ( ) = >
{
this . changingService = true ;
BtnStartStop_Clicked ( ) ;
} ) ) ;
2018-06-19 07:04:30 +02:00
2019-07-11 22:58:03 +02:00
while ( this . changingService )
{
Thread . SpinWait ( 500 ) ;
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
2019-07-11 22:58:03 +02:00
this . Invoke ( ( System . Action ) ( ( ) = >
{
//hotkeysTimer.Start();
ChangeHotkeysStatus ( true ) ;
ChangeAutoProfilesStatus ( true ) ;
//autoProfilesTimer.Start();
} ) ) ;
}
2014-06-09 01:41:36 +02:00
}
2019-07-11 22:58:03 +02:00
tempProfileProgram = matchingProgramPathItem ;
2014-06-09 01:41:36 +02:00
}
2019-07-11 22:58:03 +02:00
else if ( tempProfileProgram ! = null )
2014-06-09 01:41:36 +02:00
{
2019-07-11 22:58:03 +02:00
// The current active program doesn't match any of the programs in autoprofile path list.
// Unload temp profile if controller is not using the default profile already.
tempProfileProgram = null ;
2014-06-09 01:41:36 +02:00
for ( int j = 0 ; j < 4 ; j + + )
2019-07-11 22:58:03 +02:00
{
if ( Global . useTempProfile [ j ] )
{
if ( DS4Form . autoProfileDebugLogLevel > 0 )
AppLogger . LogToGui ( $"DEBUG: Auto-Profile. RestoreProfile Controller {j + 1}={Global.ProfilePath[j]} (default)" , false ) ;
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 )
2019-07-11 22:58:03 +02:00
programpaths . Add ( new ProgramPathItem ( x . Attributes [ "path" ] ? . Value , x . Attributes [ "title" ] ? . Value ) ) ;
2017-05-14 01:47:04 +02:00
2019-07-11 22:58:03 +02:00
int nodeIdx = 0 ;
foreach ( ProgramPathItem pathItem 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
{
2019-07-11 22:58:03 +02:00
XmlNode item ;
nodeIdx + + ;
2014-06-06 22:38:52 +02:00
for ( int i = 0 ; i < 4 ; i + + )
{
2019-07-11 22:58:03 +02:00
item = doc . SelectSingleNode ( $"/Programs/Program[{nodeIdx}]/Controller{i+1}" ) ;
if ( item ! = null )
proprofiles [ i ] . Add ( item . InnerText ) ;
else
proprofiles [ i ] . Add ( "(none)" ) ;
2014-06-06 22:38:52 +02:00
}
2017-05-14 01:47:04 +02:00
2019-07-11 22:58:03 +02:00
item = doc . SelectSingleNode ( $"/Programs/Program[{nodeIdx}]/TurnOff" ) ;
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 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 ;
2019-03-19 07:33:41 +01:00
deriverinstalled = Global . IsViGEmBusInstalled ( ) ;
2018-01-28 09:25:35 +01:00
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 ( ) ;
2019-07-08 07:32:31 +02:00
bool launchUpdate = false ;
2019-02-07 18:52:28 +01:00
if ( ! string . IsNullOrWhiteSpace ( newversion ) & & version . Replace ( ',' , '.' ) . CompareTo ( newversion ) ! = 0 )
2017-05-13 07:54:29 +02:00
{
2019-10-29 02:28:42 +01:00
DialogResult result = DialogResult . No ;
this . Invoke ( ( System . Action ) ( ( ) = >
{
MessageBox . Show ( Properties . Resources . DownloadVersion . Replace ( "*number*" , newversion ) ,
Properties . Resources . DS4Update , MessageBoxButtons . YesNo , MessageBoxIcon . Question ) ;
} ) ) ;
if ( result = = 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
{
2019-07-08 07:32:31 +02:00
launchUpdate = true ;
2014-08-18 07:18:46 +02:00
if ( ! File . Exists ( exepath + "\\DS4Updater.exe" ) | | ( File . Exists ( exepath + "\\DS4Updater.exe" )
2018-12-23 15:45:03 +01:00
& & ( FileVersionInfo . GetVersionInfo ( exepath + "\\DS4Updater.exe" ) . FileVersion . CompareTo ( UPDATER_VERSION ) ! = 0 ) ) )
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
{
2018-12-29 02:33:03 +01:00
Uri url2 = new Uri ( $"https://github.com/Ryochan7/DS4Updater/releases/download/v{UPDATER_VERSION}/{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 )
2019-03-30 14:08:21 +01: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
wc2 . DownloadFile ( url2 , exepath + "\\DS4Updater.exe" ) ;
2019-03-30 14:08:21 +01: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
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 ) ) ) ;
2018-12-29 02:33:03 +01:00
Process . Start ( $"https://github.com/Ryochan7/DS4Updater/releases/download/v{UPDATER_VERSION}/{updaterExe}" ) ;
2019-07-08 07:32:31 +02:00
launchUpdate = false ;
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
}
2019-07-08 07:32:31 +02:00
if ( launchUpdate )
{
2019-10-29 02:28:42 +01:00
using ( Process p = new Process ( ) )
{
p . StartInfo . FileName = exepath + "\\DS4Updater.exe" ;
p . StartInfo . Arguments = "-autolaunch" ;
if ( AdminNeeded ( ) )
p . StartInfo . Verb = "runas" ;
try { p . Start ( ) ; }
catch ( Exception ) { launchUpdate = false ; }
}
}
if ( launchUpdate )
{
Close ( ) ;
2019-07-08 07:32:31 +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
}
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
}
2014-05-21 07:36:05 +02:00
2018-08-10 02:50:26 +02:00
else if ( FormWindowState . Normal = = WindowState & & ! minToTask )
2014-05-19 07:55:12 +02:00
{
2014-11-20 20:03:18 +01: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
2018-12-06 12:26:44 +01:00
if ( WindowState ! = FormWindowState . Minimized )
{
FormWidth = Width ;
FormHeight = Height ;
}
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-12-06 12:26:44 +01:00
private void TrackLocationChanged ( object sender , EventArgs e )
{
if ( WindowState ! = FormWindowState . Minimized )
{
FormLocationX = Location . X ;
FormLocationY = Location . Y ;
}
}
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 ;
2019-07-26 10:41:38 +02:00
btnStartStop . Enabled = false ;
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 ;
2019-07-26 10:41:38 +02:00
btnStartStop . Enabled = true ;
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 ;
2019-07-26 10:41:38 +02:00
btnStartStop . Enabled = false ;
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 ;
2019-07-26 10:41:38 +02:00
btnStartStop . Enabled = true ;
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
{
2019-03-19 08:32:49 +01:00
case Util . 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 ) ;
2019-03-19 08:32:49 +01:00
bool result = Util . RegisterNotify ( this . Handle , hidGuid , ref regHandle ) ;
2018-10-17 06:06:39 +02:00
if ( ! result )
{
ScpForm_Closing ( this ,
new FormClosingEventArgs ( CloseReason . ApplicationExitCall , false ) ) ;
}
break ;
2018-10-16 21:35:41 +02:00
}
2019-03-19 08:32:49 +01:00
case Util . 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 ;
2019-03-12 22:03:08 +01:00
TaskRunner . Run ( ( ) = > { InnerHotplug2 ( ) ; } ) ;
2018-10-17 06:06:39 +02:00
}
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_QUERYENDSESSION :
{
systemShutdown = true ;
break ;
}
2019-07-01 12:34:36 +02:00
case WM_COPYDATA :
2019-07-01 01:45:55 +02:00
{
2019-07-01 12:34:36 +02:00
// Received InterProcessCommunication (IPC) message. DS4Win command is embedded as a string value in lpData buffer
2019-07-01 01:45:55 +02:00
Program . COPYDATASTRUCT cds = ( Program . COPYDATASTRUCT ) m . GetLParam ( typeof ( Program . COPYDATASTRUCT ) ) ;
2019-07-01 12:34:36 +02:00
if ( cds . cbData > = 4 & & cds . cbData < = 256 )
2019-07-01 01:45:55 +02:00
{
int tdevice = - 1 ;
byte [ ] buffer = new byte [ cds . cbData ] ;
Marshal . Copy ( cds . lpData , buffer , 0 , cds . cbData ) ;
string [ ] strData = Encoding . ASCII . GetString ( buffer ) . Split ( '.' ) ;
if ( strData . Length > = 1 )
{
strData [ 0 ] = strData [ 0 ] . ToLower ( ) ;
if ( strData [ 0 ] = = "start" )
ServiceStartup ( true ) ;
else if ( strData [ 0 ] = = "stop" )
ServiceShutdown ( true ) ;
else if ( strData [ 0 ] = = "shutdown" )
ScpForm_Closing ( this , new FormClosingEventArgs ( CloseReason . ApplicationExitCall , false ) ) ;
2019-07-01 12:34:36 +02:00
else if ( ( strData [ 0 ] = = "loadprofile" | | strData [ 0 ] = = "loadtempprofile" ) & & strData . Length > = 3 )
2019-07-01 01:45:55 +02:00
{
2019-07-01 12:34:36 +02:00
// Command syntax: LoadProfile.device#.profileName (fex LoadProfile.1.GameSnake or LoadTempProfile.1.WebBrowserSet)
2019-07-01 01:45:55 +02:00
if ( int . TryParse ( strData [ 1 ] , out tdevice ) ) tdevice - - ;
2019-07-01 12:34:36 +02:00
if ( tdevice > = 0 & & tdevice < ControlService . DS4_CONTROLLER_COUNT & & File . Exists ( Global . appdatapath + "\\Profiles\\" + strData [ 2 ] + ".xml" ) )
2019-07-01 01:45:55 +02:00
{
2019-07-01 12:34:36 +02:00
if ( strData [ 0 ] = = "loadprofile" )
{
ProfilePath [ tdevice ] = strData [ 2 ] ;
LoadProfile ( tdevice , true , Program . rootHub ) ;
}
else
{
LoadTempProfile ( tdevice , strData [ 2 ] , true , Program . rootHub ) ;
}
Program . rootHub . LogDebug ( Properties . Resources . UsingProfile . Replace ( "*number*" , ( tdevice + 1 ) . ToString ( ) ) . Replace ( "*Profile name*" , strData [ 2 ] ) ) ;
2019-07-01 01:45:55 +02:00
}
}
}
}
break ;
}
2018-10-17 06:06:39 +02:00
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
{
2019-03-19 03:03:02 +01:00
Thread . Sleep ( 1500 ) ;
2019-03-22 06:14:42 +01: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 )
{
2018-12-27 10:02:05 +01:00
notifyText [ i + 1 ] = ( i + 1 ) + ": " + temp ;
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 )
{
2018-12-27 10:02:05 +01:00
notifyText [ index + 1 ] = ( index + 1 ) + ": " + temp ;
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 ) )
{
2018-12-27 10:02:05 +01:00
tooltip + = "\n" + notifyText [ i ] ;
2017-06-05 10:29:02 +02:00
}
}
2018-12-27 10:02:05 +01:00
notifyIcon1 . Text = tooltip . Length > 63 ? tooltip . Substring ( 0 , 63 ) : tooltip ; // Carefully stay under the 63 character limit.
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 ;
}
2019-09-06 23:04:07 +02:00
DS4Device dev = Program . rootHub . DS4Controllers [ Index ] ;
if ( dev ! = null )
{
2019-09-07 16:08:09 +02:00
exclusivePB [ Index ] . Visible = true ;
2019-09-06 23:04:07 +02:00
exclusivePB [ Index ] . Image = dev . IsExclusive ? Properties . Resources . _checked : Properties . Resources . cancel ;
}
else
{
2019-09-07 16:08:09 +02:00
exclusivePB [ Index ] . Visible = false ;
2019-09-06 23:04:07 +02:00
exclusivePB [ Index ] . Image = Properties . Resources . cancel ;
}
2017-04-29 10:19:45 +02:00
Batteries [ Index ] . Text = Program . rootHub . getDS4Battery ( Index ) ;
2019-07-02 22:41:29 +02:00
int profileIndex = cbs [ Index ] . FindStringExact ( ProfilePath [ Index ] ) ;
2017-10-19 21:16:09 +02:00
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 ;
2019-09-06 23:04:07 +02:00
exclusivePB [ devIndex ] . Visible = false ;
2017-08-18 09:40:09 +02:00
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 )
{
2019-03-26 03:38:08 +01:00
DS4Device dev = Program . rootHub . DS4Controllers [ device ] ;
ConnectionType conType = ConnectionType . USB ;
if ( dev ! = null )
conType = dev . ConnectionType ;
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 ;
2019-03-26 03:38:08 +01:00
disconnectShortcuts [ device ] . Visible = on & & conType ! = 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 ;
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 )
{
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 )
{
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 ;
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
}
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 ;
}
}
2019-04-20 17:47:08 +02:00
private void cBCustomSteam_CheckedChanged ( object sender , EventArgs e )
{
UseCustomSteamFolder = cBCustomSteam . Checked ;
tBSteamFolder . Enabled = cBCustomSteam . Checked ;
}
private void tBSteamFolder_TextChanged ( object sender , EventArgs e )
{
CustomSteamFolder = tBSteamFolder . Text ;
}
2014-06-06 22:38:52 +02:00
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
2018-12-29 02:02:56 +01:00
Uri url = new Uri ( "https://raw.githubusercontent.com/Ryochan7/DS4Windows/jay/DS4Windows/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 ( ) ;
2019-10-29 02:28:42 +01:00
bool launchUpdate = false ;
2019-02-07 18:52:28 +01:00
if ( ! string . IsNullOrWhiteSpace ( newversion2 ) & & version2 . Replace ( ',' , '.' ) . CompareTo ( newversion2 ) ! = 0 )
2017-05-13 07:54:29 +02:00
{
2019-10-29 02:28:42 +01:00
DialogResult result = DialogResult . No ;
this . Invoke ( ( System . Action ) ( ( ) = >
2018-02-08 08:48:12 +01:00
{
2019-10-29 02:28:42 +01:00
MessageBox . Show ( Properties . Resources . DownloadVersion . Replace ( "*number*" , newversion2 ) ,
Properties . Resources . DS4Update , MessageBoxButtons . YesNo , MessageBoxIcon . Question ) ;
} ) ) ;
if ( result = = 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
{
2019-10-29 02:28:42 +01:00
launchUpdate = true ;
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" )
2018-12-18 04:19:18 +01:00
& & ( FileVersionInfo . GetVersionInfo ( exepath + "\\DS4Updater.exe" ) . FileVersion . CompareTo ( UPDATER_VERSION ) ! = 0 ) ) )
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
{
2018-12-29 02:33:03 +01:00
Uri url2 = new Uri ( $"https://github.com/Ryochan7/DS4Updater/releases/download/v{UPDATER_VERSION}/{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 ) ) ) ;
2018-12-29 02:33:03 +01:00
Process . Start ( $"https://github.com/Ryochan7/DS4Updater/releases/download/v{UPDATER_VERSION}/{updaterExe}" ) ;
2019-10-29 02:28:42 +01:00
launchUpdate = false ;
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
2019-10-29 02:28:42 +01:00
if ( launchUpdate )
{
using ( Process p = new Process ( ) )
{
p . StartInfo . FileName = exepath + "\\DS4Updater.exe" ;
p . StartInfo . Arguments = "-autolaunch" ;
if ( AdminNeeded ( ) )
p . StartInfo . Verb = "runas" ;
2017-05-13 07:54:29 +02:00
2019-10-29 02:28:42 +01:00
try { p . Start ( ) ; }
catch ( Exception ) { launchUpdate = false ; }
}
}
if ( launchUpdate )
{
Close ( ) ;
}
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
}
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 )
{
2019-05-08 08:11:36 +02:00
DriverSetupPrep ( ) ;
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
2019-05-08 08:11:36 +02:00
private void DriverSetupPrep ( )
{
if ( btnStartStop . Text = = Properties . Resources . StopText )
BtnStartStop_Clicked ( false ) ;
TaskRunner . Run ( ( ) = >
{
while ( changingService )
{
Thread . SpinWait ( 1000 ) ;
}
Process p = new Process ( ) ;
p . StartInfo . FileName = Assembly . GetExecutingAssembly ( ) . Location ;
p . StartInfo . Arguments = "-driverinstall" ;
p . StartInfo . Verb = "runas" ;
try { p . Start ( ) ; }
catch { }
//WelcomeDialog wd = new WelcomeDialog();
//wd.ShowDialog();
} ) ;
}
2017-06-30 15:46:54 +02:00
bool tempBool = false ;
2018-11-13 22:01:57 +01:00
private 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
{
2018-11-13 22:01:57 +01:00
if ( optPop )
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 ;
}
2018-10-25 04:41:29 +02:00
else
{
2019-03-19 08:32:49 +01:00
Util . UnregisterNotify ( regHandle ) ;
2018-10-25 04:41:29 +02:00
}
}
else
{
2019-03-19 08:32:49 +01:00
Util . UnregisterNotify ( regHandle ) ;
2017-06-25 20:07:48 +02:00
}
}
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
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
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 ;
}
2019-03-07 20:35:13 +01:00
private void advColor_CustomColorUpdate ( Color color , EventArgs e )
2017-11-23 02:23:23 +01:00
{
2019-03-07 20:35:13 +01:00
if ( currentCustomLed < 4 )
2017-11-23 02:23:23 +01:00
{
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-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 )
2015-03-15 19:16:01 +01:00
{
2018-05-26 06:52:41 +02:00
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 ( ) ;
}
}
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
}
2018-06-01 23:45:58 +02:00
private void MintoTaskCheckBox_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
{
2018-06-01 23:45:58 +02:00
MinToTaskbar = mintoTaskCheckBox . Checked ;
Save ( ) ;
2015-03-15 19:16:01 +01:00
}
2014-03-28 02:50:40 +01:00
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 ) ;
2018-11-27 01:54:26 +01:00
await TaskRunner . Delay ( 100 ) . ContinueWith ( ( t ) = >
{
Program . rootHub . ChangeUDPStatus ( state ) ;
} ) ;
2018-08-06 12:00:37 +02:00
}
else
{
Program . rootHub . ChangeUDPStatus ( state ) ;
2018-11-27 01:54:26 +01:00
await TaskRunner . Delay ( 100 ) . ContinueWith ( ( t ) = >
{
Program . rootHub . ChangeMotionEventStatus ( state ) ;
} ) ;
2018-08-06 12:00:37 +02:00
}
nUDUdpPortNum . Enabled = state ;
2019-05-27 00:07:17 +02:00
tBUdpListenAddress . Enabled = state ;
2018-08-06 12:00:37 +02:00
}
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 ;
2019-05-27 00:07:17 +02:00
tBUdpListenAddress . Enabled = false ;
2018-08-08 10:54:19 +02:00
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 ;
2019-05-27 00:07:17 +02:00
tBUdpListenAddress . Enabled = true ;
2018-08-11 08:22:33 +02:00
}
2018-08-06 12:00:37 +02:00
}
2015-03-15 19:16:01 +01:00
private void cBFlashWhenLate_CheckedChanged ( object sender , EventArgs e )
2014-03-28 02:50:40 +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
FlashWhenLate = cBFlashWhenLate . Checked ;
nUDLatency . Enabled = cBFlashWhenLate . Checked ;
lbMsLatency . Enabled = cBFlashWhenLate . Checked ;
2014-03-28 02:50:40 +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
private void nUDLatency_ValueChanged ( object sender , EventArgs e )
2014-03-28 02:50:40 +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
FlashWhenLateAt = ( int ) Math . Round ( nUDLatency . Value ) ;
2014-03-28 02:50:40 +01:00
}
}
2019-07-11 22:58:03 +02:00
//
// Class to store autoprofile path and title data. Path and Title are pre-stored as lowercase versions (case insensitive search) to speed up IsMatch method in autoprofile timer calls.
// AutoProfile thread monitors active processes and windows. Autoprofile search rule can define just a process path or both path and window title search keywords.
// Keyword syntax: xxxx = exact matach, ^xxxx = match to beginning of path or title string. xxxx$ = match to end of string. *xxxx = contains in a string search
//
public class ProgramPathItem
{
public string path ;
public string title ;
private string path_lowercase ;
private string title_lowercase ;
public ProgramPathItem ( string pathStr , string titleStr )
{
// Initialize autoprofile search keywords (xxx_tolower). To improve performance the search keyword is pre-calculated in xxx_tolower variables,
// so autoprofile timer thread doesn't have to create substrings/replace/tolower string instances every second over and over again.
if ( ! string . IsNullOrEmpty ( pathStr ) )
{
path = pathStr ;
path_lowercase = path . ToLower ( ) . Replace ( '/' , '\\' ) ;
if ( path . Length > = 2 )
{
if ( path [ 0 ] = = '^' ) path_lowercase = path_lowercase . Substring ( 1 ) ;
else if ( path [ path . Length - 1 ] = = '$' ) path_lowercase = path_lowercase . Substring ( 0 , path_lowercase . Length - 1 ) ;
else if ( path [ 0 ] = = '*' ) path_lowercase = path_lowercase . Substring ( 1 ) ;
}
}
else path = path_lowercase = String . Empty ;
if ( ! string . IsNullOrEmpty ( titleStr ) )
{
title = titleStr ;
title_lowercase = title . ToLower ( ) ;
if ( title . Length > = 2 )
{
if ( title [ 0 ] = = '^' ) title_lowercase = title_lowercase . Substring ( 1 ) ;
else if ( title [ title . Length - 1 ] = = '$' ) title_lowercase = title_lowercase . Substring ( 0 , title_lowercase . Length - 1 ) ;
else if ( title [ 0 ] = = '*' ) title_lowercase = title_lowercase . Substring ( 1 ) ;
}
}
else title = title_lowercase = String . Empty ;
}
public bool IsMatch ( string searchPath , string searchTitle )
{
bool bPathMatched = true ;
bool bTitleMwatched = true ;
if ( ! String . IsNullOrEmpty ( path_lowercase ) )
{
bPathMatched = ( path_lowercase = = searchPath
| | ( path [ 0 ] = = '^' & & searchPath . StartsWith ( path_lowercase ) )
| | ( path [ path . Length - 1 ] = = '$' & & searchPath . EndsWith ( path_lowercase ) )
| | ( path [ 0 ] = = '*' & & searchPath . Contains ( path_lowercase ) )
) ;
}
if ( bPathMatched & & ! String . IsNullOrEmpty ( title_lowercase ) )
{
bTitleMwatched = ( title_lowercase = = searchTitle
| | ( title [ 0 ] = = '^' & & searchTitle . StartsWith ( title_lowercase ) )
| | ( title [ title . Length - 1 ] = = '$' & & searchTitle . EndsWith ( title_lowercase ) )
| | ( title [ 0 ] = = '*' & & searchTitle . Contains ( title_lowercase ) )
) ;
}
// If both path and title defined in autoprofile entry then do AND condition (ie. both path and title should match)
return bPathMatched & & bTitleMwatched ;
}
}
2014-03-28 02:50:40 +01:00
}