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
|
|
|
|
|
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
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
2014-12-13 21:12:03 +01:00
|
|
|
|
using System.Diagnostics;
|
2015-12-05 09:55:11 +01:00
|
|
|
|
using static DS4Windows.Global;
|
2015-02-08 22:51:52 +01:00
|
|
|
|
namespace DS4Windows
|
2014-03-28 02:50:40 +01:00
|
|
|
|
{
|
2014-04-27 21:32:09 +02:00
|
|
|
|
public class Mapping
|
2014-03-28 02:50:40 +01:00
|
|
|
|
{
|
2014-04-27 21:32:09 +02:00
|
|
|
|
/*
|
|
|
|
|
* Represent the synthetic keyboard and mouse events. Maintain counts for each so we don't duplicate events.
|
|
|
|
|
*/
|
2014-05-28 04:49:58 +02:00
|
|
|
|
public class SyntheticState
|
2014-03-28 02:50:40 +01:00
|
|
|
|
{
|
2014-04-27 21:32:09 +02:00
|
|
|
|
public struct MouseClick
|
2014-03-28 02:50:40 +01:00
|
|
|
|
{
|
2014-05-28 04:49:58 +02:00
|
|
|
|
public int leftCount, middleCount, rightCount, fourthCount, fifthCount, wUpCount, wDownCount, toggleCount;
|
|
|
|
|
public bool toggle;
|
2014-04-27 21:32:09 +02:00
|
|
|
|
}
|
|
|
|
|
public MouseClick previousClicks, currentClicks;
|
|
|
|
|
public struct KeyPress
|
|
|
|
|
{
|
2014-05-28 04:49:58 +02:00
|
|
|
|
public int vkCount, scanCodeCount, repeatCount, toggleCount; // repeat takes priority over non-, and scancode takes priority over non-
|
|
|
|
|
public bool toggle;
|
2014-04-27 21:32:09 +02:00
|
|
|
|
}
|
|
|
|
|
public class KeyPresses
|
|
|
|
|
{
|
|
|
|
|
public KeyPress previous, current;
|
|
|
|
|
}
|
|
|
|
|
public Dictionary<UInt16, KeyPresses> keyPresses = new Dictionary<UInt16, KeyPresses>();
|
|
|
|
|
|
|
|
|
|
public void SavePrevious(bool performClear)
|
|
|
|
|
{
|
|
|
|
|
previousClicks = currentClicks;
|
|
|
|
|
if (performClear)
|
2014-05-28 04:49:58 +02:00
|
|
|
|
currentClicks.leftCount = currentClicks.middleCount = currentClicks.rightCount = currentClicks.fourthCount = currentClicks.fifthCount = currentClicks.wUpCount = currentClicks.wDownCount = currentClicks.toggleCount = 0;
|
2014-04-27 21:32:09 +02:00
|
|
|
|
foreach (KeyPresses kp in keyPresses.Values)
|
|
|
|
|
{
|
|
|
|
|
kp.previous = kp.current;
|
|
|
|
|
if (performClear)
|
2014-05-28 04:49:58 +02:00
|
|
|
|
{
|
|
|
|
|
kp.current.repeatCount = kp.current.scanCodeCount = kp.current.vkCount = kp.current.toggleCount = 0;
|
|
|
|
|
//kp.current.toggle = false;
|
|
|
|
|
}
|
2014-04-27 21:32:09 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
|
|
|
|
|
public class ActionState
|
|
|
|
|
{
|
|
|
|
|
public bool[] dev = new bool[4];
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-28 04:49:58 +02:00
|
|
|
|
public static SyntheticState globalState = new SyntheticState();
|
|
|
|
|
public static SyntheticState[] deviceState = { new SyntheticState(), new SyntheticState(), new SyntheticState(), new SyntheticState() };
|
2014-04-27 21:32:09 +02:00
|
|
|
|
|
|
|
|
|
// TODO When we disconnect, process a null/dead state to release any keys or buttons.
|
2014-05-23 04:42:07 +02:00
|
|
|
|
public static DateTime oldnow = DateTime.UtcNow;
|
2014-05-06 20:49:18 +02:00
|
|
|
|
private static bool pressagain = false;
|
|
|
|
|
private static int wheel = 0, keyshelddown = 0;
|
2015-02-12 20:36:40 +01:00
|
|
|
|
|
|
|
|
|
//mapcustom
|
|
|
|
|
public static bool[] pressedonce = new bool[261], macrodone = new bool[34];
|
|
|
|
|
static bool[] macroControl = new bool[25];
|
|
|
|
|
|
|
|
|
|
//actions
|
|
|
|
|
public static int[] fadetimer = { 0, 0, 0, 0 };
|
|
|
|
|
public static int[] prevFadetimer = { 0, 0, 0, 0 };
|
|
|
|
|
public static DS4Color[] lastColor = new DS4Color[4];
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
public static List<ActionState> actionDone = new List<ActionState>();
|
|
|
|
|
//public static List<bool>[] actionDone = { new List<bool>(), new List<bool>(), new List<bool>(), new List<bool>() };
|
|
|
|
|
//public static bool[,] actionDone = new bool[4, 50];
|
2015-02-12 20:36:40 +01:00
|
|
|
|
public static SpecialAction[] untriggeraction = new SpecialAction[4];
|
|
|
|
|
public static DateTime[] nowAction = { DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue };
|
|
|
|
|
public static DateTime[] oldnowAction = { DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue };
|
|
|
|
|
public static int[] untriggerindex = { -1, -1, -1, -1 };
|
|
|
|
|
public static DateTime[] oldnowKeyAct = { DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue };
|
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
|
|
|
|
private static bool tappedOnce = false, firstTouch = false, secondtouchbegin = false;
|
|
|
|
|
private static DateTime pastTime, firstTap, TimeofEnd;
|
2015-02-12 20:36:40 +01:00
|
|
|
|
|
|
|
|
|
//special macros
|
|
|
|
|
static bool altTabDone = true;
|
|
|
|
|
static DateTime altTabNow = DateTime.UtcNow, oldAltTabNow = DateTime.UtcNow - TimeSpan.FromSeconds(1);
|
|
|
|
|
|
|
|
|
|
//mouse
|
|
|
|
|
public static int mcounter = 34;
|
|
|
|
|
public static int mouseaccel = 0;
|
|
|
|
|
public static int prevmouseaccel = 0;
|
|
|
|
|
private static double horizontalRemainder = 0.0, verticalRemainder = 0.0;
|
|
|
|
|
|
2014-04-27 21:32:09 +02:00
|
|
|
|
public static void Commit(int device)
|
|
|
|
|
{
|
|
|
|
|
SyntheticState state = deviceState[device];
|
|
|
|
|
lock (globalState)
|
|
|
|
|
{
|
|
|
|
|
globalState.currentClicks.leftCount += state.currentClicks.leftCount - state.previousClicks.leftCount;
|
|
|
|
|
globalState.currentClicks.middleCount += state.currentClicks.middleCount - state.previousClicks.middleCount;
|
|
|
|
|
globalState.currentClicks.rightCount += state.currentClicks.rightCount - state.previousClicks.rightCount;
|
|
|
|
|
globalState.currentClicks.fourthCount += state.currentClicks.fourthCount - state.previousClicks.fourthCount;
|
|
|
|
|
globalState.currentClicks.fifthCount += state.currentClicks.fifthCount - state.previousClicks.fifthCount;
|
|
|
|
|
globalState.currentClicks.wUpCount += state.currentClicks.wUpCount - state.previousClicks.wUpCount;
|
2014-05-28 04:49:58 +02:00
|
|
|
|
globalState.currentClicks.wDownCount += state.currentClicks.wDownCount - state.previousClicks.wDownCount;
|
|
|
|
|
globalState.currentClicks.toggleCount += state.currentClicks.toggleCount - state.previousClicks.toggleCount;
|
|
|
|
|
globalState.currentClicks.toggle = state.currentClicks.toggle;
|
|
|
|
|
|
|
|
|
|
if (globalState.currentClicks.toggleCount != 0 && globalState.previousClicks.toggleCount == 0 && globalState.currentClicks.toggle)
|
2014-05-06 20:49:18 +02:00
|
|
|
|
{
|
2014-05-28 04:49:58 +02:00
|
|
|
|
if (globalState.currentClicks.leftCount != 0 && globalState.previousClicks.leftCount == 0)
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_LEFTDOWN);
|
|
|
|
|
if (globalState.currentClicks.rightCount != 0 && globalState.previousClicks.rightCount == 0)
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_RIGHTDOWN);
|
|
|
|
|
if (globalState.currentClicks.middleCount != 0 && globalState.previousClicks.middleCount == 0)
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_MIDDLEDOWN);
|
|
|
|
|
if (globalState.currentClicks.fourthCount != 0 && globalState.previousClicks.fourthCount == 0)
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_XBUTTONDOWN, 1);
|
|
|
|
|
if (globalState.currentClicks.fifthCount != 0 && globalState.previousClicks.fifthCount == 0)
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_XBUTTONDOWN, 2);
|
2014-05-06 20:49:18 +02:00
|
|
|
|
}
|
2014-05-28 04:49:58 +02:00
|
|
|
|
else if (globalState.currentClicks.toggleCount != 0 && globalState.previousClicks.toggleCount == 0 && !globalState.currentClicks.toggle)
|
2014-05-06 20:49:18 +02:00
|
|
|
|
{
|
2014-05-28 04:49:58 +02:00
|
|
|
|
if (globalState.currentClicks.leftCount != 0 && globalState.previousClicks.leftCount == 0)
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_LEFTUP);
|
|
|
|
|
if (globalState.currentClicks.rightCount != 0 && globalState.previousClicks.rightCount == 0)
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_RIGHTUP);
|
|
|
|
|
if (globalState.currentClicks.middleCount != 0 && globalState.previousClicks.middleCount == 0)
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_MIDDLEUP);
|
|
|
|
|
if (globalState.currentClicks.fourthCount != 0 && globalState.previousClicks.fourthCount == 0)
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_XBUTTONUP, 1);
|
|
|
|
|
if (globalState.currentClicks.fifthCount != 0 && globalState.previousClicks.fifthCount == 0)
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_XBUTTONUP, 2);
|
2014-05-06 20:49:18 +02:00
|
|
|
|
}
|
2014-05-28 04:49:58 +02:00
|
|
|
|
|
|
|
|
|
if (globalState.currentClicks.toggleCount == 0 && globalState.previousClicks.toggleCount == 0)
|
|
|
|
|
{
|
|
|
|
|
if (globalState.currentClicks.leftCount != 0 && globalState.previousClicks.leftCount == 0)
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_LEFTDOWN);
|
|
|
|
|
else if (globalState.currentClicks.leftCount == 0 && globalState.previousClicks.leftCount != 0)
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_LEFTUP);
|
|
|
|
|
|
|
|
|
|
if (globalState.currentClicks.middleCount != 0 && globalState.previousClicks.middleCount == 0)
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_MIDDLEDOWN);
|
|
|
|
|
else if (globalState.currentClicks.middleCount == 0 && globalState.previousClicks.middleCount != 0)
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_MIDDLEUP);
|
|
|
|
|
|
|
|
|
|
if (globalState.currentClicks.rightCount != 0 && globalState.previousClicks.rightCount == 0)
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_RIGHTDOWN);
|
|
|
|
|
else if (globalState.currentClicks.rightCount == 0 && globalState.previousClicks.rightCount != 0)
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_RIGHTUP);
|
|
|
|
|
|
|
|
|
|
if (globalState.currentClicks.fourthCount != 0 && globalState.previousClicks.fourthCount == 0)
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_XBUTTONDOWN, 1);
|
|
|
|
|
else if (globalState.currentClicks.fourthCount == 0 && globalState.previousClicks.fourthCount != 0)
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_XBUTTONUP, 1);
|
|
|
|
|
|
|
|
|
|
if (globalState.currentClicks.fifthCount != 0 && globalState.previousClicks.fifthCount == 0)
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_XBUTTONDOWN, 2);
|
|
|
|
|
else if (globalState.currentClicks.fifthCount == 0 && globalState.previousClicks.fifthCount != 0)
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_XBUTTONUP, 2);
|
|
|
|
|
|
|
|
|
|
if (globalState.currentClicks.wUpCount != 0 && globalState.previousClicks.wUpCount == 0)
|
|
|
|
|
{
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_WHEEL, 100);
|
|
|
|
|
oldnow = DateTime.UtcNow;
|
|
|
|
|
wheel = 100;
|
|
|
|
|
}
|
|
|
|
|
else if (globalState.currentClicks.wUpCount == 0 && globalState.previousClicks.wUpCount != 0)
|
|
|
|
|
wheel = 0;
|
|
|
|
|
|
|
|
|
|
if (globalState.currentClicks.wDownCount != 0 && globalState.previousClicks.wDownCount == 0)
|
|
|
|
|
{
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_WHEEL, -100);
|
|
|
|
|
oldnow = DateTime.UtcNow;
|
|
|
|
|
wheel = -100;
|
|
|
|
|
}
|
|
|
|
|
if (globalState.currentClicks.wDownCount == 0 && globalState.previousClicks.wDownCount != 0)
|
|
|
|
|
wheel = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-06 20:49:18 +02:00
|
|
|
|
|
|
|
|
|
if (wheel != 0) //Continue mouse wheel movement
|
|
|
|
|
{
|
2014-05-23 04:42:07 +02:00
|
|
|
|
DateTime now = DateTime.UtcNow;
|
2014-05-06 20:49:18 +02:00
|
|
|
|
if (now >= oldnow + TimeSpan.FromMilliseconds(100) && !pressagain)
|
|
|
|
|
{
|
|
|
|
|
oldnow = now;
|
|
|
|
|
InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_WHEEL, wheel);
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-04-27 21:32:09 +02:00
|
|
|
|
|
|
|
|
|
// Merge and synthesize all key presses/releases that are present in this device's mapping.
|
|
|
|
|
// TODO what about the rest? e.g. repeat keys really ought to be on some set schedule
|
|
|
|
|
foreach (KeyValuePair<UInt16, SyntheticState.KeyPresses> kvp in state.keyPresses)
|
2014-03-28 02:50:40 +01:00
|
|
|
|
{
|
2014-04-27 21:32:09 +02:00
|
|
|
|
SyntheticState.KeyPresses gkp;
|
|
|
|
|
if (globalState.keyPresses.TryGetValue(kvp.Key, out gkp))
|
|
|
|
|
{
|
|
|
|
|
gkp.current.vkCount += kvp.Value.current.vkCount - kvp.Value.previous.vkCount;
|
|
|
|
|
gkp.current.scanCodeCount += kvp.Value.current.scanCodeCount - kvp.Value.previous.scanCodeCount;
|
|
|
|
|
gkp.current.repeatCount += kvp.Value.current.repeatCount - kvp.Value.previous.repeatCount;
|
2014-05-28 04:49:58 +02:00
|
|
|
|
gkp.current.toggle = kvp.Value.current.toggle;
|
|
|
|
|
gkp.current.toggleCount += kvp.Value.current.toggleCount - kvp.Value.previous.toggleCount;
|
2014-04-27 21:32:09 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gkp = new SyntheticState.KeyPresses();
|
|
|
|
|
gkp.current = kvp.Value.current;
|
|
|
|
|
globalState.keyPresses[kvp.Key] = gkp;
|
|
|
|
|
}
|
2014-05-28 04:49:58 +02:00
|
|
|
|
if (gkp.current.toggleCount != 0 && gkp.previous.toggleCount == 0 && gkp.current.toggle)
|
|
|
|
|
{
|
|
|
|
|
if (gkp.current.scanCodeCount != 0)
|
2014-12-13 21:30:14 +01:00
|
|
|
|
InputMethods.performSCKeyPress(kvp.Key);
|
2014-05-28 04:49:58 +02:00
|
|
|
|
else
|
2014-12-13 21:30:14 +01:00
|
|
|
|
InputMethods.performKeyPress(kvp.Key);
|
2014-05-28 04:49:58 +02:00
|
|
|
|
}
|
|
|
|
|
else if (gkp.current.toggleCount != 0 && gkp.previous.toggleCount == 0 && !gkp.current.toggle)
|
|
|
|
|
{
|
|
|
|
|
if (gkp.previous.scanCodeCount != 0) // use the last type of VK/SC
|
|
|
|
|
InputMethods.performSCKeyRelease(kvp.Key);
|
|
|
|
|
else
|
2014-12-13 21:30:14 +01:00
|
|
|
|
InputMethods.performKeyRelease(kvp.Key);
|
2014-05-28 04:49:58 +02:00
|
|
|
|
}
|
|
|
|
|
else if (gkp.current.vkCount + gkp.current.scanCodeCount != 0 && gkp.previous.vkCount + gkp.previous.scanCodeCount == 0)
|
2014-04-27 21:32:09 +02:00
|
|
|
|
{
|
|
|
|
|
if (gkp.current.scanCodeCount != 0)
|
2014-05-06 20:49:18 +02:00
|
|
|
|
{
|
2014-05-23 04:42:07 +02:00
|
|
|
|
oldnow = DateTime.UtcNow;
|
2014-12-13 21:30:14 +01:00
|
|
|
|
InputMethods.performSCKeyPress(kvp.Key);
|
2014-05-06 20:49:18 +02:00
|
|
|
|
pressagain = false;
|
|
|
|
|
keyshelddown = kvp.Key;
|
|
|
|
|
}
|
2014-04-27 21:32:09 +02:00
|
|
|
|
else
|
2014-05-06 20:49:18 +02:00
|
|
|
|
{
|
2014-05-23 04:42:07 +02:00
|
|
|
|
oldnow = DateTime.UtcNow;
|
2014-12-13 21:30:14 +01:00
|
|
|
|
InputMethods.performKeyPress(kvp.Key);
|
2014-05-06 20:49:18 +02:00
|
|
|
|
pressagain = false;
|
|
|
|
|
keyshelddown = kvp.Key;
|
|
|
|
|
}
|
2014-04-27 21:32:09 +02:00
|
|
|
|
}
|
2014-05-28 04:49:58 +02:00
|
|
|
|
else if (gkp.current.toggleCount != 0 || gkp.previous.toggleCount != 0 || gkp.current.repeatCount != 0 || // repeat or SC/VK transition
|
2014-05-07 06:35:08 +02:00
|
|
|
|
((gkp.previous.scanCodeCount == 0) != (gkp.current.scanCodeCount == 0))) //repeat keystroke after 500ms
|
2014-03-28 02:50:40 +01:00
|
|
|
|
{
|
2014-05-06 20:49:18 +02:00
|
|
|
|
if (keyshelddown == kvp.Key)
|
|
|
|
|
{
|
2014-05-23 04:42:07 +02:00
|
|
|
|
DateTime now = DateTime.UtcNow;
|
2014-05-06 20:49:18 +02:00
|
|
|
|
if (now >= oldnow + TimeSpan.FromMilliseconds(500) && !pressagain)
|
|
|
|
|
{
|
|
|
|
|
oldnow = now;
|
|
|
|
|
pressagain = true;
|
|
|
|
|
}
|
|
|
|
|
if (pressagain && gkp.current.scanCodeCount != 0)
|
|
|
|
|
{
|
2014-05-23 04:42:07 +02:00
|
|
|
|
now = DateTime.UtcNow;
|
2014-05-06 21:04:42 +02:00
|
|
|
|
if (now >= oldnow + TimeSpan.FromMilliseconds(25) && pressagain)
|
|
|
|
|
{
|
|
|
|
|
oldnow = now;
|
2014-12-13 21:30:14 +01:00
|
|
|
|
InputMethods.performSCKeyPress(kvp.Key);
|
2014-05-28 04:49:58 +02:00
|
|
|
|
}
|
2014-05-06 20:49:18 +02:00
|
|
|
|
}
|
|
|
|
|
else if (pressagain)
|
|
|
|
|
{
|
2014-05-23 04:42:07 +02:00
|
|
|
|
now = DateTime.UtcNow;
|
2014-05-06 21:04:42 +02:00
|
|
|
|
if (now >= oldnow + TimeSpan.FromMilliseconds(25) && pressagain)
|
|
|
|
|
{
|
|
|
|
|
oldnow = now;
|
2014-12-13 21:30:14 +01:00
|
|
|
|
InputMethods.performKeyPress(kvp.Key);
|
2014-05-06 21:04:42 +02:00
|
|
|
|
}
|
2014-05-06 20:49:18 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2014-04-27 21:32:09 +02:00
|
|
|
|
}
|
2014-12-17 19:29:22 +01:00
|
|
|
|
if ((gkp.current.toggleCount == 0 && gkp.previous.toggleCount == 0) && gkp.current.vkCount + gkp.current.scanCodeCount == 0 && gkp.previous.vkCount + gkp.previous.scanCodeCount != 0)
|
2014-04-27 21:32:09 +02:00
|
|
|
|
{
|
|
|
|
|
if (gkp.previous.scanCodeCount != 0) // use the last type of VK/SC
|
2014-05-06 20:49:18 +02:00
|
|
|
|
{
|
2014-04-27 21:32:09 +02:00
|
|
|
|
InputMethods.performSCKeyRelease(kvp.Key);
|
2014-05-06 20:49:18 +02:00
|
|
|
|
pressagain = false;
|
|
|
|
|
}
|
2014-04-27 21:32:09 +02:00
|
|
|
|
else
|
2014-05-06 20:49:18 +02:00
|
|
|
|
{
|
2014-12-13 21:30:14 +01:00
|
|
|
|
InputMethods.performKeyRelease(kvp.Key);
|
2014-05-06 20:49:18 +02:00
|
|
|
|
pressagain = false;
|
|
|
|
|
}
|
2014-03-28 02:50:40 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2014-04-27 21:32:09 +02:00
|
|
|
|
globalState.SavePrevious(false);
|
|
|
|
|
}
|
|
|
|
|
state.SavePrevious(true);
|
|
|
|
|
}
|
|
|
|
|
public enum Click { None, Left, Middle, Right, Fourth, Fifth, WUP, WDOWN };
|
|
|
|
|
public static void MapClick(int device, Click mouseClick)
|
|
|
|
|
{
|
|
|
|
|
switch (mouseClick)
|
|
|
|
|
{
|
|
|
|
|
case Click.Left:
|
|
|
|
|
deviceState[device].currentClicks.leftCount++;
|
|
|
|
|
break;
|
|
|
|
|
case Click.Middle:
|
|
|
|
|
deviceState[device].currentClicks.middleCount++;
|
|
|
|
|
break;
|
|
|
|
|
case Click.Right:
|
|
|
|
|
deviceState[device].currentClicks.rightCount++;
|
|
|
|
|
break;
|
|
|
|
|
case Click.Fourth:
|
|
|
|
|
deviceState[device].currentClicks.fourthCount++;
|
|
|
|
|
break;
|
|
|
|
|
case Click.Fifth:
|
|
|
|
|
deviceState[device].currentClicks.fifthCount++;
|
|
|
|
|
break;
|
|
|
|
|
case Click.WUP:
|
|
|
|
|
deviceState[device].currentClicks.wUpCount++;
|
|
|
|
|
break;
|
|
|
|
|
case Click.WDOWN:
|
|
|
|
|
deviceState[device].currentClicks.wDownCount++;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
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 static int DS4ControltoInt(DS4Controls ctrl)
|
|
|
|
|
{
|
|
|
|
|
switch (ctrl)
|
|
|
|
|
{
|
|
|
|
|
case DS4Controls.Share: return 1;
|
|
|
|
|
case DS4Controls.Options: return 2;
|
|
|
|
|
case DS4Controls.L1: return 3;
|
|
|
|
|
case DS4Controls.R1: return 4;
|
|
|
|
|
case DS4Controls.L3: return 5;
|
|
|
|
|
case DS4Controls.R3: return 6;
|
|
|
|
|
case DS4Controls.DpadUp: return 7;
|
|
|
|
|
case DS4Controls.DpadDown: return 8;
|
|
|
|
|
case DS4Controls.DpadLeft: return 9;
|
|
|
|
|
case DS4Controls.DpadRight: return 10;
|
|
|
|
|
case DS4Controls.PS: return 11;
|
|
|
|
|
case DS4Controls.Cross: return 12;
|
|
|
|
|
case DS4Controls.Square: return 13;
|
|
|
|
|
case DS4Controls.Triangle: return 14;
|
|
|
|
|
case DS4Controls.Circle: return 15;
|
|
|
|
|
case DS4Controls.LXNeg: return 16;
|
|
|
|
|
case DS4Controls.LYNeg: return 17;
|
|
|
|
|
case DS4Controls.RXNeg: return 18;
|
|
|
|
|
case DS4Controls.RYNeg: return 19;
|
|
|
|
|
case DS4Controls.LXPos: return 20;
|
|
|
|
|
case DS4Controls.LYPos: return 21;
|
|
|
|
|
case DS4Controls.RXPos: return 22;
|
|
|
|
|
case DS4Controls.RYPos: return 23;
|
|
|
|
|
case DS4Controls.L2: return 24;
|
|
|
|
|
case DS4Controls.R2: return 25;
|
|
|
|
|
case DS4Controls.TouchMulti: return 26;
|
|
|
|
|
case DS4Controls.TouchLeft: return 27;
|
|
|
|
|
case DS4Controls.TouchRight: return 28;
|
|
|
|
|
case DS4Controls.TouchUpper: return 29;
|
2014-06-26 20:02:01 +02:00
|
|
|
|
case DS4Controls.GyroXNeg: return 30;
|
|
|
|
|
case DS4Controls.GyroXPos: return 31;
|
|
|
|
|
case DS4Controls.GyroZNeg: return 32;
|
|
|
|
|
case DS4Controls.GyroZPos: return 33;
|
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
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2014-12-13 21:12:03 +01:00
|
|
|
|
|
|
|
|
|
static double TValue(double value1, double value2, double percent)
|
|
|
|
|
{
|
|
|
|
|
percent /= 100f;
|
|
|
|
|
return value1 * percent + value2 * (1 - percent);
|
|
|
|
|
}
|
2015-12-05 09:55:11 +01:00
|
|
|
|
static double Clamp(double min, double value, double max)
|
|
|
|
|
{
|
|
|
|
|
if (value > max)
|
|
|
|
|
return max;
|
|
|
|
|
else if (value < min)
|
|
|
|
|
return min;
|
|
|
|
|
else
|
|
|
|
|
return value;
|
|
|
|
|
}
|
2014-12-13 21:12:03 +01:00
|
|
|
|
|
|
|
|
|
public static DS4State SetCurveAndDeadzone(int device, DS4State cState)
|
|
|
|
|
{
|
|
|
|
|
DS4State dState = new DS4State(cState);
|
|
|
|
|
int x;
|
|
|
|
|
int y;
|
|
|
|
|
int curve;
|
2017-03-31 03:00:17 +02:00
|
|
|
|
int lsCurve = getLSCurve(device);
|
2017-03-27 11:55:53 +02:00
|
|
|
|
if (lsCurve > 0)
|
2014-12-13 21:12:03 +01:00
|
|
|
|
{
|
|
|
|
|
x = cState.LX;
|
|
|
|
|
y = cState.LY;
|
|
|
|
|
float max = x + y;
|
|
|
|
|
double curvex;
|
|
|
|
|
double curvey;
|
2017-03-27 11:55:53 +02:00
|
|
|
|
curve = lsCurve;
|
2014-12-13 21:12:03 +01:00
|
|
|
|
double multimax = TValue(382.5, max, curve);
|
|
|
|
|
double multimin = TValue(127.5, max, curve);
|
|
|
|
|
if ((x > 127.5f && y > 127.5f) || (x < 127.5f && y < 127.5f))
|
|
|
|
|
{
|
|
|
|
|
curvex = (x > 127.5f ? Math.Min(x, (x / max) * multimax) : Math.Max(x, (x / max) * multimin));
|
|
|
|
|
curvey = (y > 127.5f ? Math.Min(y, (y / max) * multimax) : Math.Max(y, (y / max) * multimin));
|
|
|
|
|
//btnLSTrack.Location = new Point((int)(dpix * curvex / 2.09 + lbLSTrack.Location.X), (int)(dpiy * curvey / 2.09 + lbLSTrack.Location.Y));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (x < 127.5f)
|
|
|
|
|
{
|
|
|
|
|
curvex = Math.Min(x, (x / max) * multimax);
|
|
|
|
|
curvey = Math.Min(y, (-(y / max) * multimax + 510));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
curvex = Math.Min(x, (-(x / max) * multimax + 510));
|
|
|
|
|
curvey = Math.Min(y, (y / max) * multimax);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
dState.LX = (byte)Math.Round(curvex, 0);
|
|
|
|
|
dState.LY = (byte)Math.Round(curvey, 0);
|
|
|
|
|
}
|
2017-03-27 11:55:53 +02:00
|
|
|
|
|
2017-03-31 03:00:17 +02:00
|
|
|
|
int rsCurve = getRSCurve(device);
|
2017-03-27 11:55:53 +02:00
|
|
|
|
if (rsCurve > 0)
|
2014-12-13 21:12:03 +01:00
|
|
|
|
{
|
|
|
|
|
x = cState.RX;
|
|
|
|
|
y = cState.RY;
|
|
|
|
|
float max = x + y;
|
|
|
|
|
double curvex;
|
|
|
|
|
double curvey;
|
2017-03-27 11:55:53 +02:00
|
|
|
|
curve = rsCurve;
|
2014-12-13 21:12:03 +01:00
|
|
|
|
double multimax = TValue(382.5, max, curve);
|
|
|
|
|
double multimin = TValue(127.5, max, curve);
|
|
|
|
|
if ((x > 127.5f && y > 127.5f) || (x < 127.5f && y < 127.5f))
|
|
|
|
|
{
|
|
|
|
|
curvex = (x > 127.5f ? Math.Min(x, (x / max) * multimax) : Math.Max(x, (x / max) * multimin));
|
|
|
|
|
curvey = (y > 127.5f ? Math.Min(y, (y / max) * multimax) : Math.Max(y, (y / max) * multimin));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (x < 127.5f)
|
|
|
|
|
{
|
|
|
|
|
curvex = Math.Min(x, (x / max) * multimax);
|
|
|
|
|
curvey = Math.Min(y, (-(y / max) * multimax + 510));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
curvex = Math.Min(x, (-(x / max) * multimax + 510));
|
|
|
|
|
curvey = Math.Min(y, (y / max) * multimax);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
dState.RX = (byte)Math.Round(curvex, 0);
|
|
|
|
|
dState.RY = (byte)Math.Round(curvey, 0);
|
|
|
|
|
}
|
2017-03-27 11:55:53 +02:00
|
|
|
|
|
2017-03-31 03:00:17 +02:00
|
|
|
|
int lsDeadzone = getLSDeadzone(device);
|
|
|
|
|
int lsAntiDead = getLSAntiDeadzone(device);
|
2017-03-27 15:02:04 +02:00
|
|
|
|
if (lsDeadzone > 0 || lsAntiDead > 0)
|
2014-12-13 21:12:03 +01:00
|
|
|
|
{
|
2017-03-27 15:02:04 +02:00
|
|
|
|
double lsSquared = Math.Pow(cState.LX - 127.5f, 2) + Math.Pow(cState.LY - 127.5f, 2);
|
|
|
|
|
double lsDeadzoneSquared = Math.Pow(lsDeadzone, 2);
|
|
|
|
|
if (lsDeadzone > 0 && lsSquared <= lsDeadzoneSquared)
|
|
|
|
|
{
|
|
|
|
|
dState.LX = 127;
|
|
|
|
|
dState.LY = 127;
|
|
|
|
|
}
|
|
|
|
|
else if ((lsDeadzone > 0 && lsSquared > lsDeadzoneSquared) || lsAntiDead > 0)
|
2017-03-27 05:55:05 +02:00
|
|
|
|
{
|
2017-03-27 15:02:04 +02:00
|
|
|
|
double r = Math.Atan2(-(dState.LY - 127.5f), (dState.LX - 127.5f));
|
|
|
|
|
double maxXValue = dState.LX >= 127.5 ? 127.5 : -127.5;
|
|
|
|
|
double maxYValue = dState.LY >= 127.5 ? 127.5 : -127.5;
|
2017-03-27 08:03:10 +02:00
|
|
|
|
|
2017-03-27 15:02:04 +02:00
|
|
|
|
double tempLsXDead = 0.0, tempLsYDead = 0.0;
|
|
|
|
|
double tempOutputX = 0.0, tempOutputY = 0.0;
|
|
|
|
|
if (lsDeadzone > 0)
|
2017-03-27 08:03:10 +02:00
|
|
|
|
{
|
2017-03-27 15:02:04 +02:00
|
|
|
|
tempLsXDead = Math.Abs(Math.Cos(r)) * (lsDeadzone / 127.0) * maxXValue;
|
|
|
|
|
tempLsYDead = Math.Abs(Math.Sin(r)) * (lsDeadzone / 127.0) * maxYValue;
|
|
|
|
|
|
|
|
|
|
if (lsSquared > lsDeadzoneSquared)
|
|
|
|
|
{
|
|
|
|
|
tempOutputX = ((dState.LX - 127.5f - tempLsXDead) / (double)(maxXValue - tempLsXDead));
|
|
|
|
|
tempOutputY = ((dState.LY - 127.5f - tempLsYDead) / (double)(maxYValue - tempLsYDead));
|
|
|
|
|
}
|
2017-03-27 08:03:10 +02:00
|
|
|
|
}
|
2017-03-30 09:37:01 +02:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
tempOutputX = ((dState.LX - 127.5f) / (double)(maxXValue));
|
|
|
|
|
tempOutputY = ((dState.LY - 127.5f) / (double)(maxYValue));
|
|
|
|
|
}
|
2017-03-27 05:55:05 +02:00
|
|
|
|
|
2017-03-27 15:02:04 +02:00
|
|
|
|
double tempLsXAntiDeadPercent = 0.0, tempLsYAntiDeadPercent = 0.0;
|
|
|
|
|
if (lsAntiDead > 0)
|
|
|
|
|
{
|
2017-03-30 09:37:01 +02:00
|
|
|
|
tempLsXAntiDeadPercent = (lsAntiDead * 0.01) * Math.Abs(Math.Cos(r));
|
|
|
|
|
tempLsYAntiDeadPercent = (lsAntiDead * 0.01) * Math.Abs(Math.Sin(r));
|
2017-03-27 15:02:04 +02:00
|
|
|
|
}
|
2017-03-27 05:55:05 +02:00
|
|
|
|
|
2017-03-27 15:02:04 +02:00
|
|
|
|
if (tempOutputX > 0.0)
|
|
|
|
|
{
|
|
|
|
|
dState.LX = (byte)((((1.0 - tempLsXAntiDeadPercent) * tempOutputX + tempLsXAntiDeadPercent)) * maxXValue + 127.5f);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dState.LX = 127;
|
|
|
|
|
}
|
2017-03-27 08:03:10 +02:00
|
|
|
|
|
2017-03-27 15:02:04 +02:00
|
|
|
|
if (tempOutputY > 0.0)
|
|
|
|
|
{
|
|
|
|
|
dState.LY = (byte)((((1.0 - tempLsYAntiDeadPercent) * tempOutputY + tempLsYAntiDeadPercent)) * maxYValue + 127.5f);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dState.LY = 127;
|
|
|
|
|
}
|
2017-03-27 05:55:05 +02:00
|
|
|
|
|
2017-03-27 15:02:04 +02:00
|
|
|
|
//dState.LX = (byte)(Math.Cos(r) * (127.5f + LSDeadzone[device]) + 127.5f);
|
|
|
|
|
//dState.LY = (byte)(Math.Sin(r) * (127.5f + LSDeadzone[device]) + 127.5f);
|
|
|
|
|
}
|
2015-04-21 21:00:09 +02:00
|
|
|
|
}
|
2017-03-27 15:02:04 +02:00
|
|
|
|
|
2017-03-31 03:00:17 +02:00
|
|
|
|
int rsDeadzone = getRSDeadzone(device);
|
|
|
|
|
int rsAntiDead = getRSAntiDeadzone(device);
|
2017-03-27 15:02:04 +02:00
|
|
|
|
if (rsDeadzone > 0 || rsAntiDead > 0)
|
2014-12-13 21:12:03 +01:00
|
|
|
|
{
|
2017-03-27 15:02:04 +02:00
|
|
|
|
double rsSquared = Math.Pow(cState.RX - 127.5f, 2) + Math.Pow(cState.RY - 127.5f, 2);
|
|
|
|
|
double rsDeadzoneSquared = Math.Pow(rsDeadzone, 2);
|
|
|
|
|
if (rsDeadzone > 0 && rsSquared <= rsDeadzoneSquared)
|
|
|
|
|
{
|
|
|
|
|
dState.RX = 127;
|
|
|
|
|
dState.RY = 127;
|
|
|
|
|
}
|
|
|
|
|
else if ((rsDeadzone > 0 && rsSquared > rsDeadzoneSquared) || rsAntiDead > 0)
|
2017-03-27 05:55:05 +02:00
|
|
|
|
{
|
2017-03-27 15:02:04 +02:00
|
|
|
|
double r = Math.Atan2(-(dState.RY - 127.5f), (dState.RX - 127.5f));
|
|
|
|
|
double maxXValue = dState.RX >= 127.5 ? 127.5 : -127.5;
|
|
|
|
|
double maxYValue = dState.RY >= 127.5 ? 127.5 : -127.5;
|
2017-03-27 08:03:10 +02:00
|
|
|
|
|
2017-03-27 15:02:04 +02:00
|
|
|
|
double tempRsXDead = 0.0, tempRsYDead = 0.0;
|
|
|
|
|
double tempOutputX = 0.0, tempOutputY = 0.0;
|
|
|
|
|
if (rsDeadzone > 0)
|
2017-03-27 08:03:10 +02:00
|
|
|
|
{
|
2017-03-27 15:02:04 +02:00
|
|
|
|
tempRsXDead = Math.Abs(Math.Cos(r)) * (rsDeadzone / 127.0) * maxXValue;
|
|
|
|
|
tempRsYDead = Math.Abs(Math.Sin(r)) * (rsDeadzone / 127.0) * maxYValue;
|
|
|
|
|
|
|
|
|
|
if (rsSquared > rsDeadzoneSquared)
|
|
|
|
|
{
|
|
|
|
|
tempOutputX = ((dState.RX - 127.5f - tempRsXDead) / (double)(maxXValue - tempRsXDead));
|
|
|
|
|
tempOutputY = ((dState.RY - 127.5f - tempRsYDead) / (double)(maxYValue - tempRsYDead));
|
|
|
|
|
}
|
2017-03-27 08:03:10 +02:00
|
|
|
|
}
|
2017-03-30 09:37:01 +02:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
tempOutputX = ((dState.RX - 127.5f) / (double)(maxXValue));
|
|
|
|
|
tempOutputY = ((dState.RY - 127.5f) / (double)(maxYValue));
|
|
|
|
|
}
|
2017-03-27 05:55:05 +02:00
|
|
|
|
|
2017-03-27 15:02:04 +02:00
|
|
|
|
double tempRsXAntiDeadPercent = 0.0, tempRsYAntiDeadPercent = 0.0;
|
|
|
|
|
if (rsAntiDead > 0)
|
|
|
|
|
{
|
2017-03-30 09:37:01 +02:00
|
|
|
|
tempRsXAntiDeadPercent = (rsAntiDead * 0.01) * Math.Abs(Math.Cos(r));
|
|
|
|
|
tempRsYAntiDeadPercent = (rsAntiDead * 0.01) * Math.Abs(Math.Sin(r));
|
2017-03-27 15:02:04 +02:00
|
|
|
|
}
|
2017-03-27 05:55:05 +02:00
|
|
|
|
|
2017-03-27 15:02:04 +02:00
|
|
|
|
if (tempOutputX > 0.0)
|
|
|
|
|
{
|
|
|
|
|
dState.RX = (byte)((((1.0 - tempRsXAntiDeadPercent) * tempOutputX + tempRsXAntiDeadPercent)) * maxXValue + 127.5f);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dState.RX = 127;
|
|
|
|
|
}
|
2017-03-27 08:03:10 +02:00
|
|
|
|
|
2017-03-27 15:02:04 +02:00
|
|
|
|
if (tempOutputY > 0.0)
|
|
|
|
|
{
|
|
|
|
|
dState.RY = (byte)((((1.0 - tempRsYAntiDeadPercent) * tempOutputY + tempRsYAntiDeadPercent)) * maxYValue + 127.5f);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dState.RY = 127;
|
|
|
|
|
}
|
2017-03-27 05:55:05 +02:00
|
|
|
|
|
2017-03-27 15:02:04 +02:00
|
|
|
|
//dState.RX = (byte)(((dState.RX - 127.5f - tempRsXDead) / (double)(maxXValue - tempRsXDead)) * maxXValue + 127.5f);
|
|
|
|
|
//dState.RY = (byte)(((dState.RY - 127.5f - tempRsYDead) / (double)(maxYValue - tempRsYDead)) * maxYValue + 127.5f);
|
|
|
|
|
//dState.RX = (byte)(Math.Cos(r) * (127.5f + RSDeadzone[device]) + 127.5f);
|
|
|
|
|
//dState.RY = (byte)(Math.Sin(r) * (127.5f + RSDeadzone[device]) + 127.5f);
|
|
|
|
|
}
|
2015-04-21 21:00:09 +02:00
|
|
|
|
}
|
2017-03-26 00:32:45 +01:00
|
|
|
|
|
2017-03-31 03:00:17 +02:00
|
|
|
|
byte l2Deadzone = getL2Deadzone(device);
|
|
|
|
|
int l2AntiDeadzone = getL2AntiDeadzone(device);
|
2017-03-30 09:37:01 +02:00
|
|
|
|
if (l2Deadzone > 0 || l2AntiDeadzone > 0)
|
2017-03-26 00:32:45 +01:00
|
|
|
|
{
|
2017-03-30 09:37:01 +02:00
|
|
|
|
double tempL2Output = (cState.L2 / 255.0);
|
|
|
|
|
double tempL2AntiDead = 0.0;
|
|
|
|
|
if (l2Deadzone > 0)
|
|
|
|
|
{
|
|
|
|
|
if (cState.L2 > l2Deadzone)
|
|
|
|
|
{
|
|
|
|
|
tempL2Output = ((dState.L2 - l2Deadzone) / (double)(255 - l2Deadzone));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
tempL2Output = 0.0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (l2AntiDeadzone > 0)
|
|
|
|
|
{
|
|
|
|
|
tempL2AntiDead = l2AntiDeadzone * 0.01;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (tempL2Output > 0.0)
|
|
|
|
|
{
|
|
|
|
|
dState.L2 = (byte)(((1.0 - tempL2AntiDead) * tempL2Output + tempL2AntiDead) * 255);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dState.L2 = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*if (cState.L2 > l2Deadzone)
|
2017-03-26 00:32:45 +01:00
|
|
|
|
{
|
2017-03-26 03:50:34 +02:00
|
|
|
|
dState.L2 = (byte)(((dState.L2 - l2Deadzone) / (double)(255 - l2Deadzone)) * 255);
|
2017-03-26 00:32:45 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dState.L2 = 0;
|
|
|
|
|
}
|
2017-03-30 09:37:01 +02:00
|
|
|
|
*/
|
2017-03-26 00:32:45 +01:00
|
|
|
|
}
|
|
|
|
|
|
2017-03-31 03:00:17 +02:00
|
|
|
|
byte r2Deadzone = getR2Deadzone(device);
|
|
|
|
|
int r2AntiDeadzone = getR2AntiDeadzone(device);
|
2017-03-30 09:37:01 +02:00
|
|
|
|
if (r2Deadzone > 0 || r2AntiDeadzone > 0)
|
2017-03-26 00:32:45 +01:00
|
|
|
|
{
|
2017-03-30 09:37:01 +02:00
|
|
|
|
double tempR2Output = (cState.R2 / 255.0);
|
|
|
|
|
double tempR2AntiDead = 0.0;
|
|
|
|
|
if (r2Deadzone > 0)
|
|
|
|
|
{
|
|
|
|
|
if (cState.R2 > r2Deadzone)
|
|
|
|
|
{
|
|
|
|
|
tempR2Output = ((dState.R2 - r2Deadzone) / (double)(255 - r2Deadzone));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
tempR2Output = 0.0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (r2AntiDeadzone > 0)
|
|
|
|
|
{
|
|
|
|
|
tempR2AntiDead = r2AntiDeadzone * 0.01;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (tempR2Output > 0.0)
|
2017-03-26 00:32:45 +01:00
|
|
|
|
{
|
2017-03-30 09:37:01 +02:00
|
|
|
|
dState.R2 = (byte)(((1.0 - tempR2AntiDead) * tempR2Output + tempR2AntiDead) * 255);
|
2017-03-26 00:32:45 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dState.R2 = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-03-31 03:00:17 +02:00
|
|
|
|
double lsSens = getLSSens(device);
|
2017-03-26 00:42:34 +01:00
|
|
|
|
if (lsSens != 1.0)
|
2015-12-05 09:55:11 +01:00
|
|
|
|
{
|
2017-03-26 03:50:34 +02:00
|
|
|
|
dState.LX = (byte)Clamp(0, lsSens * (dState.LX - 127.5f) + 127.5f, 255);
|
|
|
|
|
dState.LY = (byte)Clamp(0, lsSens * (dState.LY - 127.5f) + 127.5f, 255);
|
2015-12-05 09:55:11 +01:00
|
|
|
|
}
|
2017-03-26 00:42:34 +01:00
|
|
|
|
|
2017-03-31 03:00:17 +02:00
|
|
|
|
double rsSens = getRSSens(device);
|
2017-03-26 00:42:34 +01:00
|
|
|
|
if (rsSens != 1.0)
|
2015-12-05 09:55:11 +01:00
|
|
|
|
{
|
2017-03-26 03:50:34 +02:00
|
|
|
|
dState.RX = (byte)Clamp(0, rsSens * (dState.RX - 127.5f) + 127.5f, 255);
|
|
|
|
|
dState.RY = (byte)Clamp(0, rsSens * (dState.RY - 127.5f) + 127.5f, 255);
|
2015-12-05 09:55:11 +01:00
|
|
|
|
}
|
2017-03-26 00:42:34 +01:00
|
|
|
|
|
2017-03-31 03:00:17 +02:00
|
|
|
|
double l2Sens = getL2Sens(device);
|
2017-03-26 00:42:34 +01:00
|
|
|
|
if (l2Sens != 1.0)
|
|
|
|
|
dState.L2 = (byte)Clamp(0, l2Sens * dState.L2, 255);
|
|
|
|
|
|
2017-03-31 03:00:17 +02:00
|
|
|
|
double r2Sens = getR2Sens(device);
|
2017-03-26 00:42:34 +01:00
|
|
|
|
if (r2Sens != 1.0)
|
|
|
|
|
dState.R2 = (byte)Clamp(0, r2Sens * dState.R2, 255);
|
|
|
|
|
|
2014-12-13 21:12:03 +01:00
|
|
|
|
return dState;
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-18 07:25:51 +01:00
|
|
|
|
private static bool ShiftTrigger(int trigger, int device, DS4State cState, DS4StateExposed eState, Mouse tp)
|
|
|
|
|
{
|
|
|
|
|
switch (trigger)
|
|
|
|
|
{
|
|
|
|
|
case 1: return getBoolMapping(device, DS4Controls.Cross, cState, eState, tp);
|
|
|
|
|
case 2: return getBoolMapping(device, DS4Controls.Circle, cState, eState, tp);
|
|
|
|
|
case 3: return getBoolMapping(device, DS4Controls.Square, cState, eState, tp);
|
|
|
|
|
case 4: return getBoolMapping(device, DS4Controls.Triangle, cState, eState, tp);
|
|
|
|
|
case 5: return getBoolMapping(device, DS4Controls.Options, cState, eState, tp);
|
|
|
|
|
case 6: return getBoolMapping(device, DS4Controls.Share, cState, eState, tp);
|
|
|
|
|
case 7: return getBoolMapping(device, DS4Controls.DpadUp, cState, eState, tp);
|
|
|
|
|
case 8: return getBoolMapping(device, DS4Controls.DpadDown, cState, eState, tp);
|
|
|
|
|
case 9: return getBoolMapping(device, DS4Controls.DpadLeft, cState, eState, tp);
|
|
|
|
|
case 10: return getBoolMapping(device, DS4Controls.DpadRight, cState, eState, tp);
|
|
|
|
|
case 11: return getBoolMapping(device, DS4Controls.PS, cState, eState, tp);
|
|
|
|
|
case 12: return getBoolMapping(device, DS4Controls.L1, cState, eState, tp);
|
|
|
|
|
case 13: return getBoolMapping(device, DS4Controls.R1, cState, eState, tp);
|
|
|
|
|
case 14: return getBoolMapping(device, DS4Controls.L2, cState, eState, tp);
|
|
|
|
|
case 15: return getBoolMapping(device, DS4Controls.R2, cState, eState, tp);
|
|
|
|
|
case 16: return getBoolMapping(device, DS4Controls.L3, cState, eState, tp);
|
|
|
|
|
case 17: return getBoolMapping(device, DS4Controls.R3, cState, eState, tp);
|
|
|
|
|
case 18: return getBoolMapping(device, DS4Controls.TouchLeft, cState, eState, tp);
|
|
|
|
|
case 19: return getBoolMapping(device, DS4Controls.TouchUpper, cState, eState, tp);
|
|
|
|
|
case 20: return getBoolMapping(device, DS4Controls.TouchMulti, cState, eState, tp);
|
|
|
|
|
case 21: return getBoolMapping(device, DS4Controls.TouchRight, cState, eState, tp);
|
|
|
|
|
case 22: return getBoolMapping(device, DS4Controls.GyroZNeg, cState, eState, tp);
|
|
|
|
|
case 23: return getBoolMapping(device, DS4Controls.GyroZPos, cState, eState, tp);
|
|
|
|
|
case 24: return getBoolMapping(device, DS4Controls.GyroXPos, cState, eState, tp);
|
|
|
|
|
case 25: return getBoolMapping(device, DS4Controls.GyroXNeg, cState, eState, tp);
|
|
|
|
|
case 26: return cState.Touch1;
|
|
|
|
|
default: return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private static X360Controls getX360ControlsByName(string key)
|
|
|
|
|
{
|
|
|
|
|
X360Controls x3c;
|
|
|
|
|
if (Enum.TryParse(key, true, out x3c))
|
|
|
|
|
return x3c;
|
|
|
|
|
switch (key)
|
|
|
|
|
{
|
|
|
|
|
case "Back": return X360Controls.Back;
|
|
|
|
|
case "Left Stick": return X360Controls.LS;
|
|
|
|
|
case "Right Stick": return X360Controls.RS;
|
|
|
|
|
case "Start": return X360Controls.Start;
|
|
|
|
|
case "Up Button": return X360Controls.DpadUp;
|
|
|
|
|
case "Right Button": return X360Controls.DpadRight;
|
|
|
|
|
case "Down Button": return X360Controls.DpadDown;
|
|
|
|
|
case "Left Button": return X360Controls.DpadLeft;
|
|
|
|
|
|
|
|
|
|
case "Left Bumper": return X360Controls.LB;
|
|
|
|
|
case "Right Bumper": return X360Controls.RB;
|
|
|
|
|
case "Y Button": return X360Controls.Y;
|
|
|
|
|
case "B Button": return X360Controls.B;
|
|
|
|
|
case "A Button": return X360Controls.A;
|
|
|
|
|
case "X Button": return X360Controls.X;
|
|
|
|
|
|
|
|
|
|
case "Guide": return X360Controls.Guide;
|
|
|
|
|
case "Left X-Axis-": return X360Controls.LXNeg;
|
|
|
|
|
case "Left Y-Axis-": return X360Controls.LYNeg;
|
|
|
|
|
case "Right X-Axis-": return X360Controls.RXNeg;
|
|
|
|
|
case "Right Y-Axis-": return X360Controls.RYNeg;
|
|
|
|
|
|
|
|
|
|
case "Left X-Axis+": return X360Controls.LXPos;
|
|
|
|
|
case "Left Y-Axis+": return X360Controls.LYPos;
|
|
|
|
|
case "Right X-Axis+": return X360Controls.RXPos;
|
|
|
|
|
case "Right Y-Axis+": return X360Controls.RYPos;
|
|
|
|
|
case "Left Trigger": return X360Controls.LT;
|
|
|
|
|
case "Right Trigger": return X360Controls.RT;
|
|
|
|
|
|
|
|
|
|
case "Left Mouse Button": return X360Controls.LeftMouse;
|
|
|
|
|
case "Right Mouse Button": return X360Controls.RightMouse;
|
|
|
|
|
case "Middle Mouse Button": return X360Controls.MiddleMouse;
|
|
|
|
|
case "4th Mouse Button": return X360Controls.FourthMouse;
|
|
|
|
|
case "5th Mouse Button": return X360Controls.FifthMouse;
|
|
|
|
|
case "Mouse Wheel Up": return X360Controls.WUP;
|
|
|
|
|
case "Mouse Wheel Down": return X360Controls.WDOWN;
|
|
|
|
|
case "Mouse Up": return X360Controls.MouseUp;
|
|
|
|
|
case "Mouse Down": return X360Controls.MouseDown;
|
|
|
|
|
case "Mouse Left": return X360Controls.MouseLeft;
|
|
|
|
|
case "Mouse Right": return X360Controls.MouseRight;
|
|
|
|
|
case "Unbound": return X360Controls.Unbound;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return X360Controls.Unbound;
|
|
|
|
|
}
|
|
|
|
|
|
2014-12-17 19:29:22 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Map DS4 Buttons/Axes to other DS4 Buttons/Axes (largely the same as Xinput ones) and to keyboard and mouse buttons.
|
|
|
|
|
/// </summary>
|
2015-12-18 07:25:51 +01:00
|
|
|
|
static bool[] held = new bool[4];
|
|
|
|
|
static int[] oldmouse = new int[4] { -1, -1, -1, -1 };
|
2015-02-12 20:36:40 +01:00
|
|
|
|
public static void MapCustom(int device, DS4State cState, DS4State MappedState, DS4StateExposed eState, Mouse tp, ControlService ctrl)
|
2014-04-27 21:32:09 +02:00
|
|
|
|
{
|
2017-03-29 03:41:17 +02:00
|
|
|
|
/* TODO: This method is slow sauce. Find ways to speed up action execution */
|
2015-04-21 21:00:09 +02:00
|
|
|
|
MappedState.LX = 127;
|
|
|
|
|
MappedState.LY = 127;
|
|
|
|
|
MappedState.RX = 127;
|
|
|
|
|
MappedState.RY = 127;
|
|
|
|
|
int MouseDeltaX = 0;
|
|
|
|
|
int MouseDeltaY = 0;
|
|
|
|
|
|
2014-04-27 21:32:09 +02:00
|
|
|
|
SyntheticState deviceState = Mapping.deviceState[device];
|
2017-04-02 02:46:51 +02:00
|
|
|
|
if (getProfileActionCount(device) > 0 || !string.IsNullOrEmpty(tempprofilename[device]))
|
2014-12-13 21:12:03 +01:00
|
|
|
|
MapCustomAction(device, cState, MappedState, eState, tp, ctrl);
|
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 (ctrl.DS4Controllers[device] == null) return;
|
2015-12-18 07:25:51 +01:00
|
|
|
|
|
2014-11-01 22:49:22 +01:00
|
|
|
|
cState.CopyTo(MappedState);
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
|
2017-03-30 15:14:58 +02:00
|
|
|
|
Dictionary<DS4Controls, DS4Controls> tempControlDict = new Dictionary<DS4Controls, DS4Controls>();
|
|
|
|
|
//Dictionary<DS4Controls, DS4Controls> tempAxesControlDict = new Dictionary<DS4Controls, DS4Controls>();
|
2015-12-18 07:25:51 +01:00
|
|
|
|
DS4Controls usingExtra = DS4Controls.None;
|
|
|
|
|
foreach (DS4ControlSettings dcs in getDS4CSettings(device))
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
object action = null;
|
|
|
|
|
DS4ControlSettings.ActionType actionType = 0;
|
|
|
|
|
DS4KeyType keyType = DS4KeyType.None;
|
|
|
|
|
if (dcs.shiftAction != null && ShiftTrigger(dcs.shiftTrigger, device, cState, eState, tp))
|
|
|
|
|
{
|
|
|
|
|
action = dcs.shiftAction;
|
|
|
|
|
actionType = dcs.shiftActionType;
|
|
|
|
|
keyType = dcs.shiftKeyType;
|
|
|
|
|
}
|
|
|
|
|
else if (dcs.action != null)
|
|
|
|
|
{
|
|
|
|
|
action = dcs.action;
|
|
|
|
|
actionType = dcs.actionType;
|
|
|
|
|
keyType = dcs.keyType;
|
|
|
|
|
}
|
|
|
|
|
if (action != null)
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
if (actionType == DS4ControlSettings.ActionType.Macro)
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
if (getBoolMapping(device, dcs.control, cState, eState, tp))
|
|
|
|
|
{
|
|
|
|
|
resetToDefaultValue(dcs.control, MappedState);
|
|
|
|
|
PlayMacro(device, macroControl, string.Join("/", (int[])action), dcs.control, keyType);
|
|
|
|
|
}
|
|
|
|
|
else if (!getBoolMapping(device, dcs.control, cState, eState, tp))
|
|
|
|
|
{
|
|
|
|
|
EndMacro(device, macroControl, string.Join("/", (int[])action), dcs.control);
|
|
|
|
|
}
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
}
|
2015-12-18 07:25:51 +01:00
|
|
|
|
else if (actionType == DS4ControlSettings.ActionType.Key)
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
ushort value = ushort.Parse(action.ToString());
|
|
|
|
|
if (getBoolMapping(device, dcs.control, cState, eState, tp))
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
resetToDefaultValue(dcs.control, MappedState);
|
|
|
|
|
SyntheticState.KeyPresses kp;
|
|
|
|
|
if (!deviceState.keyPresses.TryGetValue(value, out kp))
|
|
|
|
|
deviceState.keyPresses[value] = kp = new SyntheticState.KeyPresses();
|
|
|
|
|
if (keyType.HasFlag(DS4KeyType.ScanCode))
|
|
|
|
|
kp.current.scanCodeCount++;
|
|
|
|
|
else
|
|
|
|
|
kp.current.vkCount++;
|
|
|
|
|
if (keyType.HasFlag(DS4KeyType.Toggle))
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
if (!pressedonce[value])
|
|
|
|
|
{
|
|
|
|
|
kp.current.toggle = !kp.current.toggle;
|
|
|
|
|
pressedonce[value] = true;
|
|
|
|
|
}
|
|
|
|
|
kp.current.toggleCount++;
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
}
|
2015-12-18 07:25:51 +01:00
|
|
|
|
kp.current.repeatCount++;
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
}
|
2015-02-12 20:36:40 +01:00
|
|
|
|
else
|
2015-12-18 07:25:51 +01:00
|
|
|
|
pressedonce[value] = false;
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
}
|
2015-12-18 07:25:51 +01:00
|
|
|
|
else if (actionType == DS4ControlSettings.ActionType.Button)
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
int keyvalue = 0;
|
|
|
|
|
bool isAnalog = dcs.control.ToString().Contains("LX") ||
|
|
|
|
|
dcs.control.ToString().Contains("RX") ||
|
|
|
|
|
dcs.control.ToString().Contains("LY") ||
|
|
|
|
|
dcs.control.ToString().Contains("LY") ||
|
|
|
|
|
dcs.control.ToString().Contains("R2") ||
|
|
|
|
|
dcs.control.ToString().Contains("L2") ||
|
|
|
|
|
dcs.control.ToString().Contains("Gyro");
|
|
|
|
|
switch (getX360ControlsByName(action.ToString()))
|
|
|
|
|
{
|
2017-03-30 15:14:58 +02:00
|
|
|
|
case X360Controls.A: tempControlDict.Add(DS4Controls.Cross, dcs.control); break;
|
|
|
|
|
case X360Controls.B: tempControlDict.Add(DS4Controls.Circle, dcs.control); break;
|
|
|
|
|
case X360Controls.X: tempControlDict.Add(DS4Controls.Square, dcs.control); break;
|
|
|
|
|
case X360Controls.Y: tempControlDict.Add(DS4Controls.Triangle, dcs.control); break;
|
|
|
|
|
case X360Controls.LB: tempControlDict.Add(DS4Controls.L1, dcs.control); break;
|
|
|
|
|
case X360Controls.LS: tempControlDict.Add(DS4Controls.L3, dcs.control); break;
|
|
|
|
|
case X360Controls.RB: tempControlDict.Add(DS4Controls.R1, dcs.control); break;
|
|
|
|
|
case X360Controls.RS: tempControlDict.Add(DS4Controls.R3, dcs.control); break;
|
|
|
|
|
case X360Controls.DpadUp: tempControlDict.Add(DS4Controls.DpadUp, dcs.control); break;
|
|
|
|
|
case X360Controls.DpadDown: tempControlDict.Add(DS4Controls.DpadDown, dcs.control); break;
|
|
|
|
|
case X360Controls.DpadLeft: tempControlDict.Add(DS4Controls.DpadLeft, dcs.control); break;
|
|
|
|
|
case X360Controls.DpadRight: tempControlDict.Add(DS4Controls.DpadRight, dcs.control); break;
|
|
|
|
|
case X360Controls.Start: tempControlDict.Add(DS4Controls.Options, dcs.control); break;
|
|
|
|
|
case X360Controls.Guide: tempControlDict.Add(DS4Controls.PS, dcs.control); break;
|
|
|
|
|
case X360Controls.Back: tempControlDict.Add(DS4Controls.Share, dcs.control); break;
|
|
|
|
|
case X360Controls.LXNeg: tempControlDict.Add(DS4Controls.LXNeg, dcs.control); break;
|
|
|
|
|
case X360Controls.LYNeg: tempControlDict.Add(DS4Controls.LYNeg, dcs.control); break;
|
|
|
|
|
case X360Controls.RXNeg: tempControlDict.Add(DS4Controls.RXNeg, dcs.control); break;
|
|
|
|
|
case X360Controls.RYNeg: tempControlDict.Add(DS4Controls.RYNeg, dcs.control); break;
|
|
|
|
|
case X360Controls.LXPos: tempControlDict.Add(DS4Controls.LXPos, dcs.control); break;
|
|
|
|
|
case X360Controls.LYPos: tempControlDict.Add(DS4Controls.LYPos, dcs.control); break;
|
|
|
|
|
case X360Controls.RXPos: tempControlDict.Add(DS4Controls.RXPos, dcs.control); break;
|
|
|
|
|
case X360Controls.RYPos: tempControlDict.Add(DS4Controls.RYPos, dcs.control); break;
|
|
|
|
|
case X360Controls.LT: tempControlDict.Add(DS4Controls.L2, dcs.control); break;
|
|
|
|
|
case X360Controls.RT: tempControlDict.Add(DS4Controls.R2, dcs.control); break;
|
2015-12-18 07:25:51 +01:00
|
|
|
|
case X360Controls.LeftMouse:
|
|
|
|
|
keyvalue = 256;
|
|
|
|
|
if (getBoolMapping(device, dcs.control, cState, eState, tp))
|
|
|
|
|
deviceState.currentClicks.leftCount++;
|
|
|
|
|
break;
|
|
|
|
|
case X360Controls.RightMouse:
|
|
|
|
|
keyvalue = 257;
|
|
|
|
|
if (getBoolMapping(device, dcs.control, cState, eState, tp))
|
|
|
|
|
deviceState.currentClicks.rightCount++;
|
|
|
|
|
break;
|
|
|
|
|
case X360Controls.MiddleMouse:
|
|
|
|
|
keyvalue = 258;
|
|
|
|
|
if (getBoolMapping(device, dcs.control, cState, eState, tp))
|
|
|
|
|
deviceState.currentClicks.middleCount++;
|
|
|
|
|
break;
|
|
|
|
|
case X360Controls.FourthMouse:
|
|
|
|
|
keyvalue = 259;
|
|
|
|
|
if (getBoolMapping(device, dcs.control, cState, eState, tp))
|
|
|
|
|
deviceState.currentClicks.fourthCount++;
|
|
|
|
|
break;
|
|
|
|
|
case X360Controls.FifthMouse:
|
|
|
|
|
keyvalue = 260;
|
|
|
|
|
if (getBoolMapping(device, dcs.control, cState, eState, tp))
|
|
|
|
|
deviceState.currentClicks.fifthCount++;
|
|
|
|
|
break;
|
|
|
|
|
case X360Controls.WUP:
|
|
|
|
|
if (getBoolMapping(device, dcs.control, cState, eState, tp))
|
|
|
|
|
if (isAnalog)
|
|
|
|
|
getMouseWheelMapping(device, dcs.control, cState, eState, tp, false);
|
|
|
|
|
else
|
|
|
|
|
deviceState.currentClicks.wUpCount++;
|
|
|
|
|
break;
|
|
|
|
|
case X360Controls.WDOWN:
|
|
|
|
|
if (getBoolMapping(device, dcs.control, cState, eState, tp))
|
|
|
|
|
if (isAnalog)
|
|
|
|
|
getMouseWheelMapping(device, dcs.control, cState, eState, tp, true);
|
|
|
|
|
else
|
|
|
|
|
deviceState.currentClicks.wDownCount++;
|
|
|
|
|
break;
|
|
|
|
|
case X360Controls.MouseUp:
|
|
|
|
|
if (MouseDeltaY == 0)
|
|
|
|
|
{
|
|
|
|
|
MouseDeltaY = getMouseMapping(device, dcs.control, cState, eState, 0);
|
|
|
|
|
MouseDeltaY = -Math.Abs((MouseDeltaY == -2147483648 ? 0 : MouseDeltaY));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case X360Controls.MouseDown:
|
|
|
|
|
if (MouseDeltaY == 0)
|
|
|
|
|
{
|
|
|
|
|
MouseDeltaY = getMouseMapping(device, dcs.control, cState, eState, 1);
|
|
|
|
|
MouseDeltaY = Math.Abs((MouseDeltaY == -2147483648 ? 0 : MouseDeltaY));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case X360Controls.MouseLeft:
|
|
|
|
|
if (MouseDeltaX == 0)
|
|
|
|
|
{
|
|
|
|
|
MouseDeltaX = getMouseMapping(device, dcs.control, cState, eState, 2);
|
|
|
|
|
MouseDeltaX = -Math.Abs((MouseDeltaX == -2147483648 ? 0 : MouseDeltaX));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case X360Controls.MouseRight:
|
|
|
|
|
if (MouseDeltaX == 0)
|
|
|
|
|
{
|
|
|
|
|
MouseDeltaX = getMouseMapping(device, dcs.control, cState, eState, 3);
|
|
|
|
|
MouseDeltaX = Math.Abs((MouseDeltaX == -2147483648 ? 0 : MouseDeltaX));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (keyType.HasFlag(DS4KeyType.Toggle))
|
|
|
|
|
{
|
|
|
|
|
if (getBoolMapping(device, dcs.control, cState, eState, tp))
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
resetToDefaultValue(dcs.control, MappedState);
|
|
|
|
|
if (!pressedonce[keyvalue])
|
|
|
|
|
{
|
|
|
|
|
deviceState.currentClicks.toggle = !deviceState.currentClicks.toggle;
|
|
|
|
|
pressedonce[keyvalue] = true;
|
|
|
|
|
}
|
|
|
|
|
deviceState.currentClicks.toggleCount++;
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
}
|
2015-12-18 07:25:51 +01:00
|
|
|
|
else
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
pressedonce[keyvalue] = false;
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
}
|
2015-12-18 07:25:51 +01:00
|
|
|
|
}
|
|
|
|
|
resetToDefaultValue(dcs.control, MappedState); // erase default mappings for things that are remapped
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (usingExtra == DS4Controls.None || usingExtra == dcs.control)
|
|
|
|
|
{
|
2017-03-28 17:27:15 +02:00
|
|
|
|
bool shiftE = !string.IsNullOrEmpty(dcs.shiftExtras) && dcs.shiftExtras != "0,0,0,0,0,0,0,0" && ShiftTrigger(dcs.shiftTrigger, device, cState, eState, tp);
|
|
|
|
|
bool regE = !string.IsNullOrEmpty(dcs.extras) && dcs.extras != "0,0,0,0,0,0,0,0";
|
2015-12-18 07:25:51 +01:00
|
|
|
|
if ((regE || shiftE) && getBoolMapping(device, dcs.control, cState, eState, tp))
|
|
|
|
|
{
|
|
|
|
|
usingExtra = dcs.control;
|
|
|
|
|
string p;
|
|
|
|
|
if (shiftE)
|
|
|
|
|
p = dcs.shiftExtras;
|
|
|
|
|
else
|
|
|
|
|
p = dcs.extras;
|
|
|
|
|
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[device] = true;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (!(extras[0] == extras[1] && extras[1] == 0))
|
|
|
|
|
ctrl.setRumble((byte)extras[0], (byte)extras[1], device);
|
|
|
|
|
if (extras[2] == 1)
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
DS4Color color = new DS4Color { red = (byte)extras[3], green = (byte)extras[4], blue = (byte)extras[5] };
|
|
|
|
|
DS4LightBar.forcedColor[device] = color;
|
|
|
|
|
DS4LightBar.forcedFlash[device] = (byte)extras[6];
|
|
|
|
|
DS4LightBar.forcelight[device] = true;
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
}
|
2015-12-18 07:25:51 +01:00
|
|
|
|
if (extras[7] == 1)
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
if (oldmouse[device] == -1)
|
|
|
|
|
oldmouse[device] = ButtonMouseSensitivity[device];
|
|
|
|
|
ButtonMouseSensitivity[device] = extras[8];
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
}
|
2015-12-18 07:25:51 +01:00
|
|
|
|
}
|
|
|
|
|
catch { }
|
|
|
|
|
}
|
|
|
|
|
else if ((regE || shiftE) && held[device])
|
|
|
|
|
{
|
|
|
|
|
DS4LightBar.forcelight[device] = false;
|
|
|
|
|
DS4LightBar.forcedFlash[device] = 0;
|
|
|
|
|
ButtonMouseSensitivity[device] = oldmouse[device];
|
|
|
|
|
oldmouse[device] = -1;
|
|
|
|
|
ctrl.setRumble(0, 0, device);
|
|
|
|
|
held[device] = false;
|
|
|
|
|
usingExtra = DS4Controls.None;
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2015-12-18 07:25:51 +01:00
|
|
|
|
}
|
|
|
|
|
|
2015-02-08 22:51:52 +01:00
|
|
|
|
if (macroControl[00]) MappedState.Cross = true;
|
2014-11-14 20:44:50 +01:00
|
|
|
|
if (macroControl[01]) MappedState.Circle = true;
|
|
|
|
|
if (macroControl[02]) MappedState.Square = true;
|
|
|
|
|
if (macroControl[03]) MappedState.Triangle = true;
|
|
|
|
|
if (macroControl[04]) MappedState.Options = true;
|
|
|
|
|
if (macroControl[05]) MappedState.Share = true;
|
|
|
|
|
if (macroControl[06]) MappedState.DpadUp = true;
|
2015-04-21 21:00:09 +02:00
|
|
|
|
if (macroControl[07]) MappedState.DpadDown = true;
|
2014-11-14 20:44:50 +01:00
|
|
|
|
if (macroControl[08]) MappedState.DpadLeft = true;
|
|
|
|
|
if (macroControl[09]) MappedState.DpadRight = true;
|
|
|
|
|
if (macroControl[10]) MappedState.PS = true;
|
|
|
|
|
if (macroControl[11]) MappedState.L1 = true;
|
|
|
|
|
if (macroControl[12]) MappedState.R1 = true;
|
|
|
|
|
if (macroControl[13]) MappedState.L2 = 255;
|
|
|
|
|
if (macroControl[14]) MappedState.R2 = 255;
|
2015-04-21 21:00:09 +02:00
|
|
|
|
if (macroControl[15]) MappedState.L3 = true;
|
2014-11-14 20:44:50 +01:00
|
|
|
|
if (macroControl[16]) MappedState.R3 = true;
|
|
|
|
|
if (macroControl[17]) MappedState.LX = 255;
|
|
|
|
|
if (macroControl[18]) MappedState.LX = 0;
|
|
|
|
|
if (macroControl[19]) MappedState.LY = 255;
|
|
|
|
|
if (macroControl[20]) MappedState.LY = 0;
|
|
|
|
|
if (macroControl[21]) MappedState.RX = 255;
|
|
|
|
|
if (macroControl[22]) MappedState.RX = 0;
|
|
|
|
|
if (macroControl[23]) MappedState.RY = 255;
|
|
|
|
|
if (macroControl[24]) MappedState.RY = 0;
|
2017-03-30 15:14:58 +02:00
|
|
|
|
|
2017-03-30 16:07:04 +02:00
|
|
|
|
if (IfAxisIsNotModified(device, ShiftTrigger(GetDS4STrigger(device, DS4Controls.LXNeg), device, cState, eState, tp), DS4Controls.LXNeg))
|
2017-03-30 15:14:58 +02:00
|
|
|
|
tempControlDict.Add(DS4Controls.LXNeg, DS4Controls.LXNeg);
|
2015-12-18 07:25:51 +01:00
|
|
|
|
|
2017-03-30 16:07:04 +02:00
|
|
|
|
if (IfAxisIsNotModified(device, ShiftTrigger(GetDS4STrigger(device, DS4Controls.LXPos), device, cState, eState, tp), DS4Controls.LXPos))
|
2017-03-30 15:14:58 +02:00
|
|
|
|
tempControlDict.Add(DS4Controls.LXPos, DS4Controls.LXPos);
|
2015-12-18 07:25:51 +01:00
|
|
|
|
|
2017-03-30 16:07:04 +02:00
|
|
|
|
if (IfAxisIsNotModified(device, ShiftTrigger(GetDS4STrigger(device, DS4Controls.LYNeg), device, cState, eState, tp), DS4Controls.LYNeg))
|
2017-03-30 15:14:58 +02:00
|
|
|
|
tempControlDict.Add(DS4Controls.LYNeg, DS4Controls.LYNeg);
|
2015-12-18 07:25:51 +01:00
|
|
|
|
|
2017-03-30 16:07:04 +02:00
|
|
|
|
if (IfAxisIsNotModified(device, ShiftTrigger(GetDS4STrigger(device, DS4Controls.LYPos), device, cState, eState, tp), DS4Controls.LYPos))
|
2017-03-30 15:14:58 +02:00
|
|
|
|
tempControlDict.Add(DS4Controls.LYPos, DS4Controls.LYPos);
|
2015-12-18 07:25:51 +01:00
|
|
|
|
|
2017-03-30 16:07:04 +02:00
|
|
|
|
if (IfAxisIsNotModified(device, ShiftTrigger(GetDS4STrigger(device, DS4Controls.RXNeg), device, cState, eState, tp), DS4Controls.RXNeg))
|
2017-03-30 15:14:58 +02:00
|
|
|
|
tempControlDict.Add(DS4Controls.RXNeg, DS4Controls.RXNeg);
|
2015-12-18 07:25:51 +01:00
|
|
|
|
|
2017-03-30 16:07:04 +02:00
|
|
|
|
if (IfAxisIsNotModified(device, ShiftTrigger(GetDS4STrigger(device, DS4Controls.RXPos), device, cState, eState, tp), DS4Controls.RXPos))
|
2017-03-30 15:14:58 +02:00
|
|
|
|
tempControlDict.Add(DS4Controls.RXPos, DS4Controls.RXPos);
|
2015-12-18 07:25:51 +01:00
|
|
|
|
|
2017-03-30 16:07:04 +02:00
|
|
|
|
if (IfAxisIsNotModified(device, ShiftTrigger(GetDS4STrigger(device, DS4Controls.RYNeg), device, cState, eState, tp), DS4Controls.RYNeg))
|
2017-03-30 15:14:58 +02:00
|
|
|
|
tempControlDict.Add(DS4Controls.RYNeg, DS4Controls.RYNeg);
|
2015-12-18 07:25:51 +01:00
|
|
|
|
|
2017-03-30 16:07:04 +02:00
|
|
|
|
if (IfAxisIsNotModified(device, ShiftTrigger(GetDS4STrigger(device, DS4Controls.RYPos), device, cState, eState, tp), DS4Controls.RYPos))
|
2017-03-30 15:14:58 +02:00
|
|
|
|
tempControlDict.Add(DS4Controls.RYPos, DS4Controls.RYPos);
|
2015-12-18 07:25:51 +01:00
|
|
|
|
|
2017-03-30 15:14:58 +02:00
|
|
|
|
foreach (KeyValuePair<DS4Controls, DS4Controls> entry in tempControlDict)
|
|
|
|
|
{
|
|
|
|
|
DS4Controls key = entry.Key;
|
|
|
|
|
DS4Controls dc = entry.Value;
|
|
|
|
|
if (getBoolMapping(device, dc, cState, eState, tp))
|
2015-04-21 21:00:09 +02:00
|
|
|
|
{
|
2017-03-30 15:14:58 +02:00
|
|
|
|
switch (entry.Key)
|
|
|
|
|
{
|
|
|
|
|
case DS4Controls.Cross: MappedState.Cross = true; break;
|
|
|
|
|
case DS4Controls.Circle: MappedState.Circle = true; break;
|
|
|
|
|
case DS4Controls.Square: MappedState.Square = true; break;
|
|
|
|
|
case DS4Controls.Triangle: MappedState.Triangle = true; break;
|
|
|
|
|
case DS4Controls.L1: MappedState.L1 = true; break;
|
|
|
|
|
case DS4Controls.L2: MappedState.L2 = getByteMapping(device, dc, cState, eState, tp); break;
|
|
|
|
|
case DS4Controls.L3: MappedState.L3 = true; break;
|
|
|
|
|
case DS4Controls.R1: MappedState.R1 = true; break;
|
|
|
|
|
case DS4Controls.R2: MappedState.R2 = getByteMapping(device, dc, cState, eState, tp); break;
|
|
|
|
|
case DS4Controls.R3: MappedState.R3 = true; break;
|
|
|
|
|
case DS4Controls.DpadUp: MappedState.DpadUp = true; break;
|
|
|
|
|
case DS4Controls.DpadRight: MappedState.DpadRight = true; break;
|
|
|
|
|
case DS4Controls.DpadLeft: MappedState.DpadLeft = true; break;
|
|
|
|
|
case DS4Controls.DpadDown: MappedState.DpadDown = true; break;
|
|
|
|
|
case DS4Controls.Options: MappedState.Options = true; break;
|
|
|
|
|
case DS4Controls.Share: MappedState.Share = true; break;
|
|
|
|
|
case DS4Controls.PS: MappedState.PS = true; break;
|
|
|
|
|
case DS4Controls.LXNeg:
|
|
|
|
|
case DS4Controls.LXPos:
|
|
|
|
|
{
|
|
|
|
|
if (Math.Abs(MappedState.LX - 127) < 10)
|
|
|
|
|
{
|
|
|
|
|
if (key == DS4Controls.LXNeg)
|
|
|
|
|
{
|
|
|
|
|
if (Math.Abs(127 - getXYAxisMapping(device, dc, cState, eState, tp, true)) > 5)
|
|
|
|
|
MappedState.LX = getXYAxisMapping(device, dc, cState, eState, tp, true);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (Math.Abs(127 - getXYAxisMapping(device, dc, cState, eState, tp)) > 5)
|
|
|
|
|
MappedState.LX = getXYAxisMapping(device, dc, cState, eState, tp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case DS4Controls.LYNeg:
|
|
|
|
|
case DS4Controls.LYPos:
|
|
|
|
|
{
|
|
|
|
|
if (Math.Abs(MappedState.LY - 127) < 10)
|
|
|
|
|
{
|
|
|
|
|
if (key == DS4Controls.LYNeg)
|
|
|
|
|
{
|
|
|
|
|
if (Math.Abs(127 - getXYAxisMapping(device, dc, cState, eState, tp)) > 5)
|
|
|
|
|
MappedState.LY = getXYAxisMapping(device, dc, cState, eState, tp);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (Math.Abs(127 - getXYAxisMapping(device, dc, cState, eState, tp, true)) > 5)
|
|
|
|
|
MappedState.LY = getXYAxisMapping(device, dc, cState, eState, tp, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case DS4Controls.RXNeg:
|
|
|
|
|
case DS4Controls.RXPos:
|
|
|
|
|
{
|
|
|
|
|
if (Math.Abs(MappedState.RX - 127) < 10)
|
|
|
|
|
{
|
|
|
|
|
if (key == DS4Controls.RXNeg)
|
|
|
|
|
{
|
|
|
|
|
if (Math.Abs(127 - getXYAxisMapping(device, dc, cState, eState, tp)) > 5)
|
|
|
|
|
MappedState.RX = getXYAxisMapping(device, dc, cState, eState, tp);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (Math.Abs(127 - getXYAxisMapping(device, dc, cState, eState, tp, true)) > 5)
|
|
|
|
|
MappedState.RX = getXYAxisMapping(device, dc, cState, eState, tp, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case DS4Controls.RYNeg:
|
|
|
|
|
case DS4Controls.RYPos:
|
|
|
|
|
{
|
|
|
|
|
if (Math.Abs(MappedState.RY - 127) < 10)
|
|
|
|
|
{
|
|
|
|
|
if (key == DS4Controls.RYNeg)
|
|
|
|
|
{
|
|
|
|
|
if (Math.Abs(127 - getXYAxisMapping(device, dc, cState, eState, tp)) > 5)
|
|
|
|
|
MappedState.RY = getXYAxisMapping(device, dc, cState, eState, tp);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (Math.Abs(127 - getXYAxisMapping(device, dc, cState, eState, tp, true)) > 5)
|
|
|
|
|
MappedState.RY = getXYAxisMapping(device, dc, cState, eState, tp, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
default: break;
|
|
|
|
|
}
|
2015-04-21 21:00:09 +02:00
|
|
|
|
}
|
2017-03-30 15:14:58 +02:00
|
|
|
|
}
|
|
|
|
|
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
InputMethods.MoveCursorBy(MouseDeltaX, MouseDeltaY);
|
|
|
|
|
}
|
2015-02-12 20:36:40 +01:00
|
|
|
|
|
2015-12-18 07:25:51 +01:00
|
|
|
|
private static bool IfAxisIsNotModified(int device, bool shift, DS4Controls dc)
|
Shift modifier: Hold an action to use another set of controls, if nothing is set to the shifted control, in falls back to the default action
View input of controls in profiles, see exactly when a deadzone is passed and check the input delay for controllers (special thanks to jhebbel), click the on sixaxis panel
Click the Empty text on in the lightbar box to copy the lightbar color from full to empty.
While opened, option to keep the window size after closing the profile's settings
Old profiles are automatically upgraded if it's missing new settings, such as how colors are now saved, sixaxis deadzones, and shift controls
Other UI changes for profile settings, flipped touchpad and other settings boxes
Others:
Fix for when clicking the semicolon in the select an action screen
Fix assigning Sixaxis action to a key
minor UI changes and bug fixes, such as auto resize of the log listview
DS4Updater: Also now works for the new numbering system, can read the version number right from the exe instead of in profiles.xml, UI additions to better notify users of errors, Bug fixes for non-portable users
2014-07-07 21:22:42 +02:00
|
|
|
|
{
|
2017-04-02 02:46:51 +02:00
|
|
|
|
return shift ? false : GetDS4Action(device, dc, false) == null;
|
2015-12-18 07:25:51 +01:00
|
|
|
|
}
|
|
|
|
|
public static async void MapCustomAction(int device, DS4State cState, DS4State MappedState, DS4StateExposed eState, Mouse tp, ControlService ctrl)
|
|
|
|
|
{
|
2017-04-01 07:42:10 +02:00
|
|
|
|
/* TODO: This method is slow sauce. Find ways to speed up action execution */
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
List<string> profileActions = getProfileActions(device);
|
|
|
|
|
foreach (string actionname in profileActions)
|
2014-05-28 04:49:58 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
//DS4KeyType keyType = getShiftCustomKeyType(device, customKey.Key);
|
2017-04-02 02:46:51 +02:00
|
|
|
|
//SpecialAction action = GetAction(actionname);
|
|
|
|
|
//int index = GetActionIndexOf(actionname);
|
|
|
|
|
SpecialAction action = GetProfileAction(device, actionname);
|
|
|
|
|
int index = GetProfileActionIndexOf(device, actionname);
|
2017-04-01 07:42:10 +02:00
|
|
|
|
int actionDoneCount = actionDone.Count;
|
|
|
|
|
if (actionDoneCount < index + 1)
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
actionDone.Add(new ActionState());
|
2017-04-02 09:07:53 +02:00
|
|
|
|
else if (actionDoneCount > GetActions().Count)
|
2017-04-01 07:42:10 +02:00
|
|
|
|
actionDone.RemoveAt(actionDoneCount - 1);
|
|
|
|
|
double time = 0.0;
|
2015-12-18 07:25:51 +01:00
|
|
|
|
//If a key or button is assigned to the trigger, a key special action is used like
|
|
|
|
|
//a quick tap to use and hold to use the regular custom button/key
|
2017-04-02 02:46:51 +02:00
|
|
|
|
bool triggerToBeTapped = action.typeID == SpecialAction.ActionTypeId.None && action.trigger.Count == 1 &&
|
2017-04-01 07:42:10 +02:00
|
|
|
|
GetDS4Action(device, action.trigger[0], false) == null;
|
2017-04-02 09:17:48 +02:00
|
|
|
|
if (!(action.typeID == SpecialAction.ActionTypeId.None || index < 0))
|
2014-05-28 04:49:58 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
bool triggeractivated = true;
|
2017-04-01 07:42:10 +02:00
|
|
|
|
if (action.delayTime > 0.0)
|
2014-05-28 04:49:58 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
triggeractivated = false;
|
|
|
|
|
bool subtriggeractivated = true;
|
|
|
|
|
foreach (DS4Controls dc in action.trigger)
|
2014-10-21 04:31:13 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
if (!getBoolMapping(device, dc, cState, eState, tp))
|
|
|
|
|
{
|
|
|
|
|
subtriggeractivated = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2014-10-21 04:31:13 +02:00
|
|
|
|
}
|
2015-12-18 07:25:51 +01:00
|
|
|
|
if (subtriggeractivated)
|
2014-10-21 04:31:13 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
time = action.delayTime;
|
|
|
|
|
nowAction[device] = DateTime.UtcNow;
|
|
|
|
|
if (nowAction[device] >= oldnowAction[device] + TimeSpan.FromSeconds(time))
|
|
|
|
|
triggeractivated = true;
|
2014-10-21 04:31:13 +02:00
|
|
|
|
}
|
2015-12-18 07:25:51 +01:00
|
|
|
|
else if (nowAction[device] < DateTime.UtcNow - TimeSpan.FromMilliseconds(100))
|
|
|
|
|
oldnowAction[device] = DateTime.UtcNow;
|
|
|
|
|
}
|
|
|
|
|
else if (triggerToBeTapped && oldnowKeyAct[device] == DateTime.MinValue)
|
|
|
|
|
{
|
|
|
|
|
triggeractivated = false;
|
|
|
|
|
bool subtriggeractivated = true;
|
|
|
|
|
foreach (DS4Controls dc in action.trigger)
|
2014-10-21 04:31:13 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
if (!getBoolMapping(device, dc, cState, eState, tp))
|
|
|
|
|
{
|
|
|
|
|
subtriggeractivated = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2014-10-21 04:31:13 +02:00
|
|
|
|
}
|
2015-12-18 07:25:51 +01:00
|
|
|
|
if (subtriggeractivated)
|
2014-10-21 04:31:13 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
oldnowKeyAct[device] = DateTime.UtcNow;
|
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-12-18 07:25:51 +01:00
|
|
|
|
else if (triggerToBeTapped && oldnowKeyAct[device] != DateTime.MinValue)
|
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-12-18 07:25:51 +01:00
|
|
|
|
triggeractivated = false;
|
|
|
|
|
bool subtriggeractivated = true;
|
|
|
|
|
foreach (DS4Controls dc in action.trigger)
|
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-12-18 07:25:51 +01:00
|
|
|
|
if (!getBoolMapping(device, dc, cState, eState, tp))
|
|
|
|
|
{
|
|
|
|
|
subtriggeractivated = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
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-12-18 07:25:51 +01:00
|
|
|
|
DateTime now = DateTime.UtcNow;
|
|
|
|
|
if (!subtriggeractivated && now <= oldnowKeyAct[device] + TimeSpan.FromMilliseconds(250))
|
2014-12-13 21:12:03 +01:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
await Task.Delay(3); //if the button is assigned to the same key use a delay so the key down is the last action, not key up
|
|
|
|
|
triggeractivated = true;
|
|
|
|
|
oldnowKeyAct[device] = DateTime.MinValue;
|
2014-12-13 21:12:03 +01:00
|
|
|
|
}
|
2015-12-18 07:25:51 +01:00
|
|
|
|
else if (!subtriggeractivated)
|
|
|
|
|
oldnowKeyAct[device] = DateTime.MinValue;
|
2014-12-13 21:12:03 +01:00
|
|
|
|
}
|
2015-12-18 07:25:51 +01:00
|
|
|
|
else
|
|
|
|
|
foreach (DS4Controls dc in action.trigger)
|
2014-12-13 21:12:03 +01:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
if (!getBoolMapping(device, dc, cState, eState, tp))
|
|
|
|
|
{
|
|
|
|
|
triggeractivated = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2014-12-13 21:12:03 +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-12-18 07:25:51 +01:00
|
|
|
|
bool utriggeractivated = true;
|
2017-04-01 07:42:10 +02:00
|
|
|
|
int uTriggerCount = action.uTrigger.Count;
|
2017-04-02 02:46:51 +02:00
|
|
|
|
if (action.typeID == SpecialAction.ActionTypeId.Key && uTriggerCount > 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
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
foreach (DS4Controls dc in action.uTrigger)
|
2014-12-13 21:12:03 +01:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
if (!getBoolMapping(device, dc, cState, eState, tp))
|
|
|
|
|
{
|
|
|
|
|
utriggeractivated = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
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-12-18 07:25:51 +01:00
|
|
|
|
if (action.pressRelease) utriggeractivated = !utriggeractivated;
|
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
|
|
|
|
}
|
|
|
|
|
|
2017-04-02 02:46:51 +02:00
|
|
|
|
if (triggeractivated && action.typeID == SpecialAction.ActionTypeId.Program)
|
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.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
if (!actionDone[index].dev[device])
|
2015-12-18 07:25:51 +01:00
|
|
|
|
{
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
actionDone[index].dev[device] = true;
|
2015-12-18 07:25:51 +01:00
|
|
|
|
if (!string.IsNullOrEmpty(action.extra))
|
|
|
|
|
Process.Start(action.details, action.extra);
|
|
|
|
|
else
|
|
|
|
|
Process.Start(action.details);
|
|
|
|
|
}
|
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
|
|
|
|
}
|
2017-04-02 02:46:51 +02:00
|
|
|
|
else if (triggeractivated && action.typeID == SpecialAction.ActionTypeId.Profile)
|
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
|
|
|
|
{
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
if (!actionDone[index].dev[device] && string.IsNullOrEmpty(tempprofilename[device]))
|
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.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
actionDone[index].dev[device] = true;
|
2015-12-18 07:25:51 +01:00
|
|
|
|
untriggeraction[device] = action;
|
|
|
|
|
untriggerindex[device] = index;
|
|
|
|
|
foreach (DS4Controls dc in action.trigger)
|
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
|
|
|
|
{
|
2017-03-30 16:07:04 +02:00
|
|
|
|
DS4ControlSettings dcs = getDS4CSetting(device, dc);
|
2015-12-18 07:25:51 +01:00
|
|
|
|
if (dcs.action != null)
|
|
|
|
|
{
|
|
|
|
|
if (dcs.actionType == DS4ControlSettings.ActionType.Key)
|
2017-03-27 14:39:40 +02:00
|
|
|
|
InputMethods.performKeyRelease(ushort.Parse(dcs.action.ToString()));
|
2015-12-18 07:25:51 +01:00
|
|
|
|
else if (dcs.actionType == DS4ControlSettings.ActionType.Macro)
|
|
|
|
|
{
|
|
|
|
|
int[] keys = (int[])dcs.action;
|
2017-04-01 07:42:10 +02:00
|
|
|
|
for (int i = 0, keysLen = keys.Length; i < keysLen; i++)
|
2015-12-18 07:25:51 +01:00
|
|
|
|
InputMethods.performKeyRelease((ushort)keys[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
|
|
|
|
}
|
2015-12-18 07:25:51 +01:00
|
|
|
|
LoadTempProfile(device, action.details, true, ctrl);
|
|
|
|
|
return;
|
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
|
|
|
|
}
|
|
|
|
|
}
|
2017-04-02 02:46:51 +02:00
|
|
|
|
else if (triggeractivated && action.typeID == SpecialAction.ActionTypeId.Macro)
|
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.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
if (!actionDone[index].dev[device])
|
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-12-18 07:25:51 +01:00
|
|
|
|
DS4KeyType keyType = action.keyType;
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
actionDone[index].dev[device] = true;
|
2015-12-18 07:25:51 +01:00
|
|
|
|
foreach (DS4Controls dc in action.trigger)
|
|
|
|
|
resetToDefaultValue(dc, MappedState);
|
|
|
|
|
PlayMacro(device, macroControl, String.Join("/", action.macro), DS4Controls.None, keyType);
|
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
2015-12-18 07:25:51 +01:00
|
|
|
|
EndMacro(device, macroControl, String.Join("/", action.macro), DS4Controls.None);
|
2014-12-13 21:12:03 +01:00
|
|
|
|
}
|
2017-04-02 02:46:51 +02:00
|
|
|
|
else if (triggeractivated && action.typeID == SpecialAction.ActionTypeId.Key)
|
2014-12-13 21:12:03 +01:00
|
|
|
|
{
|
2017-04-01 07:42:10 +02:00
|
|
|
|
if (uTriggerCount == 0 || (uTriggerCount > 0 && untriggerindex[device] == -1 && !actionDone[index].dev[device]))
|
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.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
actionDone[index].dev[device] = true;
|
2015-12-18 07:25:51 +01:00
|
|
|
|
untriggerindex[device] = index;
|
|
|
|
|
ushort key;
|
|
|
|
|
ushort.TryParse(action.details, out key);
|
2017-04-01 07:42:10 +02:00
|
|
|
|
if (uTriggerCount == 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
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
SyntheticState.KeyPresses kp;
|
|
|
|
|
if (!deviceState[device].keyPresses.TryGetValue(key, out kp))
|
|
|
|
|
deviceState[device].keyPresses[key] = kp = new SyntheticState.KeyPresses();
|
|
|
|
|
if (action.keyType.HasFlag(DS4KeyType.ScanCode))
|
|
|
|
|
kp.current.scanCodeCount++;
|
|
|
|
|
else
|
|
|
|
|
kp.current.vkCount++;
|
|
|
|
|
kp.current.repeatCount++;
|
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-12-18 07:25:51 +01:00
|
|
|
|
else if (action.keyType.HasFlag(DS4KeyType.ScanCode))
|
|
|
|
|
InputMethods.performSCKeyPress(key);
|
|
|
|
|
else
|
|
|
|
|
InputMethods.performKeyPress(key);
|
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
|
|
|
|
}
|
|
|
|
|
}
|
2017-04-02 02:46:51 +02:00
|
|
|
|
else if (uTriggerCount > 0 && utriggeractivated && action.typeID == SpecialAction.ActionTypeId.Key)
|
2015-02-12 20:36:40 +01:00
|
|
|
|
{
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
if (untriggerindex[device] > -1 && !actionDone[index].dev[device])
|
2015-12-18 07:25:51 +01:00
|
|
|
|
{
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
actionDone[index].dev[device] = true;
|
2015-12-18 07:25:51 +01:00
|
|
|
|
untriggerindex[device] = -1;
|
|
|
|
|
ushort key;
|
|
|
|
|
ushort.TryParse(action.details, out key);
|
|
|
|
|
if (action.keyType.HasFlag(DS4KeyType.ScanCode))
|
|
|
|
|
InputMethods.performSCKeyRelease(key);
|
|
|
|
|
else
|
|
|
|
|
InputMethods.performKeyRelease(key);
|
|
|
|
|
}
|
2015-02-12 20:36:40 +01:00
|
|
|
|
}
|
2017-04-02 02:46:51 +02:00
|
|
|
|
else if (triggeractivated && action.typeID == SpecialAction.ActionTypeId.DisconnectBT)
|
2015-02-12 20:36:40 +01:00
|
|
|
|
{
|
|
|
|
|
DS4Device d = ctrl.DS4Controllers[device];
|
2015-12-18 07:25:51 +01:00
|
|
|
|
if (!d.Charging)
|
2015-02-12 20:36:40 +01:00
|
|
|
|
{
|
2017-04-06 10:19:12 +02:00
|
|
|
|
ConnectionType deviceConn = d.ConnectionType;
|
|
|
|
|
if (deviceConn == ConnectionType.BT)
|
|
|
|
|
{
|
|
|
|
|
d.DisconnectBT();
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-18 07:25:51 +01:00
|
|
|
|
foreach (DS4Controls dc in action.trigger)
|
|
|
|
|
{
|
2017-03-30 16:07:04 +02:00
|
|
|
|
DS4ControlSettings dcs = getDS4CSetting(device, dc);
|
2015-12-18 07:25:51 +01:00
|
|
|
|
if (dcs.action != null)
|
|
|
|
|
{
|
|
|
|
|
if (dcs.actionType == DS4ControlSettings.ActionType.Key)
|
|
|
|
|
InputMethods.performKeyRelease((ushort)dcs.action);
|
|
|
|
|
else if (dcs.actionType == DS4ControlSettings.ActionType.Macro)
|
|
|
|
|
{
|
|
|
|
|
int[] keys = (int[])dcs.action;
|
|
|
|
|
for (int i = 0; i < keys.Length; i++)
|
|
|
|
|
InputMethods.performKeyRelease((ushort)keys[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return;
|
2015-02-12 20:36:40 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-04-02 02:46:51 +02:00
|
|
|
|
else if (triggeractivated && action.typeID == SpecialAction.ActionTypeId.BatteryCheck)
|
2015-02-12 20:36:40 +01:00
|
|
|
|
{
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
string[] dets = action.details.Split('|');
|
|
|
|
|
if (dets.Length == 1)
|
|
|
|
|
dets = action.details.Split(',');
|
|
|
|
|
if (bool.Parse(dets[1]) && !actionDone[index].dev[device])
|
2015-02-12 20:36:40 +01:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
Log.LogToTray("Controller " + (device + 1) + ": " +
|
|
|
|
|
ctrl.getDS4Battery(device), true);
|
2015-02-12 20:36:40 +01:00
|
|
|
|
}
|
2015-12-18 07:25:51 +01:00
|
|
|
|
if (bool.Parse(dets[2]))
|
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
DS4Device d = ctrl.DS4Controllers[device];
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
if (!actionDone[index].dev[device])
|
2015-12-18 07:25:51 +01:00
|
|
|
|
{
|
|
|
|
|
lastColor[device] = d.LightBarColor;
|
|
|
|
|
DS4LightBar.forcelight[device] = true;
|
|
|
|
|
}
|
|
|
|
|
DS4Color empty = new DS4Color(byte.Parse(dets[3]), byte.Parse(dets[4]), byte.Parse(dets[5]));
|
|
|
|
|
DS4Color full = new DS4Color(byte.Parse(dets[6]), byte.Parse(dets[7]), byte.Parse(dets[8]));
|
|
|
|
|
DS4Color trans = getTransitionedColor(empty, full, d.Battery);
|
|
|
|
|
if (fadetimer[device] < 100)
|
|
|
|
|
DS4LightBar.forcedColor[device] = getTransitionedColor(lastColor[device], trans, fadetimer[device] += 2);
|
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
|
|
|
|
}
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
actionDone[index].dev[device] = 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
|
|
|
|
}
|
2017-04-02 02:46:51 +02:00
|
|
|
|
else if (!triggeractivated && action.typeID == SpecialAction.ActionTypeId.BatteryCheck)
|
2015-12-18 07:25:51 +01:00
|
|
|
|
{
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
if (actionDone[index].dev[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
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
fadetimer[device] = 0;
|
|
|
|
|
/*if (prevFadetimer[device] == fadetimer[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
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
prevFadetimer[device] = 0;
|
|
|
|
|
fadetimer[device] = 0;
|
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
|
|
|
|
}
|
2015-12-18 07:25:51 +01:00
|
|
|
|
else
|
|
|
|
|
prevFadetimer[device] = fadetimer[device];*/
|
|
|
|
|
DS4LightBar.forcelight[device] = false;
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
actionDone[index].dev[device] = false;
|
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
|
|
|
|
}
|
|
|
|
|
}
|
2017-04-02 02:46:51 +02:00
|
|
|
|
else if (action.typeID == SpecialAction.ActionTypeId.XboxGameDVR || action.typeID == SpecialAction.ActionTypeId.MultiAction)
|
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
/*if (getCustomButton(device, action.trigger[0]) != X360Controls.Unbound)
|
|
|
|
|
getCustomButtons(device)[action.trigger[0]] = X360Controls.Unbound;
|
|
|
|
|
if (getCustomMacro(device, action.trigger[0]) != "0")
|
|
|
|
|
getCustomMacros(device).Remove(action.trigger[0]);
|
|
|
|
|
if (getCustomKey(device, action.trigger[0]) != 0)
|
|
|
|
|
getCustomMacros(device).Remove(action.trigger[0]);*/
|
|
|
|
|
string[] dets = action.details.Split(',');
|
|
|
|
|
DS4Device d = ctrl.DS4Controllers[device];
|
|
|
|
|
//cus
|
|
|
|
|
if (getBoolMapping(device, action.trigger[0], cState, eState, tp) && !getBoolMapping(device, action.trigger[0], d.getPreviousState(), eState, tp))
|
|
|
|
|
{//pressed down
|
|
|
|
|
pastTime = DateTime.UtcNow;
|
|
|
|
|
if (DateTime.UtcNow <= (firstTap + TimeSpan.FromMilliseconds(150)))
|
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
tappedOnce = false;
|
|
|
|
|
secondtouchbegin = 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
|
|
|
|
}
|
2015-12-18 07:25:51 +01:00
|
|
|
|
else
|
|
|
|
|
firstTouch = 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
|
|
|
|
}
|
2015-12-18 07:25:51 +01:00
|
|
|
|
else if (!getBoolMapping(device, action.trigger[0], cState, eState, tp) && getBoolMapping(device, action.trigger[0], d.getPreviousState(), eState, tp))
|
|
|
|
|
{//released
|
|
|
|
|
if (secondtouchbegin)
|
|
|
|
|
{
|
|
|
|
|
firstTouch = false;
|
|
|
|
|
secondtouchbegin = false;
|
|
|
|
|
}
|
|
|
|
|
else if (firstTouch)
|
|
|
|
|
{
|
|
|
|
|
firstTouch = false;
|
|
|
|
|
if (DateTime.UtcNow <= (pastTime + TimeSpan.FromMilliseconds(200)) && !tappedOnce)
|
|
|
|
|
{
|
|
|
|
|
tappedOnce = true;
|
|
|
|
|
firstTap = DateTime.UtcNow;
|
|
|
|
|
TimeofEnd = DateTime.UtcNow;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int type = 0;
|
|
|
|
|
string macro = "";
|
|
|
|
|
if (tappedOnce) //single tap
|
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
|
|
|
|
{
|
2017-04-02 02:46:51 +02:00
|
|
|
|
if (action.typeID == SpecialAction.ActionTypeId.MultiAction)
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
{
|
|
|
|
|
macro = dets[0];
|
|
|
|
|
}
|
|
|
|
|
else if (int.TryParse(dets[0], out type))
|
2015-12-18 07:25:51 +01:00
|
|
|
|
{
|
|
|
|
|
switch (type)
|
|
|
|
|
{
|
|
|
|
|
case 0: macro = "91/71/71/91"; break;
|
|
|
|
|
case 1: macro = "91/164/82/82/164/91"; break;
|
|
|
|
|
case 2: macro = "91/164/44/44/164/91"; break;
|
|
|
|
|
case 3: macro = dets[3] + "/" + dets[3]; break;
|
|
|
|
|
case 4: macro = "91/164/71/71/164/91"; break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ((DateTime.UtcNow - TimeofEnd) > TimeSpan.FromMilliseconds(150))
|
|
|
|
|
{
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
if (macro != "")
|
|
|
|
|
PlayMacro(device, macroControl, macro, DS4Controls.None, DS4KeyType.None);
|
2015-12-18 07:25:51 +01:00
|
|
|
|
tappedOnce = false;
|
|
|
|
|
}
|
|
|
|
|
//if it fails the method resets, and tries again with a new tester value (gives tap a delay so tap and hold can work)
|
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
|
|
|
|
}
|
2015-12-18 07:25:51 +01:00
|
|
|
|
else if (firstTouch && (DateTime.UtcNow - pastTime) > TimeSpan.FromMilliseconds(1000)) //helddown
|
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
|
|
|
|
{
|
2017-04-02 02:46:51 +02:00
|
|
|
|
if (action.typeID == SpecialAction.ActionTypeId.MultiAction)
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
{
|
|
|
|
|
macro = dets[1];
|
|
|
|
|
}
|
|
|
|
|
else if (int.TryParse(dets[1], out type))
|
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
switch (type)
|
|
|
|
|
{
|
|
|
|
|
case 0: macro = "91/71/71/91"; break;
|
|
|
|
|
case 1: macro = "91/164/82/82/164/91"; break;
|
|
|
|
|
case 2: macro = "91/164/44/44/164/91"; break;
|
|
|
|
|
case 3: macro = dets[3] + "/" + dets[3]; break;
|
|
|
|
|
case 4: macro = "91/164/71/71/164/91"; break;
|
|
|
|
|
}
|
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
|
|
|
|
}
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
if (macro != "")
|
|
|
|
|
PlayMacro(device, macroControl, macro, DS4Controls.None, DS4KeyType.None);
|
2015-12-18 07:25:51 +01:00
|
|
|
|
firstTouch = false;
|
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
|
|
|
|
}
|
2015-12-18 07:25:51 +01:00
|
|
|
|
else if (secondtouchbegin) //if double tap
|
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
|
|
|
|
{
|
2017-04-02 02:46:51 +02:00
|
|
|
|
if (action.typeID == SpecialAction.ActionTypeId.MultiAction)
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
{
|
|
|
|
|
macro = dets[2];
|
|
|
|
|
}
|
|
|
|
|
else if (int.TryParse(dets[2], out type))
|
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
switch (type)
|
|
|
|
|
{
|
|
|
|
|
case 0: macro = "91/71/71/91"; break;
|
|
|
|
|
case 1: macro = "91/164/82/82/164/91"; break;
|
|
|
|
|
case 2: macro = "91/164/44/44/164/91"; break;
|
|
|
|
|
case 3: macro = dets[3] + "/" + dets[3]; break;
|
|
|
|
|
case 4: macro = "91/164/71/71/164/91"; break;
|
|
|
|
|
}
|
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
|
|
|
|
}
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
if (macro != "")
|
|
|
|
|
PlayMacro(device, macroControl, macro, DS4Controls.None, DS4KeyType.None);
|
2015-12-18 07:25:51 +01:00
|
|
|
|
secondtouchbegin = false;
|
Version 1.4.266
Flash Lightbar when at high latency now has the option to choose what
you decide is high latency
Show Notifications now has the option to only show warnings, such as
when a controller cannot be grabbed exclusively
Speaking of bad news for Windows 10 users: Hide DS4 has now been
disabled, until i can figure out why this is, it will be disabled, this
means some games that rely on this may not work properly or at all,
sorry about that
As for good news for Windows 10, did you know you can press Windows + G
to open a game bar which can record games. For Windows 10 users, there's
a new special action: Xbox Game DVR. Pick a trigger (only one button)
and tapping/holding/or double tapping does various things, such as
start/stop recording, save an ongoing recording, take a screenshot (via
the xbox app's option or your own hotkey ie form steam), or just open
the gamebar
Much of the code has been updated with c# 6.0
Added manifest so DS4Windows can notice Windows 10 and high DPIs, also
reorganized files
2015-07-31 05:34:22 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2015-12-18 07:25:51 +01:00
|
|
|
|
else
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
actionDone[index].dev[device] = false;
|
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
|
|
|
|
}
|
2014-12-13 21:12:03 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2015-12-18 07:25:51 +01:00
|
|
|
|
catch { return; }
|
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-12-13 21:12:03 +01:00
|
|
|
|
if (untriggeraction[device] != null)
|
|
|
|
|
{
|
|
|
|
|
SpecialAction action = untriggeraction[device];
|
|
|
|
|
int index = untriggerindex[device];
|
|
|
|
|
bool utriggeractivated = true;
|
|
|
|
|
foreach (DS4Controls dc in action.uTrigger)
|
|
|
|
|
{
|
2015-11-28 06:47:26 +01:00
|
|
|
|
if (!getBoolMapping(device, dc, cState, eState, tp))
|
2014-12-13 21:12:03 +01:00
|
|
|
|
{
|
|
|
|
|
utriggeractivated = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-02 02:46:51 +02:00
|
|
|
|
if (utriggeractivated && action.typeID == SpecialAction.ActionTypeId.Profile)
|
2014-12-13 21:12:03 +01:00
|
|
|
|
{
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
if ((action.controls == action.ucontrols && !actionDone[index].dev[device]) || //if trigger and end trigger are the same
|
2014-12-13 21:12:03 +01:00
|
|
|
|
action.controls != action.ucontrols)
|
2015-12-05 09:55:11 +01:00
|
|
|
|
if (!string.IsNullOrEmpty(tempprofilename[device]))
|
2014-12-13 21:12:03 +01:00
|
|
|
|
{
|
|
|
|
|
foreach (DS4Controls dc in action.uTrigger)
|
|
|
|
|
{
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
actionDone[index].dev[device] = true;
|
2017-03-30 16:07:04 +02:00
|
|
|
|
DS4ControlSettings dcs = getDS4CSetting(device, dc);
|
2015-12-18 07:25:51 +01:00
|
|
|
|
if (dcs.action != null)
|
2014-12-13 21:12:03 +01:00
|
|
|
|
{
|
2015-12-18 07:25:51 +01:00
|
|
|
|
if (dcs.actionType == DS4ControlSettings.ActionType.Key)
|
|
|
|
|
InputMethods.performKeyRelease((ushort)dcs.action);
|
|
|
|
|
else if (dcs.actionType == DS4ControlSettings.ActionType.Macro)
|
|
|
|
|
{
|
|
|
|
|
int[] keys = (int[])dcs.action;
|
|
|
|
|
for (int i = 0; i < keys.Length; i++)
|
|
|
|
|
InputMethods.performKeyRelease((ushort)keys[i]);
|
|
|
|
|
}
|
2014-12-13 21:12:03 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
untriggeraction[device] = null;
|
2015-12-05 09:55:11 +01:00
|
|
|
|
LoadProfile(device, false, ctrl);
|
2014-12-13 21:12:03 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
Version 1.4.5
Added support for the New DS4 USB Adapater (Thanks to boganhobo and
Chamilsaan)
Implemented teokp's amazing fix for hide ds4 not working on the
anniversary update of Windows 10: when a controller fails to enter
exclusive mode, DS4Windows will ask for admin privilages to fix the
issue.
Now (near)unlimited Special Actions can be made from the previous limit
of 50
Special Action Xbox Game DVR is now no longer limited to Windows 10,
renamed multi action button: Assign a macro to single tap, double tap,
and holding down a button
Added option for White DS4Windows Icon in the notification tray (While
not merged from, thanks to tehmantra)
Added option to temporarily turn off DS4Windows when using a certain
program (togglable in the Auto Profiles Tab) (Same case as above but
thanks to dedChar to bring to light)
Fixed Options crashes in certain locales where decimal points are
repesented with commas, such as German (Thanks to kiliansch)
Added/Updated translations for many languauges, now including Japanese,
Slovenian, Hungarian, Greek, Finnish, Czech, Indonesian, and Ukrainian
2016-09-22 03:38:38 +02:00
|
|
|
|
actionDone[index].dev[device] = false;
|
2014-12-13 21:12:03 +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-12 20:36:40 +01:00
|
|
|
|
private static async void PlayMacro(int device, bool[] macrocontrol, string macro, DS4Controls control, DS4KeyType keyType)
|
|
|
|
|
{
|
|
|
|
|
if (macro.StartsWith("164/9/9/164") || macro.StartsWith("18/9/9/18"))
|
|
|
|
|
{
|
|
|
|
|
string[] skeys;
|
|
|
|
|
int wait = 1000;
|
|
|
|
|
if (!string.IsNullOrEmpty(macro))
|
|
|
|
|
{
|
|
|
|
|
skeys = macro.Split('/');
|
|
|
|
|
ushort delay;
|
|
|
|
|
if (ushort.TryParse(skeys[skeys.Length - 1], out delay) && delay > 300)
|
|
|
|
|
wait = delay - 300;
|
|
|
|
|
}
|
|
|
|
|
AltTabSwapping(wait, device);
|
|
|
|
|
if (control != DS4Controls.None)
|
|
|
|
|
macrodone[DS4ControltoInt(control)] = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
string[] skeys;
|
|
|
|
|
int[] keys;
|
|
|
|
|
if (!string.IsNullOrEmpty(macro))
|
|
|
|
|
{
|
|
|
|
|
skeys = macro.Split('/');
|
|
|
|
|
keys = new int[skeys.Length];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
skeys = new string[0];
|
|
|
|
|
keys = new int[0];
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < keys.Length; i++)
|
2015-08-13 05:53:43 +02:00
|
|
|
|
keys[i] = int.Parse(skeys[i]);
|
2015-02-12 20:36:40 +01:00
|
|
|
|
bool[] keydown = new bool[286];
|
|
|
|
|
if (control == DS4Controls.None || !macrodone[DS4ControltoInt(control)])
|
|
|
|
|
{
|
|
|
|
|
if (control != DS4Controls.None)
|
|
|
|
|
macrodone[DS4ControltoInt(control)] = true;
|
|
|
|
|
foreach (int i in keys)
|
|
|
|
|
{
|
2015-08-13 05:53:43 +02:00
|
|
|
|
if (i >= 1000000000)
|
|
|
|
|
{
|
|
|
|
|
string lb = i.ToString().Substring(1);
|
|
|
|
|
if (i > 1000000000)
|
|
|
|
|
{
|
|
|
|
|
byte r = (byte)(int.Parse(lb[0].ToString()) * 100 + int.Parse(lb[1].ToString()) * 10 + int.Parse(lb[2].ToString()));
|
|
|
|
|
byte g = (byte)(int.Parse(lb[3].ToString()) * 100 + int.Parse(lb[4].ToString()) * 10 + int.Parse(lb[5].ToString()));
|
|
|
|
|
byte b = (byte)(int.Parse(lb[6].ToString()) * 100 + int.Parse(lb[7].ToString()) * 10 + int.Parse(lb[8].ToString()));
|
|
|
|
|
DS4LightBar.forcelight[device] = true;
|
|
|
|
|
DS4LightBar.forcedFlash[device] = 0;
|
|
|
|
|
DS4LightBar.forcedColor[device] = new DS4Color(r, g, b);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
DS4LightBar.forcedFlash[device] = 0;
|
|
|
|
|
DS4LightBar.forcelight[device] = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (i >= 1000000)
|
|
|
|
|
{
|
|
|
|
|
DS4Device d = Program.rootHub.DS4Controllers[device];
|
|
|
|
|
string r = i.ToString().Substring(1);
|
|
|
|
|
byte heavy = (byte)(int.Parse(r[0].ToString()) * 100 + int.Parse(r[1].ToString()) * 10 + int.Parse(r[2].ToString()));
|
|
|
|
|
byte light = (byte)(int.Parse(r[3].ToString()) * 100 + int.Parse(r[4].ToString()) * 10 + int.Parse(r[5].ToString()));
|
|
|
|
|
d.setRumble(light, heavy);
|
|
|
|
|
}
|
|
|
|
|
else if (i >= 300) //ints over 300 used to delay
|
2015-02-12 20:36:40 +01:00
|
|
|
|
await Task.Delay(i - 300);
|
|
|
|
|
else if (!keydown[i])
|
|
|
|
|
{
|
|
|
|
|
if (i == 256) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_LEFTDOWN); //anything above 255 is not a keyvalue
|
|
|
|
|
else if (i == 257) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_RIGHTDOWN);
|
|
|
|
|
else if (i == 258) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_MIDDLEDOWN);
|
|
|
|
|
else if (i == 259) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_XBUTTONDOWN, 1);
|
|
|
|
|
else if (i == 260) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_XBUTTONDOWN, 2);
|
|
|
|
|
else if (i == 261) macroControl[0] = true;
|
|
|
|
|
else if (i == 262) macroControl[1] = true;
|
|
|
|
|
else if (i == 263) macroControl[2] = true;
|
|
|
|
|
else if (i == 264) macroControl[3] = true;
|
|
|
|
|
else if (i == 265) macroControl[4] = true;
|
|
|
|
|
else if (i == 266) macroControl[5] = true;
|
|
|
|
|
else if (i == 267) macroControl[6] = true;
|
|
|
|
|
else if (i == 268) macroControl[7] = true;
|
|
|
|
|
else if (i == 269) macroControl[8] = true;
|
|
|
|
|
else if (i == 270) macroControl[9] = true;
|
|
|
|
|
else if (i == 271) macroControl[10] = true;
|
|
|
|
|
else if (i == 272) macroControl[11] = true;
|
|
|
|
|
else if (i == 273) macroControl[12] = true;
|
|
|
|
|
else if (i == 274) macroControl[13] = true;
|
|
|
|
|
else if (i == 275) macroControl[14] = true;
|
|
|
|
|
else if (i == 276) macroControl[15] = true;
|
|
|
|
|
else if (i == 277) macroControl[16] = true;
|
|
|
|
|
else if (i == 278) macroControl[17] = true;
|
|
|
|
|
else if (i == 279) macroControl[18] = true;
|
|
|
|
|
else if (i == 280) macroControl[19] = true;
|
|
|
|
|
else if (i == 281) macroControl[20] = true;
|
|
|
|
|
else if (i == 282) macroControl[21] = true;
|
|
|
|
|
else if (i == 283) macroControl[22] = true;
|
|
|
|
|
else if (i == 284) macroControl[23] = true;
|
|
|
|
|
else if (i == 285) macroControl[24] = true;
|
|
|
|
|
else if (keyType.HasFlag(DS4KeyType.ScanCode))
|
|
|
|
|
InputMethods.performSCKeyPress((ushort)i);
|
|
|
|
|
else
|
|
|
|
|
InputMethods.performKeyPress((ushort)i);
|
|
|
|
|
keydown[i] = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (i == 256) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_LEFTUP); //anything above 255 is not a keyvalue
|
|
|
|
|
else if (i == 257) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_RIGHTUP);
|
|
|
|
|
else if (i == 258) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_MIDDLEUP);
|
|
|
|
|
else if (i == 259) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_XBUTTONUP, 1);
|
|
|
|
|
else if (i == 260) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_XBUTTONUP, 2);
|
|
|
|
|
else if (i == 261) macroControl[0] = false;
|
|
|
|
|
else if (i == 262) macroControl[1] = false;
|
|
|
|
|
else if (i == 263) macroControl[2] = false;
|
|
|
|
|
else if (i == 264) macroControl[3] = false;
|
|
|
|
|
else if (i == 265) macroControl[4] = false;
|
|
|
|
|
else if (i == 266) macroControl[5] = false;
|
|
|
|
|
else if (i == 267) macroControl[6] = false;
|
|
|
|
|
else if (i == 268) macroControl[7] = false;
|
|
|
|
|
else if (i == 269) macroControl[8] = false;
|
|
|
|
|
else if (i == 270) macroControl[9] = false;
|
|
|
|
|
else if (i == 271) macroControl[10] = false;
|
|
|
|
|
else if (i == 272) macroControl[11] = false;
|
|
|
|
|
else if (i == 273) macroControl[12] = false;
|
|
|
|
|
else if (i == 274) macroControl[13] = false;
|
|
|
|
|
else if (i == 275) macroControl[14] = false;
|
|
|
|
|
else if (i == 276) macroControl[15] = false;
|
|
|
|
|
else if (i == 277) macroControl[16] = false;
|
|
|
|
|
else if (i == 278) macroControl[17] = false;
|
|
|
|
|
else if (i == 279) macroControl[18] = false;
|
|
|
|
|
else if (i == 280) macroControl[19] = false;
|
|
|
|
|
else if (i == 281) macroControl[20] = false;
|
|
|
|
|
else if (i == 282) macroControl[21] = false;
|
|
|
|
|
else if (i == 283) macroControl[22] = false;
|
|
|
|
|
else if (i == 284) macroControl[23] = false;
|
|
|
|
|
else if (i == 285) macroControl[24] = false;
|
|
|
|
|
else if (keyType.HasFlag(DS4KeyType.ScanCode))
|
|
|
|
|
InputMethods.performSCKeyRelease((ushort)i);
|
|
|
|
|
else
|
|
|
|
|
InputMethods.performKeyRelease((ushort)i);
|
|
|
|
|
keydown[i] = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-03-29 16:26:07 +02:00
|
|
|
|
for (int i = 0, arlength = keydown.Length; i < arlength; i++)
|
2015-02-12 20:36:40 +01:00
|
|
|
|
{
|
|
|
|
|
if (keydown[i])
|
|
|
|
|
if (i == 256) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_LEFTUP); //anything above 255 is not a keyvalue
|
|
|
|
|
else if (i == 257) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_RIGHTUP);
|
|
|
|
|
else if (i == 258) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_MIDDLEUP);
|
|
|
|
|
else if (i == 259) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_XBUTTONUP, 1);
|
|
|
|
|
else if (i == 260) InputMethods.MouseEvent(InputMethods.MOUSEEVENTF_XBUTTONUP, 2);
|
|
|
|
|
else if (i == 261) macroControl[0] = false;
|
|
|
|
|
else if (i == 262) macroControl[1] = false;
|
|
|
|
|
else if (i == 263) macroControl[2] = false;
|
|
|
|
|
else if (i == 264) macroControl[3] = false;
|
|
|
|
|
else if (i == 265) macroControl[4] = false;
|
|
|
|
|
else if (i == 266) macroControl[5] = false;
|
|
|
|
|
else if (i == 267) macroControl[6] = false;
|
|
|
|
|
else if (i == 268) macroControl[7] = false;
|
|
|
|
|
else if (i == 269) macroControl[8] = false;
|
|
|
|
|
else if (i == 270) macroControl[9] = false;
|
|
|
|
|
else if (i == 271) macroControl[10] = false;
|
|
|
|
|
else if (i == 272) macroControl[11] = false;
|
|
|
|
|
else if (i == 273) macroControl[12] = false;
|
|
|
|
|
else if (i == 274) macroControl[13] = false;
|
|
|
|
|
else if (i == 275) macroControl[14] = false;
|
|
|
|
|
else if (i == 276) macroControl[15] = false;
|
|
|
|
|
else if (i == 277) macroControl[16] = false;
|
2015-03-15 19:16:01 +01:00
|
|
|
|
else if (i == 278) macroControl[17] = false;
|
|
|
|
|
else if (i == 279) macroControl[18] = false;
|
|
|
|
|
else if (i == 280) macroControl[19] = false;
|
|
|
|
|
else if (i == 281) macroControl[20] = false;
|
|
|
|
|
else if (i == 282) macroControl[21] = false;
|
|
|
|
|
else if (i == 283) macroControl[22] = false;
|
|
|
|
|
else if (i == 284) macroControl[23] = false;
|
|
|
|
|
else if (i == 285) macroControl[24] = false;
|
2015-02-12 20:36:40 +01:00
|
|
|
|
else if (keyType.HasFlag(DS4KeyType.ScanCode))
|
2017-03-29 16:26:07 +02:00
|
|
|
|
InputMethods.performSCKeyRelease((ushort)i);
|
2015-02-12 20:36:40 +01:00
|
|
|
|
else
|
2017-03-29 16:26:07 +02:00
|
|
|
|
InputMethods.performKeyRelease((ushort)i);
|
2015-02-12 20:36:40 +01:00
|
|
|
|
}
|
2015-08-13 05:53:43 +02:00
|
|
|
|
DS4LightBar.forcedFlash[device] = 0;
|
|
|
|
|
DS4LightBar.forcelight[device] = false;
|
|
|
|
|
Program.rootHub.DS4Controllers[device].setRumble(0, 0);
|
2015-02-12 20:36:40 +01:00
|
|
|
|
if (keyType.HasFlag(DS4KeyType.HoldMacro))
|
|
|
|
|
{
|
|
|
|
|
await Task.Delay(50);
|
|
|
|
|
if (control != DS4Controls.None)
|
|
|
|
|
macrodone[DS4ControltoInt(control)] = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void EndMacro(int device, bool[] macrocontrol, string macro, DS4Controls control)
|
|
|
|
|
{
|
|
|
|
|
if ((macro.StartsWith("164/9/9/164") || macro.StartsWith("18/9/9/18")) && !altTabDone)
|
|
|
|
|
AltTabSwappingRelease();
|
|
|
|
|
if (control != DS4Controls.None)
|
|
|
|
|
macrodone[DS4ControltoInt(control)] = false;
|
|
|
|
|
}
|
|
|
|
|
private static void AltTabSwapping(int wait, int device)
|
|
|
|
|
{
|
|
|
|
|
if (altTabDone)
|
|
|
|
|
{
|
|
|
|
|
altTabDone = false;
|
|
|
|
|
InputMethods.performKeyPress(18);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
altTabNow = DateTime.UtcNow;
|
|
|
|
|
if (altTabNow >= oldAltTabNow + TimeSpan.FromMilliseconds(wait))
|
|
|
|
|
{
|
|
|
|
|
oldAltTabNow = altTabNow;
|
|
|
|
|
InputMethods.performKeyPress(9);
|
|
|
|
|
InputMethods.performKeyRelease(9);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void AltTabSwappingRelease()
|
|
|
|
|
{
|
|
|
|
|
if (altTabNow < DateTime.UtcNow - TimeSpan.FromMilliseconds(10)) //in case multiple controls are mapped to alt+tab
|
|
|
|
|
{
|
|
|
|
|
altTabDone = true;
|
|
|
|
|
InputMethods.performKeyRelease(9);
|
|
|
|
|
InputMethods.performKeyRelease(18);
|
|
|
|
|
altTabNow = DateTime.UtcNow;
|
|
|
|
|
oldAltTabNow = DateTime.UtcNow - TimeSpan.FromDays(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
|
|
|
|
private static void getMouseWheelMapping(int device, DS4Controls control, DS4State cState, DS4StateExposed eState, Mouse tp, bool down)
|
|
|
|
|
{
|
|
|
|
|
DateTime now = DateTime.UtcNow;
|
|
|
|
|
if (now >= oldnow + TimeSpan.FromMilliseconds(10) && !pressagain)
|
|
|
|
|
{
|
|
|
|
|
oldnow = now;
|
|
|
|
|
InputMethods.MouseWheel((int)(getByteMapping(device, control, cState, eState, tp) / 51f * (down ? -1 : 1)), 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-24 00:27:14 +02:00
|
|
|
|
private static int getMouseMapping(int device, DS4Controls control, DS4State cState, DS4StateExposed eState, int mnum)
|
2014-04-27 21:32:09 +02:00
|
|
|
|
{
|
2014-06-26 20:02:01 +02:00
|
|
|
|
int controlnum = DS4ControltoInt(control);
|
2015-12-05 09:55:11 +01:00
|
|
|
|
double SXD = SXDeadzone[device];
|
|
|
|
|
double SZD = SZDeadzone[device];
|
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
|
|
|
|
int deadzoneL = 3;
|
|
|
|
|
int deadzoneR = 3;
|
2015-12-05 09:55:11 +01:00
|
|
|
|
if (LSDeadzone[device] >= 3)
|
2014-12-13 21:12:03 +01:00
|
|
|
|
deadzoneL = 0;
|
2015-12-05 09:55:11 +01:00
|
|
|
|
if (RSDeadzone[device] >= 3)
|
2014-12-13 21:12:03 +01:00
|
|
|
|
deadzoneR = 0;
|
2014-05-28 21:47:25 +02:00
|
|
|
|
double value = 0;
|
2015-12-05 09:55:11 +01:00
|
|
|
|
int speed = ButtonMouseSensitivity[device] + 15;
|
2014-06-14 21:14:27 +02:00
|
|
|
|
double root = 1.002;
|
|
|
|
|
double divide = 10000d;
|
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
|
|
|
|
//DateTime now = mousenow[mnum];
|
2014-04-29 23:56:58 +02:00
|
|
|
|
switch (control)
|
|
|
|
|
{
|
|
|
|
|
case DS4Controls.LXNeg:
|
2014-11-21 20:56:31 +01:00
|
|
|
|
if (cState.LX - 127.5f < -deadzoneL)
|
|
|
|
|
value = -(cState.LX - 127.5f) / 2550d * speed;
|
2014-07-26 01:17:45 +02:00
|
|
|
|
break;
|
|
|
|
|
case DS4Controls.LXPos:
|
2014-11-21 20:56:31 +01:00
|
|
|
|
if (cState.LX - 127.5f > deadzoneL)
|
|
|
|
|
value = (cState.LX - 127.5f) / 2550d * speed;
|
2014-07-26 01:17:45 +02:00
|
|
|
|
break;
|
|
|
|
|
case DS4Controls.RXNeg:
|
2014-11-21 20:56:31 +01:00
|
|
|
|
if (cState.RX - 127.5f < -deadzoneR)
|
|
|
|
|
value = -(cState.RX - 127.5f) / 2550d * speed;
|
2014-07-26 01:17:45 +02:00
|
|
|
|
break;
|
|
|
|
|
case DS4Controls.RXPos:
|
2014-11-21 20:56:31 +01:00
|
|
|
|
if (cState.RX - 127.5f > deadzoneR)
|
|
|
|
|
value = (cState.RX - 127.5f) / 2550d * speed;
|
2014-07-26 01:17:45 +02:00
|
|
|
|
break;
|
|
|
|
|
case DS4Controls.LYNeg:
|
2014-11-21 20:56:31 +01:00
|
|
|
|
if (cState.LY - 127.5f < -deadzoneL)
|
|
|
|
|
value = -(cState.LY - 127.5f) / 2550d * speed;
|
2014-07-26 01:17:45 +02:00
|
|
|
|
break;
|
|
|
|
|
case DS4Controls.LYPos:
|
2014-11-21 20:56:31 +01:00
|
|
|
|
if (cState.LY - 127.5f > deadzoneL)
|
|
|
|
|
value = (cState.LY - 127.5f) / 2550d * speed;
|
2014-07-26 01:17:45 +02:00
|
|
|
|
break;
|
|
|
|
|
case DS4Controls.RYNeg:
|
2014-11-21 20:56:31 +01:00
|
|
|
|
if (cState.RY - 127.5f < -deadzoneR)
|
|
|
|
|
value = -(cState.RY - 127.5f) / 2550d * speed;
|
2014-07-26 01:17:45 +02:00
|
|
|
|
break;
|
|
|
|
|
case DS4Controls.RYPos:
|
2014-11-21 20:56:31 +01:00
|
|
|
|
if (cState.RY - 127.5f > deadzoneR)
|
|
|
|
|
value = (cState.RY - 127.5f) / 2550d * speed;
|
2014-07-26 01:17:45 +02:00
|
|
|
|
break;
|
2014-06-14 21:14:27 +02:00
|
|
|
|
case DS4Controls.Share: value = (cState.Share ? Math.Pow(root + speed / divide, 100) - 1 : 0); break;
|
|
|
|
|
case DS4Controls.Options: value = (cState.Options ? Math.Pow(root + speed / divide, 100) - 1 : 0); break;
|
|
|
|
|
case DS4Controls.L1: value = (cState.L1 ? Math.Pow(root + speed / divide, 100) - 1 : 0); break;
|
|
|
|
|
case DS4Controls.R1: value = (cState.R1 ? Math.Pow(root + speed / divide, 100) - 1 : 0); break;
|
|
|
|
|
case DS4Controls.L3: value = (cState.L3 ? Math.Pow(root + speed / divide, 100) - 1 : 0); break;
|
|
|
|
|
case DS4Controls.R3: value = (cState.R3 ? Math.Pow(root + speed / divide, 100) - 1 : 0); break;
|
|
|
|
|
case DS4Controls.DpadUp: value = (cState.DpadUp ? Math.Pow(root + speed / divide, 100) - 1 : 0); break;
|
|
|
|
|
case DS4Controls.DpadDown: value = (cState.DpadDown ? Math.Pow(root + speed / divide, 100) - 1 : 0); break;
|
|
|
|
|
case DS4Controls.DpadLeft: value = (cState.DpadLeft ? Math.Pow(root + speed / divide, 100) - 1 : 0); break;
|
|
|
|
|
case DS4Controls.DpadRight: value = (cState.DpadRight ? Math.Pow(root + speed / divide, 100) - 1 : 0); break;
|
|
|
|
|
case DS4Controls.PS: value = (cState.PS ? Math.Pow(root + speed / divide, 100) - 1 : 0); break;
|
|
|
|
|
case DS4Controls.Cross: value = (cState.Cross ? Math.Pow(root + speed / divide, 100) - 1 : 0); break;
|
|
|
|
|
case DS4Controls.Square: value = (cState.Square ? Math.Pow(root + speed / divide, 100) - 1 : 0); break;
|
|
|
|
|
case DS4Controls.Triangle: value = (cState.Triangle ? Math.Pow(root + speed / divide, 100) - 1 : 0); break;
|
|
|
|
|
case DS4Controls.Circle: value = (cState.Circle ? Math.Pow(root + speed / divide, 100) - 1 : 0); break;
|
|
|
|
|
case DS4Controls.L2: value = Math.Pow(root + speed / divide, cState.L2 / 2d) - 1; break;
|
|
|
|
|
case DS4Controls.R2: value = Math.Pow(root + speed / divide, cState.R2 / 2d) - 1; break;
|
2015-11-28 06:47:26 +01:00
|
|
|
|
case DS4Controls.GyroXPos: return (byte)(eState.GyroX > SXD * 10 ?
|
|
|
|
|
Math.Pow(root + speed / divide, eState.GyroX) : 0);
|
|
|
|
|
case DS4Controls.GyroXNeg: return (byte)(eState.GyroX < -SXD * 10 ?
|
|
|
|
|
Math.Pow(root + speed / divide, -eState.GyroX) : 0);
|
|
|
|
|
case DS4Controls.GyroZPos: return (byte)(eState.GyroZ > SZD * 10 ?
|
|
|
|
|
Math.Pow(root + speed / divide, eState.GyroZ) : 0);
|
|
|
|
|
case DS4Controls.GyroZNeg: return (byte)(eState.GyroZ < -SZD * 10 ?
|
|
|
|
|
Math.Pow(root + speed / divide, -eState.GyroZ) : 0);
|
2014-04-29 23:56:58 +02:00
|
|
|
|
}
|
2014-11-20 20:03:18 +01:00
|
|
|
|
bool LXChanged = (Math.Abs(127 - cState.LX) < deadzoneL);
|
|
|
|
|
bool LYChanged = (Math.Abs(127 - cState.LY) < deadzoneL);
|
|
|
|
|
bool RXChanged = (Math.Abs(127 - cState.RX) < deadzoneR);
|
|
|
|
|
bool RYChanged = (Math.Abs(127 - cState.RY) < deadzoneR);
|
2014-11-21 20:56:31 +01:00
|
|
|
|
bool contains = (control.ToString().Contains("LX") ||
|
|
|
|
|
control.ToString().Contains("LY") ||
|
|
|
|
|
control.ToString().Contains("RX") ||
|
|
|
|
|
control.ToString().Contains("RY"));
|
2015-12-05 09:55:11 +01:00
|
|
|
|
if (MouseAccel[device])
|
2014-06-26 20:02:01 +02:00
|
|
|
|
{
|
|
|
|
|
if (value > 0)
|
2014-05-28 21:47:25 +02:00
|
|
|
|
{
|
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
|
|
|
|
mcounter = 34;
|
|
|
|
|
mouseaccel++;
|
2014-05-28 21:47:25 +02:00
|
|
|
|
}
|
Version 1.4.222
Added Press/Toggle Key to Special Actions, you can hold a trigger to
hold a key or toggle a key with one set of buttons, and untoggle it by
pressing or releasing another set of buttons
Added Disconnect BT to Special Actions, PS+Options to d/c is now added
to Special actions and can be enabled for each profile. You can now set
Disconnect BT to any control(s) and how long you need to hold the
control(s) to take affect
Added Partial German Translation (Thanks Michél)
Added 95% Finished Russian Translation (Thanks overclockers.ru members:
KoNoRIMCI & Sr_psycho)
Added Partial Italian Translation (Thanks Giulio)
Updates to the translations sheets, they should now have every bit of
text in DS4Windows, minus the controls of the controller
English Spelling fixes
Main/Starting tab only shows info for connected controllers, and context
menu only shows options for connected controllers.
Mouse wheel scrolling with analog sticks/triggers/gyro, the mouse now
scrolls smoothly
Slightly reworked analog mouse movement + mouse acceleration (not as
janky anymore)
When starting DS4Windows, if no controllers are connected, DS4Windows
defaults to the profile tab
Certain log warnings (Like unable to get controller exclusively) shows
up in red
Easter egg: try pressing a few buttons in sequence while in the log tab
Fixed Start Profile with TP off being unchecked next time a profile is
opened
Other minor Bug Fixes, such as clearing the log then moving to a new tab
crashing DS4W
2015-01-17 21:16:48 +01:00
|
|
|
|
if (mouseaccel == prevmouseaccel)
|
|
|
|
|
{
|
|
|
|
|
mcounter--;
|
|
|
|
|
}
|
|
|
|
|
if (mcounter <= 0)
|
|
|
|
|
{
|
|
|
|
|
mouseaccel = 0;
|
|
|
|
|
mcounter = 34;
|
|
|
|
|
}
|
|
|
|
|
value *= 1 + (double)Math.Min(20000, (mouseaccel)) / 10000d;
|
|
|
|
|
prevmouseaccel = mouseaccel;
|
|
|
|
|
}
|
|
|
|
|
int intValue;
|
|
|
|
|
if (mnum > 1)
|
|
|
|
|
{
|
|
|
|
|
if ((value > 0.0 && horizontalRemainder > 0.0) || (value < 0.0 && horizontalRemainder < 0.0))
|
|
|
|
|
value += horizontalRemainder;
|
|
|
|
|
intValue = (int)value;
|
|
|
|
|
horizontalRemainder = value - intValue;
|
2014-05-28 21:47:25 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
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 ((value > 0.0 && verticalRemainder > 0.0) || (value < 0.0 && verticalRemainder < 0.0))
|
|
|
|
|
value += verticalRemainder;
|
|
|
|
|
intValue = (int)value;
|
|
|
|
|
verticalRemainder = value - intValue;
|
|
|
|
|
}
|
|
|
|
|
return intValue;
|
2014-04-27 21:32:09 +02:00
|
|
|
|
}
|
2014-04-29 23:56:58 +02:00
|
|
|
|
|
2014-03-28 02:50:40 +01:00
|
|
|
|
public static bool compare(byte b1, byte b2)
|
|
|
|
|
{
|
|
|
|
|
if (Math.Abs(b1 - b2) > 10)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2014-04-27 21:32:09 +02:00
|
|
|
|
|
2014-10-31 00:56:51 +01:00
|
|
|
|
public static byte getByteMapping(int device, DS4Controls control, DS4State cState, DS4StateExposed eState, Mouse tp)
|
2014-03-28 02:50:40 +01:00
|
|
|
|
{
|
2015-12-05 09:55:11 +01:00
|
|
|
|
double SXD = SXDeadzone[device];
|
|
|
|
|
double SZD = SZDeadzone[device];
|
|
|
|
|
bool sOff = UseSAforMouse[device];
|
2014-03-28 02:50:40 +01:00
|
|
|
|
switch (control)
|
|
|
|
|
{
|
|
|
|
|
case DS4Controls.Share: return (byte)(cState.Share ? 255 : 0);
|
|
|
|
|
case DS4Controls.Options: return (byte)(cState.Options ? 255 : 0);
|
|
|
|
|
case DS4Controls.L1: return (byte)(cState.L1 ? 255 : 0);
|
|
|
|
|
case DS4Controls.R1: return (byte)(cState.R1 ? 255 : 0);
|
|
|
|
|
case DS4Controls.L3: return (byte)(cState.L3 ? 255 : 0);
|
|
|
|
|
case DS4Controls.R3: return (byte)(cState.R3 ? 255 : 0);
|
|
|
|
|
case DS4Controls.DpadUp: return (byte)(cState.DpadUp ? 255 : 0);
|
|
|
|
|
case DS4Controls.DpadDown: return (byte)(cState.DpadDown ? 255 : 0);
|
|
|
|
|
case DS4Controls.DpadLeft: return (byte)(cState.DpadLeft ? 255 : 0);
|
|
|
|
|
case DS4Controls.DpadRight: return (byte)(cState.DpadRight ? 255 : 0);
|
|
|
|
|
case DS4Controls.PS: return (byte)(cState.PS ? 255 : 0);
|
|
|
|
|
case DS4Controls.Cross: return (byte)(cState.Cross ? 255 : 0);
|
|
|
|
|
case DS4Controls.Square: return (byte)(cState.Square ? 255 : 0);
|
|
|
|
|
case DS4Controls.Triangle: return (byte)(cState.Triangle ? 255 : 0);
|
|
|
|
|
case DS4Controls.Circle: return (byte)(cState.Circle ? 255 : 0);
|
2014-11-01 22:49:22 +01:00
|
|
|
|
case DS4Controls.TouchLeft: return (byte)(tp != null && tp.leftDown ? 255 : 0);
|
|
|
|
|
case DS4Controls.TouchRight: return (byte)(tp != null && tp.rightDown ? 255 : 0);
|
|
|
|
|
case DS4Controls.TouchMulti: return (byte)(tp != null && tp.multiDown ? 255 : 0);
|
|
|
|
|
case DS4Controls.TouchUpper: return (byte)(tp != null && tp.upperDown ? 255 : 0);
|
2014-11-15 22:54:14 +01:00
|
|
|
|
case DS4Controls.LXNeg: return (byte)(cState.LX - 127.5f > 0 ? 0 : -(cState.LX - 127.5f) * 2);
|
|
|
|
|
case DS4Controls.LYNeg: return (byte)(cState.LY - 127.5f > 0 ? 0 : -(cState.LY - 127.5f) * 2);
|
|
|
|
|
case DS4Controls.RXNeg: return (byte)(cState.RX - 127.5f > 0 ? 0 : -(cState.RX - 127.5f) * 2);
|
|
|
|
|
case DS4Controls.RYNeg: return (byte)(cState.RY - 127.5f > 0 ? 0 : -(cState.RY - 127.5f) * 2);
|
|
|
|
|
case DS4Controls.LXPos: return (byte)(cState.LX - 127.5f < 0 ? 0 : (cState.LX - 127.5f) * 2);
|
|
|
|
|
case DS4Controls.LYPos: return (byte)(cState.LY - 127.5f < 0 ? 0 : (cState.LY - 127.5f) * 2);
|
|
|
|
|
case DS4Controls.RXPos: return (byte)(cState.RX - 127.5f < 0 ? 0 : (cState.RX - 127.5f) * 2);
|
|
|
|
|
case DS4Controls.RYPos: return (byte)(cState.RY - 127.5f < 0 ? 0 : (cState.RY - 127.5f) * 2);
|
|
|
|
|
case DS4Controls.L2: return cState.L2;
|
|
|
|
|
case DS4Controls.R2: return cState.R2;
|
2015-12-05 09:55:11 +01:00
|
|
|
|
case DS4Controls.GyroXPos: return (byte)(!sOff && SXSens[device] * eState.GyroX > SXD * 10 ? Math.Min(255, SXSens[device] * eState.GyroX * 2) : 0);
|
|
|
|
|
case DS4Controls.GyroXNeg: return (byte)(!sOff && SXSens[device] * eState.GyroX < -SXD * 10 ? Math.Min(255, SXSens[device] * -eState.GyroX * 2) : 0);
|
|
|
|
|
case DS4Controls.GyroZPos: return (byte)(!sOff && SZSens[device] * eState.GyroZ > SZD * 10 ? Math.Min(255, SZSens[device] * eState.GyroZ * 2) : 0);
|
|
|
|
|
case DS4Controls.GyroZNeg: return (byte)(!sOff && SZSens[device] * eState.GyroZ < -SZD * 10 ? Math.Min(255, SZSens[device] * -eState.GyroZ * 2) : 0);
|
2014-11-15 22:54:14 +01:00
|
|
|
|
case DS4Controls.SwipeUp: return (byte)(tp != null ? tp.swipeUpB : 0);
|
|
|
|
|
case DS4Controls.SwipeDown: return (byte)(tp != null ? tp.swipeDownB: 0);
|
|
|
|
|
case DS4Controls.SwipeLeft: return (byte)(tp != null ? tp.swipeLeftB: 0);
|
|
|
|
|
case DS4Controls.SwipeRight: return (byte)(tp != null ? tp.swipeRightB : 0);
|
2014-04-27 21:32:09 +02:00
|
|
|
|
}
|
2014-03-28 02:50:40 +01:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
2014-10-31 00:56:51 +01:00
|
|
|
|
|
2015-11-28 06:47:26 +01:00
|
|
|
|
public static bool getBoolMapping(int device, DS4Controls control, DS4State cState, DS4StateExposed eState, Mouse tp)
|
2014-03-28 02:50:40 +01:00
|
|
|
|
{
|
2015-12-05 09:55:11 +01:00
|
|
|
|
bool sOff = UseSAforMouse[device];
|
2014-03-28 02:50:40 +01:00
|
|
|
|
switch (control)
|
|
|
|
|
{
|
|
|
|
|
case DS4Controls.Share: return cState.Share;
|
|
|
|
|
case DS4Controls.Options: return cState.Options;
|
|
|
|
|
case DS4Controls.L1: return cState.L1;
|
|
|
|
|
case DS4Controls.R1: return cState.R1;
|
|
|
|
|
case DS4Controls.L3: return cState.L3;
|
|
|
|
|
case DS4Controls.R3: return cState.R3;
|
|
|
|
|
case DS4Controls.DpadUp: return cState.DpadUp;
|
|
|
|
|
case DS4Controls.DpadDown: return cState.DpadDown;
|
|
|
|
|
case DS4Controls.DpadLeft: return cState.DpadLeft;
|
|
|
|
|
case DS4Controls.DpadRight: return cState.DpadRight;
|
|
|
|
|
case DS4Controls.PS: return cState.PS;
|
|
|
|
|
case DS4Controls.Cross: return cState.Cross;
|
|
|
|
|
case DS4Controls.Square: return cState.Square;
|
|
|
|
|
case DS4Controls.Triangle: return cState.Triangle;
|
|
|
|
|
case DS4Controls.Circle: return cState.Circle;
|
2014-10-31 20:00:15 +01:00
|
|
|
|
case DS4Controls.TouchLeft: return (tp != null ? tp.leftDown : false);
|
|
|
|
|
case DS4Controls.TouchRight: return (tp != null ? tp.rightDown : false);
|
|
|
|
|
case DS4Controls.TouchMulti: return (tp != null ? tp.multiDown : false);
|
|
|
|
|
case DS4Controls.TouchUpper: return (tp != null ? tp.upperDown : false);
|
2014-05-21 23:42:25 +02:00
|
|
|
|
case DS4Controls.LXNeg: return cState.LX < 127 - 55;
|
|
|
|
|
case DS4Controls.LYNeg: return cState.LY < 127 - 55;
|
|
|
|
|
case DS4Controls.RXNeg: return cState.RX < 127 - 55;
|
|
|
|
|
case DS4Controls.RYNeg: return cState.RY < 127 - 55;
|
|
|
|
|
case DS4Controls.LXPos: return cState.LX > 127 + 55;
|
|
|
|
|
case DS4Controls.LYPos: return cState.LY > 127 + 55;
|
|
|
|
|
case DS4Controls.RXPos: return cState.RX > 127 + 55;
|
|
|
|
|
case DS4Controls.RYPos: return cState.RY > 127 + 55;
|
2014-03-28 02:50:40 +01:00
|
|
|
|
case DS4Controls.L2: return cState.L2 > 100;
|
|
|
|
|
case DS4Controls.R2: return cState.R2 > 100;
|
2015-12-05 09:55:11 +01:00
|
|
|
|
case DS4Controls.GyroXPos: return !sOff ? SXSens[device] * eState.GyroX > 67 : false;
|
|
|
|
|
case DS4Controls.GyroXNeg: return !sOff ? SXSens[device] * eState.GyroX < -67 : false;
|
|
|
|
|
case DS4Controls.GyroZPos: return !sOff ? SZSens[device] * eState.GyroZ > 67 : false;
|
|
|
|
|
case DS4Controls.GyroZNeg: return !sOff ? SZSens[device] * eState.GyroZ < -67 : false;
|
2014-11-15 22:54:14 +01:00
|
|
|
|
case DS4Controls.SwipeUp: return (tp != null && tp.swipeUp);
|
|
|
|
|
case DS4Controls.SwipeDown: return (tp != null && tp.swipeDown);
|
|
|
|
|
case DS4Controls.SwipeLeft: return (tp != null && tp.swipeLeft);
|
|
|
|
|
case DS4Controls.SwipeRight: return (tp != null && tp.swipeRight);
|
2014-03-28 02:50:40 +01:00
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2014-10-31 00:56:51 +01:00
|
|
|
|
public static byte getXYAxisMapping(int device, DS4Controls control, DS4State cState, DS4StateExposed eState, Mouse tp, bool alt = false)
|
2014-03-28 02:50:40 +01:00
|
|
|
|
{
|
|
|
|
|
byte trueVal = 0;
|
|
|
|
|
byte falseVal = 127;
|
2015-12-05 09:55:11 +01:00
|
|
|
|
double SXD = SXDeadzone[device];
|
|
|
|
|
double SZD = SZDeadzone[device];
|
|
|
|
|
bool sOff = UseSAforMouse[device];
|
2014-03-28 02:50:40 +01:00
|
|
|
|
if (alt)
|
|
|
|
|
trueVal = 255;
|
|
|
|
|
switch (control)
|
|
|
|
|
{
|
|
|
|
|
case DS4Controls.Share: return (byte)(cState.Share ? trueVal : falseVal);
|
|
|
|
|
case DS4Controls.Options: return (byte)(cState.Options ? trueVal : falseVal);
|
|
|
|
|
case DS4Controls.L1: return (byte)(cState.L1 ? trueVal : falseVal);
|
|
|
|
|
case DS4Controls.R1: return (byte)(cState.R1 ? trueVal : falseVal);
|
|
|
|
|
case DS4Controls.L3: return (byte)(cState.L3 ? trueVal : falseVal);
|
|
|
|
|
case DS4Controls.R3: return (byte)(cState.R3 ? trueVal : falseVal);
|
|
|
|
|
case DS4Controls.DpadUp: return (byte)(cState.DpadUp ? trueVal : falseVal);
|
|
|
|
|
case DS4Controls.DpadDown: return (byte)(cState.DpadDown ? trueVal : falseVal);
|
|
|
|
|
case DS4Controls.DpadLeft: return (byte)(cState.DpadLeft ? trueVal : falseVal);
|
|
|
|
|
case DS4Controls.DpadRight: return (byte)(cState.DpadRight ? trueVal : falseVal);
|
|
|
|
|
case DS4Controls.PS: return (byte)(cState.PS ? trueVal : falseVal);
|
|
|
|
|
case DS4Controls.Cross: return (byte)(cState.Cross ? trueVal : falseVal);
|
|
|
|
|
case DS4Controls.Square: return (byte)(cState.Square ? trueVal : falseVal);
|
|
|
|
|
case DS4Controls.Triangle: return (byte)(cState.Triangle ? trueVal : falseVal);
|
|
|
|
|
case DS4Controls.Circle: return (byte)(cState.Circle ? trueVal : falseVal);
|
2014-11-01 22:49:22 +01:00
|
|
|
|
case DS4Controls.TouchLeft: return (byte)(tp != null && tp.leftDown ? trueVal : falseVal);
|
|
|
|
|
case DS4Controls.TouchRight: return (byte)(tp != null && tp.rightDown ? trueVal : falseVal);
|
|
|
|
|
case DS4Controls.TouchMulti: return (byte)(tp != null && tp.multiDown ? trueVal : falseVal);
|
|
|
|
|
case DS4Controls.TouchUpper: return (byte)(tp != null && tp.upperDown ? trueVal : falseVal);
|
2014-11-15 22:54:14 +01:00
|
|
|
|
case DS4Controls.L2: if (alt) return (byte)(127.5f + cState.L2 / 2f); else return (byte)(127.5f - cState.L2 / 2f);
|
|
|
|
|
case DS4Controls.R2: if (alt) return (byte)(127.5f + cState.R2 / 2f); else return (byte)(127.5f - cState.R2 / 2f);
|
|
|
|
|
case DS4Controls.SwipeUp: if (alt) return (byte)(tp != null ? 127.5f + tp.swipeUpB / 2f : 0); else return (byte)(tp != null ? 127.5f - tp.swipeUpB / 2f : 0);
|
|
|
|
|
case DS4Controls.SwipeDown: if (alt) return (byte)(tp != null ? 127.5f + tp.swipeDownB / 2f : 0); else return (byte)(tp != null ? 127.5f - tp.swipeDownB / 2f : 0);
|
|
|
|
|
case DS4Controls.SwipeLeft: if (alt) return (byte)(tp != null ? 127.5f + tp.swipeLeftB / 2f : 0); else return (byte)(tp != null ? 127.5f - tp.swipeLeftB / 2f : 0);
|
|
|
|
|
case DS4Controls.SwipeRight: if (alt) return (byte)(tp != null ? 127.5f + tp.swipeRightB / 2f : 0); else return (byte)(tp != null ? 127.5f - tp.swipeRightB / 2f : 0);
|
2015-11-28 06:47:26 +01:00
|
|
|
|
case DS4Controls.GyroXPos: if (!sOff && eState.GyroX > SXD * 10)
|
2015-12-05 09:55:11 +01:00
|
|
|
|
if (alt) return (byte)Math.Min(255, 127 + SXSens[device] * eState.GyroX); else return (byte)Math.Max(0, 127 - SXSens[device] * eState.GyroX);
|
2014-10-31 00:56:51 +01:00
|
|
|
|
else return falseVal;
|
2015-11-28 06:47:26 +01:00
|
|
|
|
case DS4Controls.GyroXNeg: if (!sOff && eState.GyroX < -SXD * 10)
|
2015-12-05 09:55:11 +01:00
|
|
|
|
if (alt) return (byte)Math.Min(255, 127 + SXSens[device] * -eState.GyroX); else return (byte)Math.Max(0, 127 - SXSens[device] * -eState.GyroX);
|
2014-10-31 00:56:51 +01:00
|
|
|
|
else return falseVal;
|
2015-11-28 06:47:26 +01:00
|
|
|
|
case DS4Controls.GyroZPos: if (!sOff && eState.GyroZ > SZD * 10)
|
2015-12-05 09:55:11 +01:00
|
|
|
|
if (alt) return (byte)Math.Min(255, 127 + SZSens[device] * eState.GyroZ); else return (byte)Math.Max(0, 127 - SZSens[device] * eState.GyroZ);
|
2014-10-31 00:56:51 +01:00
|
|
|
|
else return falseVal;
|
2015-11-28 06:47:26 +01:00
|
|
|
|
case DS4Controls.GyroZNeg: if (!sOff && eState.GyroZ < -SZD * 10)
|
2015-12-05 09:55:11 +01:00
|
|
|
|
if (alt) return (byte)Math.Min(255, 127 + SZSens[device] * -eState.GyroZ); else return (byte)Math.Max(0, 127 - SZSens[device] * -eState.GyroZ);
|
2014-10-31 00:56:51 +01:00
|
|
|
|
else return falseVal;
|
|
|
|
|
}
|
2014-03-28 02:50:40 +01:00
|
|
|
|
if (!alt)
|
|
|
|
|
{
|
|
|
|
|
switch (control)
|
|
|
|
|
{
|
|
|
|
|
case DS4Controls.LXNeg: return cState.LX;
|
|
|
|
|
case DS4Controls.LYNeg: return cState.LY;
|
|
|
|
|
case DS4Controls.RXNeg: return cState.RX;
|
|
|
|
|
case DS4Controls.RYNeg: return cState.RY;
|
|
|
|
|
case DS4Controls.LXPos: return (byte)(255 - cState.LX);
|
|
|
|
|
case DS4Controls.LYPos: return (byte)(255 - cState.LY);
|
2014-05-22 00:19:07 +02:00
|
|
|
|
case DS4Controls.RXPos: return (byte)(255 - cState.RX);
|
2014-03-28 02:50:40 +01:00
|
|
|
|
case DS4Controls.RYPos: return (byte)(255 - cState.RY);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
switch (control)
|
|
|
|
|
{
|
|
|
|
|
case DS4Controls.LXNeg: return (byte)(255 - cState.LX);
|
|
|
|
|
case DS4Controls.LYNeg: return (byte)(255 - cState.LY);
|
2014-05-22 00:19:07 +02:00
|
|
|
|
case DS4Controls.RXNeg: return (byte)(255 - cState.RX);
|
2014-03-28 02:50:40 +01:00
|
|
|
|
case DS4Controls.RYNeg: return (byte)(255 - cState.RY);
|
|
|
|
|
case DS4Controls.LXPos: return cState.LX;
|
|
|
|
|
case DS4Controls.LYPos: return cState.LY;
|
|
|
|
|
case DS4Controls.RXPos: return cState.RX;
|
|
|
|
|
case DS4Controls.RYPos: return cState.RY;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Returns false for any bool,
|
|
|
|
|
//if control is one of the xy axis returns 127
|
|
|
|
|
//if its a trigger returns 0
|
|
|
|
|
public static void resetToDefaultValue(DS4Controls control, DS4State cState)
|
|
|
|
|
{
|
|
|
|
|
switch (control)
|
|
|
|
|
{
|
|
|
|
|
case DS4Controls.Share: cState.Share = false; break;
|
|
|
|
|
case DS4Controls.Options: cState.Options = false; break;
|
|
|
|
|
case DS4Controls.L1: cState.L1 = false; break;
|
|
|
|
|
case DS4Controls.R1: cState.R1 = false; break;
|
|
|
|
|
case DS4Controls.L3: cState.L3 = false; break;
|
|
|
|
|
case DS4Controls.R3: cState.R3 = false; break;
|
|
|
|
|
case DS4Controls.DpadUp: cState.DpadUp = false; break;
|
|
|
|
|
case DS4Controls.DpadDown: cState.DpadDown = false; break;
|
|
|
|
|
case DS4Controls.DpadLeft: cState.DpadLeft = false; break;
|
|
|
|
|
case DS4Controls.DpadRight: cState.DpadRight = false; break;
|
|
|
|
|
case DS4Controls.PS: cState.PS = false; break;
|
|
|
|
|
case DS4Controls.Cross: cState.Cross = false; break;
|
|
|
|
|
case DS4Controls.Square: cState.Square = false; break;
|
|
|
|
|
case DS4Controls.Triangle: cState.Triangle = false; break;
|
|
|
|
|
case DS4Controls.Circle: cState.Circle = false; break;
|
|
|
|
|
case DS4Controls.LXNeg: cState.LX = 127; break;
|
|
|
|
|
case DS4Controls.LYNeg: cState.LY = 127; break;
|
|
|
|
|
case DS4Controls.RXNeg: cState.RX = 127; break;
|
|
|
|
|
case DS4Controls.RYNeg: cState.RY = 127; break;
|
|
|
|
|
case DS4Controls.LXPos: cState.LX = 127; break;
|
|
|
|
|
case DS4Controls.LYPos: cState.LY = 127; break;
|
|
|
|
|
case DS4Controls.RXPos: cState.RX = 127; break;
|
|
|
|
|
case DS4Controls.RYPos: cState.RY = 127; break;
|
|
|
|
|
case DS4Controls.L2: cState.L2 = 0; break;
|
|
|
|
|
case DS4Controls.R2: cState.R2 = 0; break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|