Merge branch 'jay' into vigem-udpserver

# Conflicts:
#	DS4Windows/DS4Control/ScpUtil.cs
This commit is contained in:
Travis Nickles 2019-02-28 04:24:03 -06:00
commit c575b3b525
33 changed files with 3004 additions and 1131 deletions

View File

@ -387,9 +387,12 @@ namespace DS4Windows
DS4LightBar.defaultLight = false;
//foreach (DS4Device device in devices)
for (int i = 0, devCount = devices.Count(); i < devCount; i++)
//for (int i = 0, devCount = devices.Count(); i < devCount; i++)
int i = 0;
for (var devEnum = devices.GetEnumerator(); devEnum.MoveNext(); i++)
{
DS4Device device = devices.ElementAt(i);
DS4Device device = devEnum.Current;
//DS4Device device = devices.ElementAt(i);
if (showlog)
LogDebug(Properties.Resources.FoundController + device.getMacAddress() + " (" + device.getConnectionType() + ")");
@ -410,8 +413,9 @@ namespace DS4Windows
{
ProfilePath[i] = OlderProfilePath[i];
}
LoadProfile(i, false, this, false, false);
touchPad[i] = new Mouse(i, device);
LoadProfile(i, false, this, false, false);
device.LightBarColor = getMainColor(i);
if (!getDInputOnly(i) && device.isSynced())
@ -439,7 +443,7 @@ namespace DS4Windows
this.On_Report(sender, e, tempIdx);
};
EventHandler<EventArgs> tempEvnt = (sender, args) =>
DS4Device.ReportHandler<EventArgs> tempEvnt = (sender, args) =>
{
DualShockPadMeta padDetail = new DualShockPadMeta();
GetPadDetailForIdx(tempIdx, ref padDetail);
@ -594,9 +598,11 @@ namespace DS4Windows
DS4Devices.findControllers();
IEnumerable<DS4Device> devices = DS4Devices.getDS4Controllers();
//foreach (DS4Device device in devices)
for (int i = 0, devlen = devices.Count(); i < devlen; i++)
//for (int i = 0, devlen = devices.Count(); i < devlen; i++)
for (var devEnum = devices.GetEnumerator(); devEnum.MoveNext();)
{
DS4Device device = devices.ElementAt(i);
DS4Device device = devEnum.Current;
//DS4Device device = devices.ElementAt(i);
if (device.isDisconnectingStatus())
continue;
@ -638,8 +644,8 @@ namespace DS4Windows
ProfilePath[Index] = OlderProfilePath[Index];
}
LoadProfile(Index, false, this, false, false);
touchPad[Index] = new Mouse(Index, device);
LoadProfile(Index, false, this, false, false);
device.LightBarColor = getMainColor(Index);
int tempIdx = Index;
@ -648,7 +654,7 @@ namespace DS4Windows
this.On_Report(sender, e, tempIdx);
};
EventHandler<EventArgs> tempEvnt = (sender, args) =>
DS4Device.ReportHandler<EventArgs> tempEvnt = (sender, args) =>
{
DualShockPadMeta padDetail = new DualShockPadMeta();
GetPadDetailForIdx(tempIdx, ref padDetail);
@ -1077,9 +1083,10 @@ namespace DS4Windows
private string[] tempStrings = new string[4] { string.Empty, string.Empty, string.Empty, string.Empty };
// Called every time a new input report has arrived
protected virtual void On_Report(object sender, EventArgs e, int ind)
//protected virtual void On_Report(object sender, EventArgs e, int ind)
protected virtual void On_Report(DS4Device device, EventArgs e, int ind)
{
DS4Device device = (DS4Device)sender;
//DS4Device device = (DS4Device)sender;
if (ind != -1)
{

View File

@ -47,9 +47,9 @@ namespace DS4Windows
{
if (getLedAsBatteryIndicator(deviceNum))
{
DS4Color fullColor = getCustomColor(deviceNum);
DS4Color lowColor = getLowColor(deviceNum);
color = getTransitionedColor(lowColor, fullColor, device.getBattery());
ref DS4Color fullColor = ref getCustomColor(deviceNum);
ref DS4Color lowColor = ref getLowColor(deviceNum);
color = getTransitionedColor(ref lowColor, ref fullColor, device.getBattery());
}
else
color = getCustomColor(deviceNum);
@ -83,9 +83,9 @@ namespace DS4Windows
}
else if (getLedAsBatteryIndicator(deviceNum))
{
DS4Color fullColor = getMainColor(deviceNum);
DS4Color lowColor = getLowColor(deviceNum);
color = getTransitionedColor(lowColor, fullColor, device.getBattery());
ref DS4Color fullColor = ref getMainColor(deviceNum);
ref DS4Color lowColor = ref getLowColor(deviceNum);
color = getTransitionedColor(ref lowColor, ref fullColor, device.getBattery());
}
else
{
@ -95,7 +95,7 @@ namespace DS4Windows
if (device.getBattery() <= getFlashAt(deviceNum) && !defaultLight && !device.isCharging())
{
DS4Color flashColor = getFlashColor(deviceNum);
ref DS4Color flashColor = ref getFlashColor(deviceNum);
if (!(flashColor.red == 0 &&
flashColor.green == 0 &&
flashColor.blue == 0))
@ -144,7 +144,8 @@ namespace DS4Windows
}
}
color = getTransitionedColor(color, new DS4Color(0, 0, 0), ratio);
DS4Color tempCol = new DS4Color(0, 0, 0);
color = getTransitionedColor(ref color, ref tempCol, ratio);
}
}
@ -159,11 +160,16 @@ namespace DS4Windows
double ratio = 100.0 * (botratio / topratio), elapsed = ratio;
if (ratio >= 50.0 && ratio < 100.0)
{
color = getTransitionedColor(color, new DS4Color(0, 0, 0),
DS4Color emptyCol = new DS4Color(0, 0, 0);
color = getTransitionedColor(ref color, ref emptyCol,
(uint)(-100.0 * (elapsed = 0.02 * (ratio - 50.0)) * (elapsed - 2.0)));
}
else if (ratio >= 100.0)
color = getTransitionedColor(color, new DS4Color(0, 0, 0), 100.0);
{
DS4Color emptyCol = new DS4Color(0, 0, 0);
color = getTransitionedColor(ref color, ref emptyCol, 100.0);
}
}
if (device.isCharging() && device.getBattery() < 100)
@ -217,7 +223,8 @@ namespace DS4Windows
}
}
color = getTransitionedColor(color, new DS4Color(0, 0, 0), ratio);
DS4Color emptyCol = new DS4Color(0, 0, 0);
color = getTransitionedColor(ref color, ref emptyCol, ratio);
break;
}
case 2:
@ -257,9 +264,22 @@ namespace DS4Windows
float rumble = device.getLeftHeavySlowRumble() / 2.55f;
byte max = Max(color.red, Max(color.green, color.blue));
if (device.getLeftHeavySlowRumble() > 100)
color = getTransitionedColor(new DS4Color(max, max, 0), new DS4Color(255, 0, 0), rumble);
{
DS4Color maxCol = new DS4Color(max, max, 0);
DS4Color redCol = new DS4Color(255, 0, 0);
color = getTransitionedColor(ref maxCol, ref redCol, rumble);
}
else
color = getTransitionedColor(color, getTransitionedColor(new DS4Color(max, max, 0), new DS4Color(255, 0, 0), 39.6078f), device.getLeftHeavySlowRumble());
{
DS4Color maxCol = new DS4Color(max, max, 0);
DS4Color redCol = new DS4Color(255, 0, 0);
DS4Color tempCol = getTransitionedColor(ref maxCol,
ref redCol, 39.6078f);
color = getTransitionedColor(ref color, ref tempCol,
device.getLeftHeavySlowRumble());
}
}
DS4HapticState haptics = new DS4HapticState

View File

@ -63,93 +63,100 @@ namespace DS4Windows
public void populateFieldMapping(DS4State cState, DS4StateExposed exposeState, Mouse tp, bool priorMouse = false)
{
axisdirs[(int)DS4Controls.LXNeg] = cState.LX;
axisdirs[(int)DS4Controls.LXPos] = cState.LX;
axisdirs[(int)DS4Controls.LYNeg] = cState.LY;
axisdirs[(int)DS4Controls.LYPos] = cState.LY;
unchecked
{
axisdirs[(int)DS4Controls.LXNeg] = cState.LX;
axisdirs[(int)DS4Controls.LXPos] = cState.LX;
axisdirs[(int)DS4Controls.LYNeg] = cState.LY;
axisdirs[(int)DS4Controls.LYPos] = cState.LY;
axisdirs[(int)DS4Controls.RXNeg] = cState.RX;
axisdirs[(int)DS4Controls.RXPos] = cState.RX;
axisdirs[(int)DS4Controls.RYNeg] = cState.RY;
axisdirs[(int)DS4Controls.RYPos] = cState.RY;
axisdirs[(int)DS4Controls.RXNeg] = cState.RX;
axisdirs[(int)DS4Controls.RXPos] = cState.RX;
axisdirs[(int)DS4Controls.RYNeg] = cState.RY;
axisdirs[(int)DS4Controls.RYPos] = cState.RY;
triggers[(int)DS4Controls.L2] = cState.L2;
triggers[(int)DS4Controls.R2] = cState.R2;
triggers[(int)DS4Controls.L2] = cState.L2;
triggers[(int)DS4Controls.R2] = cState.R2;
buttons[(int)DS4Controls.L1] = cState.L1;
buttons[(int)DS4Controls.L3] = cState.L3;
buttons[(int)DS4Controls.R1] = cState.R1;
buttons[(int)DS4Controls.R3] = cState.R3;
buttons[(int)DS4Controls.L1] = cState.L1;
buttons[(int)DS4Controls.L3] = cState.L3;
buttons[(int)DS4Controls.R1] = cState.R1;
buttons[(int)DS4Controls.R3] = cState.R3;
buttons[(int)DS4Controls.Cross] = cState.Cross;
buttons[(int)DS4Controls.Triangle] = cState.Triangle;
buttons[(int)DS4Controls.Circle] = cState.Circle;
buttons[(int)DS4Controls.Square] = cState.Square;
buttons[(int)DS4Controls.PS] = cState.PS;
buttons[(int)DS4Controls.Options] = cState.Options;
buttons[(int)DS4Controls.Share] = cState.Share;
buttons[(int)DS4Controls.Cross] = cState.Cross;
buttons[(int)DS4Controls.Triangle] = cState.Triangle;
buttons[(int)DS4Controls.Circle] = cState.Circle;
buttons[(int)DS4Controls.Square] = cState.Square;
buttons[(int)DS4Controls.PS] = cState.PS;
buttons[(int)DS4Controls.Options] = cState.Options;
buttons[(int)DS4Controls.Share] = cState.Share;
buttons[(int)DS4Controls.DpadUp] = cState.DpadUp;
buttons[(int)DS4Controls.DpadRight] = cState.DpadRight;
buttons[(int)DS4Controls.DpadDown] = cState.DpadDown;
buttons[(int)DS4Controls.DpadLeft] = cState.DpadLeft;
buttons[(int)DS4Controls.DpadUp] = cState.DpadUp;
buttons[(int)DS4Controls.DpadRight] = cState.DpadRight;
buttons[(int)DS4Controls.DpadDown] = cState.DpadDown;
buttons[(int)DS4Controls.DpadLeft] = cState.DpadLeft;
buttons[(int)DS4Controls.TouchLeft] = tp != null ? (!priorMouse ? tp.leftDown : tp.priorLeftDown) : false;
buttons[(int)DS4Controls.TouchRight] = tp != null ? (!priorMouse ? tp.rightDown : tp.priorRightDown) : false;
buttons[(int)DS4Controls.TouchUpper] = tp != null ? (!priorMouse ? tp.upperDown : tp.priorUpperDown) : false;
buttons[(int)DS4Controls.TouchMulti] = tp != null ? (!priorMouse ? tp.multiDown : tp.priorMultiDown) : false;
buttons[(int)DS4Controls.TouchLeft] = tp != null ? (!priorMouse ? tp.leftDown : tp.priorLeftDown) : false;
buttons[(int)DS4Controls.TouchRight] = tp != null ? (!priorMouse ? tp.rightDown : tp.priorRightDown) : false;
buttons[(int)DS4Controls.TouchUpper] = tp != null ? (!priorMouse ? tp.upperDown : tp.priorUpperDown) : false;
buttons[(int)DS4Controls.TouchMulti] = tp != null ? (!priorMouse ? tp.multiDown : tp.priorMultiDown) : false;
int sixAxisX = -exposeState.getOutputAccelX();
gryodirs[(int)DS4Controls.GyroXPos] = sixAxisX > 0 ? sixAxisX : 0;
gryodirs[(int)DS4Controls.GyroXNeg] = sixAxisX < 0 ? sixAxisX : 0;
int sixAxisX = -exposeState.getOutputAccelX();
gryodirs[(int)DS4Controls.GyroXPos] = sixAxisX > 0 ? sixAxisX : 0;
gryodirs[(int)DS4Controls.GyroXNeg] = sixAxisX < 0 ? sixAxisX : 0;
int sixAxisZ = exposeState.getOutputAccelZ();
gryodirs[(int)DS4Controls.GyroZPos] = sixAxisZ > 0 ? sixAxisZ : 0;
gryodirs[(int)DS4Controls.GyroZNeg] = sixAxisZ < 0 ? sixAxisZ : 0;
int sixAxisZ = exposeState.getOutputAccelZ();
gryodirs[(int)DS4Controls.GyroZPos] = sixAxisZ > 0 ? sixAxisZ : 0;
gryodirs[(int)DS4Controls.GyroZNeg] = sixAxisZ < 0 ? sixAxisZ : 0;
swipedirs[(int)DS4Controls.SwipeLeft] = tp != null ? (!priorMouse ? tp.swipeLeftB : tp.priorSwipeLeftB) : (byte)0;
swipedirs[(int)DS4Controls.SwipeRight] = tp != null ? (!priorMouse ? tp.swipeRightB : tp.priorSwipeRightB) : (byte)0;
swipedirs[(int)DS4Controls.SwipeUp] = tp != null ? (!priorMouse ? tp.swipeUpB : tp.priorSwipeUpB) : (byte)0;
swipedirs[(int)DS4Controls.SwipeDown] = tp != null ? (!priorMouse ? tp.swipeDownB : tp.priorSwipeDownB) : (byte)0;
swipedirs[(int)DS4Controls.SwipeLeft] = tp != null ? (!priorMouse ? tp.swipeLeftB : tp.priorSwipeLeftB) : (byte)0;
swipedirs[(int)DS4Controls.SwipeRight] = tp != null ? (!priorMouse ? tp.swipeRightB : tp.priorSwipeRightB) : (byte)0;
swipedirs[(int)DS4Controls.SwipeUp] = tp != null ? (!priorMouse ? tp.swipeUpB : tp.priorSwipeUpB) : (byte)0;
swipedirs[(int)DS4Controls.SwipeDown] = tp != null ? (!priorMouse ? tp.swipeDownB : tp.priorSwipeDownB) : (byte)0;
swipedirbools[(int)DS4Controls.SwipeLeft] = tp != null ? (!priorMouse ? tp.swipeLeft : tp.priorSwipeLeft) : false;
swipedirbools[(int)DS4Controls.SwipeRight] = tp != null ? (!priorMouse ? tp.swipeRight : tp.priorSwipeRight) : false;
swipedirbools[(int)DS4Controls.SwipeUp] = tp != null ? (!priorMouse ? tp.swipeUp : tp.priorSwipeUp) : false;
swipedirbools[(int)DS4Controls.SwipeDown] = tp != null ? (!priorMouse ? tp.swipeDown : tp.priorSwipeDown) : false;
}
swipedirbools[(int)DS4Controls.SwipeLeft] = tp != null ? (!priorMouse ? tp.swipeLeft : tp.priorSwipeLeft) : false;
swipedirbools[(int)DS4Controls.SwipeRight] = tp != null ? (!priorMouse ? tp.swipeRight : tp.priorSwipeRight) : false;
swipedirbools[(int)DS4Controls.SwipeUp] = tp != null ? (!priorMouse ? tp.swipeUp : tp.priorSwipeUp) : false;
swipedirbools[(int)DS4Controls.SwipeDown] = tp != null ? (!priorMouse ? tp.swipeDown : tp.priorSwipeDown) : false;
}
public void populateState(DS4State state)
{
state.LX = axisdirs[(int)DS4Controls.LXNeg];
state.LX = axisdirs[(int)DS4Controls.LXPos];
state.LY = axisdirs[(int)DS4Controls.LYNeg];
state.LY = axisdirs[(int)DS4Controls.LYPos];
unchecked
{
state.LX = axisdirs[(int)DS4Controls.LXNeg];
state.LX = axisdirs[(int)DS4Controls.LXPos];
state.LY = axisdirs[(int)DS4Controls.LYNeg];
state.LY = axisdirs[(int)DS4Controls.LYPos];
state.RX = axisdirs[(int)DS4Controls.RXNeg];
state.RX = axisdirs[(int)DS4Controls.RXPos];
state.RY = axisdirs[(int)DS4Controls.RYNeg];
state.RY = axisdirs[(int)DS4Controls.RYPos];
state.RX = axisdirs[(int)DS4Controls.RXNeg];
state.RX = axisdirs[(int)DS4Controls.RXPos];
state.RY = axisdirs[(int)DS4Controls.RYNeg];
state.RY = axisdirs[(int)DS4Controls.RYPos];
state.L2 = triggers[(int)DS4Controls.L2];
state.R2 = triggers[(int)DS4Controls.R2];
state.L2 = triggers[(int)DS4Controls.L2];
state.R2 = triggers[(int)DS4Controls.R2];
state.L1 = buttons[(int)DS4Controls.L1];
state.L3 = buttons[(int)DS4Controls.L3];
state.R1 = buttons[(int)DS4Controls.R1];
state.R3 = buttons[(int)DS4Controls.R3];
state.L1 = buttons[(int)DS4Controls.L1];
state.L3 = buttons[(int)DS4Controls.L3];
state.R1 = buttons[(int)DS4Controls.R1];
state.R3 = buttons[(int)DS4Controls.R3];
state.Cross = buttons[(int)DS4Controls.Cross];
state.Triangle = buttons[(int)DS4Controls.Triangle];
state.Circle = buttons[(int)DS4Controls.Circle];
state.Square = buttons[(int)DS4Controls.Square];
state.PS = buttons[(int)DS4Controls.PS];
state.Options = buttons[(int)DS4Controls.Options];
state.Share = buttons[(int)DS4Controls.Share];
state.Cross = buttons[(int)DS4Controls.Cross];
state.Triangle = buttons[(int)DS4Controls.Triangle];
state.Circle = buttons[(int)DS4Controls.Circle];
state.Square = buttons[(int)DS4Controls.Square];
state.PS = buttons[(int)DS4Controls.PS];
state.Options = buttons[(int)DS4Controls.Options];
state.Share = buttons[(int)DS4Controls.Share];
state.DpadUp = buttons[(int)DS4Controls.DpadUp];
state.DpadRight = buttons[(int)DS4Controls.DpadRight];
state.DpadDown = buttons[(int)DS4Controls.DpadDown];
state.DpadLeft = buttons[(int)DS4Controls.DpadLeft];
state.DpadUp = buttons[(int)DS4Controls.DpadUp];
state.DpadRight = buttons[(int)DS4Controls.DpadRight];
state.DpadDown = buttons[(int)DS4Controls.DpadDown];
state.DpadLeft = buttons[(int)DS4Controls.DpadLeft];
}
}
}
}

View File

@ -4,12 +4,12 @@ namespace DS4Windows
{
interface ITouchpadBehaviour
{
void touchesBegan(object sender, TouchpadEventArgs arg);
void touchesMoved(object sender, TouchpadEventArgs arg);
void touchButtonUp(object sender, TouchpadEventArgs arg);
void touchButtonDown(object sender, TouchpadEventArgs arg);
void touchesEnded(object sender, TouchpadEventArgs arg);
void sixaxisMoved(object sender, SixAxisEventArgs unused);
void touchUnchanged(object sender, EventArgs unused);
void touchesBegan(DS4Touchpad sender, TouchpadEventArgs arg);
void touchesMoved(DS4Touchpad sender, TouchpadEventArgs arg);
void touchButtonUp(DS4Touchpad sender, TouchpadEventArgs arg);
void touchButtonDown(DS4Touchpad sender, TouchpadEventArgs arg);
void touchesEnded(DS4Touchpad sender, TouchpadEventArgs arg);
void sixaxisMoved(DS4SixAxis sender, SixAxisEventArgs unused);
void touchUnchanged(DS4Touchpad sender, EventArgs unused);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,7 @@ namespace DS4Windows
public bool priorLeftDown, priorRightDown, priorUpperDown, priorMultiDown;
protected DS4Controls pushed = DS4Controls.None;
protected Mapping.Click clicked = Mapping.Click.None;
public int CursorGyroDead { get => cursor.GyroCursorDeadZone; set => cursor.GyroCursorDeadZone = value; }
internal const int TRACKBALL_INIT_FICTION = 10;
internal const int TRACKBALL_MASS = 45;
@ -57,10 +58,20 @@ namespace DS4Windows
trackballAccel = TRACKBALL_RADIUS * friction / TRACKBALL_INERTIA;
}
bool triggeractivated = false;
bool useReverseRatchet = false;
public void ResetToggleGyroM()
{
currentToggleGyroM = false;
}
public virtual void sixaxisMoved(object sender, SixAxisEventArgs arg)
bool triggeractivated = false;
bool previousTriggerActivated = false;
bool useReverseRatchet = false;
bool toggleGyroMouse = true;
public bool ToggleGyroMouse { get => toggleGyroMouse;
set { toggleGyroMouse = value; ResetToggleGyroM(); } }
bool currentToggleGyroM = false;
public virtual void sixaxisMoved(DS4SixAxis sender, SixAxisEventArgs arg)
{
if (Global.isUsingSAforMouse(deviceNum) && Global.getGyroSensitivity(deviceNum) > 0)
{
@ -90,6 +101,21 @@ namespace DS4Windows
}
}
if (toggleGyroMouse)
{
if (triggeractivated && triggeractivated != previousTriggerActivated)
{
currentToggleGyroM = !currentToggleGyroM;
}
previousTriggerActivated = triggeractivated;
triggeractivated = currentToggleGyroM;
}
else
{
previousTriggerActivated = triggeractivated;
}
if (useReverseRatchet && triggeractivated)
cursor.sixaxisMoved(arg);
else if (!useReverseRatchet && !triggeractivated)
@ -130,7 +156,7 @@ namespace DS4Windows
}
private bool tempBool = false;
public virtual void touchesMoved(object sender, TouchpadEventArgs arg)
public virtual void touchesMoved(DS4Touchpad sender, TouchpadEventArgs arg)
{
s = dev.getCurrentStateRef();
@ -184,7 +210,7 @@ namespace DS4Windows
synthesizeMouseButtons();
}
public virtual void touchesBegan(object sender, TouchpadEventArgs arg)
public virtual void touchesBegan(DS4Touchpad sender, TouchpadEventArgs arg)
{
if (!Global.UseTPforControls[deviceNum])
{
@ -217,7 +243,7 @@ namespace DS4Windows
synthesizeMouseButtons();
}
public virtual void touchesEnded(object sender, TouchpadEventArgs arg)
public virtual void touchesEnded(DS4Touchpad sender, TouchpadEventArgs arg)
{
s = dev.getCurrentStateRef();
slideright = slideleft = false;
@ -349,7 +375,7 @@ namespace DS4Windows
return t.hwX >= 1920 * 2 / 5;
}
public virtual void touchUnchanged(object sender, EventArgs unused)
public virtual void touchUnchanged(DS4Touchpad sender, EventArgs unused)
{
s = dev.getCurrentStateRef();
@ -419,6 +445,7 @@ namespace DS4Windows
}
public bool dragging, dragging2;
private void synthesizeMouseButtons()
{
if (Global.GetDS4Action(deviceNum, DS4Controls.TouchLeft, false) == null && leftDown)
@ -464,7 +491,7 @@ namespace DS4Windows
}
}
public virtual void touchButtonUp(object sender, TouchpadEventArgs arg)
public virtual void touchButtonUp(DS4Touchpad sender, TouchpadEventArgs arg)
{
pushed = DS4Controls.None;
upperDown = leftDown = rightDown = multiDown = false;
@ -474,7 +501,7 @@ namespace DS4Windows
synthesizeMouseButtons();
}
public virtual void touchButtonDown(object sender, TouchpadEventArgs arg)
public virtual void touchButtonDown(DS4Touchpad sender, TouchpadEventArgs arg)
{
if (arg.touches == null)
upperDown = true;

View File

@ -21,7 +21,7 @@ namespace DS4Windows
private Direction hDirection = Direction.Neutral, vDirection = Direction.Neutral;
private const double GYRO_MOUSE_COEFFICIENT = 0.0095;
private const int GYRO_MOUSE_DEADZONE = 10;
public const int GYRO_MOUSE_DEADZONE = 10;
private const double GYRO_MOUSE_OFFSET = 0.1463;
private const double GYRO_SMOOTH_MOUSE_OFFSET = 0.14698;
private const double TOUCHPAD_MOUSE_OFFSET = 0.015;
@ -30,7 +30,8 @@ namespace DS4Windows
private double[] xSmoothBuffer = new double[SMOOTH_BUFFER_LEN];
private double[] ySmoothBuffer = new double[SMOOTH_BUFFER_LEN];
private int smoothBufferTail = 0;
private int gyroCursorDeadZone = GYRO_MOUSE_DEADZONE;
public int GyroCursorDeadZone { get => gyroCursorDeadZone; set => gyroCursorDeadZone = value; }
double coefficient = 0.0;
@ -80,8 +81,8 @@ namespace DS4Windows
vRemainder = 0.0;
}
int deadzoneX = (int)Math.Abs(normX * GYRO_MOUSE_DEADZONE);
int deadzoneY = (int)Math.Abs(normY * GYRO_MOUSE_DEADZONE);
int deadzoneX = (int)Math.Abs(normX * gyroCursorDeadZone);
int deadzoneY = (int)Math.Abs(normY * gyroCursorDeadZone);
if (Math.Abs(deltaX) > deadzoneX)
{

View File

@ -20,6 +20,8 @@ namespace DS4Windows
public enum DS4Controls : byte { None, LXNeg, LXPos, LYNeg, LYPos, RXNeg, RXPos, RYNeg, RYPos, L1, L2, L3, R1, R2, R3, Square, Triangle, Circle, Cross, DpadUp, DpadRight, DpadDown, DpadLeft, PS, TouchLeft, TouchUpper, TouchMulti, TouchRight, Share, Options, GyroXPos, GyroXNeg, GyroZPos, GyroZNeg, SwipeLeft, SwipeRight, SwipeUp, SwipeDown };
public enum X360Controls : byte { None, LXNeg, LXPos, LYNeg, LYPos, RXNeg, RXPos, RYNeg, RYPos, LB, LT, LS, RB, RT, RS, X, Y, B, A, DpadUp, DpadRight, DpadDown, DpadLeft, Guide, Back, Start, LeftMouse, RightMouse, MiddleMouse, FourthMouse, FifthMouse, WUP, WDOWN, MouseUp, MouseDown, MouseLeft, MouseRight, Unbound };
public enum SASteeringWheelEmulationAxisType: byte { None = 0, LX, LY, RX, RY, L2R2, VJoy1X, VJoy1Y, VJoy1Z, VJoy2X, VJoy2Y, VJoy2Z };
public class DS4ControlSettings
{
public DS4Controls control;
@ -270,6 +272,7 @@ namespace DS4Windows
m_Config.m_Profile = appdatapath + "\\Profiles.xml";
m_Config.m_Actions = appdatapath + "\\Actions.xml";
m_Config.m_linkedProfiles = Global.appdatapath + "\\LinkedProfiles.xml";
m_Config.m_controllerConfigs = Global.appdatapath + "\\ControllerConfigs.xml";
}
/// <summary>
@ -730,6 +733,18 @@ namespace DS4Windows
m_Config.SetSaTriggerCond(index, text);
}
public static SASteeringWheelEmulationAxisType[] SASteeringWheelEmulationAxis => m_Config.sASteeringWheelEmulationAxis;
public static SASteeringWheelEmulationAxisType GetSASteeringWheelEmulationAxis(int index)
{
return m_Config.sASteeringWheelEmulationAxis[index];
}
public static int[] SASteeringWheelEmulationRange => m_Config.sASteeringWheelEmulationRange;
public static int GetSASteeringWheelEmulationRange(int index)
{
return m_Config.sASteeringWheelEmulationRange[index];
}
public static int[][] TouchDisInvertTriggers => m_Config.touchDisInvertTriggers;
public static int[] getTouchDisInvertTriggers(int index)
{
@ -778,28 +793,43 @@ namespace DS4Windows
return m_Config.gyroMouseHorizontalAxis[index];
}
public static DS4Color[] MainColor => m_Config.m_Leds;
public static DS4Color getMainColor(int index)
public static int[] GyroMouseDeadZone => m_Config.gyroMouseDZ;
public static int GetGyroMouseDeadZone(int index)
{
return m_Config.m_Leds[index];
return m_Config.gyroMouseDZ[index];
}
public static void SetGyroMouseDeadZone(int index, int value, ControlService control)
{
m_Config.SetGyroMouseDZ(index, value, control);
}
public static bool[] GyroMouseToggle => m_Config.gyroMouseToggle;
public static void SetGyroMouseToggle(int index, bool value, ControlService control)
=> m_Config.SetGyroMouseToggle(index, value, control);
public static DS4Color[] MainColor => m_Config.m_Leds;
public static ref DS4Color getMainColor(int index)
{
return ref m_Config.m_Leds[index];
}
public static DS4Color[] LowColor => m_Config.m_LowLeds;
public static DS4Color getLowColor(int index)
public static ref DS4Color getLowColor(int index)
{
return m_Config.m_LowLeds[index];
return ref m_Config.m_LowLeds[index];
}
public static DS4Color[] ChargingColor => m_Config.m_ChargingLeds;
public static DS4Color getChargingColor(int index)
public static ref DS4Color getChargingColor(int index)
{
return m_Config.m_ChargingLeds[index];
return ref m_Config.m_ChargingLeds[index];
}
public static DS4Color[] CustomColor => m_Config.m_CustomLeds;
public static DS4Color getCustomColor(int index)
public static ref DS4Color getCustomColor(int index)
{
return m_Config.m_CustomLeds[index];
return ref m_Config.m_CustomLeds[index];
}
public static bool[] UseCustomLed => m_Config.useCustomLeds;
@ -809,9 +839,9 @@ namespace DS4Windows
}
public static DS4Color[] FlashColor => m_Config.m_FlashLeds;
public static DS4Color getFlashColor(int index)
public static ref DS4Color getFlashColor(int index)
{
return m_Config.m_FlashLeds[index];
return ref m_Config.m_FlashLeds[index];
}
public static byte[] TapSensitivity => m_Config.tapSensitivity;
@ -1297,6 +1327,30 @@ namespace DS4Windows
return m_Config.LoadLinkedProfiles();
}
public static bool SaveControllerConfigs(DS4Device device = null)
{
if (device != null)
return m_Config.SaveControllerConfigsForDevice(device);
for (int idx = 0; idx < ControlService.DS4_CONTROLLER_COUNT; idx++)
if (Program.rootHub.DS4Controllers[idx] != null)
m_Config.SaveControllerConfigsForDevice(Program.rootHub.DS4Controllers[idx]);
return true;
}
public static bool LoadControllerConfigs(DS4Device device = null)
{
if (device != null)
return m_Config.LoadControllerConfigsForDevice(device);
for (int idx = 0; idx < ControlService.DS4_CONTROLLER_COUNT; idx++)
if (Program.rootHub.DS4Controllers[idx] != null)
m_Config.LoadControllerConfigsForDevice(Program.rootHub.DS4Controllers[idx]);
return true;
}
private static byte applyRatio(byte b1, byte b2, double r)
{
if (r > 100.0)
@ -1304,17 +1358,20 @@ namespace DS4Windows
else if (r < 0.0)
r = 0.0;
r /= 100.0;
return (byte)Math.Round((b1 * (1 - r) + b2 * r), 0);
r *= 0.01;
return (byte)Math.Round((b1 * (1 - r)) + b2 * r, 0);
}
public static DS4Color getTransitionedColor(DS4Color c1, DS4Color c2, double ratio)
public static DS4Color getTransitionedColor(ref DS4Color c1, ref DS4Color c2, double ratio)
{
//Color cs = Color.FromArgb(c1.red, c1.green, c1.blue);
c1.red = applyRatio(c1.red, c2.red, ratio);
c1.green = applyRatio(c1.green, c2.green, ratio);
c1.blue = applyRatio(c1.blue, c2.blue, ratio);
return c1;
DS4Color cs = new DS4Color
{
red = applyRatio(c1.red, c2.red, ratio),
green = applyRatio(c1.green, c2.green, ratio),
blue = applyRatio(c1.blue, c2.blue, ratio)
};
return cs;
}
private static Color applyRatio(Color c1, Color c2, uint r)
@ -1395,6 +1452,7 @@ namespace DS4Windows
public String m_Profile = Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName + "\\Profiles.xml";
public String m_Actions = Global.appdatapath + "\\Actions.xml";
public string m_linkedProfiles = Global.appdatapath + "\\LinkedProfiles.xml";
public string m_controllerConfigs = Global.appdatapath + "\\ControllerConfigs.xml";
protected XmlDocument m_Xdoc = new XmlDocument();
// fifth value used for options, not fifth controller
@ -1437,6 +1495,11 @@ namespace DS4Windows
public int[] flashAt = new int[5] { 0, 0, 0, 0, 0 };
public bool[] mouseAccel = new bool[5] { true, true, true, true, true };
public int[] btPollRate = new int[5] { 4, 4, 4, 4, 4 };
public int[] gyroMouseDZ = new int[5] { MouseCursor.GYRO_MOUSE_DEADZONE, MouseCursor.GYRO_MOUSE_DEADZONE,
MouseCursor.GYRO_MOUSE_DEADZONE, MouseCursor.GYRO_MOUSE_DEADZONE,
MouseCursor.GYRO_MOUSE_DEADZONE };
public bool[] gyroMouseToggle = new bool[5] { false, false, false,
false, false };
public int[] lsOutCurveMode = new int[5] { 0, 0, 0, 0, 0 };
public int[] rsOutCurveMode = new int[5] { 0, 0, 0, 0, 0 };
public int[] l2OutCurveMode = new int[5] { 0, 0, 0, 0, 0 };
@ -1494,6 +1557,8 @@ namespace DS4Windows
public bool[] useSAforMouse = new bool[5] { false, false, false, false, false };
public string[] sATriggers = new string[5] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty };
public bool[] sATriggerCond = new bool[5] { true, true, true, true, true };
public SASteeringWheelEmulationAxisType[] sASteeringWheelEmulationAxis = new SASteeringWheelEmulationAxisType[5] { SASteeringWheelEmulationAxisType.None, SASteeringWheelEmulationAxisType.None, SASteeringWheelEmulationAxisType.None, SASteeringWheelEmulationAxisType.None, SASteeringWheelEmulationAxisType.None };
public int[] sASteeringWheelEmulationRange = new int[5] { 360, 360, 360, 360, 360 };
public int[][] touchDisInvertTriggers = new int[5][] { new int[1] { -1 }, new int[1] { -1 }, new int[1] { -1 },
new int[1] { -1 }, new int[1] { -1 } };
public int[] lsCurve = new int[5] { 0, 0, 0, 0, 0 };
@ -1579,6 +1644,7 @@ namespace DS4Windows
case 1: result = "enhanced-precision"; break;
case 2: result = "quadratic"; break;
case 3: result = "cubic"; break;
case 4: result = "easeout-quad"; break;
default: break;
}
@ -1594,6 +1660,7 @@ namespace DS4Windows
case "enhanced-precision": id = 1; break;
case "quadratic": id = 2; break;
case "cubic": id = 3; break;
case "easeout-quad": id = 4; break;
default: break;
}
@ -1608,6 +1675,7 @@ namespace DS4Windows
case 0: break;
case 1: result = "quadratic"; break;
case 2: result = "cubic"; break;
case 3: result = "easeout-quad"; break;
default: break;
}
@ -1622,6 +1690,7 @@ namespace DS4Windows
case "linear": id = 0; break;
case "quadratic": id = 1; break;
case "cubic": id = 2; break;
case "easeout-quad": id = 3; break;
default: break;
}
@ -1652,6 +1721,20 @@ namespace DS4Windows
sATriggerCond[index] = SaTriggerCondValue(text);
}
public void SetGyroMouseDZ(int index, int value, ControlService control)
{
gyroMouseDZ[index] = value;
if (index < 4 && control.touchPad[index] != null)
control.touchPad[index].CursorGyroDead = value;
}
public void SetGyroMouseToggle(int index, bool value, ControlService control)
{
gyroMouseToggle[index] = value;
if (index < 4 && control.touchPad[index] != null)
control.touchPad[index].ToggleGyroMouse = value;
}
public bool SaveProfile(int device, string propath)
{
bool Saved = true;
@ -1740,6 +1823,8 @@ namespace DS4Windows
XmlNode xmlUseSAforMouse = m_Xdoc.CreateNode(XmlNodeType.Element, "UseSAforMouse", null); xmlUseSAforMouse.InnerText = useSAforMouse[device].ToString(); Node.AppendChild(xmlUseSAforMouse);
XmlNode xmlSATriggers = m_Xdoc.CreateNode(XmlNodeType.Element, "SATriggers", null); xmlSATriggers.InnerText = sATriggers[device].ToString(); Node.AppendChild(xmlSATriggers);
XmlNode xmlSATriggerCond = m_Xdoc.CreateNode(XmlNodeType.Element, "SATriggerCond", null); xmlSATriggerCond.InnerText = SaTriggerCondString(sATriggerCond[device]); Node.AppendChild(xmlSATriggerCond);
XmlNode xmlSASteeringWheelEmulationAxis = m_Xdoc.CreateNode(XmlNodeType.Element, "SASteeringWheelEmulationAxis", null); xmlSASteeringWheelEmulationAxis.InnerText = sASteeringWheelEmulationAxis[device].ToString("G"); Node.AppendChild(xmlSASteeringWheelEmulationAxis);
XmlNode xmlSASteeringWheelEmulationRange = m_Xdoc.CreateNode(XmlNodeType.Element, "SASteeringWheelEmulationRange", null); xmlSASteeringWheelEmulationRange.InnerText = sASteeringWheelEmulationRange[device].ToString(); Node.AppendChild(xmlSASteeringWheelEmulationRange);
XmlNode xmlTouchDisInvTriggers = m_Xdoc.CreateNode(XmlNodeType.Element, "TouchDisInvTriggers", null);
string tempTouchDisInv = string.Join(",", touchDisInvertTriggers[device]);
@ -1753,6 +1838,8 @@ namespace DS4Windows
XmlNode xmlGyroSmoothWeight = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroSmoothingWeight", null); xmlGyroSmoothWeight.InnerText = Convert.ToInt32(gyroSmoothWeight[device] * 100).ToString(); Node.AppendChild(xmlGyroSmoothWeight);
XmlNode xmlGyroSmoothing = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroSmoothing", null); xmlGyroSmoothing.InnerText = gyroSmoothing[device].ToString(); Node.AppendChild(xmlGyroSmoothing);
XmlNode xmlGyroMouseHAxis = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroMouseHAxis", null); xmlGyroMouseHAxis.InnerText = gyroMouseHorizontalAxis[device].ToString(); Node.AppendChild(xmlGyroMouseHAxis);
XmlNode xmlGyroMouseDZ = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroMouseDeadZone", null); xmlGyroMouseDZ.InnerText = gyroMouseDZ[device].ToString(); Node.AppendChild(xmlGyroMouseDZ);
XmlNode xmlGyroMouseToggle = m_Xdoc.CreateNode(XmlNodeType.Element, "GyroMouseToggle", null); xmlGyroMouseToggle.InnerText = gyroMouseToggle[device].ToString(); Node.AppendChild(xmlGyroMouseToggle);
XmlNode xmlLSC = m_Xdoc.CreateNode(XmlNodeType.Element, "LSCurve", null); xmlLSC.InnerText = lsCurve[device].ToString(); Node.AppendChild(xmlLSC);
XmlNode xmlRSC = m_Xdoc.CreateNode(XmlNodeType.Element, "RSCurve", null); xmlRSC.InnerText = rsCurve[device].ToString(); Node.AppendChild(xmlRSC);
XmlNode xmlProfileActions = m_Xdoc.CreateNode(XmlNodeType.Element, "ProfileActions", null); xmlProfileActions.InnerText = string.Join("/", profileActions[device]); Node.AppendChild(xmlProfileActions);
@ -2562,7 +2649,6 @@ namespace DS4Windows
catch { dinputOnly[device] = false; missingSetting = true; }
bool oldUseDInputOnly = Global.useDInputOnly[device];
Global.useDInputOnly[device] = dinputOnly[device];
// Only change xinput devices under certain conditions. Avoid
// performing this upon program startup before loading devices.
@ -2578,20 +2664,14 @@ namespace DS4Windows
{
if (dinputOnly[device] == true)
{
Global.useDInputOnly[device] = true;
xinputPlug = false;
xinputStatus = true;
}
else if (synced && isAlive)
{
Global.useDInputOnly[device] = false;
xinputPlug = true;
xinputStatus = true;
}
else if (!synced)
{
Global.useDInputOnly[device] = true;
}
}
}
}
@ -2616,7 +2696,14 @@ namespace DS4Windows
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SATriggerCond"); sATriggerCond[device] = SaTriggerCondValue(Item.InnerText); }
catch { sATriggerCond[device] = true; missingSetting = true; }
try {
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SASteeringWheelEmulationAxis"); SASteeringWheelEmulationAxisType.TryParse(Item.InnerText, out sASteeringWheelEmulationAxis[device]); }
catch { sASteeringWheelEmulationAxis[device] = SASteeringWheelEmulationAxisType.None; missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SASteeringWheelEmulationRange"); int.TryParse(Item.InnerText, out sASteeringWheelEmulationRange[device]); }
catch { sASteeringWheelEmulationRange[device] = 360; missingSetting = true; }
try
{
Item = m_Xdoc.SelectSingleNode("/" + rootname + "/TouchDisInvTriggers");
string[] triggers = Item.InnerText.Split(',');
int temp = -1;
@ -2652,6 +2739,17 @@ namespace DS4Windows
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroMouseHAxis"); int temp = 0; int.TryParse(Item.InnerText, out temp); gyroMouseHorizontalAxis[device] = Math.Min(Math.Max(0, temp), 1); }
catch { gyroMouseHorizontalAxis[device] = 0; missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroMouseDeadZone"); int.TryParse(Item.InnerText, out int temp);
SetGyroMouseDZ(device, temp, control); }
catch { SetGyroMouseDZ(device, MouseCursor.GYRO_MOUSE_DEADZONE, control); missingSetting = true; }
try
{
Item = m_Xdoc.SelectSingleNode("/" + rootname + "/GyroMouseToggle"); bool.TryParse(Item.InnerText, out bool temp);
SetGyroMouseToggle(device, temp, control);
}
catch { SetGyroMouseToggle(device, false, control); missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/LSCurve"); int.TryParse(Item.InnerText, out lsCurve[device]); }
catch { lsCurve[device] = 0; missingSetting = true; }
@ -2942,12 +3040,14 @@ namespace DS4Windows
{
control.x360controls[device] = new Nefarius.ViGEm.Client.Targets.Xbox360Controller(control.vigemTestClient);
control.x360controls[device].Connect();
Global.useDInputOnly[device] = false;
AppLogger.LogToGui("X360 Controller # " + (device + 1) + " connected", false);
}
else if (xinputStatus && !xinputPlug)
{
control.x360controls[device].Disconnect();
control.x360controls[device] = null;
Global.useDInputOnly[device] = true;
AppLogger.LogToGui("X360 Controller # " + (device + 1) + " unplugged", false);
}
@ -3239,6 +3339,10 @@ namespace DS4Windows
el.AppendChild(m_Xdoc.CreateElement("Type")).InnerText = "MultiAction";
el.AppendChild(m_Xdoc.CreateElement("Details")).InnerText = details;
break;
case 8:
el.AppendChild(m_Xdoc.CreateElement("Type")).InnerText = "SASteeringWheelEmulationCalibrate";
el.AppendChild(m_Xdoc.CreateElement("Details")).InnerText = details;
break;
}
if (edit)
@ -3358,6 +3462,14 @@ namespace DS4Windows
{
actions.Add(new SpecialAction(name, controls, type, details));
}
else if (type == "SASteeringWheelEmulationCalibrate")
{
double doub;
if (double.TryParse(details, out doub))
actions.Add(new SpecialAction(name, controls, type, "", doub));
else
actions.Add(new SpecialAction(name, controls, type, ""));
}
}
}
catch { saved = false; }
@ -3442,9 +3554,11 @@ namespace DS4Windows
linkedXdoc.AppendChild(Node);
Dictionary<string, string>.KeyCollection serials = linkedProfiles.Keys;
for (int i = 0, itemCount = linkedProfiles.Count; i < itemCount; i++)
//for (int i = 0, itemCount = linkedProfiles.Count; i < itemCount; i++)
for (var serialEnum = serials.GetEnumerator(); serialEnum.MoveNext();)
{
string serial = serials.ElementAt(i);
//string serial = serials.ElementAt(i);
string serial = serialEnum.Current;
string profile = linkedProfiles[serial];
XmlElement link = linkedXdoc.CreateElement("MAC" + serial);
link.InnerText = profile;
@ -3463,6 +3577,107 @@ namespace DS4Windows
return saved;
}
public bool createControllerConfigs()
{
bool saved = true;
XmlDocument configXdoc = new XmlDocument();
XmlNode Node;
Node = configXdoc.CreateXmlDeclaration("1.0", "utf-8", string.Empty);
configXdoc.AppendChild(Node);
Node = configXdoc.CreateComment(string.Format(" Controller config data. {0} ", DateTime.Now));
configXdoc.AppendChild(Node);
Node = configXdoc.CreateWhitespace("\r\n");
configXdoc.AppendChild(Node);
Node = configXdoc.CreateNode(XmlNodeType.Element, "Controllers", "");
configXdoc.AppendChild(Node);
try { configXdoc.Save(m_controllerConfigs); }
catch (UnauthorizedAccessException) { AppLogger.LogToGui("Unauthorized Access - Save failed to path: " + m_controllerConfigs, false); saved = false; }
return saved;
}
public bool LoadControllerConfigsForDevice(DS4Device device)
{
bool loaded = false;
if (device == null) return false;
if (!File.Exists(m_controllerConfigs)) createControllerConfigs();
try
{
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(m_controllerConfigs);
XmlNode node = xmlDoc.SelectSingleNode("/Controllers/Controller[@Mac=\"" + device.getMacAddress() + "\"]");
if (node != null)
{
Int32 intValue;
if (Int32.TryParse(node["wheelCenterPoint"].InnerText.Split(',')[0], out intValue)) device.wheelCenterPoint.X = intValue;
if (Int32.TryParse(node["wheelCenterPoint"].InnerText.Split(',')[1], out intValue)) device.wheelCenterPoint.Y = intValue;
if (Int32.TryParse(node["wheel90DegPointLeft"].InnerText.Split(',')[0], out intValue)) device.wheel90DegPointLeft.X = intValue;
if (Int32.TryParse(node["wheel90DegPointLeft"].InnerText.Split(',')[1], out intValue)) device.wheel90DegPointLeft.Y = intValue;
if (Int32.TryParse(node["wheel90DegPointRight"].InnerText.Split(',')[0], out intValue)) device.wheel90DegPointRight.X = intValue;
if (Int32.TryParse(node["wheel90DegPointRight"].InnerText.Split(',')[1], out intValue)) device.wheel90DegPointRight.Y = intValue;
loaded = true;
}
}
catch
{
AppLogger.LogToGui("ControllerConfigs.xml can't be found.", false);
loaded = false;
}
return loaded;
}
public bool SaveControllerConfigsForDevice(DS4Device device)
{
bool saved = true;
if (device == null) return false;
if (!File.Exists(m_controllerConfigs)) createControllerConfigs();
try
{
//XmlNode node = null;
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(m_controllerConfigs);
XmlNode node = xmlDoc.SelectSingleNode("/Controllers/Controller[@Mac=\"" + device.getMacAddress() + "\"]");
if (node == null)
{
XmlNode xmlControllersNode = xmlDoc.SelectSingleNode("/Controllers");
XmlElement el = xmlDoc.CreateElement("Controller");
el.SetAttribute("Mac", device.getMacAddress());
el.AppendChild(xmlDoc.CreateElement("wheelCenterPoint"));
el.AppendChild(xmlDoc.CreateElement("wheel90DegPointLeft"));
el.AppendChild(xmlDoc.CreateElement("wheel90DegPointRight"));
node = xmlControllersNode.AppendChild(el);
}
node["wheelCenterPoint"].InnerText = $"{device.wheelCenterPoint.X},{device.wheelCenterPoint.Y}";
node["wheel90DegPointLeft"].InnerText = $"{device.wheel90DegPointLeft.X},{device.wheel90DegPointLeft.Y}";
node["wheel90DegPointRight"].InnerText = $"{device.wheel90DegPointRight.X},{device.wheel90DegPointRight.Y}";
xmlDoc.Save(m_controllerConfigs);
}
catch (UnauthorizedAccessException)
{
AppLogger.LogToGui("Unauthorized Access - Save failed to path: " + m_controllerConfigs, false);
saved = false;
}
return saved;
}
public void UpdateDS4CSetting(int deviceNum, string buttonName, bool shift, object action, string exts, DS4KeyType kt, int trigger = 0)
{
DS4Controls dc;
@ -3535,7 +3750,7 @@ namespace DS4Windows
DS4ControlSettings dcs = ds4settings[deviceNum][index];
if (shift)
{
return dcs.shiftTrigger;
return dcs.shiftAction;
}
else
{
@ -3555,7 +3770,7 @@ namespace DS4Windows
DS4ControlSettings dcs = ds4settings[deviceNum][index];
if (shift)
{
return dcs.shiftTrigger;
return dcs.shiftAction;
}
else
{
@ -3763,6 +3978,8 @@ namespace DS4Windows
useSAforMouse[device] = false;
sATriggers[device] = string.Empty;
sATriggerCond[device] = true;
sASteeringWheelEmulationAxis[device] = SASteeringWheelEmulationAxisType.None;
sASteeringWheelEmulationRange[device] = 360;
touchDisInvertTriggers[device] = new int[1] { -1 };
lsCurve[device] = rsCurve[device] = 0;
gyroSensitivity[device] = 100;
@ -3784,7 +4001,7 @@ namespace DS4Windows
public class SpecialAction
{
public enum ActionTypeId { None, Key, Program, Profile, Macro, DisconnectBT, BatteryCheck, MultiAction, XboxGameDVR }
public enum ActionTypeId { None, Key, Program, Profile, Macro, DisconnectBT, BatteryCheck, MultiAction, XboxGameDVR, SASteeringWheelEmulationCalibrate }
public string name;
public List<DS4Controls> trigger = new List<DS4Controls>();
@ -3902,6 +4119,10 @@ namespace DS4Windows
type = "MultiAction";
this.details = string.Join(",", macros);
}
else if (type == "SASteeringWheelEmulationCalibrate")
{
typeID = ActionTypeId.SASteeringWheelEmulationCalibrate;
}
else
this.details = details;

View File

@ -100,7 +100,7 @@ namespace DS4Windows
Output[4] = (Byte)(device + firstController);
Output[9] = 0x14;
for (int i = 10, outLen = Output.Length; i < outLen; i++)
for (int i = 10; i < 28; i++)
{
Output[i] = 0;
}
@ -127,13 +127,78 @@ namespace DS4Windows
if (state.PS) Output[11] |= (Byte)(1 << 2); // Guide
SASteeringWheelEmulationAxisType steeringWheelMappedAxis = Global.GetSASteeringWheelEmulationAxis(device);
Int32 ThumbLX;
Int32 ThumbLY;
Int32 ThumbRX;
Int32 ThumbRY;
Output[12] = state.L2; // Left Trigger
Output[13] = state.R2; // Right Trigger
Int32 ThumbLX = Scale(state.LX, false);
Int32 ThumbLY = Scale(state.LY, true);
Int32 ThumbRX = Scale(state.RX, false);
Int32 ThumbRY = Scale(state.RY, true);
switch(steeringWheelMappedAxis)
{
case SASteeringWheelEmulationAxisType.None:
ThumbLX = Scale(state.LX, false);
ThumbLY = Scale(state.LY, true);
ThumbRX = Scale(state.RX, false);
ThumbRY = Scale(state.RY, true);
break;
case SASteeringWheelEmulationAxisType.LX:
ThumbLX = state.SASteeringWheelEmulationUnit;
ThumbLY = Scale(state.LY, true);
ThumbRX = Scale(state.RX, false);
ThumbRY = Scale(state.RY, true);
break;
case SASteeringWheelEmulationAxisType.LY:
ThumbLX = Scale(state.LX, false);
ThumbLY = state.SASteeringWheelEmulationUnit;
ThumbRX = Scale(state.RX, false);
ThumbRY = Scale(state.RY, true);
break;
case SASteeringWheelEmulationAxisType.RX:
ThumbLX = Scale(state.LX, false);
ThumbLY = Scale(state.LY, true);
ThumbRX = state.SASteeringWheelEmulationUnit;
ThumbRY = Scale(state.RY, true);
break;
case SASteeringWheelEmulationAxisType.RY:
ThumbLX = Scale(state.LX, false);
ThumbLY = Scale(state.LY, true);
ThumbRX = Scale(state.RX, false);
ThumbRY = state.SASteeringWheelEmulationUnit;
break;
case SASteeringWheelEmulationAxisType.L2R2:
Output[12] = Output[13] = 0;
if (state.SASteeringWheelEmulationUnit >= 0) Output[12] = (Byte)state.SASteeringWheelEmulationUnit;
else Output[13] = (Byte)state.SASteeringWheelEmulationUnit;
goto case SASteeringWheelEmulationAxisType.None;
case SASteeringWheelEmulationAxisType.VJoy1X:
case SASteeringWheelEmulationAxisType.VJoy2X:
DS4Windows.VJoyFeeder.vJoyFeeder.FeedAxisValue(state.SASteeringWheelEmulationUnit, ((((uint)steeringWheelMappedAxis) - ((uint)SASteeringWheelEmulationAxisType.VJoy1X)) / 3) + 1, DS4Windows.VJoyFeeder.HID_USAGES.HID_USAGE_X);
goto case SASteeringWheelEmulationAxisType.None;
case SASteeringWheelEmulationAxisType.VJoy1Y:
case SASteeringWheelEmulationAxisType.VJoy2Y:
DS4Windows.VJoyFeeder.vJoyFeeder.FeedAxisValue(state.SASteeringWheelEmulationUnit, ((((uint)steeringWheelMappedAxis) - ((uint)SASteeringWheelEmulationAxisType.VJoy1X)) / 3) + 1, DS4Windows.VJoyFeeder.HID_USAGES.HID_USAGE_Y);
goto case SASteeringWheelEmulationAxisType.None;
case SASteeringWheelEmulationAxisType.VJoy1Z:
case SASteeringWheelEmulationAxisType.VJoy2Z:
DS4Windows.VJoyFeeder.vJoyFeeder.FeedAxisValue(state.SASteeringWheelEmulationUnit, ((((uint)steeringWheelMappedAxis) - ((uint)SASteeringWheelEmulationAxisType.VJoy1X)) / 3) + 1, DS4Windows.VJoyFeeder.HID_USAGES.HID_USAGE_Z);
goto case SASteeringWheelEmulationAxisType.None;
default:
// Should never come here but just in case use the NONE case as default handler....
goto case SASteeringWheelEmulationAxisType.None;
}
Output[14] = (Byte)((ThumbLX >> 0) & 0xFF); // LX
Output[15] = (Byte)((ThumbLX >> 8) & 0xFF);
Output[16] = (Byte)((ThumbLY >> 0) & 0xFF); // LY

View File

@ -63,7 +63,7 @@ namespace DS4Windows
{ "DS4Windows v" + FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion,
string.Empty, string.Empty, string.Empty, string.Empty };
private const string UPDATER_VERSION = "1.3.0";
private const string UPDATER_VERSION = "1.3.1";
private const int WM_QUERYENDSESSION = 0x11;
private const int WM_CLOSE = 0x10;
internal string updaterExe = Environment.Is64BitProcess ? "DS4Updater.exe" : "DS4Updater_x86.exe";
@ -786,7 +786,7 @@ namespace DS4Windows
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
string version = fvi.FileVersion;
string newversion = File.ReadAllText(appdatapath + "\\version.txt").Trim();
if (version.Replace(',', '.').CompareTo(newversion) != 0)
if (!string.IsNullOrWhiteSpace(newversion) && version.Replace(',', '.').CompareTo(newversion) != 0)
{
if ((DialogResult)this.Invoke(new Func<DialogResult>(() => {
return MessageBox.Show(Properties.Resources.DownloadVersion.Replace("*number*", newversion),
@ -2097,7 +2097,7 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
string version2 = fvi.FileVersion;
string newversion2 = File.ReadAllText(appdatapath + "\\version.txt").Trim();
if (version2.Replace(',', '.').CompareTo(newversion2) != 0)
if (!string.IsNullOrWhiteSpace(newversion2) && version2.Replace(',', '.').CompareTo(newversion2) != 0)
{
if ((DialogResult)this.Invoke(new Func<DialogResult>(() =>
{

View File

@ -188,6 +188,11 @@
this.lbGyroXP = new System.Windows.Forms.Label();
this.bnGyroXN = new System.Windows.Forms.Button();
this.lbGyroXN = new System.Windows.Forms.Label();
this.lblSteeringWheelEmulationAxis = new System.Windows.Forms.Label();
this.cBSteeringWheelEmulationAxis = new System.Windows.Forms.ComboBox();
this.lblSteeringWheelEmulationRange = new System.Windows.Forms.Label();
this.cBSteeringWheelEmulationRange = new System.Windows.Forms.ComboBox();
this.btnSteeringWheelEmulationCalibrate = new System.Windows.Forms.Button();
this.tCControls = new System.Windows.Forms.TabControl();
this.tPControls = new System.Windows.Forms.TabPage();
this.lBControls = new System.Windows.Forms.ListBox();
@ -315,6 +320,11 @@
this.rBSAControls = new System.Windows.Forms.RadioButton();
this.rBSAMouse = new System.Windows.Forms.RadioButton();
this.pnlSAMouse = new System.Windows.Forms.Panel();
this.toggleGyroMCb = new System.Windows.Forms.CheckBox();
this.label27 = new System.Windows.Forms.Label();
this.gyroMouseDzNUD = new System.Windows.Forms.NumericUpDown();
this.label26 = new System.Windows.Forms.Label();
this.triggerCondAndCombo = new System.Windows.Forms.ComboBox();
this.cBGyroMouseXAxis = new System.Windows.Forms.ComboBox();
this.label16 = new System.Windows.Forms.Label();
this.lbGyroSmooth = new System.Windows.Forms.Label();
@ -386,8 +396,6 @@
this.optionsTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.shareTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.psTouchInvStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.triggerCondAndCombo = new System.Windows.Forms.ComboBox();
this.label26 = new System.Windows.Forms.Label();
this.advColorDialog = new DS4Windows.AdvancedColorDialog();
((System.ComponentModel.ISupportInitialize)(this.nUDRainbow)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tBBlueBar)).BeginInit();
@ -470,6 +478,7 @@
this.fLPSettings.SuspendLayout();
this.gBGyro.SuspendLayout();
this.pnlSAMouse.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gyroMouseDzNUD)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDGyroSmoothWeight)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDGyroMouseVertScale)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDGyroSensitivity)).BeginInit();
@ -1856,6 +1865,11 @@
this.fLPTiltControls.Controls.Add(this.lbGyroXP);
this.fLPTiltControls.Controls.Add(this.bnGyroXN);
this.fLPTiltControls.Controls.Add(this.lbGyroXN);
this.fLPTiltControls.Controls.Add(this.lblSteeringWheelEmulationAxis);
this.fLPTiltControls.Controls.Add(this.cBSteeringWheelEmulationAxis);
this.fLPTiltControls.Controls.Add(this.lblSteeringWheelEmulationRange);
this.fLPTiltControls.Controls.Add(this.cBSteeringWheelEmulationRange);
this.fLPTiltControls.Controls.Add(this.btnSteeringWheelEmulationCalibrate);
resources.ApplyResources(this.fLPTiltControls, "fLPTiltControls");
this.fLPTiltControls.Name = "fLPTiltControls";
//
@ -1911,6 +1925,62 @@
resources.ApplyResources(this.lbGyroXN, "lbGyroXN");
this.lbGyroXN.Name = "lbGyroXN";
//
// lblSteeringWheelEmulationAxis
//
resources.ApplyResources(this.lblSteeringWheelEmulationAxis, "lblSteeringWheelEmulationAxis");
this.lblSteeringWheelEmulationAxis.Name = "lblSteeringWheelEmulationAxis";
//
// cBSteeringWheelEmulationAxis
//
this.cBSteeringWheelEmulationAxis.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cBSteeringWheelEmulationAxis.FormattingEnabled = true;
this.cBSteeringWheelEmulationAxis.Items.AddRange(new object[] {
resources.GetString("cBSteeringWheelEmulationAxis.Items"),
resources.GetString("cBSteeringWheelEmulationAxis.Items1"),
resources.GetString("cBSteeringWheelEmulationAxis.Items2"),
resources.GetString("cBSteeringWheelEmulationAxis.Items3"),
resources.GetString("cBSteeringWheelEmulationAxis.Items4"),
resources.GetString("cBSteeringWheelEmulationAxis.Items5"),
resources.GetString("cBSteeringWheelEmulationAxis.Items6"),
resources.GetString("cBSteeringWheelEmulationAxis.Items7"),
resources.GetString("cBSteeringWheelEmulationAxis.Items8"),
resources.GetString("cBSteeringWheelEmulationAxis.Items9"),
resources.GetString("cBSteeringWheelEmulationAxis.Items10"),
resources.GetString("cBSteeringWheelEmulationAxis.Items11")});
resources.ApplyResources(this.cBSteeringWheelEmulationAxis, "cBSteeringWheelEmulationAxis");
this.cBSteeringWheelEmulationAxis.Name = "cBSteeringWheelEmulationAxis";
this.cBSteeringWheelEmulationAxis.SelectedIndexChanged += new System.EventHandler(this.cBSteeringWheelEmulationAxis_SelectedIndexChanged);
//
// lblSteeringWheelEmulationRange
//
resources.ApplyResources(this.lblSteeringWheelEmulationRange, "lblSteeringWheelEmulationRange");
this.lblSteeringWheelEmulationRange.Name = "lblSteeringWheelEmulationRange";
//
// cBSteeringWheelEmulationRange
//
this.cBSteeringWheelEmulationRange.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cBSteeringWheelEmulationRange.FormattingEnabled = true;
this.cBSteeringWheelEmulationRange.Items.AddRange(new object[] {
resources.GetString("cBSteeringWheelEmulationRange.Items"),
resources.GetString("cBSteeringWheelEmulationRange.Items1"),
resources.GetString("cBSteeringWheelEmulationRange.Items2"),
resources.GetString("cBSteeringWheelEmulationRange.Items3"),
resources.GetString("cBSteeringWheelEmulationRange.Items4"),
resources.GetString("cBSteeringWheelEmulationRange.Items5"),
resources.GetString("cBSteeringWheelEmulationRange.Items6"),
resources.GetString("cBSteeringWheelEmulationRange.Items7"),
resources.GetString("cBSteeringWheelEmulationRange.Items8")});
resources.ApplyResources(this.cBSteeringWheelEmulationRange, "cBSteeringWheelEmulationRange");
this.cBSteeringWheelEmulationRange.Name = "cBSteeringWheelEmulationRange";
this.cBSteeringWheelEmulationRange.SelectedIndexChanged += new System.EventHandler(this.cBSteeringWheelEmulationRange_SelectedIndexChanged);
//
// btnSteeringWheelEmulationCalibrate
//
resources.ApplyResources(this.btnSteeringWheelEmulationCalibrate, "btnSteeringWheelEmulationCalibrate");
this.btnSteeringWheelEmulationCalibrate.Name = "btnSteeringWheelEmulationCalibrate";
this.btnSteeringWheelEmulationCalibrate.UseVisualStyleBackColor = true;
this.btnSteeringWheelEmulationCalibrate.Click += new System.EventHandler(this.btnSteeringWheelEmulationCalibrate_Click);
//
// tCControls
//
this.tCControls.Controls.Add(this.tPControls);
@ -3137,7 +3207,8 @@
this.cBSixaxisZOutputCurve.Items.AddRange(new object[] {
resources.GetString("cBSixaxisZOutputCurve.Items"),
resources.GetString("cBSixaxisZOutputCurve.Items1"),
resources.GetString("cBSixaxisZOutputCurve.Items2")});
resources.GetString("cBSixaxisZOutputCurve.Items2"),
resources.GetString("cBSixaxisZOutputCurve.Items3")});
resources.ApplyResources(this.cBSixaxisZOutputCurve, "cBSixaxisZOutputCurve");
this.cBSixaxisZOutputCurve.Name = "cBSixaxisZOutputCurve";
this.cBSixaxisZOutputCurve.SelectedIndexChanged += new System.EventHandler(this.cBSixaxisZOutputCurve_SelectedIndexChanged);
@ -3150,7 +3221,8 @@
this.cBSixaxisXOutputCurve.Items.AddRange(new object[] {
resources.GetString("cBSixaxisXOutputCurve.Items"),
resources.GetString("cBSixaxisXOutputCurve.Items1"),
resources.GetString("cBSixaxisXOutputCurve.Items2")});
resources.GetString("cBSixaxisXOutputCurve.Items2"),
resources.GetString("cBSixaxisXOutputCurve.Items3")});
resources.ApplyResources(this.cBSixaxisXOutputCurve, "cBSixaxisXOutputCurve");
this.cBSixaxisXOutputCurve.Name = "cBSixaxisXOutputCurve";
this.cBSixaxisXOutputCurve.SelectedIndexChanged += new System.EventHandler(this.cBSixaxisXOutputCurve_SelectedIndexChanged);
@ -3173,7 +3245,8 @@
this.cBR2OutputCurve.Items.AddRange(new object[] {
resources.GetString("cBR2OutputCurve.Items"),
resources.GetString("cBR2OutputCurve.Items1"),
resources.GetString("cBR2OutputCurve.Items2")});
resources.GetString("cBR2OutputCurve.Items2"),
resources.GetString("cBR2OutputCurve.Items3")});
resources.ApplyResources(this.cBR2OutputCurve, "cBR2OutputCurve");
this.cBR2OutputCurve.Name = "cBR2OutputCurve";
this.cBR2OutputCurve.SelectedIndexChanged += new System.EventHandler(this.cBR2OutputCurve_SelectedIndexChanged);
@ -3186,7 +3259,8 @@
this.cBL2OutputCurve.Items.AddRange(new object[] {
resources.GetString("cBL2OutputCurve.Items"),
resources.GetString("cBL2OutputCurve.Items1"),
resources.GetString("cBL2OutputCurve.Items2")});
resources.GetString("cBL2OutputCurve.Items2"),
resources.GetString("cBL2OutputCurve.Items3")});
resources.ApplyResources(this.cBL2OutputCurve, "cBL2OutputCurve");
this.cBL2OutputCurve.Name = "cBL2OutputCurve";
this.cBL2OutputCurve.SelectedIndexChanged += new System.EventHandler(this.cBL2OutputCurve_SelectedIndexChanged);
@ -3210,7 +3284,8 @@
resources.GetString("rsOutCurveComboBox.Items"),
resources.GetString("rsOutCurveComboBox.Items1"),
resources.GetString("rsOutCurveComboBox.Items2"),
resources.GetString("rsOutCurveComboBox.Items3")});
resources.GetString("rsOutCurveComboBox.Items3"),
resources.GetString("rsOutCurveComboBox.Items4")});
resources.ApplyResources(this.rsOutCurveComboBox, "rsOutCurveComboBox");
this.rsOutCurveComboBox.Name = "rsOutCurveComboBox";
this.rsOutCurveComboBox.SelectedIndexChanged += new System.EventHandler(this.rsOutCurveComboBox_SelectedIndexChanged);
@ -3224,7 +3299,8 @@
resources.GetString("lsOutCurveComboBox.Items"),
resources.GetString("lsOutCurveComboBox.Items1"),
resources.GetString("lsOutCurveComboBox.Items2"),
resources.GetString("lsOutCurveComboBox.Items3")});
resources.GetString("lsOutCurveComboBox.Items3"),
resources.GetString("lsOutCurveComboBox.Items4")});
resources.ApplyResources(this.lsOutCurveComboBox, "lsOutCurveComboBox");
this.lsOutCurveComboBox.Name = "lsOutCurveComboBox";
this.lsOutCurveComboBox.SelectedIndexChanged += new System.EventHandler(this.lsOutCurveComboBox_SelectedIndexChanged);
@ -3362,8 +3438,8 @@
this.gBGyro.BackColor = System.Drawing.SystemColors.Control;
this.gBGyro.Controls.Add(this.rBSAControls);
this.gBGyro.Controls.Add(this.rBSAMouse);
this.gBGyro.Controls.Add(this.pnlSAMouse);
this.gBGyro.Controls.Add(this.fLPTiltControls);
this.gBGyro.Controls.Add(this.pnlSAMouse);
resources.ApplyResources(this.gBGyro, "gBGyro");
this.gBGyro.Name = "gBGyro";
this.gBGyro.TabStop = false;
@ -3386,6 +3462,9 @@
//
// pnlSAMouse
//
this.pnlSAMouse.Controls.Add(this.toggleGyroMCb);
this.pnlSAMouse.Controls.Add(this.label27);
this.pnlSAMouse.Controls.Add(this.gyroMouseDzNUD);
this.pnlSAMouse.Controls.Add(this.label26);
this.pnlSAMouse.Controls.Add(this.triggerCondAndCombo);
this.pnlSAMouse.Controls.Add(this.cBGyroMouseXAxis);
@ -3408,6 +3487,44 @@
resources.ApplyResources(this.pnlSAMouse, "pnlSAMouse");
this.pnlSAMouse.Name = "pnlSAMouse";
//
// toggleGyroMCb
//
resources.ApplyResources(this.toggleGyroMCb, "toggleGyroMCb");
this.toggleGyroMCb.Name = "toggleGyroMCb";
this.toggleGyroMCb.UseVisualStyleBackColor = true;
this.toggleGyroMCb.Click += new System.EventHandler(this.toggleGyroMCb_Click);
//
// label27
//
resources.ApplyResources(this.label27, "label27");
this.label27.Name = "label27";
//
// gyroMouseDzNUD
//
resources.ApplyResources(this.gyroMouseDzNUD, "gyroMouseDzNUD");
this.gyroMouseDzNUD.Name = "gyroMouseDzNUD";
this.gyroMouseDzNUD.Value = new decimal(new int[] {
10,
0,
0,
0});
this.gyroMouseDzNUD.ValueChanged += new System.EventHandler(this.gyroMouseDzNUD_ValueChanged);
//
// label26
//
resources.ApplyResources(this.label26, "label26");
this.label26.Name = "label26";
//
// triggerCondAndCombo
//
this.triggerCondAndCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.triggerCondAndCombo.FormattingEnabled = true;
this.triggerCondAndCombo.Items.AddRange(new object[] {
resources.GetString("triggerCondAndCombo.Items"),
resources.GetString("triggerCondAndCombo.Items1")});
resources.ApplyResources(this.triggerCondAndCombo, "triggerCondAndCombo");
this.triggerCondAndCombo.Name = "triggerCondAndCombo";
//
// cBGyroMouseXAxis
//
this.cBGyroMouseXAxis.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
@ -4110,21 +4227,6 @@
resources.ApplyResources(this.psTouchInvStripMenuItem, "psTouchInvStripMenuItem");
this.psTouchInvStripMenuItem.CheckedChanged += new System.EventHandler(this.TouchDisableInvert_CheckedChanged);
//
// triggerCondAndCombo
//
this.triggerCondAndCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.triggerCondAndCombo.FormattingEnabled = true;
this.triggerCondAndCombo.Items.AddRange(new object[] {
resources.GetString("triggerCondAndCombo.Items"),
resources.GetString("triggerCondAndCombo.Items1")});
resources.ApplyResources(this.triggerCondAndCombo, "triggerCondAndCombo");
this.triggerCondAndCombo.Name = "triggerCondAndCombo";
//
// label26
//
resources.ApplyResources(this.label26, "label26");
this.label26.Name = "label26";
//
// Options
//
resources.ApplyResources(this, "$this");
@ -4234,6 +4336,7 @@
this.gBGyro.PerformLayout();
this.pnlSAMouse.ResumeLayout(false);
this.pnlSAMouse.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.gyroMouseDzNUD)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDGyroSmoothWeight)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDGyroMouseVertScale)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nUDGyroSensitivity)).EndInit();
@ -4614,5 +4717,13 @@
private System.Windows.Forms.CheckBox trackballCk;
private System.Windows.Forms.Label label26;
private System.Windows.Forms.ComboBox triggerCondAndCombo;
private System.Windows.Forms.Label lblSteeringWheelEmulationAxis;
private System.Windows.Forms.ComboBox cBSteeringWheelEmulationAxis;
private System.Windows.Forms.Label lblSteeringWheelEmulationRange;
private System.Windows.Forms.ComboBox cBSteeringWheelEmulationRange;
private System.Windows.Forms.Button btnSteeringWheelEmulationCalibrate;
private System.Windows.Forms.Label label27;
private System.Windows.Forms.NumericUpDown gyroMouseDzNUD;
private System.Windows.Forms.CheckBox toggleGyroMCb;
}
}

View File

@ -718,6 +718,13 @@ namespace DS4Windows
nUDGyroSmoothWeight.Value = (decimal)(GyroSmoothingWeight[device]);
cBGyroMouseXAxis.SelectedIndex = GyroMouseHorizontalAxis[device];
triggerCondAndCombo.SelectedIndex = SATriggerCond[device] ? 0 : 1;
gyroMouseDzNUD.Value = GyroMouseDeadZone[device];
toggleGyroMCb.Checked = GyroMouseToggle[device];
cBSteeringWheelEmulationAxis.SelectedIndex = (int) GetSASteeringWheelEmulationAxis(device);
int idxSASteeringWheelEmulationRange = cBSteeringWheelEmulationRange.Items.IndexOf(GetSASteeringWheelEmulationRange(device).ToString());
if (idxSASteeringWheelEmulationRange >= 0) cBSteeringWheelEmulationRange.SelectedIndex = idxSASteeringWheelEmulationRange;
}
else
{
@ -834,8 +841,12 @@ namespace DS4Windows
cBGyroInvertY.Checked = false;
cBGyroSmooth.Checked = false;
nUDGyroSmoothWeight.Value = 0.5m;
gyroMouseDzNUD.Value = MouseCursor.GYRO_MOUSE_DEADZONE;
toggleGyroMCb.Checked = false;
cBGyroMouseXAxis.SelectedIndex = 0;
triggerCondAndCombo.SelectedIndex = 0;
cBSteeringWheelEmulationAxis.SelectedIndex = 0;
cBSteeringWheelEmulationRange.SelectedIndex = cBSteeringWheelEmulationRange.Items.IndexOf("360");
Set();
}
@ -873,6 +884,9 @@ namespace DS4Windows
case "MultiAction":
lvi.SubItems.Add(Properties.Resources.MultiAction);
break;
case "SASteeringWheelEmulationCalibrate":
lvi.SubItems.Add(Properties.Resources.SASteeringWheelEmulationCalibrate);
break;
}
if (newp)
@ -1334,6 +1348,8 @@ namespace DS4Windows
GyroSmoothing[device] = cBGyroSmooth.Checked;
GyroSmoothingWeight[device] = (double)nUDGyroSmoothWeight.Value;
GyroMouseHorizontalAxis[device] = cBGyroMouseXAxis.SelectedIndex;
SetGyroMouseDeadZone(device, (int)gyroMouseDzNUD.Value, Program.rootHub);
SetGyroMouseToggle(device, toggleGyroMCb.Checked, Program.rootHub);
int invert = 0;
if (cBGyroInvertX.Checked)
@ -2814,6 +2830,8 @@ namespace DS4Windows
if (!loading)
{
GyroTriggerTurns[device] = gyroTriggerBehavior.Checked;
if (device < 4)
Program.rootHub.touchPad[device]?.ResetToggleGyroM();
}
}
@ -2989,6 +3007,98 @@ namespace DS4Windows
}
}
private void cBSteeringWheelEmulationRange_SelectedIndexChanged(object sender, EventArgs e)
{
if (loading == false)
{
SASteeringWheelEmulationRange[device] = Convert.ToInt32(cBSteeringWheelEmulationRange.Items[cBSteeringWheelEmulationRange.SelectedIndex].ToString());
}
}
private void cBSteeringWheelEmulationAxis_SelectedIndexChanged(object sender, EventArgs e)
{
if (loading == false)
{
if (cBSteeringWheelEmulationAxis.SelectedIndex >= 0) SASteeringWheelEmulationAxis[device] = (SASteeringWheelEmulationAxisType) ((byte) cBSteeringWheelEmulationAxis.SelectedIndex);
else SASteeringWheelEmulationAxis[device] = SASteeringWheelEmulationAxisType.None;
}
}
private void btnSteeringWheelEmulationCalibrate_Click(object sender, EventArgs e)
{
if(cBSteeringWheelEmulationAxis.SelectedIndex > 0)
{
DS4Device d;
int tempDeviceNum = (int)nUDSixaxis.Value - 1;
d = Program.rootHub.DS4Controllers[tempDeviceNum];
if (d != null)
{
Point origWheelCenterPoint = new Point(d.wheelCenterPoint.X, d.wheelCenterPoint.Y);
Point origWheel90DegPointLeft = new Point(d.wheel90DegPointLeft.X, d.wheel90DegPointLeft.Y);
Point origWheel90DegPointRight = new Point(d.wheel90DegPointRight.X, d.wheel90DegPointRight.Y);
d.WheelRecalibrateActiveState = 1;
DialogResult msgBoxResult = MessageBox.Show($"{Properties.Resources.SASteeringWheelEmulationCalibrate}.\n\n" +
$"{Properties.Resources.SASteeringWheelEmulationCalibrateInstruction1}.\n" +
$"{Properties.Resources.SASteeringWheelEmulationCalibrateInstruction2}.\n" +
$"{Properties.Resources.SASteeringWheelEmulationCalibrateInstruction3}.\n\n" +
$"{Properties.Resources.SASteeringWheelEmulationCalibrateInstruction}.\n",
Properties.Resources.SASteeringWheelEmulationCalibrate,
MessageBoxButtons.OKCancel,
MessageBoxIcon.Information,
MessageBoxDefaultButton.Button1,
0,
false);
if (msgBoxResult == DialogResult.OK)
{
// Accept new calibration values (State 3 is "Complete calibration" state)
d.WheelRecalibrateActiveState = 3;
}
else
{
// Cancel calibration and reset back to original calibration values
d.WheelRecalibrateActiveState = 4;
d.wheelFullTurnCount = 0;
d.wheelCenterPoint = origWheelCenterPoint;
d.wheel90DegPointLeft = origWheel90DegPointLeft;
d.wheel90DegPointRight = origWheel90DegPointRight;
}
}
else
{
MessageBox.Show($"{Properties.Resources.SASteeringWheelEmulationCalibrateNoControllerError}.");
}
}
else
{
MessageBox.Show($"{Properties.Resources.SASteeringWheelEmulationCalibrateNoneAxisError}.");
}
}
private void gyroMouseDzNUD_ValueChanged(object sender, EventArgs e)
{
if (loading == false)
{
SetGyroMouseDeadZone(device, (int)gyroMouseDzNUD.Value,
Program.rootHub);
}
}
private void toggleGyroMCb_Click(object sender, EventArgs e)
{
if (loading == false)
{
if (device < 4)
{
SetGyroMouseToggle(device, toggleGyroMCb.Checked, Program.rootHub);
}
}
}
private void trackFrictionNUD_ValueChanged(object sender, EventArgs e)
{
if (loading == false)

View File

@ -148,7 +148,7 @@
<value>0</value>
</data>
<data name="nUDRainbow.Location" type="System.Drawing.Point, System.Drawing">
<value>30, 215</value>
<value>28, 207</value>
</data>
<data name="nUDRainbow.Size" type="System.Drawing.Size, System.Drawing">
<value>39, 20</value>
@ -256,7 +256,7 @@
<value>NoControl</value>
</data>
<data name="cBLightbyBattery.Location" type="System.Drawing.Point, System.Drawing">
<value>6, 191</value>
<value>6, 184</value>
</data>
<data name="cBLightbyBattery.Size" type="System.Drawing.Size, System.Drawing">
<value>111, 17</value>
@ -346,7 +346,7 @@
<value>NoControl</value>
</data>
<data name="lbspc.Location" type="System.Drawing.Point, System.Drawing">
<value>72, 218</value>
<value>70, 210</value>
</data>
<data name="lbspc.Size" type="System.Drawing.Size, System.Drawing">
<value>59, 13</value>
@ -2552,7 +2552,7 @@ with profile</value>
<value>NoControl</value>
</data>
<data name="btnRainbow.Location" type="System.Drawing.Point, System.Drawing">
<value>6, 214</value>
<value>4, 206</value>
</data>
<data name="btnRainbow.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>2, 2, 2, 2</value>
@ -2582,7 +2582,7 @@ with profile</value>
<value>NoControl</value>
</data>
<data name="lbRainbowB.Location" type="System.Drawing.Point, System.Drawing">
<value>203, 214</value>
<value>201, 206</value>
</data>
<data name="lbRainbowB.Size" type="System.Drawing.Size, System.Drawing">
<value>15, 13</value>
@ -2609,7 +2609,7 @@ with profile</value>
<value>1</value>
</data>
<data name="nUDRainbowB.Location" type="System.Drawing.Point, System.Drawing">
<value>151, 214</value>
<value>149, 206</value>
</data>
<data name="nUDRainbowB.Size" type="System.Drawing.Size, System.Drawing">
<value>43, 20</value>
@ -2639,7 +2639,7 @@ with profile</value>
<value>Pulse at</value>
</data>
<data name="cBFlashType.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 133</value>
<value>6, 123</value>
</data>
<data name="cBFlashType.Size" type="System.Drawing.Size, System.Drawing">
<value>68, 21</value>
@ -2672,7 +2672,7 @@ with profile</value>
<value>Color</value>
</data>
<data name="cBWhileCharging.Location" type="System.Drawing.Point, System.Drawing">
<value>91, 166</value>
<value>90, 156</value>
</data>
<data name="cBWhileCharging.Size" type="System.Drawing.Size, System.Drawing">
<value>121, 21</value>
@ -2702,7 +2702,7 @@ with profile</value>
<value>NoControl</value>
</data>
<data name="btnFlashColor.Location" type="System.Drawing.Point, System.Drawing">
<value>146, 137</value>
<value>148, 127</value>
</data>
<data name="btnFlashColor.Size" type="System.Drawing.Size, System.Drawing">
<value>13, 13</value>
@ -2729,7 +2729,7 @@ with profile</value>
<value>NoControl</value>
</data>
<data name="btnChargingColor.Location" type="System.Drawing.Point, System.Drawing">
<value>218, 168</value>
<value>217, 158</value>
</data>
<data name="btnChargingColor.Size" type="System.Drawing.Size, System.Drawing">
<value>13, 13</value>
@ -2759,7 +2759,7 @@ with profile</value>
<value>NoControl</value>
</data>
<data name="lbWhileCharging.Location" type="System.Drawing.Point, System.Drawing">
<value>5, 167</value>
<value>4, 157</value>
</data>
<data name="lbWhileCharging.Size" type="System.Drawing.Size, System.Drawing">
<value>82, 13</value>
@ -2813,7 +2813,7 @@ with profile</value>
<value>8</value>
</data>
<data name="nUDflashLED.Location" type="System.Drawing.Point, System.Drawing">
<value>78, 134</value>
<value>80, 124</value>
</data>
<data name="nUDflashLED.Size" type="System.Drawing.Size, System.Drawing">
<value>43, 20</value>
@ -2837,7 +2837,7 @@ with profile</value>
<value>3, 3</value>
</data>
<data name="gBLightbar.Size" type="System.Drawing.Size, System.Drawing">
<value>272, 244</value>
<value>272, 233</value>
</data>
<data name="gBLightbar.TabIndex" type="System.Int32, mscorlib">
<value>247</value>
@ -3821,7 +3821,7 @@ with profile</value>
<value>3, 3, 3, 3</value>
</data>
<data name="lbL2TrackS.Size" type="System.Drawing.Size, System.Drawing">
<value>438, 455</value>
<value>438, 485</value>
</data>
<data name="lbL2TrackS.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
@ -4057,11 +4057,209 @@ with profile</value>
<data name="&gt;&gt;lbGyroXN.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="lblSteeringWheelEmulationAxis.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="lblSteeringWheelEmulationAxis.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="lblSteeringWheelEmulationAxis.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 116</value>
</data>
<data name="lblSteeringWheelEmulationAxis.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 5, 0, 0</value>
</data>
<data name="lblSteeringWheelEmulationAxis.Size" type="System.Drawing.Size, System.Drawing">
<value>98, 18</value>
</data>
<data name="lblSteeringWheelEmulationAxis.TabIndex" type="System.Int32, mscorlib">
<value>290</value>
</data>
<data name="lblSteeringWheelEmulationAxis.Text" xml:space="preserve">
<value>Steering wheel axis</value>
</data>
<data name="&gt;&gt;lblSteeringWheelEmulationAxis.Name" xml:space="preserve">
<value>lblSteeringWheelEmulationAxis</value>
</data>
<data name="&gt;&gt;lblSteeringWheelEmulationAxis.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lblSteeringWheelEmulationAxis.Parent" xml:space="preserve">
<value>fLPTiltControls</value>
</data>
<data name="&gt;&gt;lblSteeringWheelEmulationAxis.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="cBSteeringWheelEmulationAxis.Items" xml:space="preserve">
<value>None</value>
</data>
<data name="cBSteeringWheelEmulationAxis.Items1" xml:space="preserve">
<value>Left X-Axis</value>
</data>
<data name="cBSteeringWheelEmulationAxis.Items2" xml:space="preserve">
<value>Left Y-Axis</value>
</data>
<data name="cBSteeringWheelEmulationAxis.Items3" xml:space="preserve">
<value>Right X-Axis</value>
</data>
<data name="cBSteeringWheelEmulationAxis.Items4" xml:space="preserve">
<value>Right Y-Axis</value>
</data>
<data name="cBSteeringWheelEmulationAxis.Items5" xml:space="preserve">
<value>Trigger L+R Axis</value>
</data>
<data name="cBSteeringWheelEmulationAxis.Items6" xml:space="preserve">
<value>VJoy1 X-Axis</value>
</data>
<data name="cBSteeringWheelEmulationAxis.Items7" xml:space="preserve">
<value>VJoy1 Y-Axis</value>
</data>
<data name="cBSteeringWheelEmulationAxis.Items8" xml:space="preserve">
<value>VJoy1 Z-Axis</value>
</data>
<data name="cBSteeringWheelEmulationAxis.Items9" xml:space="preserve">
<value>VJoy2 X-Axis</value>
</data>
<data name="cBSteeringWheelEmulationAxis.Items10" xml:space="preserve">
<value>VJoy2 Y-Axis</value>
</data>
<data name="cBSteeringWheelEmulationAxis.Items11" xml:space="preserve">
<value>VJoy2 Z-Axis</value>
</data>
<data name="cBSteeringWheelEmulationAxis.Location" type="System.Drawing.Point, System.Drawing">
<value>107, 119</value>
</data>
<data name="cBSteeringWheelEmulationAxis.Size" type="System.Drawing.Size, System.Drawing">
<value>110, 21</value>
</data>
<data name="cBSteeringWheelEmulationAxis.TabIndex" type="System.Int32, mscorlib">
<value>291</value>
</data>
<data name="&gt;&gt;cBSteeringWheelEmulationAxis.Name" xml:space="preserve">
<value>cBSteeringWheelEmulationAxis</value>
</data>
<data name="&gt;&gt;cBSteeringWheelEmulationAxis.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cBSteeringWheelEmulationAxis.Parent" xml:space="preserve">
<value>fLPTiltControls</value>
</data>
<data name="&gt;&gt;cBSteeringWheelEmulationAxis.ZOrder" xml:space="preserve">
<value>9</value>
</data>
<data name="lblSteeringWheelEmulationRange.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="lblSteeringWheelEmulationRange.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="lblSteeringWheelEmulationRange.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 143</value>
</data>
<data name="lblSteeringWheelEmulationRange.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 5, 0, 0</value>
</data>
<data name="lblSteeringWheelEmulationRange.Size" type="System.Drawing.Size, System.Drawing">
<value>107, 18</value>
</data>
<data name="lblSteeringWheelEmulationRange.TabIndex" type="System.Int32, mscorlib">
<value>292</value>
</data>
<data name="lblSteeringWheelEmulationRange.Text" xml:space="preserve">
<value>Steering wheel range</value>
</data>
<data name="&gt;&gt;lblSteeringWheelEmulationRange.Name" xml:space="preserve">
<value>lblSteeringWheelEmulationRange</value>
</data>
<data name="&gt;&gt;lblSteeringWheelEmulationRange.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lblSteeringWheelEmulationRange.Parent" xml:space="preserve">
<value>fLPTiltControls</value>
</data>
<data name="&gt;&gt;lblSteeringWheelEmulationRange.ZOrder" xml:space="preserve">
<value>10</value>
</data>
<data name="cBSteeringWheelEmulationRange.Items" xml:space="preserve">
<value>90</value>
</data>
<data name="cBSteeringWheelEmulationRange.Items1" xml:space="preserve">
<value>180</value>
</data>
<data name="cBSteeringWheelEmulationRange.Items2" xml:space="preserve">
<value>270</value>
</data>
<data name="cBSteeringWheelEmulationRange.Items3" xml:space="preserve">
<value>360</value>
</data>
<data name="cBSteeringWheelEmulationRange.Items4" xml:space="preserve">
<value>450</value>
</data>
<data name="cBSteeringWheelEmulationRange.Items5" xml:space="preserve">
<value>720</value>
</data>
<data name="cBSteeringWheelEmulationRange.Items6" xml:space="preserve">
<value>900</value>
</data>
<data name="cBSteeringWheelEmulationRange.Items7" xml:space="preserve">
<value>1080</value>
</data>
<data name="cBSteeringWheelEmulationRange.Items8" xml:space="preserve">
<value>1440</value>
</data>
<data name="cBSteeringWheelEmulationRange.Location" type="System.Drawing.Point, System.Drawing">
<value>116, 146</value>
</data>
<data name="cBSteeringWheelEmulationRange.Size" type="System.Drawing.Size, System.Drawing">
<value>60, 21</value>
</data>
<data name="cBSteeringWheelEmulationRange.TabIndex" type="System.Int32, mscorlib">
<value>293</value>
</data>
<data name="&gt;&gt;cBSteeringWheelEmulationRange.Name" xml:space="preserve">
<value>cBSteeringWheelEmulationRange</value>
</data>
<data name="&gt;&gt;cBSteeringWheelEmulationRange.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cBSteeringWheelEmulationRange.Parent" xml:space="preserve">
<value>fLPTiltControls</value>
</data>
<data name="&gt;&gt;cBSteeringWheelEmulationRange.ZOrder" xml:space="preserve">
<value>11</value>
</data>
<data name="btnSteeringWheelEmulationCalibrate.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnSteeringWheelEmulationCalibrate.Location" type="System.Drawing.Point, System.Drawing">
<value>182, 146</value>
</data>
<data name="btnSteeringWheelEmulationCalibrate.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnSteeringWheelEmulationCalibrate.TabIndex" type="System.Int32, mscorlib">
<value>294</value>
</data>
<data name="btnSteeringWheelEmulationCalibrate.Text" xml:space="preserve">
<value>Calibrate...</value>
</data>
<data name="&gt;&gt;btnSteeringWheelEmulationCalibrate.Name" xml:space="preserve">
<value>btnSteeringWheelEmulationCalibrate</value>
</data>
<data name="&gt;&gt;btnSteeringWheelEmulationCalibrate.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnSteeringWheelEmulationCalibrate.Parent" xml:space="preserve">
<value>fLPTiltControls</value>
</data>
<data name="&gt;&gt;btnSteeringWheelEmulationCalibrate.ZOrder" xml:space="preserve">
<value>12</value>
</data>
<data name="fLPTiltControls.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 43</value>
</data>
<data name="fLPTiltControls.Size" type="System.Drawing.Size, System.Drawing">
<value>271, 167</value>
<value>271, 203</value>
</data>
<data name="fLPTiltControls.TabIndex" type="System.Int32, mscorlib">
<value>254</value>
@ -4076,7 +4274,7 @@ with profile</value>
<value>gBGyro</value>
</data>
<data name="&gt;&gt;fLPTiltControls.ZOrder" xml:space="preserve">
<value>3</value>
<value>2</value>
</data>
<data name="tPControls.AutoScroll" type="System.Boolean, mscorlib">
<value>True</value>
@ -4187,7 +4385,7 @@ with profile</value>
<value>278, 254</value>
</data>
<data name="lBControls.Size" type="System.Drawing.Size, System.Drawing">
<value>157, 186</value>
<value>157, 212</value>
</data>
<data name="lBControls.TabIndex" type="System.Int32, mscorlib">
<value>180</value>
@ -5921,7 +6119,7 @@ with profile</value>
<value>3, 3, 3, 3</value>
</data>
<data name="tPControls.Size" type="System.Drawing.Size, System.Drawing">
<value>438, 455</value>
<value>438, 485</value>
</data>
<data name="tPControls.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@ -5966,7 +6164,7 @@ with profile</value>
<value>0, 66</value>
</data>
<data name="lVActions.Size" type="System.Drawing.Size, System.Drawing">
<value>438, 389</value>
<value>438, 419</value>
</data>
<data name="lVActions.TabIndex" type="System.Int32, mscorlib">
<value>13</value>
@ -6155,7 +6353,7 @@ with profile</value>
<value>0, 0</value>
</data>
<data name="pnlActions.Size" type="System.Drawing.Size, System.Drawing">
<value>438, 455</value>
<value>438, 485</value>
</data>
<data name="pnlActions.TabIndex" type="System.Int32, mscorlib">
<value>15</value>
@ -6176,7 +6374,7 @@ with profile</value>
<value>4, 22</value>
</data>
<data name="tPSpecial.Size" type="System.Drawing.Size, System.Drawing">
<value>438, 455</value>
<value>438, 485</value>
</data>
<data name="tPSpecial.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
@ -6203,7 +6401,7 @@ with profile</value>
<value>0, 0</value>
</data>
<data name="tCControls.Size" type="System.Drawing.Size, System.Drawing">
<value>446, 481</value>
<value>446, 511</value>
</data>
<data name="tCControls.TabIndex" type="System.Int32, mscorlib">
<value>253</value>
@ -6922,6 +7120,9 @@ with profile</value>
<data name="cBSixaxisZOutputCurve.Items2" xml:space="preserve">
<value>Cubic</value>
</data>
<data name="cBSixaxisZOutputCurve.Items3" xml:space="preserve">
<value>Easeout Quad</value>
</data>
<data name="cBSixaxisZOutputCurve.Location" type="System.Drawing.Point, System.Drawing">
<value>221, 28</value>
</data>
@ -6952,6 +7153,9 @@ with profile</value>
<data name="cBSixaxisXOutputCurve.Items2" xml:space="preserve">
<value>Cubic</value>
</data>
<data name="cBSixaxisXOutputCurve.Items3" xml:space="preserve">
<value>Easeout Quad</value>
</data>
<data name="cBSixaxisXOutputCurve.Location" type="System.Drawing.Point, System.Drawing">
<value>221, 1</value>
</data>
@ -7042,6 +7246,9 @@ with profile</value>
<data name="cBR2OutputCurve.Items2" xml:space="preserve">
<value>Cubic</value>
</data>
<data name="cBR2OutputCurve.Items3" xml:space="preserve">
<value>Easeout Quad</value>
</data>
<data name="cBR2OutputCurve.Location" type="System.Drawing.Point, System.Drawing">
<value>111, 28</value>
</data>
@ -7072,6 +7279,9 @@ with profile</value>
<data name="cBL2OutputCurve.Items2" xml:space="preserve">
<value>Cubic</value>
</data>
<data name="cBL2OutputCurve.Items3" xml:space="preserve">
<value>Easeout Quad</value>
</data>
<data name="cBL2OutputCurve.Location" type="System.Drawing.Point, System.Drawing">
<value>31, 28</value>
</data>
@ -7165,6 +7375,9 @@ with profile</value>
<data name="rsOutCurveComboBox.Items3" xml:space="preserve">
<value>Cubic</value>
</data>
<data name="rsOutCurveComboBox.Items4" xml:space="preserve">
<value>Easeout Quad</value>
</data>
<data name="rsOutCurveComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>111, 3</value>
</data>
@ -7198,6 +7411,9 @@ with profile</value>
<data name="lsOutCurveComboBox.Items3" xml:space="preserve">
<value>Cubic</value>
</data>
<data name="lsOutCurveComboBox.Items4" xml:space="preserve">
<value>Easeout Quad</value>
</data>
<data name="lsOutCurveComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>31, 2</value>
</data>
@ -7717,6 +7933,84 @@ with profile</value>
<data name="&gt;&gt;rBSAMouse.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="toggleGyroMCb.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="toggleGyroMCb.Location" type="System.Drawing.Point, System.Drawing">
<value>9, 187</value>
</data>
<data name="toggleGyroMCb.RightToLeft" type="System.Windows.Forms.RightToLeft, System.Windows.Forms">
<value>Yes</value>
</data>
<data name="toggleGyroMCb.Size" type="System.Drawing.Size, System.Drawing">
<value>59, 17</value>
</data>
<data name="toggleGyroMCb.TabIndex" type="System.Int32, mscorlib">
<value>276</value>
</data>
<data name="toggleGyroMCb.Text" xml:space="preserve">
<value>Toggle</value>
</data>
<data name="&gt;&gt;toggleGyroMCb.Name" xml:space="preserve">
<value>toggleGyroMCb</value>
</data>
<data name="&gt;&gt;toggleGyroMCb.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toggleGyroMCb.Parent" xml:space="preserve">
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;toggleGyroMCb.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="label27.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label27.Location" type="System.Drawing.Point, System.Drawing">
<value>11, 166</value>
</data>
<data name="label27.Size" type="System.Drawing.Size, System.Drawing">
<value>56, 13</value>
</data>
<data name="label27.TabIndex" type="System.Int32, mscorlib">
<value>275</value>
</data>
<data name="label27.Text" xml:space="preserve">
<value>Deadzone</value>
</data>
<data name="&gt;&gt;label27.Name" xml:space="preserve">
<value>label27</value>
</data>
<data name="&gt;&gt;label27.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label27.Parent" xml:space="preserve">
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;label27.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="gyroMouseDzNUD.Location" type="System.Drawing.Point, System.Drawing">
<value>78, 166</value>
</data>
<data name="gyroMouseDzNUD.Size" type="System.Drawing.Size, System.Drawing">
<value>43, 20</value>
</data>
<data name="gyroMouseDzNUD.TabIndex" type="System.Int32, mscorlib">
<value>274</value>
</data>
<data name="&gt;&gt;gyroMouseDzNUD.Name" xml:space="preserve">
<value>gyroMouseDzNUD</value>
</data>
<data name="&gt;&gt;gyroMouseDzNUD.Type" xml:space="preserve">
<value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;gyroMouseDzNUD.Parent" xml:space="preserve">
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;gyroMouseDzNUD.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="label26.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
@ -7745,7 +8039,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;label26.ZOrder" xml:space="preserve">
<value>0</value>
<value>3</value>
</data>
<data name="triggerCondAndCombo.Items" xml:space="preserve">
<value>And</value>
@ -7754,7 +8048,7 @@ with profile</value>
<value>Or</value>
</data>
<data name="triggerCondAndCombo.Location" type="System.Drawing.Point, System.Drawing">
<value>165, 67</value>
<value>165, 62</value>
</data>
<data name="triggerCondAndCombo.Size" type="System.Drawing.Size, System.Drawing">
<value>73, 21</value>
@ -7772,7 +8066,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;triggerCondAndCombo.ZOrder" xml:space="preserve">
<value>1</value>
<value>4</value>
</data>
<data name="cBGyroMouseXAxis.Items" xml:space="preserve">
<value>Yaw</value>
@ -7781,7 +8075,7 @@ with profile</value>
<value>Roll</value>
</data>
<data name="cBGyroMouseXAxis.Location" type="System.Drawing.Point, System.Drawing">
<value>170, 114</value>
<value>169, 107</value>
</data>
<data name="cBGyroMouseXAxis.Size" type="System.Drawing.Size, System.Drawing">
<value>74, 21</value>
@ -7799,7 +8093,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;cBGyroMouseXAxis.ZOrder" xml:space="preserve">
<value>2</value>
<value>5</value>
</data>
<data name="label16.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -7808,7 +8102,7 @@ with profile</value>
<value>NoControl</value>
</data>
<data name="label16.Location" type="System.Drawing.Point, System.Drawing">
<value>167, 95</value>
<value>166, 91</value>
</data>
<data name="label16.Size" type="System.Drawing.Size, System.Drawing">
<value>39, 13</value>
@ -7829,7 +8123,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;label16.ZOrder" xml:space="preserve">
<value>3</value>
<value>6</value>
</data>
<data name="lbGyroSmooth.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -7838,7 +8132,7 @@ with profile</value>
<value>NoControl</value>
</data>
<data name="lbGyroSmooth.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 145</value>
<value>6, 139</value>
</data>
<data name="lbGyroSmooth.Size" type="System.Drawing.Size, System.Drawing">
<value>60, 13</value>
@ -7859,7 +8153,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;lbGyroSmooth.ZOrder" xml:space="preserve">
<value>4</value>
<value>7</value>
</data>
<data name="cBGyroSmooth.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -7868,7 +8162,7 @@ with profile</value>
<value>NoControl</value>
</data>
<data name="cBGyroSmooth.Location" type="System.Drawing.Point, System.Drawing">
<value>75, 145</value>
<value>73, 139</value>
</data>
<data name="cBGyroSmooth.RightToLeft" type="System.Windows.Forms.RightToLeft, System.Windows.Forms">
<value>Yes</value>
@ -7889,7 +8183,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;cBGyroSmooth.ZOrder" xml:space="preserve">
<value>5</value>
<value>8</value>
</data>
<data name="lbSmoothWeight.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -7898,7 +8192,7 @@ with profile</value>
<value>NoControl</value>
</data>
<data name="lbSmoothWeight.Location" type="System.Drawing.Point, System.Drawing">
<value>96, 145</value>
<value>94, 139</value>
</data>
<data name="lbSmoothWeight.Size" type="System.Drawing.Size, System.Drawing">
<value>83, 13</value>
@ -7919,13 +8213,13 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;lbSmoothWeight.ZOrder" xml:space="preserve">
<value>6</value>
<value>9</value>
</data>
<data name="nUDGyroSmoothWeight.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="nUDGyroSmoothWeight.Location" type="System.Drawing.Point, System.Drawing">
<value>185, 141</value>
<value>183, 135</value>
</data>
<data name="nUDGyroSmoothWeight.Size" type="System.Drawing.Size, System.Drawing">
<value>55, 20</value>
@ -7943,7 +8237,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;nUDGyroSmoothWeight.ZOrder" xml:space="preserve">
<value>7</value>
<value>10</value>
</data>
<data name="label12.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -7973,10 +8267,10 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;label12.ZOrder" xml:space="preserve">
<value>8</value>
<value>11</value>
</data>
<data name="nUDGyroMouseVertScale.Location" type="System.Drawing.Point, System.Drawing">
<value>96, 93</value>
<value>95, 89</value>
</data>
<data name="nUDGyroMouseVertScale.Size" type="System.Drawing.Size, System.Drawing">
<value>49, 20</value>
@ -7994,7 +8288,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;nUDGyroMouseVertScale.ZOrder" xml:space="preserve">
<value>9</value>
<value>12</value>
</data>
<data name="label11.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -8003,7 +8297,7 @@ with profile</value>
<value>NoControl</value>
</data>
<data name="label11.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 95</value>
<value>7, 91</value>
</data>
<data name="label11.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 13</value>
@ -8024,7 +8318,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;label11.ZOrder" xml:space="preserve">
<value>10</value>
<value>13</value>
</data>
<data name="gyroTriggerBehavior.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -8057,7 +8351,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;gyroTriggerBehavior.ZOrder" xml:space="preserve">
<value>11</value>
<value>14</value>
</data>
<data name="cBGyroInvertY.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -8066,7 +8360,7 @@ with profile</value>
<value>NoControl</value>
</data>
<data name="cBGyroInvertY.Location" type="System.Drawing.Point, System.Drawing">
<value>92, 119</value>
<value>95, 114</value>
</data>
<data name="cBGyroInvertY.RightToLeft" type="System.Windows.Forms.RightToLeft, System.Windows.Forms">
<value>Yes</value>
@ -8090,7 +8384,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;cBGyroInvertY.ZOrder" xml:space="preserve">
<value>12</value>
<value>15</value>
</data>
<data name="cBGyroInvertX.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -8099,7 +8393,7 @@ with profile</value>
<value>NoControl</value>
</data>
<data name="cBGyroInvertX.Location" type="System.Drawing.Point, System.Drawing">
<value>49, 119</value>
<value>52, 114</value>
</data>
<data name="cBGyroInvertX.RightToLeft" type="System.Windows.Forms.RightToLeft, System.Windows.Forms">
<value>Yes</value>
@ -8123,7 +8417,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;cBGyroInvertX.ZOrder" xml:space="preserve">
<value>13</value>
<value>16</value>
</data>
<data name="lbGyroInvert.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -8132,7 +8426,7 @@ with profile</value>
<value>NoControl</value>
</data>
<data name="lbGyroInvert.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 119</value>
<value>11, 114</value>
</data>
<data name="lbGyroInvert.Size" type="System.Drawing.Size, System.Drawing">
<value>37, 13</value>
@ -8156,7 +8450,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;lbGyroInvert.ZOrder" xml:space="preserve">
<value>14</value>
<value>17</value>
</data>
<data name="lbGyroTriggers.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -8189,7 +8483,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;lbGyroTriggers.ZOrder" xml:space="preserve">
<value>15</value>
<value>18</value>
</data>
<data name="btnGyroTriggers.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -8219,10 +8513,10 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;btnGyroTriggers.ZOrder" xml:space="preserve">
<value>16</value>
<value>19</value>
</data>
<data name="nUDGyroSensitivity.Location" type="System.Drawing.Point, System.Drawing">
<value>96, 67</value>
<value>96, 62</value>
</data>
<data name="nUDGyroSensitivity.Size" type="System.Drawing.Size, System.Drawing">
<value>49, 20</value>
@ -8240,7 +8534,7 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;nUDGyroSensitivity.ZOrder" xml:space="preserve">
<value>17</value>
<value>20</value>
</data>
<data name="lbGyroSens.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -8249,7 +8543,7 @@ with profile</value>
<value>NoControl</value>
</data>
<data name="lbGyroSens.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 69</value>
<value>8, 64</value>
</data>
<data name="lbGyroSens.Size" type="System.Drawing.Size, System.Drawing">
<value>82, 13</value>
@ -8273,16 +8567,16 @@ with profile</value>
<value>pnlSAMouse</value>
</data>
<data name="&gt;&gt;lbGyroSens.ZOrder" xml:space="preserve">
<value>18</value>
<value>21</value>
</data>
<data name="pnlSAMouse.Location" type="System.Drawing.Point, System.Drawing">
<value>6, 43</value>
<value>6, 39</value>
</data>
<data name="pnlSAMouse.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>2, 2, 2, 2</value>
</data>
<data name="pnlSAMouse.Size" type="System.Drawing.Size, System.Drawing">
<value>263, 170</value>
<value>263, 207</value>
</data>
<data name="pnlSAMouse.TabIndex" type="System.Int32, mscorlib">
<value>259</value>
@ -8297,13 +8591,13 @@ with profile</value>
<value>gBGyro</value>
</data>
<data name="&gt;&gt;pnlSAMouse.ZOrder" xml:space="preserve">
<value>2</value>
<value>3</value>
</data>
<data name="gBGyro.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 253</value>
<value>3, 242</value>
</data>
<data name="gBGyro.Size" type="System.Drawing.Size, System.Drawing">
<value>272, 224</value>
<value>272, 257</value>
</data>
<data name="gBGyro.TabIndex" type="System.Int32, mscorlib">
<value>248</value>
@ -8678,7 +8972,7 @@ with profile</value>
<value>2, 2, 2, 2</value>
</data>
<data name="fLPSettings.Size" type="System.Drawing.Size, System.Drawing">
<value>565, 481</value>
<value>565, 511</value>
</data>
<data name="fLPSettings.TabIndex" type="System.Int32, mscorlib">
<value>254</value>
@ -8960,7 +9254,7 @@ with profile</value>
<value>True</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>102</value>
<value>25</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>96, 96</value>
@ -8969,19 +9263,16 @@ with profile</value>
<value>True</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>1011, 481</value>
</data>
<data name="$this.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
<value>1011, 511</value>
</data>
<data name="$this.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
</data>
<data name="$this.MaximumSize" type="System.Drawing.Size, System.Drawing">
<value>1027, 520</value>
<value>1027, 550</value>
</data>
<data name="$this.MinimumSize" type="System.Drawing.Size, System.Drawing">
<value>18, 94</value>
<value>18, 520</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Profile Options</value>
@ -9392,7 +9683,7 @@ with profile</value>
<value>advColorDialog</value>
</data>
<data name="&gt;&gt;advColorDialog.Type" xml:space="preserve">
<value>DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.5.8.0, Culture=neutral, PublicKeyToken=null</value>
<value>DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.6.8.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>Options</value>

View File

@ -86,7 +86,6 @@
this.lbDTapDVR = new System.Windows.Forms.Label();
this.lbHoldDVR = new System.Windows.Forms.Label();
this.lbTapDVR = new System.Windows.Forms.Label();
this.advColorDialog = new DS4Windows.AdvancedColorDialog();
((System.ComponentModel.ISupportInitialize)(this.pBProgram)).BeginInit();
this.pnlProgram.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nUDProg)).BeginInit();
@ -221,7 +220,8 @@
resources.GetString("cBActions.Items4"),
resources.GetString("cBActions.Items5"),
resources.GetString("cBActions.Items6"),
resources.GetString("cBActions.Items7")});
resources.GetString("cBActions.Items7"),
resources.GetString("cBActions.Items8")});
resources.ApplyResources(this.cBActions, "cBActions");
this.cBActions.Name = "cBActions";
this.cBActions.SelectedIndexChanged += new System.EventHandler(this.cBActions_SelectedIndexChanged);
@ -596,13 +596,6 @@
resources.ApplyResources(this.lbTapDVR, "lbTapDVR");
this.lbTapDVR.Name = "lbTapDVR";
//
// advColorDialog
//
this.advColorDialog.AnyColor = true;
this.advColorDialog.Color = System.Drawing.Color.Blue;
this.advColorDialog.FullOpen = true;
this.advColorDialog.OnUpdateColor += new DS4Windows.AdvancedColorDialog.ColorUpdateHandler(this.advColorDialog_OnUpdateColor);
//
// SpecActions
//
resources.ApplyResources(this, "$this");

View File

@ -177,6 +177,10 @@ namespace DS4Windows
cBHoldDVR.SelectedIndex = int.Parse(dets[1]);
cBDTapDVR.SelectedIndex = int.Parse(dets[2]);*/
break;
case "SASteeringWheelEmulationCalibrate":
cBActions.SelectedIndex = 8;
nUDDCBT.Value = (decimal)act.delayTime;
break;
}
}
@ -331,6 +335,13 @@ namespace DS4Windows
}
break;
case 8:
action = Properties.Resources.SASteeringWheelEmulationCalibrate;
actRe = true;
if (!string.IsNullOrEmpty(oldprofilename) && oldprofilename != tBName.Text)
Global.RemoveAction(oldprofilename);
Global.SaveAction(tBName.Text, String.Join("/", controls), cBActions.SelectedIndex, Math.Round(nUDDCBT.Value, 1).ToString(), edit);
break;
}
if (actRe)
{
@ -368,7 +379,7 @@ namespace DS4Windows
pnlProgram.Visible = i == 2;
pnlProfile.Visible = i == 3;
pnlKeys.Visible = i == 4;
pnlDisconnectBT.Visible = i == 5;
pnlDisconnectBT.Visible = i == 5 || i == 8; // SASteeringWheelEmulationCalibrate action #8 re-uses DisconnectBT panel ("hold for X secs" detail option)
pnlBatteryCheck.Visible = i == 6;
pnlGameDVR.Visible = i == 7;
btnSave.Enabled = i > 0;

View File

@ -796,13 +796,10 @@
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="lVTrigger.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 41</value>
</data>
<data name="lVTrigger.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>14, 33</value>
</data>
<data name="lVTrigger.Size" type="System.Drawing.Size, System.Drawing">
<value>237, 267</value>
<value>178, 217</value>
</data>
<data name="lVTrigger.TabIndex" type="System.Int32, mscorlib">
<value>14</value>
@ -825,11 +822,8 @@
<data name="btnRecordMacro.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="btnRecordMacro.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
</data>
<data name="btnRecordMacro.Size" type="System.Drawing.Size, System.Drawing">
<value>204, 28</value>
<value>153, 23</value>
</data>
<data name="btnRecordMacro.TabIndex" type="System.Int32, mscorlib">
<value>16</value>
@ -853,13 +847,10 @@
<value>NoControl</value>
</data>
<data name="btnBrowse.Location" type="System.Drawing.Point, System.Drawing">
<value>1, 33</value>
</data>
<data name="btnBrowse.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>1, 27</value>
</data>
<data name="btnBrowse.Size" type="System.Drawing.Size, System.Drawing">
<value>204, 28</value>
<value>153, 23</value>
</data>
<data name="btnBrowse.TabIndex" type="System.Int32, mscorlib">
<value>16</value>
@ -882,11 +873,8 @@
<data name="cBProfiles.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="cBProfiles.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
</data>
<data name="cBProfiles.Size" type="System.Drawing.Size, System.Drawing">
<value>203, 24</value>
<value>153, 21</value>
</data>
<data name="cBProfiles.TabIndex" type="System.Int32, mscorlib">
<value>17</value>
@ -913,13 +901,10 @@
<value>NoControl</value>
</data>
<data name="btnSave.Location" type="System.Drawing.Point, System.Drawing">
<value>275, 282</value>
</data>
<data name="btnSave.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>206, 229</value>
</data>
<data name="btnSave.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
<value>79, 23</value>
</data>
<data name="btnSave.TabIndex" type="System.Int32, mscorlib">
<value>16</value>
@ -946,13 +931,10 @@
<value>NoControl</value>
</data>
<data name="btnCancel.Location" type="System.Drawing.Point, System.Drawing">
<value>388, 282</value>
</data>
<data name="btnCancel.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>291, 229</value>
</data>
<data name="btnCancel.Size" type="System.Drawing.Size, System.Drawing">
<value>91, 28</value>
<value>68, 23</value>
</data>
<data name="btnCancel.TabIndex" type="System.Int32, mscorlib">
<value>16</value>
@ -976,13 +958,10 @@
<value>NoControl</value>
</data>
<data name="lbName.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 10</value>
</data>
<data name="lbName.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 0, 4, 0</value>
<value>12, 8</value>
</data>
<data name="lbName.Size" type="System.Drawing.Size, System.Drawing">
<value>72, 16</value>
<value>54, 13</value>
</data>
<data name="lbName.TabIndex" type="System.Int32, mscorlib">
<value>15</value>
@ -1009,13 +988,10 @@
<value>Top, Left, Right</value>
</data>
<data name="tBName.Location" type="System.Drawing.Point, System.Drawing">
<value>77, 6</value>
</data>
<data name="tBName.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>58, 5</value>
</data>
<data name="tBName.Size" type="System.Drawing.Size, System.Drawing">
<value>431, 22</value>
<value>324, 20</value>
</data>
<data name="tBName.TabIndex" type="System.Int32, mscorlib">
<value>18</value>
@ -1056,14 +1032,14 @@
<data name="cBActions.Items7" xml:space="preserve">
<value>Mutli Action Button</value>
</data>
<data name="cBActions.Location" type="System.Drawing.Point, System.Drawing">
<value>273, 38</value>
<data name="cBActions.Items8" xml:space="preserve">
<value>Calibration of sixaxis wheel emulation</value>
</data>
<data name="cBActions.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<data name="cBActions.Location" type="System.Drawing.Point, System.Drawing">
<value>205, 31</value>
</data>
<data name="cBActions.Size" type="System.Drawing.Size, System.Drawing">
<value>203, 24</value>
<value>153, 21</value>
</data>
<data name="cBActions.TabIndex" type="System.Int32, mscorlib">
<value>17</value>
@ -1093,13 +1069,10 @@
<value>NoControl</value>
</data>
<data name="pBProgram.Location" type="System.Drawing.Point, System.Drawing">
<value>173, 65</value>
</data>
<data name="pBProgram.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>130, 53</value>
</data>
<data name="pBProgram.Size" type="System.Drawing.Size, System.Drawing">
<value>31, 28</value>
<value>23, 23</value>
</data>
<data name="pBProgram.SizeMode" type="System.Windows.Forms.PictureBoxSizeMode, System.Windows.Forms">
<value>Zoom</value>
@ -1123,13 +1096,10 @@
<value>NoControl</value>
</data>
<data name="lbProgram.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 65</value>
</data>
<data name="lbProgram.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 0, 4, 0</value>
<value>3, 53</value>
</data>
<data name="lbProgram.Size" type="System.Drawing.Size, System.Drawing">
<value>163, 28</value>
<value>122, 23</value>
</data>
<data name="lbProgram.TabIndex" type="System.Int32, mscorlib">
<value>15</value>
@ -1159,13 +1129,10 @@
<value>NoControl</value>
</data>
<data name="btnBorder.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 38</value>
</data>
<data name="btnBorder.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>12, 31</value>
</data>
<data name="btnBorder.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 272</value>
<value>182, 221</value>
</data>
<data name="btnBorder.TabIndex" type="System.Int32, mscorlib">
<value>257</value>
@ -1186,13 +1153,10 @@
<value>NoControl</value>
</data>
<data name="btnSetUTriggerProfile.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 33</value>
</data>
<data name="btnSetUTriggerProfile.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>0, 27</value>
</data>
<data name="btnSetUTriggerProfile.Size" type="System.Drawing.Size, System.Drawing">
<value>204, 28</value>
<value>153, 23</value>
</data>
<data name="btnSetUTriggerProfile.TabIndex" type="System.Int32, mscorlib">
<value>258</value>
@ -1888,13 +1852,10 @@
</value>
</data>
<data name="lVUnloadTrigger.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 41</value>
</data>
<data name="lVUnloadTrigger.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>14, 33</value>
</data>
<data name="lVUnloadTrigger.Size" type="System.Drawing.Size, System.Drawing">
<value>237, 267</value>
<value>178, 217</value>
</data>
<data name="lVUnloadTrigger.TabIndex" type="System.Int32, mscorlib">
<value>259</value>
@ -1912,13 +1873,10 @@
<value>7</value>
</data>
<data name="tBArg.Location" type="System.Drawing.Point, System.Drawing">
<value>5, 112</value>
</data>
<data name="tBArg.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>4, 91</value>
</data>
<data name="tBArg.Size" type="System.Drawing.Size, System.Drawing">
<value>196, 22</value>
<value>148, 20</value>
</data>
<data name="tBArg.TabIndex" type="System.Int32, mscorlib">
<value>264</value>
@ -1936,13 +1894,10 @@
<value>0</value>
</data>
<data name="nUDProg.Location" type="System.Drawing.Point, System.Drawing">
<value>75, 4</value>
</data>
<data name="nUDProg.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>56, 3</value>
</data>
<data name="nUDProg.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 22</value>
<value>53, 20</value>
</data>
<data name="nUDProg.TabIndex" type="System.Int32, mscorlib">
<value>263</value>
@ -1966,13 +1921,10 @@
<value>NoControl</value>
</data>
<data name="lbArg.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 94</value>
</data>
<data name="lbArg.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 0, 4, 0</value>
<value>3, 76</value>
</data>
<data name="lbArg.Size" type="System.Drawing.Size, System.Drawing">
<value>76, 17</value>
<value>57, 13</value>
</data>
<data name="lbArg.TabIndex" type="System.Int32, mscorlib">
<value>261</value>
@ -1999,20 +1951,17 @@
<value>NoControl</value>
</data>
<data name="lbHoldForProg.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 6</value>
</data>
<data name="lbHoldForProg.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 0, 4, 0</value>
<value>3, 5</value>
</data>
<data name="lbHoldForProg.Size" type="System.Drawing.Size, System.Drawing">
<value>63, 22</value>
<value>47, 18</value>
</data>
<data name="lbHoldForProg.TabIndex" type="System.Int32, mscorlib">
<value>261</value>
</data>
<data name="lbHoldForProg.Text" xml:space="preserve">
<value>Hold for</value>
<comment>@Invariant</comment></data>
</data>
<data name="lbHoldForProg.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>TopCenter</value>
</data>
@ -2032,20 +1981,17 @@
<value>NoControl</value>
</data>
<data name="lbSecsProg.Location" type="System.Drawing.Point, System.Drawing">
<value>153, 6</value>
</data>
<data name="lbSecsProg.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 0, 4, 0</value>
<value>115, 5</value>
</data>
<data name="lbSecsProg.Size" type="System.Drawing.Size, System.Drawing">
<value>44, 22</value>
<value>33, 18</value>
</data>
<data name="lbSecsProg.TabIndex" type="System.Int32, mscorlib">
<value>262</value>
</data>
<data name="lbSecsProg.Text" xml:space="preserve">
<value>secs</value>
<comment>@Invariant</comment></data>
</data>
<data name="lbSecsProg.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>TopCenter</value>
</data>
@ -2062,13 +2008,10 @@
<value>4</value>
</data>
<data name="pnlProgram.Location" type="System.Drawing.Point, System.Drawing">
<value>275, 71</value>
</data>
<data name="pnlProgram.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>206, 58</value>
</data>
<data name="pnlProgram.Size" type="System.Drawing.Size, System.Drawing">
<value>216, 153</value>
<value>162, 124</value>
</data>
<data name="pnlProgram.TabIndex" type="System.Int32, mscorlib">
<value>260</value>
@ -2095,13 +2038,10 @@
<value>NoControl</value>
</data>
<data name="cBMacroScanCode.Location" type="System.Drawing.Point, System.Drawing">
<value>5, 37</value>
</data>
<data name="cBMacroScanCode.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>4, 30</value>
</data>
<data name="cBMacroScanCode.Size" type="System.Drawing.Size, System.Drawing">
<value>99, 21</value>
<value>79, 17</value>
</data>
<data name="cBMacroScanCode.TabIndex" type="System.Int32, mscorlib">
<value>17</value>
@ -2125,13 +2065,10 @@
<value>NoControl</value>
</data>
<data name="lbMacroRecorded.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 62</value>
</data>
<data name="lbMacroRecorded.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 0, 4, 0</value>
<value>0, 50</value>
</data>
<data name="lbMacroRecorded.Size" type="System.Drawing.Size, System.Drawing">
<value>204, 28</value>
<value>153, 23</value>
</data>
<data name="lbMacroRecorded.TabIndex" type="System.Int32, mscorlib">
<value>15</value>
@ -2152,13 +2089,10 @@
<value>2</value>
</data>
<data name="pnlMacro.Location" type="System.Drawing.Point, System.Drawing">
<value>275, 71</value>
</data>
<data name="pnlMacro.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>206, 58</value>
</data>
<data name="pnlMacro.Size" type="System.Drawing.Size, System.Drawing">
<value>217, 116</value>
<value>163, 94</value>
</data>
<data name="pnlMacro.TabIndex" type="System.Int32, mscorlib">
<value>261</value>
@ -2182,13 +2116,10 @@
<value>NoControl</value>
</data>
<data name="lbUnloadTipProfile.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 68</value>
</data>
<data name="lbUnloadTipProfile.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 0, 4, 0</value>
<value>0, 55</value>
</data>
<data name="lbUnloadTipProfile.Size" type="System.Drawing.Size, System.Drawing">
<value>133, 28</value>
<value>100, 23</value>
</data>
<data name="lbUnloadTipProfile.TabIndex" type="System.Int32, mscorlib">
<value>259</value>
@ -2206,13 +2137,10 @@
<value>0</value>
</data>
<data name="pnlProfile.Location" type="System.Drawing.Point, System.Drawing">
<value>275, 71</value>
</data>
<data name="pnlProfile.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>206, 58</value>
</data>
<data name="pnlProfile.Size" type="System.Drawing.Size, System.Drawing">
<value>215, 116</value>
<value>161, 94</value>
</data>
<data name="pnlProfile.TabIndex" type="System.Int32, mscorlib">
<value>262</value>
@ -2233,13 +2161,10 @@
<value>11</value>
</data>
<data name="nUDDCBT.Location" type="System.Drawing.Point, System.Drawing">
<value>75, 4</value>
</data>
<data name="nUDDCBT.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>56, 3</value>
</data>
<data name="nUDDCBT.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 22</value>
<value>53, 20</value>
</data>
<data name="nUDDCBT.TabIndex" type="System.Int32, mscorlib">
<value>260</value>
@ -2260,13 +2185,10 @@
<value>NoControl</value>
</data>
<data name="lbHoldFor.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 6</value>
</data>
<data name="lbHoldFor.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 0, 4, 0</value>
<value>3, 5</value>
</data>
<data name="lbHoldFor.Size" type="System.Drawing.Size, System.Drawing">
<value>63, 22</value>
<value>47, 18</value>
</data>
<data name="lbHoldFor.TabIndex" type="System.Int32, mscorlib">
<value>259</value>
@ -2293,13 +2215,10 @@
<value>NoControl</value>
</data>
<data name="lbSecs.Location" type="System.Drawing.Point, System.Drawing">
<value>153, 6</value>
</data>
<data name="lbSecs.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 0, 4, 0</value>
<value>115, 5</value>
</data>
<data name="lbSecs.Size" type="System.Drawing.Size, System.Drawing">
<value>44, 22</value>
<value>33, 18</value>
</data>
<data name="lbSecs.TabIndex" type="System.Int32, mscorlib">
<value>259</value>
@ -2323,13 +2242,10 @@
<value>2</value>
</data>
<data name="pnlDisconnectBT.Location" type="System.Drawing.Point, System.Drawing">
<value>275, 71</value>
</data>
<data name="pnlDisconnectBT.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>206, 58</value>
</data>
<data name="pnlDisconnectBT.Size" type="System.Drawing.Size, System.Drawing">
<value>215, 73</value>
<value>161, 59</value>
</data>
<data name="pnlDisconnectBT.TabIndex" type="System.Int32, mscorlib">
<value>262</value>
@ -2353,13 +2269,10 @@
<value>NoControl</value>
</data>
<data name="btnSelectKey.Location" type="System.Drawing.Point, System.Drawing">
<value>7, 4</value>
</data>
<data name="btnSelectKey.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>5, 3</value>
</data>
<data name="btnSelectKey.Size" type="System.Drawing.Size, System.Drawing">
<value>204, 28</value>
<value>153, 23</value>
</data>
<data name="btnSelectKey.TabIndex" type="System.Int32, mscorlib">
<value>260</value>
@ -2386,13 +2299,10 @@
<value>releasing unload trigger</value>
</data>
<data name="cBPressRelease.Location" type="System.Drawing.Point, System.Drawing">
<value>7, 94</value>
</data>
<data name="cBPressRelease.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>5, 76</value>
</data>
<data name="cBPressRelease.Size" type="System.Drawing.Size, System.Drawing">
<value>203, 24</value>
<value>153, 21</value>
</data>
<data name="cBPressRelease.TabIndex" type="System.Int32, mscorlib">
<value>17</value>
@ -2416,13 +2326,10 @@
<value>NoControl</value>
</data>
<data name="btnSetUTriggerKeys.Location" type="System.Drawing.Point, System.Drawing">
<value>7, 36</value>
</data>
<data name="btnSetUTriggerKeys.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>5, 29</value>
</data>
<data name="btnSetUTriggerKeys.Size" type="System.Drawing.Size, System.Drawing">
<value>204, 28</value>
<value>153, 23</value>
</data>
<data name="btnSetUTriggerKeys.TabIndex" type="System.Int32, mscorlib">
<value>258</value>
@ -2449,13 +2356,10 @@
<value>NoControl</value>
</data>
<data name="lbUnloadTipKey.Location" type="System.Drawing.Point, System.Drawing">
<value>7, 75</value>
</data>
<data name="lbUnloadTipKey.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 0, 4, 0</value>
<value>5, 61</value>
</data>
<data name="lbUnloadTipKey.Size" type="System.Drawing.Size, System.Drawing">
<value>203, 27</value>
<value>152, 22</value>
</data>
<data name="lbUnloadTipKey.TabIndex" type="System.Int32, mscorlib">
<value>259</value>
@ -2482,13 +2386,10 @@
<value>3</value>
</data>
<data name="pnlKeys.Location" type="System.Drawing.Point, System.Drawing">
<value>267, 71</value>
</data>
<data name="pnlKeys.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>200, 58</value>
</data>
<data name="pnlKeys.Size" type="System.Drawing.Size, System.Drawing">
<value>215, 132</value>
<value>161, 107</value>
</data>
<data name="pnlKeys.TabIndex" type="System.Int32, mscorlib">
<value>263</value>
@ -2512,13 +2413,10 @@
<value>NoControl</value>
</data>
<data name="pBGraident.Location" type="System.Drawing.Point, System.Drawing">
<value>37, 87</value>
</data>
<data name="pBGraident.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>28, 71</value>
</data>
<data name="pBGraident.Size" type="System.Drawing.Size, System.Drawing">
<value>145, 16</value>
<value>109, 13</value>
</data>
<data name="pBGraident.TabIndex" type="System.Int32, mscorlib">
<value>264</value>
@ -2542,13 +2440,10 @@
<value>NoControl</value>
</data>
<data name="cBNotificationBatt.Location" type="System.Drawing.Point, System.Drawing">
<value>24, 31</value>
</data>
<data name="cBNotificationBatt.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>18, 25</value>
</data>
<data name="cBNotificationBatt.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 21</value>
<value>94, 17</value>
</data>
<data name="cBNotificationBatt.TabIndex" type="System.Int32, mscorlib">
<value>263</value>
@ -2575,13 +2470,10 @@
<value>NoControl</value>
</data>
<data name="cbLightbarBatt.Location" type="System.Drawing.Point, System.Drawing">
<value>24, 54</value>
</data>
<data name="cbLightbarBatt.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>18, 44</value>
</data>
<data name="cbLightbarBatt.Size" type="System.Drawing.Size, System.Drawing">
<value>99, 21</value>
<value>77, 17</value>
</data>
<data name="cbLightbarBatt.TabIndex" type="System.Int32, mscorlib">
<value>262</value>
@ -2608,13 +2500,10 @@
<value>NoControl</value>
</data>
<data name="bnFullColor.Location" type="System.Drawing.Point, System.Drawing">
<value>191, 87</value>
</data>
<data name="bnFullColor.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>143, 71</value>
</data>
<data name="bnFullColor.Size" type="System.Drawing.Size, System.Drawing">
<value>17, 16</value>
<value>13, 13</value>
</data>
<data name="bnFullColor.TabIndex" type="System.Int32, mscorlib">
<value>261</value>
@ -2638,13 +2527,10 @@
<value>NoControl</value>
</data>
<data name="bnEmptyColor.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 87</value>
</data>
<data name="bnEmptyColor.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>9, 71</value>
</data>
<data name="bnEmptyColor.Size" type="System.Drawing.Size, System.Drawing">
<value>17, 16</value>
<value>13, 13</value>
</data>
<data name="bnEmptyColor.TabIndex" type="System.Int32, mscorlib">
<value>261</value>
@ -2662,13 +2548,10 @@
<value>4</value>
</data>
<data name="nUDDCBatt.Location" type="System.Drawing.Point, System.Drawing">
<value>75, 4</value>
</data>
<data name="nUDDCBatt.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>56, 3</value>
</data>
<data name="nUDDCBatt.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 22</value>
<value>53, 20</value>
</data>
<data name="nUDDCBatt.TabIndex" type="System.Int32, mscorlib">
<value>260</value>
@ -2689,20 +2572,17 @@
<value>NoControl</value>
</data>
<data name="lbHoldForBatt.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 6</value>
</data>
<data name="lbHoldForBatt.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 0, 4, 0</value>
<value>3, 5</value>
</data>
<data name="lbHoldForBatt.Size" type="System.Drawing.Size, System.Drawing">
<value>63, 22</value>
<value>47, 18</value>
</data>
<data name="lbHoldForBatt.TabIndex" type="System.Int32, mscorlib">
<value>259</value>
</data>
<data name="lbHoldForBatt.Text" xml:space="preserve">
<value>Hold for</value>
<comment>@Invariant</comment></data>
</data>
<data name="lbHoldForBatt.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>TopCenter</value>
</data>
@ -2722,20 +2602,17 @@
<value>NoControl</value>
</data>
<data name="lbFullBatt.Location" type="System.Drawing.Point, System.Drawing">
<value>171, 114</value>
</data>
<data name="lbFullBatt.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 0, 4, 0</value>
<value>128, 93</value>
</data>
<data name="lbFullBatt.Size" type="System.Drawing.Size, System.Drawing">
<value>44, 22</value>
<value>33, 18</value>
</data>
<data name="lbFullBatt.TabIndex" type="System.Int32, mscorlib">
<value>259</value>
</data>
<data name="lbFullBatt.Text" xml:space="preserve">
<value>100%</value>
<comment>@Invariant</comment></data>
</data>
<data name="lbFullBatt.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>TopRight</value>
</data>
@ -2755,20 +2632,17 @@
<value>NoControl</value>
</data>
<data name="lbEmptyBatt.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 114</value>
</data>
<data name="lbEmptyBatt.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 0, 4, 0</value>
<value>6, 93</value>
</data>
<data name="lbEmptyBatt.Size" type="System.Drawing.Size, System.Drawing">
<value>44, 22</value>
<value>33, 18</value>
</data>
<data name="lbEmptyBatt.TabIndex" type="System.Int32, mscorlib">
<value>259</value>
</data>
<data name="lbEmptyBatt.Text" xml:space="preserve">
<value>0%</value>
<comment>@Invariant</comment></data>
</data>
<data name="&gt;&gt;lbEmptyBatt.Name" xml:space="preserve">
<value>lbEmptyBatt</value>
</data>
@ -2785,20 +2659,17 @@
<value>NoControl</value>
</data>
<data name="lbSecsBatt.Location" type="System.Drawing.Point, System.Drawing">
<value>153, 6</value>
</data>
<data name="lbSecsBatt.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 0, 4, 0</value>
<value>115, 5</value>
</data>
<data name="lbSecsBatt.Size" type="System.Drawing.Size, System.Drawing">
<value>44, 22</value>
<value>33, 18</value>
</data>
<data name="lbSecsBatt.TabIndex" type="System.Int32, mscorlib">
<value>259</value>
</data>
<data name="lbSecsBatt.Text" xml:space="preserve">
<value>secs</value>
<comment>@Invariant</comment></data>
</data>
<data name="lbSecsBatt.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>TopCenter</value>
</data>
@ -2815,13 +2686,10 @@
<value>9</value>
</data>
<data name="pnlBatteryCheck.Location" type="System.Drawing.Point, System.Drawing">
<value>271, 73</value>
</data>
<data name="pnlBatteryCheck.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>203, 59</value>
</data>
<data name="pnlBatteryCheck.Size" type="System.Drawing.Size, System.Drawing">
<value>215, 151</value>
<value>161, 123</value>
</data>
<data name="pnlBatteryCheck.TabIndex" type="System.Int32, mscorlib">
<value>264</value>
@ -2845,13 +2713,10 @@
<value>NoControl</value>
</data>
<data name="btnDTapT.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 123</value>
</data>
<data name="btnDTapT.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>3, 100</value>
</data>
<data name="btnDTapT.Size" type="System.Drawing.Size, System.Drawing">
<value>217, 28</value>
<value>163, 23</value>
</data>
<data name="btnDTapT.TabIndex" type="System.Int32, mscorlib">
<value>267</value>
@ -2875,13 +2740,10 @@
<value>NoControl</value>
</data>
<data name="btnHoldT.Location" type="System.Drawing.Point, System.Drawing">
<value>6, 73</value>
</data>
<data name="btnHoldT.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>4, 59</value>
</data>
<data name="btnHoldT.Size" type="System.Drawing.Size, System.Drawing">
<value>217, 28</value>
<value>163, 23</value>
</data>
<data name="btnHoldT.TabIndex" type="System.Int32, mscorlib">
<value>266</value>
@ -2905,13 +2767,10 @@
<value>NoControl</value>
</data>
<data name="btnSTapT.Location" type="System.Drawing.Point, System.Drawing">
<value>6, 25</value>
</data>
<data name="btnSTapT.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>4, 20</value>
</data>
<data name="btnSTapT.Size" type="System.Drawing.Size, System.Drawing">
<value>217, 28</value>
<value>163, 23</value>
</data>
<data name="btnSTapT.TabIndex" type="System.Int32, mscorlib">
<value>265</value>
@ -2938,13 +2797,10 @@
<value>NoControl</value>
</data>
<data name="lbDTapDVR.Location" type="System.Drawing.Point, System.Drawing">
<value>5, 102</value>
</data>
<data name="lbDTapDVR.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 0, 4, 0</value>
<value>4, 83</value>
</data>
<data name="lbDTapDVR.Size" type="System.Drawing.Size, System.Drawing">
<value>132, 17</value>
<value>99, 13</value>
</data>
<data name="lbDTapDVR.TabIndex" type="System.Int32, mscorlib">
<value>263</value>
@ -2971,13 +2827,10 @@
<value>NoControl</value>
</data>
<data name="lbHoldDVR.Location" type="System.Drawing.Point, System.Drawing">
<value>5, 54</value>
</data>
<data name="lbHoldDVR.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 0, 4, 0</value>
<value>4, 44</value>
</data>
<data name="lbHoldDVR.Size" type="System.Drawing.Size, System.Drawing">
<value>87, 17</value>
<value>65, 13</value>
</data>
<data name="lbHoldDVR.TabIndex" type="System.Int32, mscorlib">
<value>261</value>
@ -3004,13 +2857,10 @@
<value>NoControl</value>
</data>
<data name="lbTapDVR.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 4</value>
</data>
<data name="lbTapDVR.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 0, 4, 0</value>
<value>3, 3</value>
</data>
<data name="lbTapDVR.Size" type="System.Drawing.Size, System.Drawing">
<value>83, 17</value>
<value>62, 13</value>
</data>
<data name="lbTapDVR.TabIndex" type="System.Int32, mscorlib">
<value>259</value>
@ -3031,13 +2881,10 @@
<value>5</value>
</data>
<data name="pnlGameDVR.Location" type="System.Drawing.Point, System.Drawing">
<value>267, 70</value>
</data>
<data name="pnlGameDVR.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>200, 57</value>
</data>
<data name="pnlGameDVR.Size" type="System.Drawing.Size, System.Drawing">
<value>228, 154</value>
<value>171, 125</value>
</data>
<data name="pnlGameDVR.TabIndex" type="System.Int32, mscorlib">
<value>264</value>
@ -3057,24 +2904,18 @@
<data name="&gt;&gt;pnlGameDVR.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="advColorDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>267, 17</value>
</metadata>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>8, 16</value>
<value>6, 13</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>536, 325</value>
</data>
<data name="$this.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
<value>402, 264</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>SpecActions</value>
<comment>@Invariant</comment></data>
</data>
<data name="&gt;&gt;cHTrigger.Name" xml:space="preserve">
<value>cHTrigger</value>
</data>
@ -3099,12 +2940,6 @@
<data name="&gt;&gt;cHUnloadTrigger.Type" xml:space="preserve">
<value>System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;advColorDialog.Name" xml:space="preserve">
<value>advColorDialog</value>
</data>
<data name="&gt;&gt;advColorDialog.Type" xml:space="preserve">
<value>DS4Windows.AdvancedColorDialog, DS4Windows, Version=1.4.5.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>SpecActions</value>
</data>

View File

@ -43,12 +43,12 @@ namespace DS4Windows
{
byte alphacolor = Math.Max(red, Math.Max(green, blue));
Color reg = Color.FromArgb(red, green, blue);
Color full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), reg);
Color full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), ref reg);
return Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full);
}
}
private Color HuetoRGB(float hue, float light, Color rgb)
private Color HuetoRGB(float hue, float light, ref Color rgb)
{
float L = (float)Math.Max(.5, light);
float C = (1 - Math.Abs(2 * L - 1));
@ -147,16 +147,52 @@ namespace DS4Windows
return warnInterval;
}
public Int32 wheelPrevPhysicalAngle = 0;
public Int32 wheelPrevFullAngle = 0;
public Int32 wheelFullTurnCount = 0;
public Point wheelCenterPoint;
public Point wheel90DegPointLeft;
public Point wheelCircleCenterPointLeft;
public Point wheel90DegPointRight;
public Point wheelCircleCenterPointRight;
public DateTime wheelPrevRecalibrateTime;
private int wheelRecalibrateActiveState = 0;
public int WheelRecalibrateActiveState
{
get { return wheelRecalibrateActiveState; }
set
{
wheelRecalibrateActiveState = value;
}
}
public enum WheelCalibrationPoint
{
None = 0,
Center = 1,
Right90 = 2,
Left90 = 4,
All = Center | Right90 | Left90
}
public WheelCalibrationPoint wheelCalibratedAxisBitmask;
private bool exitOutputThread = false;
public bool ExitOutputThread => exitOutputThread;
private bool exitInputThread = false;
private object exitLocker = new object();
public event EventHandler<EventArgs> Report = null;
public delegate void ReportHandler<TEventArgs>(DS4Device sender, TEventArgs args);
//public event EventHandler<EventArgs> Report = null;
public event ReportHandler<EventArgs> Report = null;
public event EventHandler<EventArgs> Removal = null;
public event EventHandler<EventArgs> SyncChange = null;
public event EventHandler<EventArgs> SerialChange = null;
public EventHandler<EventArgs> MotionEvent = null;
//public EventHandler<EventArgs> MotionEvent = null;
public ReportHandler<EventArgs> MotionEvent = null;
public HidDevice HidDevice => hDevice;
public bool IsExclusive => HidDevice.IsExclusive;

View File

@ -179,9 +179,11 @@ namespace DS4Windows
{
IEnumerable<DS4Device> devices = getDS4Controllers();
//foreach (DS4Device device in devices)
for (int i = 0, devCount = devices.Count(); i < devCount; i++)
//for (int i = 0, devCount = devices.Count(); i < devCount; i++)
for (var devEnum = devices.GetEnumerator(); devEnum.MoveNext();)
{
DS4Device device = devices.ElementAt(i);
DS4Device device = devEnum.Current;
//DS4Device device = devices.ElementAt(i);
device.StopUpdate();
//device.runRemoval();
device.HidDevice.CloseDevice();
@ -248,9 +250,11 @@ namespace DS4Windows
if (disabledDevCount > 0)
{
List<HidDevice> disabledDevList = new List<HidDevice>();
for (int i = 0, arlen = disabledDevCount; i < arlen; i++)
for (var devEnum = DisabledDevices.GetEnumerator(); devEnum.MoveNext();)
//for (int i = 0, arlen = disabledDevCount; i < arlen; i++)
{
HidDevice tempDev = DisabledDevices.ElementAt(i);
//HidDevice tempDev = DisabledDevices.ElementAt(i);
HidDevice tempDev = devEnum.Current;
if (tempDev != null)
{
if (tempDev.IsOpen && tempDev.IsConnected)

View File

@ -2,6 +2,8 @@
namespace DS4Windows
{
public delegate void SixAxisHandler<TEventArgs>(DS4SixAxis sender, TEventArgs args);
public class SixAxisEventArgs : EventArgs
{
public readonly SixAxis sixAxis;
@ -110,7 +112,8 @@ namespace DS4Windows
public class DS4SixAxis
{
public event EventHandler<SixAxisEventArgs> SixAccelMoved = null;
//public event EventHandler<SixAxisEventArgs> SixAccelMoved = null;
public event SixAxisHandler<SixAxisEventArgs> SixAccelMoved = null;
private SixAxis sPrev = null, now = null;
private CalibData[] calibrationData = new CalibData[6] { new CalibData(), new CalibData(),
new CalibData(), new CalibData(), new CalibData(), new CalibData()

View File

@ -28,6 +28,7 @@ namespace DS4Windows
public ulong totalMicroSec = 0;
public SixAxis Motion = null;
public static readonly int DEFAULT_AXISDIR_VALUE = 127;
public Int32 SASteeringWheelEmulationUnit;
public struct TrackPadTouch
{
@ -66,6 +67,7 @@ namespace DS4Windows
Motion = new SixAxis(0, 0, 0, 0, 0, 0, 0.0);
TrackPadTouch0.IsActive = false;
TrackPadTouch1.IsActive = false;
SASteeringWheelEmulationUnit = 0;
}
public DS4State(DS4State state)
@ -120,6 +122,7 @@ namespace DS4Windows
Motion = state.Motion;
TrackPadTouch0 = state.TrackPadTouch0;
TrackPadTouch1 = state.TrackPadTouch1;
SASteeringWheelEmulationUnit = state.SASteeringWheelEmulationUnit;
}
public DS4State Clone()
@ -179,6 +182,7 @@ namespace DS4Windows
state.Motion = Motion;
state.TrackPadTouch0 = TrackPadTouch0;
state.TrackPadTouch1 = TrackPadTouch1;
state.SASteeringWheelEmulationUnit = SASteeringWheelEmulationUnit;
}
public void calculateStickAngles()

View File

@ -52,13 +52,16 @@ namespace DS4Windows
public class DS4Touchpad
{
public event EventHandler<TouchpadEventArgs> TouchesBegan = null; // finger one or two landed (or both, or one then two, or two then one; any touches[] count increase)
public event EventHandler<TouchpadEventArgs> TouchesMoved = null; // deltaX/deltaY are set because one or both fingers were already down on a prior sensor reading
public event EventHandler<TouchpadEventArgs> TouchesEnded = null; // all fingers lifted
public event EventHandler<TouchpadEventArgs> TouchButtonDown = null; // touchpad pushed down until the button clicks
public event EventHandler<TouchpadEventArgs> TouchButtonUp = null; // touchpad button released
public event EventHandler<EventArgs> TouchUnchanged = null; // no status change for the touchpad itself... but other sensors may have changed, or you may just want to do some processing
public event EventHandler<EventArgs> PreTouchProcess = null; // used to publish that a touch packet is about to be processed
public delegate void TouchHandler<TEventArgs>(DS4Touchpad sender, TEventArgs args);
public event TouchHandler<TouchpadEventArgs> TouchesBegan = null; // finger one or two landed (or both, or one then two, or two then one; any touches[] count increase)
public event TouchHandler<TouchpadEventArgs> TouchesMoved = null; // deltaX/deltaY are set because one or both fingers were already down on a prior sensor reading
public event TouchHandler<TouchpadEventArgs> TouchesEnded = null; // all fingers lifted
public event TouchHandler<TouchpadEventArgs> TouchButtonDown = null; // touchpad pushed down until the button clicks
public event TouchHandler<TouchpadEventArgs> TouchButtonUp = null; // touchpad button released
public event TouchHandler<EventArgs> TouchUnchanged = null; // no status change for the touchpad itself... but other sensors may have changed, or you may just want to do some processing
public event TouchHandler<EventArgs> PreTouchProcess = null; // used to publish that a touch packet is about to be processed
//public event EventHandler<EventArgs> PreTouchProcess = null; // used to publish that a touch packet is about to be processed
public readonly static int TOUCHPAD_DATA_OFFSET = 35;
internal int lastTouchPadX1, lastTouchPadY1,

View File

@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DS4Windows</RootNamespace>
<AssemblyName>DS4Windows</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
@ -82,7 +82,7 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<DefineConstants>WIN64</DefineConstants>
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
<LangVersion>7.2</LangVersion>
<LangVersion>7.3</LangVersion>
<DebugSymbols>false</DebugSymbols>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<WarningLevel>1</WarningLevel>
@ -235,6 +235,7 @@
<Compile Include="HidLibrary\NativeMethods.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Settings.cs" />
<Compile Include="VJoyFeeder\vJoyFeeder.cs" />
<EmbeddedResource Include="DS4Forms\DS4Form.ar.resx">
<DependentUpon>DS4Form.cs</DependentUpon>
<SubType>Designer</SubType>
@ -300,6 +301,7 @@
</EmbeddedResource>
<EmbeddedResource Include="DS4Forms\DS4Form.resx">
<DependentUpon>DS4Form.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="DS4Forms\DS4Form.ro-RO.resx">
<DependentUpon>DS4Form.cs</DependentUpon>
@ -625,6 +627,7 @@
</EmbeddedResource>
<EmbeddedResource Include="DS4Forms\Options.resx">
<DependentUpon>Options.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="DS4Forms\Options.ro-RO.resx">
<DependentUpon>Options.cs</DependentUpon>
@ -859,6 +862,7 @@
</EmbeddedResource>
<EmbeddedResource Include="DS4Forms\SpecActions.resx">
<DependentUpon>SpecActions.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="DS4Forms\SpecActions.ro-RO.resx">
<DependentUpon>SpecActions.cs</DependentUpon>
@ -1047,7 +1051,9 @@
<EmbeddedResource Include="Properties\Resources.cs.resx" />
<EmbeddedResource Include="Properties\Resources.de-DE.resx" />
<EmbeddedResource Include="Properties\Resources.el.resx" />
<EmbeddedResource Include="Properties\Resources.es.resx" />
<EmbeddedResource Include="Properties\Resources.es.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.fi.resx" />
<EmbeddedResource Include="Properties\Resources.fr-FR.resx" />
<EmbeddedResource Include="Properties\Resources.he.resx" />
@ -1175,6 +1181,7 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="PostBuildMacros">
<GetAssemblyIdentity AssemblyFiles="$(TargetPath)">

View File

@ -46,9 +46,11 @@ namespace DS4Windows
List<HidDevice> foundDevs = new List<HidDevice>();
int devInfoLen = devInfo.Length;
IEnumerable<DeviceInfo> temp = EnumerateDevices();
for (int i = 0, len = temp.Count(); i < len; i++)
for (var devEnum = temp.GetEnumerator(); devEnum.MoveNext();)
//for (int i = 0, len = temp.Count(); i < len; i++)
{
DeviceInfo x = temp.ElementAt(i);
DeviceInfo x = devEnum.Current;
//DeviceInfo x = temp.ElementAt(i);
HidDevice tempDev = new HidDevice(x.Path, x.Description);
bool found = false;
for (int j = 0; !found && j < devInfoLen; j++)

View File

@ -96,7 +96,7 @@ namespace DS4Windows
//if (mutex.WaitOne(TimeSpan.Zero, true))
//{
createControlService();
createControlService();
//rootHub = new ControlService();
Application.EnableVisualStyles();
ds4form = new DS4Form(args);

View File

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

View File

@ -1627,6 +1627,69 @@ namespace DS4Windows.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Calibration of sixaxis wheel emulation.
/// </summary>
public static string SASteeringWheelEmulationCalibrate {
get {
return ResourceManager.GetString("SASteeringWheelEmulationCalibrate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to All calibraton points are set when lightbar color turns to green. While turning the controller the lightbar color flashes when the controller is at calibration point. Accept calibration with OK button.
/// </summary>
public static string SASteeringWheelEmulationCalibrateInstruction {
get {
return ResourceManager.GetString("SASteeringWheelEmulationCalibrateInstruction", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to (1) Center the controller, hold it steady and press &quot;X&quot;.
/// </summary>
public static string SASteeringWheelEmulationCalibrateInstruction1 {
get {
return ResourceManager.GetString("SASteeringWheelEmulationCalibrateInstruction1", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to (2) Turn to 90° left (or right) position and press &quot;X&quot;.
/// </summary>
public static string SASteeringWheelEmulationCalibrateInstruction2 {
get {
return ResourceManager.GetString("SASteeringWheelEmulationCalibrateInstruction2", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to (3) Turn to 90° right (or left) position and press &quot;X&quot;.
/// </summary>
public static string SASteeringWheelEmulationCalibrateInstruction3 {
get {
return ResourceManager.GetString("SASteeringWheelEmulationCalibrateInstruction3", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Cannot calibrate gyro (sixaxis) steering wheel emulation values without a controller. Connect a controller via bluetooth or usb.
/// </summary>
public static string SASteeringWheelEmulationCalibrateNoControllerError {
get {
return ResourceManager.GetString("SASteeringWheelEmulationCalibrateNoControllerError", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Gyro steering wheel emulation axis option is set to NONE (emulation is not used). Please select an axis option before calibrating the sixaxis gyro steering wheel emulation.
/// </summary>
public static string SASteeringWheelEmulationCalibrateNoneAxisError {
get {
return ResourceManager.GetString("SASteeringWheelEmulationCalibrateNoneAxisError", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
@ -549,4 +549,55 @@
<data name="XMLFiles" xml:space="preserve">
<value>XML-tiedostot (*xml)</value>
</data>
<data name="BTPollRate" xml:space="preserve">
<value>Määrittelee DS4 laitteen tietojen luentatiheyden BT yhteystavassa</value>
</data>
<data name="CloseConfirm" xml:space="preserve">
<value>Tämä toiminto sulkee yhteyden kaikkiin ohjaimiin. Suorita toiminto?</value>
</data>
<data name="Confirm" xml:space="preserve">
<value>Vahvista...</value>
</data>
<data name="GyroTriggerBehavior" xml:space="preserve">
<value>Valitse valinta jolloin kytkimen painallus aktivoi gyro toiminnon. Poista valinta jolloin kytkimen painallus poistaa gyro toiminnon.</value>
</data>
<data name="LanguagePackApplyRestartRequired" xml:space="preserve">
<value>Kielivalinta tulee voimaan kun DS4Windows sovellus käynnistetään seuraavan kerran uudelleen.</value>
</data>
<data name="MacroRecorded" xml:space="preserve">
<value>Makro tallennettu.</value>
</data>
<data name="MultiAction" xml:space="preserve">
<value>Monitoiminappi</value>
</data>
<data name="RunAtStartup" xml:space="preserve">
<value>Määrittää Windowsin käynnistämään DS4Windows sovelluksen kirjautumisen yhteydessä</value>
</data>
<data name="SelectMacro" xml:space="preserve">
<value>Valitse makro</value>
</data>
<data name="SASteeringWheelEmulationCalibrate" xml:space="preserve">
<value>Sixaxis rattitoiminnon kalibrointi</value>
</data>
<data name="SASteeringWheelEmulationCalibrateInstruction1" xml:space="preserve">
<value>(1) Keskitä ohjain vaakatasoon, pidä ohjain vakaana ja paina "X"</value>
</data>
<data name="SASteeringWheelEmulationCalibrateInstruction2" xml:space="preserve">
<value>(2) Kallista ohjainta 90° vasemmalle (tai oikealle) keskikohdasta ja paina "X"</value>
</data>
<data name="SASteeringWheelEmulationCalibrateInstruction3" xml:space="preserve">
<value>(3) Kallista ohjainta 90° oikealle (tai vasemmalle) keskikohdasta ja paina "X"</value>
</data>
<data name="SASteeringWheelEmulationCalibrateInstruction" xml:space="preserve">
<value>Kaikki kolme kalibrointipistettä on asetettu kun valopalkin väri on muuttunut vihreäksi. Ohjaimen kallistelun aikana valopalkki vilkkuu kun ohjain on kallistettu kalibrointipisteen kohdalle. Hyväksy kalibrointi OK napilla.</value>
</data>
<data name="SASteeringWheelEmulationCalibrateNoControllerError" xml:space="preserve">
<value>Rattiohjainemuloinnin sixaxis kallistusantureita ei voi kalibroida ilman ohjainta. Kytke ohjain joko bluetooth tai usb yhteydellä</value>
</data>
<data name="SASteeringWheelEmulationCalibrateNoneAxisError" xml:space="preserve">
<value>Gyro rattiohjainemuloinnin käyttöakseli on asetettu NONE (ei käytössä) valinnalle. Valitse jokin muu valintavaihtoehto ennen sixaxis rattiohjainemuloinnin kalibrointia</value>
</data>
<data name="UACTask" xml:space="preserve">
<value>DS4Windows sovellus pitää käynnistää järjestelmävalvojan oikeuksilla tämän toiminnon käyttämiseksi.</value>
</data>
</root>

View File

@ -637,6 +637,27 @@
<data name="Shortcuts" xml:space="preserve">
<value>Shortcuts</value>
</data>
<data name="SASteeringWheelEmulationCalibrate" xml:space="preserve">
<value>Calibration of sixaxis wheel emulation</value>
</data>
<data name="SASteeringWheelEmulationCalibrateInstruction1" xml:space="preserve">
<value>(1) Center the controller, hold it steady and press "X"</value>
</data>
<data name="SASteeringWheelEmulationCalibrateInstruction2" xml:space="preserve">
<value>(2) Turn to 90° left (or right) position and press "X"</value>
</data>
<data name="SASteeringWheelEmulationCalibrateInstruction3" xml:space="preserve">
<value>(3) Turn to 90° right (or left) position and press "X"</value>
</data>
<data name="SASteeringWheelEmulationCalibrateInstruction" xml:space="preserve">
<value>All calibraton points are set when lightbar color turns to green. While turning the controller the lightbar color flashes when the controller is at calibration point. Accept calibration with OK button</value>
</data>
<data name="SASteeringWheelEmulationCalibrateNoControllerError" xml:space="preserve">
<value>Cannot calibrate gyro (sixaxis) steering wheel emulation values without a controller. Connect a controller via bluetooth or usb</value>
</data>
<data name="SASteeringWheelEmulationCalibrateNoneAxisError" xml:space="preserve">
<value>Gyro steering wheel emulation axis option is set to NONE (emulation is not used). Please select an axis option before calibrating the sixaxis gyro steering wheel emulation</value>
</data>
<data name="SixAxisReading" xml:space="preserve">
<value>Click for advanced Sixaxis reading</value>
</data>

View File

@ -0,0 +1,716 @@
// VJoy C# interface file taken from an excellent Shaul's virtual joystick driver project.
// Licensed to public domain as is (http://vjoystick.sourceforge.net/site/index.php/forum/5-Discussion/104-what-is-the-usage-license-for-this-software).
// http://vjoystick.sourceforge.net/site/
// https://github.com/shauleiz/vJoy/tree/master/apps/common/vJoyInterfaceCS
//
// This module is a feeder for VJoy virtual joystick driver. DS4Windows can optionally re-map and feed buttons and analog axis values from DS4 Controller to VJoy device.
// At first this may seem silly because DS4Windows can already do re-mapping by using a virtual X360 Controller driver, so why feed VJoy virtual driver also?
// Sometimes X360 driver may run out of analog axis options, so for example "SA motion sensor steering wheel emulation" in DS4Windows would reserve a thumbstick X or Y
// axis for SA steering wheel emulation usage. That thumbstick axis would be unavailable for "normal" thumbstick usage after this re-mapping.
// The problem can be solved by configuring DS4Windows to re-map SA steering wheel emulation axis to VJoy axis, so all analog axies in DS4 controller are still available for normal usage.
//
using System;
using System.Runtime.InteropServices;
using System.Security; // SuppressUnmanagedCodeSecurity support to optimize for performance instead of code security
namespace DS4Windows.VJoyFeeder
{
[Flags]
public enum HID_USAGES
{
HID_USAGE_X = 0x30,
HID_USAGE_Y = 0x31,
HID_USAGE_Z = 0x32,
HID_USAGE_RX = 0x33,
HID_USAGE_RY = 0x34,
HID_USAGE_RZ = 0x35,
HID_USAGE_SL0 = 0x36,
HID_USAGE_SL1 = 0x37,
HID_USAGE_WHL = 0x38,
HID_USAGE_POV = 0x39,
}
public enum VjdStat /* Declares an enumeration data type called BOOLEAN */
{
VJD_STAT_OWN, // The vJoy Device is owned by this application.
VJD_STAT_FREE, // The vJoy Device is NOT owned by any application (including this one).
VJD_STAT_BUSY, // The vJoy Device is owned by another application. It cannot be acquired by this application.
VJD_STAT_MISS, // The vJoy Device is missing. It either does not exist or the driver is down.
VJD_STAT_UNKN // Unknown
};
// FFB Declarations
// HID Descriptor definitions - FFB Report IDs
public enum FFBPType // FFB Packet Type
{
// Write
PT_EFFREP = 0x01, // Usage Set Effect Report
PT_ENVREP = 0x02, // Usage Set Envelope Report
PT_CONDREP = 0x03, // Usage Set Condition Report
PT_PRIDREP = 0x04, // Usage Set Periodic Report
PT_CONSTREP = 0x05, // Usage Set Constant Force Report
PT_RAMPREP = 0x06, // Usage Set Ramp Force Report
PT_CSTMREP = 0x07, // Usage Custom Force Data Report
PT_SMPLREP = 0x08, // Usage Download Force Sample
PT_EFOPREP = 0x0A, // Usage Effect Operation Report
PT_BLKFRREP = 0x0B, // Usage PID Block Free Report
PT_CTRLREP = 0x0C, // Usage PID Device Control
PT_GAINREP = 0x0D, // Usage Device Gain Report
PT_SETCREP = 0x0E, // Usage Set Custom Force Report
// Feature
PT_NEWEFREP = 0x01 + 0x10, // Usage Create New Effect Report
PT_BLKLDREP = 0x02 + 0x10, // Usage Block Load Report
PT_POOLREP = 0x03 + 0x10, // Usage PID Pool Report
};
public enum FFBEType // FFB Effect Type
{
// Effect Type
ET_NONE = 0, // No Force
ET_CONST = 1, // Constant Force
ET_RAMP = 2, // Ramp
ET_SQR = 3, // Square
ET_SINE = 4, // Sine
ET_TRNGL = 5, // Triangle
ET_STUP = 6, // Sawtooth Up
ET_STDN = 7, // Sawtooth Down
ET_SPRNG = 8, // Spring
ET_DMPR = 9, // Damper
ET_INRT = 10, // Inertia
ET_FRCTN = 11, // Friction
ET_CSTM = 12, // Custom Force Data
};
public enum FFB_CTRL
{
CTRL_ENACT = 1, // Enable all device actuators.
CTRL_DISACT = 2, // Disable all the device actuators.
CTRL_STOPALL = 3, // Stop All Effects­ Issues a stop on every running effect.
CTRL_DEVRST = 4, // Device Reset Clears any device paused condition, enables all actuators and clears all effects from memory.
CTRL_DEVPAUSE = 5, // Device Pause The all effects on the device are paused at the current time step.
CTRL_DEVCONT = 6, // Device Continue The all effects that running when the device was paused are restarted from their last time step.
};
public enum FFBOP
{
EFF_START = 1, // EFFECT START
EFF_SOLO = 2, // EFFECT SOLO START
EFF_STOP = 3, // EFFECT STOP
};
//namespace vJoyInterfaceWrap
//{
[SuppressUnmanagedCodeSecurity]
public class VJoy
{
/***************************************************/
/*********** Various declarations ******************/
/***************************************************/
private static RemovalCbFunc UserRemCB;
private static WrapRemovalCbFunc wrf;
private static GCHandle hRemUserData;
private static FfbCbFunc UserFfbCB;
private static WrapFfbCbFunc wf;
private static GCHandle hFfbUserData;
[StructLayout(LayoutKind.Sequential)]
public struct JoystickState
{
public byte bDevice;
public Int32 Throttle;
public Int32 Rudder;
public Int32 Aileron;
public Int32 AxisX;
public Int32 AxisY;
public Int32 AxisZ;
public Int32 AxisXRot;
public Int32 AxisYRot;
public Int32 AxisZRot;
public Int32 Slider;
public Int32 Dial;
public Int32 Wheel;
public Int32 AxisVX;
public Int32 AxisVY;
public Int32 AxisVZ;
public Int32 AxisVBRX;
public Int32 AxisVBRY;
public Int32 AxisVBRZ;
public UInt32 Buttons;
public UInt32 bHats; // Lower 4 bits: HAT switch or 16-bit of continuous HAT switch
public UInt32 bHatsEx1; // Lower 4 bits: HAT switch or 16-bit of continuous HAT switch
public UInt32 bHatsEx2; // Lower 4 bits: HAT switch or 16-bit of continuous HAT switch
public UInt32 bHatsEx3; // Lower 4 bits: HAT switch or 16-bit of continuous HAT switch
public UInt32 ButtonsEx1;
public UInt32 ButtonsEx2;
public UInt32 ButtonsEx3;
};
[StructLayout(LayoutKind.Sequential)]
private struct FFB_DATA
{
private UInt32 size;
private UInt32 cmd;
private IntPtr data;
}
[StructLayout(LayoutKind.Explicit)]
public struct FFB_EFF_CONSTANT
{
[FieldOffset(0)]
public Byte EffectBlockIndex;
[FieldOffset(4)]
public Int16 Magnitude;
}
[System.Obsolete("use FFB_EFF_REPORT")]
[StructLayout(LayoutKind.Explicit)]
public struct FFB_EFF_CONST
{
[FieldOffset(0)]
public Byte EffectBlockIndex;
[FieldOffset(4)]
public FFBEType EffectType;
[FieldOffset(8)]
public UInt16 Duration;// Value in milliseconds. 0xFFFF means infinite
[FieldOffset(10)]
public UInt16 TrigerRpt;
[FieldOffset(12)]
public UInt16 SamplePrd;
[FieldOffset(14)]
public Byte Gain;
[FieldOffset(15)]
public Byte TrigerBtn;
[FieldOffset(16)]
public bool Polar; // How to interpret force direction Polar (0-360°) or Cartesian (X,Y)
[FieldOffset(20)]
public Byte Direction; // Polar direction: (0x00-0xFF correspond to 0-360°)
[FieldOffset(20)]
public Byte DirX; // X direction: Positive values are To the right of the center (X); Negative are Two's complement
[FieldOffset(21)]
public Byte DirY; // Y direction: Positive values are below the center (Y); Negative are Two's complement
}
[StructLayout(LayoutKind.Explicit)]
public struct FFB_EFF_REPORT
{
[FieldOffset(0)]
public Byte EffectBlockIndex;
[FieldOffset(4)]
public FFBEType EffectType;
[FieldOffset(8)]
public UInt16 Duration;// Value in milliseconds. 0xFFFF means infinite
[FieldOffset(10)]
public UInt16 TrigerRpt;
[FieldOffset(12)]
public UInt16 SamplePrd;
[FieldOffset(14)]
public Byte Gain;
[FieldOffset(15)]
public Byte TrigerBtn;
[FieldOffset(16)]
public bool Polar; // How to interpret force direction Polar (0-360°) or Cartesian (X,Y)
[FieldOffset(20)]
public Byte Direction; // Polar direction: (0x00-0xFF correspond to 0-360°)
[FieldOffset(20)]
public Byte DirX; // X direction: Positive values are To the right of the center (X); Negative are Two's complement
[FieldOffset(21)]
public Byte DirY; // Y direction: Positive values are below the center (Y); Negative are Two's complement
}
[StructLayout(LayoutKind.Explicit)]
public struct FFB_EFF_OP
{
[FieldOffset(0)]
public Byte EffectBlockIndex;
[FieldOffset(4)]
public FFBOP EffectOp;
[FieldOffset(8)]
public Byte LoopCount;
}
[StructLayout(LayoutKind.Explicit)]
public struct FFB_EFF_COND
{
[FieldOffset(0)]
public Byte EffectBlockIndex;
[FieldOffset(4)]
public bool isY;
[FieldOffset(8)]
public Int16 CenterPointOffset; // CP Offset: Range 0x80­0x7F (­10000 ­ 10000)
[FieldOffset(12)]
public Int16 PosCoeff; // Positive Coefficient: Range 0x80­0x7F (­10000 ­ 10000)
[FieldOffset(16)]
public Int16 NegCoeff; // Negative Coefficient: Range 0x80­0x7F (­10000 ­ 10000)
[FieldOffset(20)]
public UInt32 PosSatur; // Positive Saturation: Range 0x00­0xFF (0 10000)
[FieldOffset(24)]
public UInt32 NegSatur; // Negative Saturation: Range 0x00­0xFF (0 10000)
[FieldOffset(28)]
public Int32 DeadBand; // Dead Band: : Range 0x00­0xFF (0 10000)
}
[StructLayout(LayoutKind.Explicit)]
public struct FFB_EFF_ENVLP
{
[FieldOffset(0)]
public Byte EffectBlockIndex;
[FieldOffset(4)]
public UInt16 AttackLevel;
[FieldOffset(8)]
public UInt16 FadeLevel;
[FieldOffset(12)]
public UInt32 AttackTime;
[FieldOffset(16)]
public UInt32 FadeTime;
}
[StructLayout(LayoutKind.Explicit)]
public struct FFB_EFF_PERIOD
{
[FieldOffset(0)]
public Byte EffectBlockIndex;
[FieldOffset(4)]
public UInt32 Magnitude;
[FieldOffset(8)]
public Int16 Offset;
[FieldOffset(12)]
public UInt32 Phase;
[FieldOffset(16)]
public UInt32 Period;
}
[StructLayout(LayoutKind.Explicit)]
public struct FFB_EFF_RAMP
{
[FieldOffset(0)]
public Byte EffectBlockIndex;
[FieldOffset(4)]
public Int16 Start; // The Normalized magnitude at the start of the effect
[FieldOffset(8)]
public Int16 End; // The Normalized magnitude at the end of the effect
}
/***************************************************/
/***** Import from file vJoyInterface.dll (C) ******/
/***************************************************/
///// General driver data
[DllImport("vJoyInterface.dll", EntryPoint = "GetvJoyVersion")]
private static extern short _GetvJoyVersion();
[DllImport("vJoyInterface.dll", EntryPoint = "vJoyEnabled")]
private static extern bool _vJoyEnabled();
[DllImport("vJoyInterface.dll", EntryPoint = "GetvJoyProductString")]
private static extern IntPtr _GetvJoyProductString();
[DllImport("vJoyInterface.dll", EntryPoint = "GetvJoyManufacturerString")]
private static extern IntPtr _GetvJoyManufacturerString();
[DllImport("vJoyInterface.dll", EntryPoint = "GetvJoySerialNumberString")]
private static extern IntPtr _GetvJoySerialNumberString();
[DllImport("vJoyInterface.dll", EntryPoint = "DriverMatch")]
private static extern bool _DriverMatch(ref UInt32 DllVer, ref UInt32 DrvVer);
///// vJoy Device properties
[DllImport("vJoyInterface.dll", EntryPoint = "GetVJDButtonNumber")]
private static extern int _GetVJDButtonNumber(UInt32 rID);
[DllImport("vJoyInterface.dll", EntryPoint = "GetVJDDiscPovNumber")]
private static extern int _GetVJDDiscPovNumber(UInt32 rID);
[DllImport("vJoyInterface.dll", EntryPoint = "GetVJDContPovNumber")]
private static extern int _GetVJDContPovNumber(UInt32 rID);
[DllImport("vJoyInterface.dll", EntryPoint = "GetVJDAxisExist")]
private static extern UInt32 _GetVJDAxisExist(UInt32 rID, UInt32 Axis);
[DllImport("vJoyInterface.dll", EntryPoint = "GetVJDAxisMax")]
private static extern bool _GetVJDAxisMax(UInt32 rID, UInt32 Axis, ref long Max);
[DllImport("vJoyInterface.dll", EntryPoint = "GetVJDAxisMin")]
private static extern bool _GetVJDAxisMin(UInt32 rID, UInt32 Axis, ref long Min);
[DllImport("vJoyInterface.dll", EntryPoint = "isVJDExists")]
private static extern bool _isVJDExists(UInt32 rID);
[DllImport("vJoyInterface.dll", EntryPoint = "GetOwnerPid")]
private static extern int _GetOwnerPid(UInt32 rID);
///// Write access to vJoy Device - Basic
[DllImport("vJoyInterface.dll", EntryPoint = "AcquireVJD")]
private static extern bool _AcquireVJD(UInt32 rID);
[DllImport("vJoyInterface.dll", EntryPoint = "RelinquishVJD")]
private static extern void _RelinquishVJD(UInt32 rID);
[DllImport("vJoyInterface.dll", EntryPoint = "UpdateVJD")]
private static extern bool _UpdateVJD(UInt32 rID, ref JoystickState pData);
[DllImport("vJoyInterface.dll", EntryPoint = "GetVJDStatus")]
private static extern int _GetVJDStatus(UInt32 rID);
//// Reset functions
[DllImport("vJoyInterface.dll", EntryPoint = "ResetVJD")]
private static extern bool _ResetVJD(UInt32 rID);
[DllImport("vJoyInterface.dll", EntryPoint = "ResetAll")]
private static extern bool _ResetAll();
[DllImport("vJoyInterface.dll", EntryPoint = "ResetButtons")]
private static extern bool _ResetButtons(UInt32 rID);
[DllImport("vJoyInterface.dll", EntryPoint = "ResetPovs")]
private static extern bool _ResetPovs(UInt32 rID);
////// Write data
[DllImport("vJoyInterface.dll", EntryPoint = "SetAxis")]
private static extern bool _SetAxis(Int32 Value, UInt32 rID, HID_USAGES Axis);
[DllImport("vJoyInterface.dll", EntryPoint = "SetBtn")]
private static extern bool _SetBtn(bool Value, UInt32 rID, Byte nBtn);
[DllImport("vJoyInterface.dll", EntryPoint = "SetDiscPov")]
private static extern bool _SetDiscPov(Int32 Value, UInt32 rID, uint nPov);
[DllImport("vJoyInterface.dll", EntryPoint = "SetContPov")]
private static extern bool _SetContPov(Int32 Value, UInt32 rID, uint nPov);
[DllImport("vJoyInterface.dll", EntryPoint = "RegisterRemovalCB", CallingConvention = CallingConvention.Cdecl)]
private extern static void _RegisterRemovalCB(WrapRemovalCbFunc cb, IntPtr data);
public delegate void RemovalCbFunc(bool complete, bool First, object userData);
public delegate void WrapRemovalCbFunc(bool complete, bool First, IntPtr userData);
public static void WrapperRemCB(bool complete, bool First, IntPtr userData)
{
object obj = null;
if (userData != IntPtr.Zero)
{
// Convert userData from pointer to object
GCHandle handle2 = (GCHandle)userData;
obj = handle2.Target as object;
}
// Call user-defined CB function
UserRemCB(complete, First, obj);
}
// Force Feedback (FFB)
[DllImport("vJoyInterface.dll", EntryPoint = "FfbRegisterGenCB", CallingConvention = CallingConvention.Cdecl)]
private extern static void _FfbRegisterGenCB(WrapFfbCbFunc cb, IntPtr data);
public delegate void FfbCbFunc(IntPtr data, object userData);
public delegate void WrapFfbCbFunc(IntPtr data, IntPtr userData);
public static void WrapperFfbCB(IntPtr data, IntPtr userData)
{
object obj = null;
if (userData != IntPtr.Zero)
{
// Convert userData from pointer to object
GCHandle handle2 = (GCHandle)userData;
obj = handle2.Target as object;
}
// Call user-defined CB function
UserFfbCB(data, obj);
}
[DllImport("vJoyInterface.dll", EntryPoint = "FfbStart")]
private static extern bool _FfbStart(UInt32 rID);
[DllImport("vJoyInterface.dll", EntryPoint = "FfbStop")]
private static extern bool _FfbStop(UInt32 rID);
[DllImport("vJoyInterface.dll", EntryPoint = "IsDeviceFfb")]
private static extern bool _IsDeviceFfb(UInt32 rID);
[DllImport("vJoyInterface.dll", EntryPoint = "IsDeviceFfbEffect")]
private static extern bool _IsDeviceFfbEffect(UInt32 rID, UInt32 Effect);
[DllImport("vJoyInterface.dll", EntryPoint = "Ffb_h_DeviceID")]
private static extern UInt32 _Ffb_h_DeviceID(IntPtr Packet, ref int DeviceID);
[DllImport("vJoyInterface.dll", EntryPoint = "Ffb_h_Type")]
private static extern UInt32 _Ffb_h_Type(IntPtr Packet, ref FFBPType Type);
[DllImport("vJoyInterface.dll", EntryPoint = "Ffb_h_Packet")]
private static extern UInt32 _Ffb_h_Packet(IntPtr Packet, ref UInt32 Type, ref Int32 DataSize, ref IntPtr Data);
[DllImport("vJoyInterface.dll", EntryPoint = "Ffb_h_EBI")]
private static extern UInt32 _Ffb_h_EBI(IntPtr Packet, ref Int32 Index);
#pragma warning disable 618
[DllImport("vJoyInterface.dll", EntryPoint = "Ffb_h_Eff_Const")]
private static extern UInt32 _Ffb_h_Eff_Const(IntPtr Packet, ref FFB_EFF_CONST Effect);
#pragma warning restore 618
[DllImport("vJoyInterface.dll", EntryPoint = "Ffb_h_Eff_Report")]
private static extern UInt32 _Ffb_h_Eff_Report(IntPtr Packet, ref FFB_EFF_REPORT Effect);
[DllImport("vJoyInterface.dll", EntryPoint = "Ffb_h_DevCtrl")]
private static extern UInt32 _Ffb_h_DevCtrl(IntPtr Packet, ref FFB_CTRL Control);
[DllImport("vJoyInterface.dll", EntryPoint = "Ffb_h_EffOp")]
private static extern UInt32 _Ffb_h_EffOp(IntPtr Packet, ref FFB_EFF_OP Operation);
[DllImport("vJoyInterface.dll", EntryPoint = "Ffb_h_DevGain")]
private static extern UInt32 _Ffb_h_DevGain(IntPtr Packet, ref Byte Gain);
[DllImport("vJoyInterface.dll", EntryPoint = "Ffb_h_Eff_Cond")]
private static extern UInt32 _Ffb_h_Eff_Cond(IntPtr Packet, ref FFB_EFF_COND Condition);
[DllImport("vJoyInterface.dll", EntryPoint = "Ffb_h_Eff_Envlp")]
private static extern UInt32 _Ffb_h_Eff_Envlp(IntPtr Packet, ref FFB_EFF_ENVLP Envelope);
[DllImport("vJoyInterface.dll", EntryPoint = "Ffb_h_Eff_Period")]
private static extern UInt32 _Ffb_h_Eff_Period(IntPtr Packet, ref FFB_EFF_PERIOD Effect);
[DllImport("vJoyInterface.dll", EntryPoint = "Ffb_h_EffNew")]
private static extern UInt32 _Ffb_h_EffNew(IntPtr Packet, ref FFBEType Effect);
[DllImport("vJoyInterface.dll", EntryPoint = "Ffb_h_Eff_Ramp")]
private static extern UInt32 _Ffb_h_Eff_Ramp(IntPtr Packet, ref FFB_EFF_RAMP RampEffect);
[DllImport("vJoyInterface.dll", EntryPoint = "Ffb_h_Eff_Constant")]
private static extern UInt32 _Ffb_h_Eff_Constant(IntPtr Packet, ref FFB_EFF_CONSTANT ConstantEffect);
/***************************************************/
/********** Export functions (C#) ******************/
/***************************************************/
///// General driver data
public short GetvJoyVersion() { return _GetvJoyVersion(); }
public bool vJoyEnabled() { return _vJoyEnabled(); }
public string GetvJoyProductString() { return Marshal.PtrToStringAuto(_GetvJoyProductString()); }
public string GetvJoyManufacturerString() { return Marshal.PtrToStringAuto(_GetvJoyManufacturerString()); }
public string GetvJoySerialNumberString() { return Marshal.PtrToStringAuto(_GetvJoySerialNumberString()); }
public bool DriverMatch(ref UInt32 DllVer, ref UInt32 DrvVer) { return _DriverMatch(ref DllVer, ref DrvVer); }
///// vJoy Device properties
public int GetVJDButtonNumber(uint rID) { return _GetVJDButtonNumber(rID); }
public int GetVJDDiscPovNumber(uint rID) { return _GetVJDDiscPovNumber(rID); }
public int GetVJDContPovNumber(uint rID) { return _GetVJDContPovNumber(rID); }
public bool GetVJDAxisExist(UInt32 rID, HID_USAGES Axis)
{
UInt32 res = _GetVJDAxisExist(rID, (uint)Axis);
if (res == 1)
return true;
else
return false;
}
public bool GetVJDAxisMax(UInt32 rID, HID_USAGES Axis, ref long Max) { return _GetVJDAxisMax(rID, (uint)Axis, ref Max); }
public bool GetVJDAxisMin(UInt32 rID, HID_USAGES Axis, ref long Min) { return _GetVJDAxisMin(rID, (uint)Axis, ref Min); }
public bool isVJDExists(UInt32 rID) { return _isVJDExists(rID); }
public int GetOwnerPid(UInt32 rID) { return _GetOwnerPid(rID); }
///// Write access to vJoy Device - Basic
public bool AcquireVJD(UInt32 rID) { return _AcquireVJD(rID); }
public void RelinquishVJD(uint rID) { _RelinquishVJD(rID); }
public bool UpdateVJD(UInt32 rID, ref JoystickState pData) { return _UpdateVJD(rID, ref pData); }
public VjdStat GetVJDStatus(UInt32 rID) { return (VjdStat)_GetVJDStatus(rID); }
//// Reset functions
public bool ResetVJD(UInt32 rID) { return _ResetVJD(rID); }
public bool ResetAll() { return _ResetAll(); }
public bool ResetButtons(UInt32 rID) { return _ResetButtons(rID); }
public bool ResetPovs(UInt32 rID) { return _ResetPovs(rID); }
////// Write data
public bool SetAxis(Int32 Value, UInt32 rID, HID_USAGES Axis) { return _SetAxis(Value, rID, Axis); }
public bool SetBtn(bool Value, UInt32 rID, uint nBtn) { return _SetBtn(Value, rID, (Byte)nBtn); }
public bool SetDiscPov(Int32 Value, UInt32 rID, uint nPov) { return _SetDiscPov(Value, rID, nPov); }
public bool SetContPov(Int32 Value, UInt32 rID, uint nPov) { return _SetContPov(Value, rID, nPov); }
// Register CB function that takes a C# object as userdata
public void RegisterRemovalCB(RemovalCbFunc cb, object data)
{
// Free existing GCHandle (if exists)
if (hRemUserData.IsAllocated && hRemUserData.Target != null)
hRemUserData.Free();
// Convert object to pointer
hRemUserData = GCHandle.Alloc(data);
// Apply the user-defined CB function
UserRemCB = new RemovalCbFunc(cb);
wrf = new WrapRemovalCbFunc(WrapperRemCB);
_RegisterRemovalCB(wrf, (IntPtr)hRemUserData);
}
// Register CB function that takes a pointer as userdata
public void RegisterRemovalCB(WrapRemovalCbFunc cb, IntPtr data)
{
wrf = new WrapRemovalCbFunc(cb);
_RegisterRemovalCB(wrf, data);
}
/////////////////////////////////////////////////////////////////////////////////////////////
//// Force Feedback (FFB)
// Register CB function that takes a C# object as userdata
public void FfbRegisterGenCB(FfbCbFunc cb, object data)
{
// Free existing GCHandle (if exists)
if (hFfbUserData.IsAllocated && hFfbUserData.Target != null)
hFfbUserData.Free();
// Convert object to pointer
hFfbUserData = GCHandle.Alloc(data);
// Apply the user-defined CB function
UserFfbCB = new FfbCbFunc(cb);
wf = new WrapFfbCbFunc(WrapperFfbCB);
_FfbRegisterGenCB(wf, (IntPtr)hFfbUserData);
}
// Register CB function that takes a pointer as userdata
public void FfbRegisterGenCB(WrapFfbCbFunc cb, IntPtr data)
{
wf = new WrapFfbCbFunc(cb);
_FfbRegisterGenCB(wf, data);
}
[Obsolete("you can remove the function from your code")]
public bool FfbStart(UInt32 rID) { return _FfbStart(rID); }
[Obsolete("you can remove the function from your code")]
public bool FfbStop(UInt32 rID) { return _FfbStop(rID); }
public bool IsDeviceFfb(UInt32 rID) { return _IsDeviceFfb(rID); }
public bool IsDeviceFfbEffect(UInt32 rID, UInt32 Effect) { return _IsDeviceFfbEffect(rID, Effect); }
public UInt32 Ffb_h_DeviceID(IntPtr Packet, ref int DeviceID) { return _Ffb_h_DeviceID(Packet, ref DeviceID); }
public UInt32 Ffb_h_Type(IntPtr Packet, ref FFBPType Type) { return _Ffb_h_Type(Packet, ref Type); }
public UInt32 Ffb_h_Packet(IntPtr Packet, ref UInt32 Type, ref Int32 DataSize, ref Byte[] Data)
{
IntPtr buf = IntPtr.Zero;
UInt32 res = _Ffb_h_Packet(Packet, ref Type, ref DataSize, ref buf);
if (res != 0)
return res;
DataSize -= 8;
Data = new byte[DataSize];
Marshal.Copy(buf, Data, 0, DataSize);
return res;
}
public UInt32 Ffb_h_EBI(IntPtr Packet, ref Int32 Index) { return _Ffb_h_EBI(Packet, ref Index); }
[Obsolete("use Ffb_h_Eff_Report instead")]
public UInt32 Ffb_h_Eff_Const(IntPtr Packet, ref FFB_EFF_CONST Effect) { return _Ffb_h_Eff_Const(Packet, ref Effect); }
public UInt32 Ffb_h_Eff_Report(IntPtr Packet, ref FFB_EFF_REPORT Effect) { return _Ffb_h_Eff_Report(Packet, ref Effect); }
public UInt32 Ffb_h_DevCtrl(IntPtr Packet, ref FFB_CTRL Control) { return _Ffb_h_DevCtrl(Packet, ref Control); }
public UInt32 Ffb_h_EffOp(IntPtr Packet, ref FFB_EFF_OP Operation) { return _Ffb_h_EffOp(Packet, ref Operation); }
public UInt32 Ffb_h_DevGain(IntPtr Packet, ref Byte Gain) { return _Ffb_h_DevGain(Packet, ref Gain); }
public UInt32 Ffb_h_Eff_Cond(IntPtr Packet, ref FFB_EFF_COND Condition) { return _Ffb_h_Eff_Cond(Packet, ref Condition); }
public UInt32 Ffb_h_Eff_Envlp(IntPtr Packet, ref FFB_EFF_ENVLP Envelope) { return _Ffb_h_Eff_Envlp(Packet, ref Envelope); }
public UInt32 Ffb_h_Eff_Period(IntPtr Packet, ref FFB_EFF_PERIOD Effect) { return _Ffb_h_Eff_Period(Packet, ref Effect); }
public UInt32 Ffb_h_EffNew(IntPtr Packet, ref FFBEType Effect) { return _Ffb_h_EffNew(Packet, ref Effect); }
public UInt32 Ffb_h_Eff_Ramp(IntPtr Packet, ref FFB_EFF_RAMP RampEffect) { return _Ffb_h_Eff_Ramp(Packet, ref RampEffect); }
public UInt32 Ffb_h_Eff_Constant(IntPtr Packet, ref FFB_EFF_CONSTANT ConstantEffect) { return _Ffb_h_Eff_Constant(Packet, ref ConstantEffect); }
}
//}
public class vJoyFeeder
{
private static readonly object vJoyLocker = new object();
static bool vJoyInitialized = false;
static bool vJoyAvailable = false;
static VJoy vJoyObj = null;
vJoyFeeder()
{
// Do nothing
}
~vJoyFeeder()
{
// Do nothing
}
public static void InitializeVJoyDevice(uint vJoyID, HID_USAGES axis)
{
lock (vJoyLocker)
{
if (vJoyInitialized) return;
vJoyInitialized = true;
AppLogger.LogToGui("Initializing VJoy virtual joystick driver via vJoyInterface.dll interface", false);
try
{
if (vJoyObj == null) vJoyObj = new VJoy();
if (vJoyObj.vJoyEnabled() && vJoyObj.GetVJDAxisExist(vJoyID, axis))
{
AppLogger.LogToGui("Connection to VJoy virtual joystick established", false);
AppLogger.LogToGui($"VJoy driver. Vendor={vJoyObj.GetvJoyManufacturerString()} Product={vJoyObj.GetvJoyProductString()} Version={vJoyObj.GetvJoySerialNumberString()} Device#={vJoyID} Axis={axis}", false);
// Test if DLL matches the driver
UInt32 DllVer = 0, DrvVer = 0;
if (!vJoyObj.DriverMatch(ref DllVer, ref DrvVer))
AppLogger.LogToGui("WARNING. VJoy version of Driver {DrvVer}) does not match interface DLL Version {DllVer}. This may lead to unexpected problems or crashes. Update VJoy driver and vJoyInterface.dll", false);
VjdStat status = vJoyObj.GetVJDStatus(vJoyID);
if ((status == VjdStat.VJD_STAT_OWN) || ((status == VjdStat.VJD_STAT_FREE) && (!vJoyObj.AcquireVJD(vJoyID))))
{
vJoyAvailable = false;
AppLogger.LogToGui("ERROR. Failed to acquire vJoy device# {vJoyID}. Use another VJoy device or make sure there are no other VJoy feeder apps using the same device", false);
}
else
{
//vJoyObj.GetVJDAxisMax(vJoyID, axis, ref vJoyAxisMaxValue);
//AppLogger.LogToGui($"VJoy axis {axis} max value={vJoyAxisMaxValue}", false);
vJoyObj.ResetVJD(vJoyID);
vJoyAvailable = true;
}
}
else
{
vJoyAvailable = false;
AppLogger.LogToGui($"ERROR. VJoy device# {vJoyID} or {axis} axis not available. Check vJoy driver installation and configuration", false);
}
}
catch
{
vJoyAvailable = false;
AppLogger.LogToGui("ERROR. vJoy initialization failed. Make sure that DS4Windows application can find vJoyInterface.dll library file", false);
}
}
}
// Feed axis value to VJoy virtual joystic driver (DS4Windows sixaxis (SA) motion sensor steering wheel emulation feature can optionally feed VJoy analog axis instead of ScpVBus x360 axis
public static void FeedAxisValue(int value, uint vJoyID, HID_USAGES axis)
{
if (vJoyAvailable)
{
vJoyObj.SetAxis(value, vJoyID, axis);
}
else if (!vJoyInitialized)
{
// If this was the first call to this FeedAxisValue function and VJoy driver connection is not yet initialized
// then try to do it now. Subsequent calls will see the the vJoy as available (if connection succeeded) and
// there is no need to re-initialize the connection everytime the feeder is used.
InitializeVJoyDevice(vJoyID, axis);
}
}
}
}

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="Lang"/>
</assemblyBinding>
<gcServer enabled="true" />
<gcServer enabled="true"/>
</runtime>
</configuration>

View File

@ -1 +1 @@
1.6.8
1.6.12

View File

@ -29,6 +29,10 @@ you've used a 360 controller before)
or built in pc). Toshiba's adapters currently do not work.
- Disable Steam Controller Mapping support in Steam
## Social
[Discord](https://discord.gg/zrpPgyN)
## Device Detection Issue
If your DS4 is not detected by DS4Windows and the lightbar continues to
@ -64,6 +68,21 @@ use DS4Windows properly, you have to open Steam Big Picture Mode, navigate to
Settings > Controller> Controller Settings and uncheck **Xbox Configuration
Support** along with **PlayStation Configuration Support**.
## Personal Game Testing
My PC game library is not that expansive so there are likely games
that will be tested by users that I will not have access to
playing. There are likely going to be times when I cannot directly test
against a game since I will not have access to play it. Most free to play
games or games that include a playable demo should be fine for testing.
For other games, it might be better if people could test against any game
that I have in my game library and try to reproduce a problem. Here are
links to my Steam and GOG profiles so that people can see what games I have
access to play.
https://steamcommunity.com/id/Ryochan7/games/?tab=all
https://www.gog.com/u/Ryochan7/games
## Pull Requests
Pull requests for DS4Windows are welcome. Before making a pull request, please

View File

@ -1,7 +1,9 @@
Travis Nickles (Ryochan7)
Korney Czukowski (czukowski)
mika-n
jdfeng
justalemon
Rajko Stojadinovic (rajkosto)
Yuki-nyan
xrossb