2014-03-28 02:50:40 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
2015-02-08 22:51:52 +01:00
|
|
|
|
|
2014-05-07 06:35:08 +02:00
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Reflection;
|
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
|
|
|
|
using System.Media;
|
2015-02-08 22:51:52 +01:00
|
|
|
|
using System.Threading.Tasks;
|
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
|
|
|
|
using static DS4Windows.Global;
|
2015-02-08 22:51:52 +01:00
|
|
|
|
namespace DS4Windows
|
2014-03-28 02:50:40 +01:00
|
|
|
|
{
|
2015-02-08 22:51:52 +01:00
|
|
|
|
public class ControlService
|
2014-03-28 02:50:40 +01:00
|
|
|
|
{
|
2014-08-23 22:52:20 +02:00
|
|
|
|
public X360Device x360Bus;
|
2017-04-02 02:46:51 +02:00
|
|
|
|
public const int DS4_CONTROLLER_COUNT = 4;
|
|
|
|
|
public DS4Device[] DS4Controllers = new DS4Device[DS4_CONTROLLER_COUNT];
|
|
|
|
|
public Mouse[] touchPad = new Mouse[DS4_CONTROLLER_COUNT];
|
2014-03-28 02:50:40 +01:00
|
|
|
|
private bool running = false;
|
2017-04-02 02:46:51 +02:00
|
|
|
|
private DS4State[] MappedState = new DS4State[DS4_CONTROLLER_COUNT];
|
|
|
|
|
private DS4State[] CurrentState = new DS4State[DS4_CONTROLLER_COUNT];
|
|
|
|
|
private DS4State[] PreviousState = new DS4State[DS4_CONTROLLER_COUNT];
|
|
|
|
|
public DS4StateExposed[] ExposedState = new DS4StateExposed[DS4_CONTROLLER_COUNT];
|
2014-11-14 20:44:50 +01:00
|
|
|
|
public bool recordingMacro = false;
|
2014-03-28 02:50:40 +01:00
|
|
|
|
public event EventHandler<DebugEventArgs> Debug = null;
|
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
|
|
|
|
public bool eastertime = false;
|
|
|
|
|
private int eCode = 0;
|
|
|
|
|
bool[] buttonsdown = { false, false, false, false };
|
|
|
|
|
List<DS4Controls> dcs = new List<DS4Controls>();
|
2017-04-02 02:46:51 +02:00
|
|
|
|
bool[] held = new bool[DS4_CONTROLLER_COUNT];
|
|
|
|
|
int[] oldmouse = new int[DS4_CONTROLLER_COUNT] { -1, -1, -1, -1 };
|
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
|
|
|
|
SoundPlayer sp = new SoundPlayer();
|
2014-03-28 02:50:40 +01:00
|
|
|
|
|
|
|
|
|
private class X360Data
|
|
|
|
|
{
|
|
|
|
|
public byte[] Report = new byte[28];
|
|
|
|
|
public byte[] Rumble = new byte[8];
|
|
|
|
|
}
|
|
|
|
|
private X360Data[] processingData = new X360Data[4];
|
|
|
|
|
|
2015-02-08 22:51:52 +01:00
|
|
|
|
public ControlService()
|
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
|
|
|
|
sp.Stream = Properties.Resources.EE;
|
2014-03-28 02:50:40 +01:00
|
|
|
|
x360Bus = new X360Device();
|
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
|
|
|
|
AddtoDS4List();
|
2017-03-28 17:27:15 +02:00
|
|
|
|
for (int i = 0, arlength = DS4Controllers.Length; i < arlength; i++)
|
2014-03-28 02:50:40 +01:00
|
|
|
|
{
|
|
|
|
|
processingData[i] = new X360Data();
|
|
|
|
|
MappedState[i] = new DS4State();
|
|
|
|
|
CurrentState[i] = new DS4State();
|
|
|
|
|
PreviousState[i] = new DS4State();
|
|
|
|
|
ExposedState[i] = new DS4StateExposed(CurrentState[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
|
|
|
|
void AddtoDS4List()
|
|
|
|
|
{
|
|
|
|
|
dcs.Add(DS4Controls.Cross);
|
|
|
|
|
dcs.Add(DS4Controls.Cross);
|
|
|
|
|
dcs.Add(DS4Controls.Circle);
|
|
|
|
|
dcs.Add(DS4Controls.Square);
|
|
|
|
|
dcs.Add(DS4Controls.Triangle);
|
|
|
|
|
dcs.Add(DS4Controls.Options);
|
|
|
|
|
dcs.Add(DS4Controls.Share);
|
|
|
|
|
dcs.Add(DS4Controls.DpadUp);
|
|
|
|
|
dcs.Add(DS4Controls.DpadDown);
|
|
|
|
|
dcs.Add(DS4Controls.DpadLeft);
|
|
|
|
|
dcs.Add(DS4Controls.DpadRight);
|
|
|
|
|
dcs.Add(DS4Controls.PS);
|
|
|
|
|
dcs.Add(DS4Controls.L1);
|
|
|
|
|
dcs.Add(DS4Controls.R1);
|
|
|
|
|
dcs.Add(DS4Controls.L2);
|
|
|
|
|
dcs.Add(DS4Controls.R2);
|
|
|
|
|
dcs.Add(DS4Controls.L3);
|
|
|
|
|
dcs.Add(DS4Controls.R3);
|
|
|
|
|
dcs.Add(DS4Controls.LXPos);
|
|
|
|
|
dcs.Add(DS4Controls.LXNeg);
|
|
|
|
|
dcs.Add(DS4Controls.LYPos);
|
|
|
|
|
dcs.Add(DS4Controls.LYNeg);
|
|
|
|
|
dcs.Add(DS4Controls.RXPos);
|
|
|
|
|
dcs.Add(DS4Controls.RXNeg);
|
|
|
|
|
dcs.Add(DS4Controls.RYPos);
|
|
|
|
|
dcs.Add(DS4Controls.RYNeg);
|
|
|
|
|
dcs.Add(DS4Controls.SwipeUp);
|
|
|
|
|
dcs.Add(DS4Controls.SwipeDown);
|
|
|
|
|
dcs.Add(DS4Controls.SwipeLeft);
|
|
|
|
|
dcs.Add(DS4Controls.SwipeRight);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private async void WarnExclusiveModeFailure(DS4Device device)
|
2014-03-29 06:29:08 +01:00
|
|
|
|
{
|
|
|
|
|
if (DS4Devices.isExclusiveMode && !device.IsExclusive)
|
|
|
|
|
{
|
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
|
|
|
|
await System.Threading.Tasks.Task.Delay(5);
|
2014-12-03 23:36:54 +01:00
|
|
|
|
String message = Properties.Resources.CouldNotOpenDS4.Replace("*Mac address*", device.MacAddress) + " " + Properties.Resources.QuitOtherPrograms;
|
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(message, true);
|
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
|
|
|
|
Log.LogToTray(message, true);
|
2014-03-29 06:29:08 +01:00
|
|
|
|
}
|
2014-05-07 06:35:08 +02:00
|
|
|
|
}
|
2014-05-25 01:08:40 +02:00
|
|
|
|
public bool Start(bool showlog = true)
|
2014-03-28 02:50:40 +01:00
|
|
|
|
{
|
|
|
|
|
if (x360Bus.Open() && x360Bus.Start())
|
|
|
|
|
{
|
2014-05-25 01:08:40 +02:00
|
|
|
|
if (showlog)
|
2014-08-17 00:09:15 +02:00
|
|
|
|
LogDebug(Properties.Resources.Starting);
|
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
|
|
|
|
DS4Devices.isExclusiveMode = UseExclusiveMode;
|
2014-05-25 01:08:40 +02:00
|
|
|
|
if (showlog)
|
|
|
|
|
{
|
2014-08-17 00:09:15 +02:00
|
|
|
|
LogDebug(Properties.Resources.SearchingController);
|
|
|
|
|
LogDebug(DS4Devices.isExclusiveMode ? Properties.Resources.UsingExclusive: Properties.Resources.UsingShared);
|
2014-05-25 01:08:40 +02:00
|
|
|
|
}
|
2014-03-28 02:50:40 +01:00
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
DS4Devices.findControllers();
|
|
|
|
|
IEnumerable<DS4Device> devices = DS4Devices.getDS4Controllers();
|
|
|
|
|
int ind = 0;
|
2014-06-02 05:19:04 +02:00
|
|
|
|
DS4LightBar.defualtLight = false;
|
2014-03-28 02:50:40 +01:00
|
|
|
|
foreach (DS4Device device in devices)
|
|
|
|
|
{
|
2014-05-25 01:08:40 +02:00
|
|
|
|
if (showlog)
|
2014-08-17 00:09:15 +02:00
|
|
|
|
LogDebug(Properties.Resources.FoundController + device.MacAddress + " (" + device.ConnectionType + ")");
|
2014-03-29 06:29:08 +01:00
|
|
|
|
WarnExclusiveModeFailure(device);
|
2014-03-28 02:50:40 +01:00
|
|
|
|
DS4Controllers[ind] = device;
|
2014-04-27 21:32:09 +02:00
|
|
|
|
device.Removal -= DS4Devices.On_Removal;
|
2014-03-28 02:50:40 +01:00
|
|
|
|
device.Removal += this.On_DS4Removal;
|
2014-04-27 21:32:09 +02:00
|
|
|
|
device.Removal += DS4Devices.On_Removal;
|
|
|
|
|
touchPad[ind] = new Mouse(ind, 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
|
|
|
|
device.LightBarColor = MainColor[ind];
|
|
|
|
|
if (!DinputOnly[ind])
|
2014-08-23 22:52:20 +02:00
|
|
|
|
x360Bus.Plugin(ind);
|
2014-03-28 02:50:40 +01:00
|
|
|
|
device.Report += this.On_Report;
|
2014-04-27 21:32:09 +02:00
|
|
|
|
TouchPadOn(ind, 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
|
|
|
|
//string filename = ProfilePath[ind];
|
2014-03-28 02:50:40 +01:00
|
|
|
|
ind++;
|
2014-05-25 01:08:40 +02:00
|
|
|
|
if (showlog)
|
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 (System.IO.File.Exists(appdatapath + "\\Profiles\\" + ProfilePath[ind-1] + ".xml"))
|
2014-05-25 01:08:40 +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
|
|
|
|
string prolog = Properties.Resources.UsingProfile.Replace("*number*", ind.ToString()).Replace("*Profile name*", ProfilePath[ind-1]);
|
2014-08-17 00:09:15 +02:00
|
|
|
|
LogDebug(prolog);
|
|
|
|
|
Log.LogToTray(prolog);
|
2014-05-25 01:08:40 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-02-08 22:51:52 +01:00
|
|
|
|
string prolog = Properties.Resources.NotUsingProfile.Replace("*number*", (ind).ToString());
|
|
|
|
|
LogDebug(prolog);
|
|
|
|
|
Log.LogToTray(prolog);
|
2014-05-25 01:08:40 +02:00
|
|
|
|
}
|
2014-03-29 06:29:08 +01:00
|
|
|
|
if (ind >= 4) // out of Xinput devices!
|
2014-03-28 02:50:40 +01:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
LogDebug(e.Message);
|
2014-03-29 06:29:08 +01:00
|
|
|
|
Log.LogToTray(e.Message);
|
2014-03-28 02:50:40 +01:00
|
|
|
|
}
|
|
|
|
|
running = true;
|
2014-05-05 09:31:24 +02:00
|
|
|
|
|
2014-03-28 02:50:40 +01:00
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-25 01:08:40 +02:00
|
|
|
|
public bool Stop(bool showlog = true)
|
2014-03-28 02:50:40 +01:00
|
|
|
|
{
|
|
|
|
|
if (running)
|
|
|
|
|
{
|
|
|
|
|
running = false;
|
2014-05-25 01:08:40 +02:00
|
|
|
|
if (showlog)
|
2014-08-17 00:09:15 +02:00
|
|
|
|
LogDebug(Properties.Resources.StoppingX360);
|
2014-05-28 04:49:58 +02:00
|
|
|
|
bool anyUnplugged = false;
|
2017-03-28 17:27:15 +02:00
|
|
|
|
for (int i = 0, arlength = DS4Controllers.Length; i < arlength; i++)
|
2014-03-28 02:50:40 +01:00
|
|
|
|
{
|
|
|
|
|
if (DS4Controllers[i] != null)
|
2014-06-21 20:00:28 +02:00
|
|
|
|
{
|
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
|
|
|
|
if (DCBTatStop && !DS4Controllers[i].Charging && showlog)
|
2017-04-06 03:37:38 +02:00
|
|
|
|
{
|
|
|
|
|
if (DS4Controllers[i].ConnectionType == ConnectionType.BT)
|
|
|
|
|
{
|
|
|
|
|
DS4Controllers[i].DisconnectBT();
|
|
|
|
|
}
|
|
|
|
|
else if (DS4Controllers[i].ConnectionType == ConnectionType.SONYWA)
|
|
|
|
|
{
|
2017-04-06 17:30:41 +02:00
|
|
|
|
DS4Controllers[i].DisconnectDongle(true);
|
2017-04-06 03:37:38 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2014-06-21 20:00:28 +02:00
|
|
|
|
else
|
|
|
|
|
{
|
2015-02-08 22:51:52 +01:00
|
|
|
|
DS4LightBar.forcelight[i] = false;
|
|
|
|
|
DS4LightBar.forcedFlash[i] = 0;
|
2014-06-21 20:00:28 +02:00
|
|
|
|
DS4LightBar.defualtLight = true;
|
2014-10-31 00:56:51 +01:00
|
|
|
|
DS4LightBar.updateLightBar(DS4Controllers[i], i, CurrentState[i], ExposedState[i], touchPad[i]);
|
2014-06-21 20:00:28 +02:00
|
|
|
|
System.Threading.Thread.Sleep(50);
|
|
|
|
|
}
|
2014-04-27 21:32:09 +02:00
|
|
|
|
CurrentState[i].Battery = PreviousState[i].Battery = 0; // Reset for the next connection's initial status change.
|
2014-04-30 05:54:41 +02:00
|
|
|
|
x360Bus.Unplug(i);
|
2014-04-27 21:32:09 +02:00
|
|
|
|
anyUnplugged = true;
|
2014-03-28 02:50:40 +01:00
|
|
|
|
DS4Controllers[i] = null;
|
2014-04-27 21:32:09 +02:00
|
|
|
|
touchPad[i] = null;
|
2014-03-28 02:50:40 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2014-04-27 21:32:09 +02:00
|
|
|
|
if (anyUnplugged)
|
|
|
|
|
System.Threading.Thread.Sleep(XINPUT_UNPLUG_SETTLE_TIME);
|
2014-09-15 04:52:21 +02:00
|
|
|
|
x360Bus.UnplugAll();
|
2014-03-28 02:50:40 +01:00
|
|
|
|
x360Bus.Stop();
|
2014-05-25 01:08:40 +02:00
|
|
|
|
if (showlog)
|
2014-08-17 00:09:15 +02:00
|
|
|
|
LogDebug(Properties.Resources.StoppingDS4);
|
2014-03-28 02:50:40 +01:00
|
|
|
|
DS4Devices.stopControllers();
|
2014-05-25 01:08:40 +02:00
|
|
|
|
if (showlog)
|
2014-08-17 00:09:15 +02:00
|
|
|
|
LogDebug(Properties.Resources.StoppedDS4Windows);
|
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
|
|
|
|
ControllerStatusChanged(this);
|
2014-03-28 02:50:40 +01:00
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool HotPlug()
|
|
|
|
|
{
|
2014-03-29 06:29:08 +01:00
|
|
|
|
if (running)
|
2014-03-28 02:50:40 +01:00
|
|
|
|
{
|
|
|
|
|
DS4Devices.findControllers();
|
|
|
|
|
IEnumerable<DS4Device> devices = DS4Devices.getDS4Controllers();
|
|
|
|
|
foreach (DS4Device device in devices)
|
|
|
|
|
{
|
2014-03-29 06:29:08 +01:00
|
|
|
|
if (device.IsDisconnecting)
|
|
|
|
|
continue;
|
2014-03-28 02:50:40 +01:00
|
|
|
|
if (((Func<bool>)delegate
|
|
|
|
|
{
|
2017-03-29 16:26:07 +02:00
|
|
|
|
for (Int32 Index = 0, arlength = DS4Controllers.Length; Index < arlength; Index++)
|
2014-05-25 01:08:40 +02:00
|
|
|
|
if (DS4Controllers[Index] != null && DS4Controllers[Index].MacAddress == device.MacAddress)
|
2014-03-28 02:50:40 +01:00
|
|
|
|
return true;
|
|
|
|
|
return false;
|
|
|
|
|
})())
|
|
|
|
|
continue;
|
2017-03-29 16:26:07 +02:00
|
|
|
|
for (Int32 Index = 0, arlength = DS4Controllers.Length; Index < arlength; Index++)
|
2014-03-28 02:50:40 +01:00
|
|
|
|
if (DS4Controllers[Index] == null)
|
|
|
|
|
{
|
2014-08-17 00:09:15 +02:00
|
|
|
|
LogDebug(Properties.Resources.FoundController + device.MacAddress + " (" + device.ConnectionType + ")");
|
2014-03-29 06:29:08 +01:00
|
|
|
|
WarnExclusiveModeFailure(device);
|
2014-03-28 02:50:40 +01:00
|
|
|
|
DS4Controllers[Index] = device;
|
2014-04-27 21:32:09 +02:00
|
|
|
|
device.Removal -= DS4Devices.On_Removal;
|
2014-03-28 02:50:40 +01:00
|
|
|
|
device.Removal += this.On_DS4Removal;
|
2014-04-27 21:32:09 +02:00
|
|
|
|
device.Removal += DS4Devices.On_Removal;
|
2014-05-05 09:31:24 +02:00
|
|
|
|
touchPad[Index] = new Mouse(Index, 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
|
|
|
|
device.LightBarColor = MainColor[Index];
|
2014-03-28 02:50:40 +01:00
|
|
|
|
device.Report += this.On_Report;
|
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 (!DinputOnly[Index])
|
2014-08-23 22:52:20 +02:00
|
|
|
|
x360Bus.Plugin(Index);
|
2014-04-27 21:32:09 +02:00
|
|
|
|
TouchPadOn(Index, 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
|
|
|
|
//string filename = Path.GetFileName(ProfilePath[Index]);
|
|
|
|
|
if (System.IO.File.Exists(appdatapath + "\\Profiles\\" + ProfilePath[Index] + ".xml"))
|
2014-05-07 06:35:08 +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
|
|
|
|
string prolog = Properties.Resources.UsingProfile.Replace("*number*", (Index + 1).ToString()).Replace("*Profile name*", ProfilePath[Index]);
|
2014-08-17 00:09:15 +02:00
|
|
|
|
LogDebug(prolog);
|
|
|
|
|
Log.LogToTray(prolog);
|
2014-05-07 06:35:08 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-02-08 22:51:52 +01:00
|
|
|
|
string prolog = Properties.Resources.NotUsingProfile.Replace("*number*", (Index + 1).ToString());
|
|
|
|
|
LogDebug(prolog);
|
|
|
|
|
Log.LogToTray(prolog);
|
2014-05-07 06:35:08 +02:00
|
|
|
|
}
|
|
|
|
|
|
2014-03-28 02:50:40 +01:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-27 21:32:09 +02:00
|
|
|
|
public void TouchPadOn(int ind, DS4Device device)
|
|
|
|
|
{
|
|
|
|
|
ITouchpadBehaviour tPad = touchPad[ind];
|
|
|
|
|
device.Touchpad.TouchButtonDown += tPad.touchButtonDown;
|
|
|
|
|
device.Touchpad.TouchButtonUp += tPad.touchButtonUp;
|
|
|
|
|
device.Touchpad.TouchesBegan += tPad.touchesBegan;
|
|
|
|
|
device.Touchpad.TouchesMoved += tPad.touchesMoved;
|
|
|
|
|
device.Touchpad.TouchesEnded += tPad.touchesEnded;
|
|
|
|
|
device.Touchpad.TouchUnchanged += tPad.touchUnchanged;
|
2015-11-28 06:47:26 +01:00
|
|
|
|
device.SixAxis.SixAccelMoved += tPad.sixaxisMoved;
|
2014-04-27 21:32:09 +02:00
|
|
|
|
//LogDebug("Touchpad mode for " + device.MacAddress + " is now " + tmode.ToString());
|
|
|
|
|
//Log.LogToTray("Touchpad mode for " + device.MacAddress + " is now " + tmode.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
|
|
|
|
ControllerStatusChanged(this);
|
2014-04-27 21:32:09 +02:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-25 01:08:40 +02:00
|
|
|
|
public void TimeoutConnection(DS4Device d)
|
2014-05-24 01:44:30 +02:00
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
|
|
|
|
|
sw.Start();
|
|
|
|
|
while (!d.IsAlive())
|
|
|
|
|
{
|
|
|
|
|
if (sw.ElapsedMilliseconds < 1000)
|
|
|
|
|
System.Threading.Thread.SpinWait(500);
|
|
|
|
|
//If weve been waiting less than 1 second let the thread keep its processing chunk
|
|
|
|
|
else
|
|
|
|
|
System.Threading.Thread.Sleep(500);
|
|
|
|
|
//If weve been waiting more than 1 second give up some resources
|
|
|
|
|
|
|
|
|
|
if (sw.ElapsedMilliseconds > 5000) throw new TimeoutException(); //Weve waited long enough
|
|
|
|
|
}
|
|
|
|
|
sw.Reset();
|
|
|
|
|
}
|
2014-05-25 01:08:40 +02:00
|
|
|
|
catch (TimeoutException)
|
2014-05-24 01:44:30 +02:00
|
|
|
|
{
|
2014-05-25 01:08:40 +02:00
|
|
|
|
Stop(false);
|
|
|
|
|
Start(false);
|
2014-05-24 01:44:30 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-28 02:50:40 +01:00
|
|
|
|
public string getDS4ControllerInfo(int index)
|
|
|
|
|
{
|
|
|
|
|
if (DS4Controllers[index] != null)
|
|
|
|
|
{
|
|
|
|
|
DS4Device d = DS4Controllers[index];
|
2014-03-29 06:29:08 +01:00
|
|
|
|
if (!d.IsAlive())
|
2014-05-24 01:44:30 +02:00
|
|
|
|
//return "Connecting..."; // awaiting the first battery charge indication
|
|
|
|
|
{
|
|
|
|
|
var TimeoutThread = new System.Threading.Thread(() => TimeoutConnection(d));
|
|
|
|
|
TimeoutThread.IsBackground = true;
|
|
|
|
|
TimeoutThread.Name = "TimeoutFor" + d.MacAddress.ToString();
|
|
|
|
|
TimeoutThread.Start();
|
2014-08-17 00:09:15 +02:00
|
|
|
|
return Properties.Resources.Connecting;
|
2014-05-24 01:44:30 +02:00
|
|
|
|
}
|
2014-03-29 06:29:08 +01:00
|
|
|
|
String battery;
|
|
|
|
|
if (d.Charging)
|
|
|
|
|
{
|
|
|
|
|
if (d.Battery >= 100)
|
2014-08-17 00:09:15 +02:00
|
|
|
|
battery = Properties.Resources.Charged;
|
2014-03-29 06:29:08 +01:00
|
|
|
|
else
|
2014-08-17 00:09:15 +02:00
|
|
|
|
battery = Properties.Resources.Charging.Replace("*number*", d.Battery.ToString());
|
2014-03-29 06:29:08 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-08-17 00:09:15 +02:00
|
|
|
|
battery = Properties.Resources.Battery.Replace("*number*", d.Battery.ToString());
|
2014-03-29 06:29:08 +01:00
|
|
|
|
}
|
2014-04-27 21:32:09 +02:00
|
|
|
|
return d.MacAddress + " (" + d.ConnectionType + "), " + battery;
|
|
|
|
|
//return d.MacAddress + " (" + d.ConnectionType + "), Battery is " + battery + ", Touchpad in " + modeSwitcher[index].ToString();
|
2014-03-28 02:50:40 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
2014-04-27 21:32:09 +02:00
|
|
|
|
return String.Empty;
|
2014-03-28 02:50:40 +01:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-30 22:39:39 +02:00
|
|
|
|
public string getDS4MacAddress(int index)
|
|
|
|
|
{
|
|
|
|
|
if (DS4Controllers[index] != null)
|
|
|
|
|
{
|
|
|
|
|
DS4Device d = DS4Controllers[index];
|
|
|
|
|
if (!d.IsAlive())
|
|
|
|
|
//return "Connecting..."; // awaiting the first battery charge indication
|
|
|
|
|
{
|
|
|
|
|
var TimeoutThread = new System.Threading.Thread(() => TimeoutConnection(d));
|
|
|
|
|
TimeoutThread.IsBackground = true;
|
|
|
|
|
TimeoutThread.Name = "TimeoutFor" + d.MacAddress.ToString();
|
|
|
|
|
TimeoutThread.Start();
|
2014-08-17 00:09:15 +02:00
|
|
|
|
return Properties.Resources.Connecting;
|
2014-05-30 22:39:39 +02:00
|
|
|
|
}
|
|
|
|
|
return d.MacAddress;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return String.Empty;
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-27 21:32:09 +02:00
|
|
|
|
public string getShortDS4ControllerInfo(int index)
|
|
|
|
|
{
|
|
|
|
|
if (DS4Controllers[index] != null)
|
|
|
|
|
{
|
|
|
|
|
DS4Device d = DS4Controllers[index];
|
|
|
|
|
String battery;
|
|
|
|
|
if (!d.IsAlive())
|
|
|
|
|
battery = "...";
|
|
|
|
|
if (d.Charging)
|
|
|
|
|
{
|
|
|
|
|
if (d.Battery >= 100)
|
2014-08-17 00:09:15 +02:00
|
|
|
|
battery = Properties.Resources.Full;
|
2014-04-27 21:32:09 +02:00
|
|
|
|
else
|
2014-04-30 21:32:44 +02:00
|
|
|
|
battery = d.Battery + "%+";
|
2014-04-27 21:32:09 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
battery = d.Battery + "%";
|
|
|
|
|
}
|
2014-08-18 07:18:46 +02:00
|
|
|
|
return (d.ConnectionType + " " + battery);
|
2014-05-30 22:39:39 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
2014-08-17 00:09:15 +02:00
|
|
|
|
return Properties.Resources.NoneText;
|
2014-05-30 22:39:39 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string getDS4Battery(int index)
|
|
|
|
|
{
|
|
|
|
|
if (DS4Controllers[index] != null)
|
|
|
|
|
{
|
|
|
|
|
DS4Device d = DS4Controllers[index];
|
|
|
|
|
String battery;
|
|
|
|
|
if (!d.IsAlive())
|
|
|
|
|
battery = "...";
|
|
|
|
|
if (d.Charging)
|
|
|
|
|
{
|
|
|
|
|
if (d.Battery >= 100)
|
2014-08-17 00:09:15 +02:00
|
|
|
|
battery = Properties.Resources.Full;
|
2014-05-30 22:39:39 +02:00
|
|
|
|
else
|
|
|
|
|
battery = d.Battery + "%+";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
battery = d.Battery + "%";
|
|
|
|
|
}
|
|
|
|
|
return battery;
|
|
|
|
|
}
|
|
|
|
|
else
|
2014-08-17 00:09:15 +02:00
|
|
|
|
return Properties.Resources.NA;
|
2014-05-30 22:39:39 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string getDS4Status(int index)
|
|
|
|
|
{
|
|
|
|
|
if (DS4Controllers[index] != null)
|
|
|
|
|
{
|
|
|
|
|
DS4Device d = DS4Controllers[index];
|
|
|
|
|
return d.ConnectionType+"";
|
2014-04-27 21:32:09 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
2014-08-17 00:09:15 +02:00
|
|
|
|
return Properties.Resources.NoneText;
|
2014-04-27 21:32:09 +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
|
|
|
|
|
2014-04-27 21:32:09 +02:00
|
|
|
|
private int XINPUT_UNPLUG_SETTLE_TIME = 250; // Inhibit races that occur with the asynchronous teardown of ScpVBus -> X360 driver instance.
|
2014-03-28 02:50:40 +01:00
|
|
|
|
//Called when DS4 is disconnected or timed out
|
|
|
|
|
protected virtual void On_DS4Removal(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
DS4Device device = (DS4Device)sender;
|
|
|
|
|
int ind = -1;
|
2017-03-29 16:26:07 +02:00
|
|
|
|
for (int i = 0, arlength = DS4Controllers.Length; ind == -1 && i < arlength; i++)
|
2014-03-28 02:50:40 +01:00
|
|
|
|
if (DS4Controllers[i] != null && device.MacAddress == DS4Controllers[i].MacAddress)
|
|
|
|
|
ind = i;
|
|
|
|
|
if (ind != -1)
|
|
|
|
|
{
|
2017-03-30 02:44:10 +02:00
|
|
|
|
bool removingStatus = false;
|
|
|
|
|
lock (device.removeLocker)
|
|
|
|
|
{
|
|
|
|
|
if (!DS4Controllers[ind].IsRemoving)
|
|
|
|
|
{
|
|
|
|
|
removingStatus = true;
|
|
|
|
|
DS4Controllers[ind].IsRemoving = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (removingStatus)
|
|
|
|
|
{
|
|
|
|
|
CurrentState[ind].Battery = PreviousState[ind].Battery = 0; // Reset for the next connection's initial status change.
|
|
|
|
|
x360Bus.Unplug(ind);
|
|
|
|
|
string removed = Properties.Resources.ControllerWasRemoved.Replace("*Mac address*", (ind + 1).ToString());
|
|
|
|
|
if (DS4Controllers[ind].Battery <= 20 &&
|
|
|
|
|
DS4Controllers[ind].ConnectionType == ConnectionType.BT && !DS4Controllers[ind].Charging)
|
|
|
|
|
removed += ". " + Properties.Resources.ChargeController;
|
|
|
|
|
LogDebug(removed);
|
|
|
|
|
Log.LogToTray(removed);
|
|
|
|
|
System.Threading.Thread.Sleep(XINPUT_UNPLUG_SETTLE_TIME);
|
|
|
|
|
DS4Controllers[ind] = null;
|
|
|
|
|
touchPad[ind] = null;
|
|
|
|
|
lag[ind] = false;
|
|
|
|
|
inWarnMonitor[ind] = false;
|
|
|
|
|
ControllerStatusChanged(this);
|
|
|
|
|
}
|
2014-03-28 02:50:40 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2015-02-08 22:51:52 +01:00
|
|
|
|
public bool[] lag = { false, false, false, false };
|
2017-03-29 16:26:07 +02:00
|
|
|
|
public bool[] inWarnMonitor = { false, false, false, false };
|
2014-03-28 02:50:40 +01:00
|
|
|
|
//Called every time the new input report has arrived
|
|
|
|
|
protected virtual void On_Report(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
DS4Device device = (DS4Device)sender;
|
|
|
|
|
|
2014-05-05 09:31:24 +02:00
|
|
|
|
int ind = -1;
|
2017-04-02 02:46:51 +02:00
|
|
|
|
for (int i = 0, arlength = DS4_CONTROLLER_COUNT; ind == -1 && i < arlength; i++)
|
2014-05-05 09:31:24 +02:00
|
|
|
|
if (device == DS4Controllers[i])
|
2014-03-28 02:50:40 +01:00
|
|
|
|
ind = i;
|
|
|
|
|
|
2014-05-05 09:31:24 +02:00
|
|
|
|
if (ind != -1)
|
2014-03-28 02:50:40 +01:00
|
|
|
|
{
|
2017-03-28 10:48:02 +02:00
|
|
|
|
if (getFlushHIDQueue(ind))
|
2014-11-18 22:23:41 +01:00
|
|
|
|
device.FlushHID();
|
2014-12-17 19:29:22 +01:00
|
|
|
|
if (!string.IsNullOrEmpty(device.error))
|
|
|
|
|
{
|
|
|
|
|
LogDebug(device.error);
|
|
|
|
|
}
|
2017-03-29 16:26:07 +02:00
|
|
|
|
|
|
|
|
|
if (inWarnMonitor[ind])
|
2015-02-08 22:51:52 +01:00
|
|
|
|
{
|
2017-03-28 10:48:02 +02:00
|
|
|
|
int flashWhenLateAt = getFlashWhenLateAt();
|
2017-03-29 16:26:07 +02:00
|
|
|
|
if (!lag[ind] && device.Latency >= flashWhenLateAt)
|
2015-02-08 22:51:52 +01:00
|
|
|
|
LagFlashWarning(ind, true);
|
2017-03-29 16:26:07 +02:00
|
|
|
|
else if (lag[ind] && device.Latency < flashWhenLateAt)
|
2015-02-08 22:51:52 +01:00
|
|
|
|
LagFlashWarning(ind, false);
|
|
|
|
|
}
|
2017-03-29 16:26:07 +02:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (DateTime.UtcNow - device.firstActive > TimeSpan.FromSeconds(5))
|
|
|
|
|
{
|
|
|
|
|
inWarnMonitor[ind] = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-29 06:29:08 +01:00
|
|
|
|
device.getExposedState(ExposedState[ind], CurrentState[ind]);
|
|
|
|
|
DS4State cState = CurrentState[ind];
|
|
|
|
|
device.getPreviousState(PreviousState[ind]);
|
|
|
|
|
DS4State pState = PreviousState[ind];
|
2014-04-27 21:32:09 +02:00
|
|
|
|
if (pState.Battery != cState.Battery)
|
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
|
|
|
|
ControllerStatusChanged(this);
|
2014-04-27 21:32:09 +02:00
|
|
|
|
CheckForHotkeys(ind, cState, pState);
|
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 (eastertime)
|
|
|
|
|
EasterTime(ind);
|
2017-03-27 15:02:04 +02:00
|
|
|
|
/*if (LSCurve[ind] != 0 || RSCurve[ind] != 0 || LSDeadzone[ind] != 0 || RSDeadzone[ind] != 0 ||
|
2015-12-05 09:55:11 +01:00
|
|
|
|
L2Deadzone[ind] != 0 || R2Deadzone[ind] != 0 || LSSens[ind] != 0 || RSSens[ind] != 0 ||
|
|
|
|
|
L2Sens[ind] != 0 || R2Sens[ind] != 0) //if a curve or deadzone is in place
|
2017-03-27 15:02:04 +02:00
|
|
|
|
*/
|
2014-12-13 21:12:03 +01:00
|
|
|
|
cState = Mapping.SetCurveAndDeadzone(ind, cState);
|
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 (!recordingMacro && (!string.IsNullOrEmpty(tempprofilename[ind]) ||
|
2017-04-02 02:46:51 +02:00
|
|
|
|
containsCustomAction(ind) || containsCustomExtras(ind) || getProfileActionCount(ind) > 0))
|
2014-03-28 02:50:40 +01:00
|
|
|
|
{
|
2014-12-13 21:12:03 +01:00
|
|
|
|
Mapping.MapCustom(ind, cState, MappedState[ind], ExposedState[ind], touchPad[ind], this);
|
2014-10-21 20:31:36 +02:00
|
|
|
|
cState = MappedState[ind];
|
2014-03-28 02:50:40 +01:00
|
|
|
|
}
|
2017-03-28 05:27:51 +02:00
|
|
|
|
|
2015-12-18 07:25:51 +01:00
|
|
|
|
//if (HasCustomExtras(ind))
|
|
|
|
|
// DoExtras(ind);
|
2014-03-28 02:50:40 +01:00
|
|
|
|
|
2014-03-29 06:29:08 +01:00
|
|
|
|
// Update the GUI/whatever.
|
2014-10-31 00:56:51 +01:00
|
|
|
|
DS4LightBar.updateLightBar(device, ind, cState, ExposedState[ind], touchPad[ind]);
|
2014-03-29 06:29:08 +01:00
|
|
|
|
|
2014-10-21 20:31:36 +02:00
|
|
|
|
x360Bus.Parse(cState, processingData[ind].Report, ind);
|
2014-03-29 06:29:08 +01:00
|
|
|
|
// We push the translated Xinput state, and simultaneously we
|
|
|
|
|
// pull back any possible rumble data coming from Xinput consumers.
|
2014-03-28 02:50:40 +01:00
|
|
|
|
if (x360Bus.Report(processingData[ind].Report, processingData[ind].Rumble))
|
|
|
|
|
{
|
|
|
|
|
Byte Big = (Byte)(processingData[ind].Rumble[3]);
|
|
|
|
|
Byte Small = (Byte)(processingData[ind].Rumble[4]);
|
|
|
|
|
|
|
|
|
|
if (processingData[ind].Rumble[1] == 0x08)
|
|
|
|
|
{
|
2014-10-14 20:54:42 +02:00
|
|
|
|
setRumble(Big, Small, ind);
|
2014-03-28 02:50:40 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2014-04-27 21:32:09 +02:00
|
|
|
|
|
|
|
|
|
// Output any synthetic events.
|
|
|
|
|
Mapping.Commit(ind);
|
|
|
|
|
// Pull settings updates.
|
2017-03-28 10:48:02 +02:00
|
|
|
|
device.IdleTimeout = getIdleDisconnectTimeout(ind);
|
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
|
|
|
|
|
2015-02-08 22:51:52 +01:00
|
|
|
|
public void LagFlashWarning(int ind, bool on)
|
|
|
|
|
{
|
|
|
|
|
if (on)
|
|
|
|
|
{
|
|
|
|
|
lag[ind] = true;
|
|
|
|
|
LogDebug(Properties.Resources.LatencyOverTen.Replace("*number*", (ind + 1).ToString()), true);
|
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 (FlashWhenLate)
|
2015-03-15 19:16:01 +01:00
|
|
|
|
{
|
|
|
|
|
DS4Color color = new DS4Color { red = 50, green = 0, blue = 0 };
|
|
|
|
|
DS4LightBar.forcedColor[ind] = color;
|
|
|
|
|
DS4LightBar.forcedFlash[ind] = 2;
|
|
|
|
|
DS4LightBar.forcelight[ind] = true;
|
|
|
|
|
}
|
2015-02-08 22:51:52 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
lag[ind] = false;
|
|
|
|
|
LogDebug(Properties.Resources.LatencyNotOverTen.Replace("*number*", (ind + 1).ToString()));
|
|
|
|
|
DS4LightBar.forcelight[ind] = false;
|
|
|
|
|
DS4LightBar.forcedFlash[ind] = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-18 07:25:51 +01:00
|
|
|
|
/* private void DoExtras(int ind)
|
2014-12-02 01:07:29 +01:00
|
|
|
|
{
|
|
|
|
|
DS4State cState = CurrentState[ind];
|
|
|
|
|
DS4StateExposed eState = ExposedState[ind];
|
|
|
|
|
Mouse tp = touchPad[ind];
|
|
|
|
|
DS4Controls helddown = DS4Controls.None;
|
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
|
|
|
|
foreach (KeyValuePair<DS4Controls, string> p in getCustomExtras(ind))
|
2014-12-02 01:07:29 +01:00
|
|
|
|
{
|
2015-11-28 06:47:26 +01:00
|
|
|
|
if (Mapping.getBoolMapping(ind, p.Key, cState, eState, tp))
|
2014-12-02 01:07:29 +01:00
|
|
|
|
{
|
|
|
|
|
helddown = p.Key;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (helddown != DS4Controls.None)
|
|
|
|
|
{
|
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 p = getCustomExtras(ind)[helddown];
|
2014-12-02 01:07:29 +01:00
|
|
|
|
string[] extraS = p.Split(',');
|
|
|
|
|
int[] extras = new int[extraS.Length];
|
|
|
|
|
for (int i = 0; i < extraS.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
int b;
|
|
|
|
|
if (int.TryParse(extraS[i], out b))
|
|
|
|
|
extras[i] = b;
|
|
|
|
|
}
|
|
|
|
|
held[ind] = true;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (!(extras[0] == extras[1] && extras[1] == 0))
|
|
|
|
|
setRumble((byte)extras[0], (byte)extras[1], ind);
|
|
|
|
|
if (extras[2] == 1)
|
|
|
|
|
{
|
|
|
|
|
DS4Color color = new DS4Color { red = (byte)extras[3], green = (byte)extras[4], blue = (byte)extras[5] };
|
|
|
|
|
DS4LightBar.forcedColor[ind] = color;
|
|
|
|
|
DS4LightBar.forcedFlash[ind] = (byte)extras[6];
|
|
|
|
|
DS4LightBar.forcelight[ind] = true;
|
|
|
|
|
}
|
|
|
|
|
if (extras[7] == 1)
|
|
|
|
|
{
|
|
|
|
|
if (oldmouse[ind] == -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
|
|
|
|
oldmouse[ind] = ButtonMouseSensitivity[ind];
|
|
|
|
|
ButtonMouseSensitivity[ind] = extras[8];
|
2014-12-02 01:07:29 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch { }
|
|
|
|
|
}
|
|
|
|
|
else if (held[ind])
|
|
|
|
|
{
|
|
|
|
|
DS4LightBar.forcelight[ind] = false;
|
2015-02-12 20:36:40 +01:00
|
|
|
|
DS4LightBar.forcedFlash[ind] = 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
|
|
|
|
ButtonMouseSensitivity[ind] = oldmouse[ind];
|
2014-12-02 01:07:29 +01:00
|
|
|
|
oldmouse[ind] = -1;
|
|
|
|
|
setRumble(0, 0, ind);
|
|
|
|
|
held[ind] = false;
|
|
|
|
|
}
|
2015-12-18 07:25:51 +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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void EasterTime(int ind)
|
|
|
|
|
{
|
|
|
|
|
DS4State cState = CurrentState[ind];
|
|
|
|
|
DS4StateExposed eState = ExposedState[ind];
|
|
|
|
|
Mouse tp = touchPad[ind];
|
|
|
|
|
|
|
|
|
|
bool pb = false;
|
|
|
|
|
foreach (DS4Controls dc in dcs)
|
|
|
|
|
{
|
2015-11-28 06:47:26 +01:00
|
|
|
|
if (Mapping.getBoolMapping(ind, dc, cState, eState, tp))
|
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
|
|
|
|
{
|
|
|
|
|
pb = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
int temp = eCode;
|
|
|
|
|
//Looks like you found the easter egg code, since you're already cheating,
|
|
|
|
|
//I scrambled the code for you :)
|
|
|
|
|
if (pb && !buttonsdown[ind])
|
|
|
|
|
{
|
|
|
|
|
if (cState.Cross && eCode == 9)
|
|
|
|
|
eCode++;
|
|
|
|
|
else if (!cState.Cross && eCode == 9)
|
|
|
|
|
eCode = 0;
|
|
|
|
|
else if (cState.DpadLeft && eCode == 6)
|
|
|
|
|
eCode++;
|
|
|
|
|
else if (!cState.DpadLeft && eCode == 6)
|
|
|
|
|
eCode = 0;
|
|
|
|
|
else if (cState.DpadRight && eCode == 7)
|
|
|
|
|
eCode++;
|
|
|
|
|
else if (!cState.DpadRight && eCode == 7)
|
|
|
|
|
eCode = 0;
|
|
|
|
|
else if (cState.DpadLeft && eCode == 4)
|
|
|
|
|
eCode++;
|
|
|
|
|
else if (!cState.DpadLeft && eCode == 4)
|
|
|
|
|
eCode = 0;
|
|
|
|
|
else if (cState.DpadDown && eCode == 2)
|
|
|
|
|
eCode++;
|
|
|
|
|
else if (!cState.DpadDown && eCode == 2)
|
|
|
|
|
eCode = 0;
|
|
|
|
|
else if (cState.DpadRight && eCode == 5)
|
|
|
|
|
eCode++;
|
|
|
|
|
else if (!cState.DpadRight && eCode == 5)
|
|
|
|
|
eCode = 0;
|
|
|
|
|
else if (cState.DpadUp && eCode == 1)
|
|
|
|
|
eCode++;
|
|
|
|
|
else if (!cState.DpadUp && eCode == 1)
|
|
|
|
|
eCode = 0;
|
|
|
|
|
else if (cState.DpadDown && eCode == 3)
|
|
|
|
|
eCode++;
|
|
|
|
|
else if (!cState.DpadDown && eCode == 3)
|
|
|
|
|
eCode = 0;
|
|
|
|
|
else if (cState.Circle && eCode == 8)
|
|
|
|
|
eCode++;
|
|
|
|
|
else if (!cState.Circle && eCode == 8)
|
|
|
|
|
eCode = 0;
|
|
|
|
|
|
|
|
|
|
if (cState.DpadUp && eCode == 0)
|
|
|
|
|
eCode++;
|
|
|
|
|
|
|
|
|
|
if (eCode == 10)
|
|
|
|
|
{
|
|
|
|
|
string message = "(!)";
|
|
|
|
|
sp.Play();
|
|
|
|
|
LogDebug(message, true);
|
|
|
|
|
eCode = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (temp != eCode)
|
|
|
|
|
Console.WriteLine(eCode);
|
|
|
|
|
buttonsdown[ind] = true;
|
|
|
|
|
}
|
|
|
|
|
else if (!pb)
|
|
|
|
|
buttonsdown[ind] = false;
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-19 07:55:12 +02:00
|
|
|
|
public string GetInputkeys(int ind)
|
|
|
|
|
{
|
|
|
|
|
DS4State cState = CurrentState[ind];
|
2014-06-24 00:27:14 +02:00
|
|
|
|
DS4StateExposed eState = ExposedState[ind];
|
2014-10-31 00:56:51 +01:00
|
|
|
|
Mouse tp = touchPad[ind];
|
2014-05-30 22:39:39 +02:00
|
|
|
|
if (DS4Controllers[ind] != null)
|
2015-11-28 06:47:26 +01:00
|
|
|
|
if (Mapping.getBoolMapping(ind, DS4Controls.Cross, cState, eState, tp)) return "Cross";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.Circle, cState, eState, tp)) return "Circle";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.Triangle, cState, eState, tp)) return "Triangle";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.Square, cState, eState, tp)) return "Square";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.L1, cState, eState, tp)) return "L1";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.R1, cState, eState, tp)) return "R1";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.L2, cState, eState, tp)) return "L2";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.R2, cState, eState, tp)) return "R2";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.L3, cState, eState, tp)) return "L3";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.R3, cState, eState, tp)) return "R3";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.DpadUp, cState, eState, tp)) return "Up";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.DpadDown, cState, eState, tp)) return "Down";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.DpadLeft, cState, eState, tp)) return "Left";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.DpadRight, cState, eState, tp)) return "Right";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.Share, cState, eState, tp)) return "Share";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.Options, cState, eState, tp)) return "Options";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.PS, cState, eState, tp)) return "PS";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.LXPos, cState, eState, tp)) return "LS Right";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.LXNeg, cState, eState, tp)) return "LS Left";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.LYPos, cState, eState, tp)) return "LS Down";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.LYNeg, cState, eState, tp)) return "LS Up";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.RXPos, cState, eState, tp)) return "RS Right";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.RXNeg, cState, eState, tp)) return "RS Left";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.RYPos, cState, eState, tp)) return "RS Down";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.RYNeg, cState, eState, tp)) return "RS Up";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.TouchLeft, cState, eState, tp)) return "Touch Left";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.TouchRight, cState, eState, tp)) return "Touch Right";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.TouchMulti, cState, eState, tp)) return "Touch Multi";
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.TouchUpper, cState, eState, tp)) return "Touch Upper";
|
2014-06-24 00:27:14 +02:00
|
|
|
|
return "nothing";
|
2014-05-19 07:55:12 +02:00
|
|
|
|
}
|
|
|
|
|
|
2014-11-14 20:44:50 +01:00
|
|
|
|
public DS4Controls GetInputkeysDS4(int ind)
|
|
|
|
|
{
|
|
|
|
|
DS4State cState = CurrentState[ind];
|
|
|
|
|
DS4StateExposed eState = ExposedState[ind];
|
|
|
|
|
Mouse tp = touchPad[ind];
|
|
|
|
|
if (DS4Controllers[ind] != null)
|
2015-11-28 06:47:26 +01:00
|
|
|
|
if (Mapping.getBoolMapping(ind, DS4Controls.Cross, cState, eState, tp)) return DS4Controls.Cross;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.Circle, cState, eState, tp)) return DS4Controls.Circle;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.Triangle, cState, eState, tp)) return DS4Controls.Triangle;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.Square, cState, eState, tp)) return DS4Controls.Square;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.L1, cState, eState, tp)) return DS4Controls.L1;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.R1, cState, eState, tp)) return DS4Controls.R1;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.L2, cState, eState, tp)) return DS4Controls.L2;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.R2, cState, eState, tp)) return DS4Controls.R2;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.L3, cState, eState, tp)) return DS4Controls.L3;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.R3, cState, eState, tp)) return DS4Controls.R3;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.DpadUp, cState, eState, tp)) return DS4Controls.DpadUp;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.DpadDown, cState, eState, tp)) return DS4Controls.DpadDown;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.DpadLeft, cState, eState, tp)) return DS4Controls.DpadLeft;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.DpadRight, cState, eState, tp)) return DS4Controls.DpadRight;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.Share, cState, eState, tp)) return DS4Controls.Share;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.Options, cState, eState, tp)) return DS4Controls.Options;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.PS, cState, eState, tp)) return DS4Controls.PS;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.LXPos, cState, eState, tp)) return DS4Controls.LXPos;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.LXNeg, cState, eState, tp)) return DS4Controls.LXNeg;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.LYPos, cState, eState, tp)) return DS4Controls.LYPos;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.LYNeg, cState, eState, tp)) return DS4Controls.LYNeg;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.RXPos, cState, eState, tp)) return DS4Controls.RXPos;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.RXNeg, cState, eState, tp)) return DS4Controls.RXNeg;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.RYPos, cState, eState, tp)) return DS4Controls.RYPos;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.RYNeg, cState, eState, tp)) return DS4Controls.RYNeg;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.TouchLeft, cState, eState, tp)) return DS4Controls.TouchLeft;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.TouchRight, cState, eState, tp)) return DS4Controls.TouchRight;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.TouchMulti, cState, eState, tp)) return DS4Controls.TouchMulti;
|
|
|
|
|
else if (Mapping.getBoolMapping(ind, DS4Controls.TouchUpper, cState, eState, tp)) return DS4Controls.TouchUpper;
|
2014-11-14 20:44:50 +01:00
|
|
|
|
return DS4Controls.None;
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-15 04:37:14 +02:00
|
|
|
|
public bool[] touchreleased = { true, true, true, true }, touchslid = { false, false, false, false };
|
|
|
|
|
public byte[] oldtouchvalue = { 0, 0, 0, 0 };
|
|
|
|
|
public int[] oldscrollvalue = { 0, 0, 0, 0 };
|
2014-03-28 02:50:40 +01:00
|
|
|
|
protected virtual void CheckForHotkeys(int deviceID, DS4State cState, DS4State pState)
|
|
|
|
|
{
|
2017-03-28 10:48:02 +02:00
|
|
|
|
if (!getUseTPforControls(deviceID) && cState.Touch1 && pState.PS)
|
2014-04-27 21:32:09 +02:00
|
|
|
|
{
|
2017-03-28 10:48:02 +02:00
|
|
|
|
if (getTouchSensitivity(deviceID) > 0 && touchreleased[deviceID])
|
2014-04-27 21:32:09 +02:00
|
|
|
|
{
|
2017-03-28 10:48:02 +02:00
|
|
|
|
oldtouchvalue[deviceID] = getTouchSensitivity(deviceID);
|
|
|
|
|
oldscrollvalue[deviceID] = getScrollSensitivity(deviceID);
|
|
|
|
|
getTouchSensitivity()[deviceID] = 0;
|
|
|
|
|
getScrollSensitivity()[deviceID] = 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
|
|
|
|
LogDebug(TouchSensitivity[deviceID] > 0 ? Properties.Resources.TouchpadMovementOn : Properties.Resources.TouchpadMovementOff);
|
|
|
|
|
Log.LogToTray(TouchSensitivity[deviceID] > 0 ? Properties.Resources.TouchpadMovementOn : Properties.Resources.TouchpadMovementOff);
|
2014-06-02 19:29:38 +02:00
|
|
|
|
touchreleased[deviceID] = false;
|
2014-04-27 21:32:09 +02:00
|
|
|
|
}
|
2014-06-02 19:29:38 +02:00
|
|
|
|
else if (touchreleased[deviceID])
|
2014-04-27 21:32:09 +02:00
|
|
|
|
{
|
2017-03-28 10:48:02 +02:00
|
|
|
|
getTouchSensitivity()[deviceID] = oldtouchvalue[deviceID];
|
|
|
|
|
getScrollSensitivity()[deviceID] = oldscrollvalue[deviceID];
|
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
|
|
|
|
LogDebug(TouchSensitivity[deviceID] > 0 ? Properties.Resources.TouchpadMovementOn : Properties.Resources.TouchpadMovementOff);
|
|
|
|
|
Log.LogToTray(TouchSensitivity[deviceID] > 0 ? Properties.Resources.TouchpadMovementOn : Properties.Resources.TouchpadMovementOff);
|
2014-06-02 19:29:38 +02:00
|
|
|
|
touchreleased[deviceID] = false;
|
2014-04-27 21:32:09 +02:00
|
|
|
|
}
|
2014-03-28 02:50:40 +01:00
|
|
|
|
}
|
2014-04-27 21:32:09 +02:00
|
|
|
|
else
|
2014-06-02 19:29:38 +02:00
|
|
|
|
touchreleased[deviceID] = true;
|
2014-03-28 02:50:40 +01:00
|
|
|
|
}
|
|
|
|
|
|
2014-09-15 04:37:14 +02:00
|
|
|
|
public virtual void StartTPOff(int deviceID)
|
|
|
|
|
{
|
2015-03-15 19:16:01 +01:00
|
|
|
|
if (deviceID < 4)
|
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
|
|
|
|
{
|
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
|
|
|
|
oldtouchvalue[deviceID] = TouchSensitivity[deviceID];
|
|
|
|
|
oldscrollvalue[deviceID] = ScrollSensitivity[deviceID];
|
|
|
|
|
TouchSensitivity[deviceID] = 0;
|
|
|
|
|
ScrollSensitivity[deviceID] = 0;
|
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
|
|
|
|
}
|
2014-09-15 04:37:14 +02:00
|
|
|
|
}
|
2015-06-01 21:04:22 +02:00
|
|
|
|
|
2014-05-30 22:39:39 +02:00
|
|
|
|
public virtual string TouchpadSlide(int ind)
|
|
|
|
|
{
|
|
|
|
|
DS4State cState = CurrentState[ind];
|
|
|
|
|
string slidedir = "none";
|
2015-06-01 21:04:22 +02:00
|
|
|
|
if (DS4Controllers[ind] != null && cState.Touch2 && !(touchPad[ind].dragging || touchPad[ind].dragging2))
|
|
|
|
|
if (touchPad[ind].slideright && !touchslid[ind])
|
|
|
|
|
{
|
|
|
|
|
slidedir = "right";
|
|
|
|
|
touchslid[ind] = true;
|
|
|
|
|
}
|
|
|
|
|
else if (touchPad[ind].slideleft && !touchslid[ind])
|
|
|
|
|
{
|
|
|
|
|
slidedir = "left";
|
|
|
|
|
touchslid[ind] = true;
|
|
|
|
|
}
|
|
|
|
|
else if (!touchPad[ind].slideleft && !touchPad[ind].slideright)
|
|
|
|
|
{
|
|
|
|
|
slidedir = "";
|
|
|
|
|
touchslid[ind] = false;
|
|
|
|
|
}
|
2014-05-30 22:39:39 +02:00
|
|
|
|
return slidedir;
|
|
|
|
|
}
|
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
|
|
|
|
public virtual void LogDebug(String Data, bool warning = false)
|
2014-03-28 02:50:40 +01:00
|
|
|
|
{
|
2014-05-21 07:36:05 +02:00
|
|
|
|
Console.WriteLine(System.DateTime.Now.ToString("G") + "> " + Data);
|
2014-03-28 02:50:40 +01:00
|
|
|
|
if (Debug != null)
|
|
|
|
|
{
|
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
|
|
|
|
DebugEventArgs args = new DebugEventArgs(Data, warning);
|
2014-03-28 02:50:40 +01:00
|
|
|
|
OnDebug(this, args);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual void OnDebug(object sender, DebugEventArgs args)
|
|
|
|
|
{
|
|
|
|
|
if (Debug != null)
|
|
|
|
|
Debug(this, args);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//sets the rumble adjusted with rumble boost
|
|
|
|
|
public virtual void setRumble(byte heavyMotor, byte lightMotor, int deviceNum)
|
|
|
|
|
{
|
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
|
|
|
|
byte boost = RumbleBoost[deviceNum];
|
2014-03-28 02:50:40 +01:00
|
|
|
|
uint lightBoosted = ((uint)lightMotor * (uint)boost) / 100;
|
|
|
|
|
if (lightBoosted > 255)
|
|
|
|
|
lightBoosted = 255;
|
|
|
|
|
uint heavyBoosted = ((uint)heavyMotor * (uint)boost) / 100;
|
|
|
|
|
if (heavyBoosted > 255)
|
|
|
|
|
heavyBoosted = 255;
|
2014-05-30 22:39:39 +02:00
|
|
|
|
if (deviceNum < 4)
|
|
|
|
|
if (DS4Controllers[deviceNum] != null)
|
|
|
|
|
DS4Controllers[deviceNum].setRumble((byte)lightBoosted, (byte)heavyBoosted);
|
2014-03-28 02:50:40 +01:00
|
|
|
|
}
|
2014-05-28 04:49:58 +02:00
|
|
|
|
|
|
|
|
|
public DS4State getDS4State(int ind)
|
|
|
|
|
{
|
|
|
|
|
return CurrentState[ind];
|
|
|
|
|
}
|
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
|
|
|
|
public DS4State getDS4StateMapped(int ind)
|
|
|
|
|
{
|
|
|
|
|
return MappedState[ind];
|
2014-06-21 20:00:28 +02:00
|
|
|
|
}
|
2014-03-28 02:50:40 +01:00
|
|
|
|
}
|
|
|
|
|
}
|