Added support for 180/360/720/900/1440 turn range (or any other turn range between 90-3240 degrees). New SASteeringWheelEmulationRange profile option with int32 value (default 360).

This commit is contained in:
mika-n 2018-12-04 00:50:37 +02:00
parent 38458e4a2f
commit 1eed418022
11 changed files with 406 additions and 416 deletions

View File

@ -1964,6 +1964,25 @@ namespace DS4Windows
}
actionDone[index].dev[device] = true;
}
else if (action.typeID == SpecialAction.ActionTypeId.SASteeringWheelEmulationCalibrate)
{
actionFound = true;
DS4Device d = ctrl.DS4Controllers[device];
// If controller is not already in SASteeringWheelCalibration state then enable it now. If calibration is active then complete it (commit calibration values)
if (d.WheelRecalibrateActiveState == 0 && DateTime.UtcNow > (action.firstTap + TimeSpan.FromMilliseconds(3000)))
{
action.firstTap = DateTime.UtcNow;
d.WheelRecalibrateActiveState = 1; // Start calibration process
}
else if (d.WheelRecalibrateActiveState == 2 && DateTime.UtcNow > (action.firstTap + TimeSpan.FromMilliseconds(3000)))
{
action.firstTap = DateTime.UtcNow;
d.WheelRecalibrateActiveState = 3; // Complete calibration process
}
actionDone[index].dev[device] = true;
}
}
else
{
@ -3803,14 +3822,19 @@ namespace DS4Windows
private static readonly DS4Color calibrationColor_3 = new DS4Color { red = 0x00, green = 0xC0, blue = 0x00 };
private static DateTime latestDebugMsgTime;
private static void LogToGuiSACalibrationDebugMsg(string data)
private static string latestDebugData;
private static void LogToGuiSACalibrationDebugMsg(string data, bool forceOutput = false)
{
// Print debug calibration log messages only once per 2 secs to avoid flooding the log receiver
DateTime curTime = DateTime.Now;
if (((TimeSpan)(curTime - latestDebugMsgTime)).TotalSeconds > 2)
if (forceOutput || ((TimeSpan)(curTime - latestDebugMsgTime)).TotalSeconds > 2)
{
latestDebugMsgTime = curTime;
AppLogger.LogToGui(data, false);
if (data != latestDebugData)
{
AppLogger.LogToGui(data, false);
latestDebugData = data;
}
}
}
@ -3828,7 +3852,7 @@ namespace DS4Windows
// Calculate and return the angle of the controller as -180...0...+180 value.
// TODO: Support >360 degree turn range by adding "lap counter" when wheel is rotated full rounds left or right.At the moment this logic supports only 360 degree turn range.
protected static Int32 CalculateControllerAngle(int gyroAccelX, int gyroAccelZ, DS4Device controller)
private static Int32 CalculateControllerAngle(int gyroAccelX, int gyroAccelZ, DS4Device controller)
{
Int32 result;
@ -3870,7 +3894,8 @@ namespace DS4Windows
else
{
double angle = Math.Acos(dotProduct / (magAB * magCD));
result = Convert.ToInt32( Clamp(-180.0 * C_WHEEL_ANGLE_PRECISION,
result = Convert.ToInt32( Global.Clamp(
-180.0 * C_WHEEL_ANGLE_PRECISION,
Math.Round((angle * (180.0 / Math.PI)), C_WHEEL_ANGLE_PRECISION_DECIMALS) * C_WHEEL_ANGLE_PRECISION,
180.0 * C_WHEEL_ANGLE_PRECISION)
);
@ -3878,15 +3903,130 @@ namespace DS4Windows
// Left turn is -180..0 and right turn 0..180 degrees
if (gyroAccelX < controller.wheelCenterPoint.X) result = -result;
// Just to be sure.. Probably not needed. TODO: Add support for 360/720/900 turn ranges by counting "laps" how many times the steering wheel is turned around
//result = ClampInt(-180, result, 180);
}
return result;
}
protected static Int32 Scale360degreeGyroAxis(int device, /*DS4State state,*/ DS4StateExposed exposedState, ControlService ctrl)
private static void SAWheelEmulationCalibration(int device, DS4StateExposed exposedState, ControlService ctrl, DS4State currentDeviceState, DS4Device controller)
{
int gyroAccelX, gyroAccelZ;
int result;
gyroAccelX = exposedState.getAccelX();
gyroAccelZ = exposedState.getAccelZ();
// "SASteeringWheelEmulaationCalibration" action key combination is used to run "in-game" calibration process (user can define the action key combination in DS4Windows GUI).
// State 0=Normal mode (ie. calibration process is not running), 1=Activating calibration, 2=Calibration process running, 3=Completing calibration
if (controller.WheelRecalibrateActiveState == 1)
{
AppLogger.LogToGui($"Controller {ctrl.x360Bus.FirstController + device} activated re-calibration of SA steering wheel emulation", false);
controller.WheelRecalibrateActiveState = 2;
controller.wheelPrevPhysicalAngle = 0;
controller.wheelFullTurnCount = 0;
// Clear existing calibration value and use current position as "center" point.
// This initial center value may be off-center because of shaking the controller while button was pressed. The value will be overriden with correct value once controller is stabilized and hold still few secs at the center point
controller.wheelCenterPoint.X = gyroAccelX;
controller.wheelCenterPoint.Y = gyroAccelZ;
controller.wheel90DegPointRight.X = gyroAccelX + 25;
controller.wheel90DegPointLeft.X = gyroAccelX - 25;
// Clear bitmask for calibration points. All three calibration points need to be set before re-calibration process is valid
controller.wheelCalibratedAxisBitmask = DS4Device.WheelCalibrationPoint.None;
controller.wheelPrevRecalibrateTime = DateTime.Now;
}
else if (controller.WheelRecalibrateActiveState == 3 /*&& currentDeviceState.Options && ((TimeSpan)(DateTime.Now - controller.wheelPrevRecalibrateTime)).TotalSeconds > 3 */)
{
AppLogger.LogToGui($"Controller {ctrl.x360Bus.FirstController + device} completed the calibration of SA steering wheel emulation. center=({controller.wheelCenterPoint.X}, {controller.wheelCenterPoint.Y}) 90L=({controller.wheel90DegPointLeft.X}, {controller.wheel90DegPointLeft.Y}) 90R=({controller.wheel90DegPointRight.X}, {controller.wheel90DegPointRight.Y})", false);
// If any of the calibration points (center, left 90deg, right 90deg) are missing then reset back to default calibration values
if (((controller.wheelCalibratedAxisBitmask & DS4Device.WheelCalibrationPoint.All) == DS4Device.WheelCalibrationPoint.All))
Global.SaveControllerConfigs(controller);
else
controller.wheelCenterPoint.X = controller.wheelCenterPoint.Y = 0;
// Reset lightbar back to normal color
// TODO: hmmm... Sometimes color is not reset back to normal "main color". Investigate why following code logic doesn't always restore it.
DS4LightBar.forcelight[device] = false;
DS4LightBar.forcedFlash[device] = 0;
DS4LightBar.updateLightBar(controller, device);
controller.LightBarColor = Global.getMainColor(device);
DS4LightBar.updateLightBar(controller, device);
controller.WheelRecalibrateActiveState = 0;
controller.wheelPrevRecalibrateTime = DateTime.Now;
}
if (controller.WheelRecalibrateActiveState > 0)
{
// Auto calibrate 90deg left/right positions (these values may change over time because gyro/accel sensor values are not "precise mathematics", so user can trigger calibration even in mid-game sessions by pressing DS4 Options btn),
// but make sure controller is stable enough to avoid misaligments because of hard shaking (check velocity of gyro axis)
if (Math.Abs(currentDeviceState.Motion.angVelPitch) < 0.5 && Math.Abs(currentDeviceState.Motion.angVelYaw) < 0.5 && Math.Abs(currentDeviceState.Motion.angVelRoll) < 0.5)
{
if (controller.wheelCalibratedAxisBitmask == DS4Device.WheelCalibrationPoint.None)
{
// Wait few secs after re-calibration button was pressed. Hold controller still at center position and don't shake it too much until red lightbar turns to yellow.
if (((TimeSpan)(DateTime.Now - controller.wheelPrevRecalibrateTime)).TotalSeconds >= 3)
{
controller.wheelCenterPoint.X = gyroAccelX;
controller.wheelCenterPoint.Y = gyroAccelZ;
controller.wheelCalibratedAxisBitmask |= DS4Device.WheelCalibrationPoint.Center;
}
}
else if (controller.wheel90DegPointRight.X < gyroAccelX)
{
controller.wheel90DegPointRight.X = gyroAccelX;
controller.wheel90DegPointRight.Y = gyroAccelZ;
controller.wheelCircleCenterPointRight.X = controller.wheelCenterPoint.X;
controller.wheelCircleCenterPointRight.Y = controller.wheel90DegPointRight.Y;
controller.wheelCalibratedAxisBitmask |= DS4Device.WheelCalibrationPoint.Right90;
}
else if (controller.wheel90DegPointLeft.X > gyroAccelX)
{
controller.wheel90DegPointLeft.X = gyroAccelX;
controller.wheel90DegPointLeft.Y = gyroAccelZ;
controller.wheelCircleCenterPointLeft.X = controller.wheelCenterPoint.X;
controller.wheelCircleCenterPointLeft.Y = controller.wheel90DegPointLeft.Y;
controller.wheelCalibratedAxisBitmask |= DS4Device.WheelCalibrationPoint.Left90;
}
}
// Show lightbar color feedback how the calibration process is proceeding.
// red / yellow / blue / green = No calibration anchors/one anchor/two anchors/three anchors calibrated (center, 90DegLeft, 90DegRight)
// Blinking led = Controller is tilted at the current calibration point (or calibration routine just set a new anchor point)
int bitsSet = CountNumOfSetBits((int)controller.wheelCalibratedAxisBitmask);
if (bitsSet >= 3) DS4LightBar.forcedColor[device] = calibrationColor_3;
else if (bitsSet == 2) DS4LightBar.forcedColor[device] = calibrationColor_2;
else if (bitsSet == 1) DS4LightBar.forcedColor[device] = calibrationColor_1;
else DS4LightBar.forcedColor[device] = calibrationColor_0;
result = CalculateControllerAngle(gyroAccelX, gyroAccelZ, controller);
if (bitsSet >= 1 && (
Math.Abs(result) <= 1 * C_WHEEL_ANGLE_PRECISION
|| (Math.Abs(result) >= 88 * C_WHEEL_ANGLE_PRECISION && Math.Abs(result) <= 92 * C_WHEEL_ANGLE_PRECISION)
|| Math.Abs(result) >= 178 * C_WHEEL_ANGLE_PRECISION
))
DS4LightBar.forcedFlash[device] = 2;
else
DS4LightBar.forcedFlash[device] = 0;
DS4LightBar.forcelight[device] = true;
//DS4LightBar.updateLightBar(controller, device);
LogToGuiSACalibrationDebugMsg($"Calibration values ({gyroAccelX}, {gyroAccelZ}) angle={result / (1.0 * C_WHEEL_ANGLE_PRECISION)}\n");
}
}
protected static Int32 Scale360degreeGyroAxis(int device, DS4StateExposed exposedState, ControlService ctrl)
{
unchecked
{
@ -3902,132 +4042,34 @@ namespace DS4Windows
currentDeviceState = controller.getCurrentStateRef();
gyroAccelX = exposedState.getAccelX();
gyroAccelZ = exposedState.getAccelZ();
// If DS4 Options btn is pressed and the previous re-calibration was done more than 2 secs ago (avoids repeated "calibration" loops if user holds down the Option btn too long) then re-calibrate the gyro wheel emulation.
// TODO. Maybe here should be logic to enter calibration process only if Options btn is hold down minimum of 3 secs? This way Option btn can be re-mapped to do other things without kicking on re-calibration everytime it is pressed.
if (currentDeviceState.Options && ((TimeSpan)(DateTime.Now - controller.wheelPrevRecalibrateTime)).TotalSeconds > 2)
// If user has pressed "SASteeringWheelEmulationCalibration" special action key combination then run "in-game" calibration process
if (controller.WheelRecalibrateActiveState > 0)
{
if (controller.WheelRecalibrateActive == false)
{
AppLogger.LogToGui($"Controller {ctrl.x360Bus.FirstController + device} activated re-calibration of motion steering wheel emulation", false);
SAWheelEmulationCalibration(device, exposedState, ctrl, currentDeviceState, controller);
controller.WheelRecalibrateActive = true;
// Clear existing calibration value and use current position as "center" point.
// This initial center value may be off-center because of shaking the controller while button was pressed. The value will be overriden with correct value once controller is stabilized and hold still few secs at the center point
controller.wheelCenterPoint.X = gyroAccelX;
controller.wheelCenterPoint.Y = gyroAccelZ;
controller.wheel90DegPointRight.X = gyroAccelX + 25;
controller.wheel90DegPointLeft.X = gyroAccelX - 25;
// Clear bitmask for calibration points. All three calibration points need to be set before re-calibration process is valid
controller.wheelCalibratedAxisBitmask = DS4Device.WheelCalibrationPoint.None;
}
else
{
AppLogger.LogToGui($"Controller {ctrl.x360Bus.FirstController + device} completed steering wheel calibration. center=({controller.wheelCenterPoint.X}, {controller.wheelCenterPoint.Y}) 90L=({controller.wheel90DegPointLeft.X}, {controller.wheel90DegPointLeft.Y}) 90R=({controller.wheel90DegPointRight.X}, {controller.wheel90DegPointRight.Y})", false);
controller.WheelRecalibrateActive = false;
// If any of the calibration points (center, left 90deg, right 90deg) are missing then reset back to default calibration values
if (((controller.wheelCalibratedAxisBitmask & DS4Device.WheelCalibrationPoint.All) == DS4Device.WheelCalibrationPoint.All))
Global.SaveControllerConfigs(controller);
else
controller.wheelCenterPoint.X = controller.wheelCenterPoint.Y = 0;
// Reset lightbar back to normal color
DS4LightBar.forcelight[device] = false;
DS4LightBar.forcedFlash[device] = 0;
controller.LightBarColor = Global.getMainColor(device);
DS4LightBar.updateLightBar(controller, device);
}
controller.wheelPrevRecalibrateTime = DateTime.Now;
}
if (controller.WheelRecalibrateActive)
{
// Auto calibrate 90deg left/right positions (these values may change over time because gyro/accel sensor values are not "precise mathematics", so user can trigger calibration even in mid-game sessions by pressing DS4 Options btn),
// but make sure controller is stable enough to avoid misaligments because of hard shaking (check velocity of gyro axis)
if (Math.Abs(/*state*/ currentDeviceState.Motion.angVelPitch) < 0.5 && Math.Abs(currentDeviceState.Motion.angVelYaw) < 0.5 && Math.Abs(currentDeviceState.Motion.angVelRoll) < 0.5)
{
if (controller.wheelCalibratedAxisBitmask == DS4Device.WheelCalibrationPoint.None)
{
// Wait few secs after re-calibration button was pressed. Hold controller still at center position and don't shake it too much until red lightbar turns to yellow.
if (((TimeSpan)(DateTime.Now - controller.wheelPrevRecalibrateTime)).TotalSeconds >= 3)
{
controller.wheelCenterPoint.X = gyroAccelX;
controller.wheelCenterPoint.Y = gyroAccelZ;
controller.wheelCalibratedAxisBitmask |= DS4Device.WheelCalibrationPoint.Center;
}
}
else if (controller.wheel90DegPointRight.X < gyroAccelX)
{
controller.wheel90DegPointRight.X = gyroAccelX;
controller.wheel90DegPointRight.Y = gyroAccelZ;
controller.wheelCircleCenterPointRight.X = controller.wheelCenterPoint.X;
controller.wheelCircleCenterPointRight.Y = controller.wheel90DegPointRight.Y;
controller.wheelCalibratedAxisBitmask |= DS4Device.WheelCalibrationPoint.Right90;
}
else if (controller.wheel90DegPointLeft.X > gyroAccelX)
{
controller.wheel90DegPointLeft.X = gyroAccelX;
controller.wheel90DegPointLeft.Y = gyroAccelZ;
controller.wheelCircleCenterPointLeft.X = controller.wheelCenterPoint.X;
controller.wheelCircleCenterPointLeft.Y = controller.wheel90DegPointLeft.Y;
controller.wheelCalibratedAxisBitmask |= DS4Device.WheelCalibrationPoint.Left90;
}
}
// Show lightbar color feedback how the calibration process is proceeding.
// red / yellow / blue / green = No calibration anchors/one anchor/two anchors/three anchors calibrated (center, 90DegLeft, 90DegRight)
// Blinking led = Controller is tilted at the current calibration point (or calibration routine just set a new anchor point)
int bitsSet = CountNumOfSetBits((int)controller.wheelCalibratedAxisBitmask);
if (bitsSet >= 3) DS4LightBar.forcedColor[device] = calibrationColor_3;
else if (bitsSet == 2) DS4LightBar.forcedColor[device] = calibrationColor_2;
else if (bitsSet == 1) DS4LightBar.forcedColor[device] = calibrationColor_1;
else DS4LightBar.forcedColor[device] = calibrationColor_0;
result = CalculateControllerAngle(gyroAccelX, gyroAccelZ, controller);
if (bitsSet >= 1 && (
Math.Abs(result) <= 1 * C_WHEEL_ANGLE_PRECISION
|| (Math.Abs(result) >= 88 * C_WHEEL_ANGLE_PRECISION && Math.Abs(result) <= 92 * C_WHEEL_ANGLE_PRECISION)
|| Math.Abs(result) >= 178 * C_WHEEL_ANGLE_PRECISION
))
DS4LightBar.forcedFlash[device] = 2;
else
DS4LightBar.forcedFlash[device] = 0;
DS4LightBar.forcelight[device] = true;
//DS4LightBar.updateLightBar(controller, device);
LogToGuiSACalibrationDebugMsg($"Calibration values ({gyroAccelX}, {gyroAccelZ}) angle={result / (1.0 * C_WHEEL_ANGLE_PRECISION)}\n");
// Return center wheel position while gyro is calibrated, not the calculated angle
// Return center wheel position while SA wheel emuation is being calibrated
return 0;
}
gyroAccelX = exposedState.getAccelX();
gyroAccelZ = exposedState.getAccelZ();
// If calibration values are missing then use "educated guesses" about good starting values.
// If calibration values are missing then use "educated guesses" about good starting values
if (controller.wheelCenterPoint.IsEmpty)
{
if (!Global.LoadControllerConfigs(controller))
{
AppLogger.LogToGui($"Controller {ctrl.x360Bus.FirstController + device} motion steering wheel calibration data missing. It is recommended to run steering wheel calibration process by pressing DS4 Options button. Using estimated values until the controller is calibrated at least once.", false);
AppLogger.LogToGui($"Controller {ctrl.x360Bus.FirstController + device} sixaxis steering wheel calibration data missing. It is recommended to run steering wheel calibration process by pressing SASteeringWheelEmulationCalibration special action key. Using estimated values until the controller is calibrated at least once.", false);
controller.wheelCenterPoint.X = gyroAccelX;
// Use current controller position as "center point". Assume DS4Windows was started while controller was hold in center position (yes, dangerous assumption but can't do much until controller is calibrated)
controller.wheelCenterPoint.X = gyroAccelX;
controller.wheelCenterPoint.Y = gyroAccelZ;
controller.wheel90DegPointRight.X = controller.wheelCenterPoint.X + 113; // 113;
controller.wheel90DegPointRight.Y = controller.wheelCenterPoint.Y + 110; // 110;
controller.wheel90DegPointRight.X = controller.wheelCenterPoint.X + 113;
controller.wheel90DegPointRight.Y = controller.wheelCenterPoint.Y + 110;
controller.wheel90DegPointLeft.X = controller.wheelCenterPoint.X - 127; // -127;
controller.wheel90DegPointLeft.Y = controller.wheel90DegPointRight.Y; // 2;
controller.wheel90DegPointLeft.X = controller.wheelCenterPoint.X - 127;
controller.wheel90DegPointLeft.Y = controller.wheel90DegPointRight.Y;
}
controller.wheelCircleCenterPointRight.X = controller.wheelCenterPoint.X;
@ -4040,13 +4082,46 @@ namespace DS4Windows
}
result = CalculateControllerAngle(gyroAccelX, gyroAccelZ, controller);
if (controller.wheelPrevPhysicalAngle < 0 && result > 0)
{
// If wrapped around from -180 to +180 side then SA steering wheel keeps on turning "left" (ie. beyond 360 degrees)
if ((result - controller.wheelPrevPhysicalAngle) > 180 * C_WHEEL_ANGLE_PRECISION)
controller.wheelFullTurnCount--;
}
else if (controller.wheelPrevPhysicalAngle > 0 && result < 0)
{
// If wrapped around from +180 to -180 side then SA steering wheel keeps on turning "right" (ie. beyond 360 degrees)
if ((controller.wheelPrevPhysicalAngle - result) > 180 * C_WHEEL_ANGLE_PRECISION)
controller.wheelFullTurnCount++;
}
controller.wheelPrevPhysicalAngle = result;
if (controller.wheelFullTurnCount != 0)
{
if (controller.wheelFullTurnCount > 0)
result = (controller.wheelFullTurnCount * 180 * C_WHEEL_ANGLE_PRECISION) + ((controller.wheelFullTurnCount * 180 * C_WHEEL_ANGLE_PRECISION) + result);
else
result = (controller.wheelFullTurnCount * 180 * C_WHEEL_ANGLE_PRECISION) - ((controller.wheelFullTurnCount * -180 * C_WHEEL_ANGLE_PRECISION) - result);
}
// TODO: How to prevent "too many laps" problem or reset it (DS4Win doesn't know when a game is running so it keeps counting laps)?
int maxRangeRight = Global.getSASteeringWheelEmulationRange(device) / 2 * C_WHEEL_ANGLE_PRECISION;
int maxRangeLeft = -maxRangeRight;
if (maxRangeRight != (360 / 2 * C_WHEEL_ANGLE_PRECISION) )
result = Mapping.ClampInt(maxRangeLeft, result, maxRangeRight);
// Keep outputting debug data 30secs after the latest re-calibration event (user can check these values from the log screen of DS4Windows GUI)
//if (((TimeSpan)(DateTime.Now - prevRecalibrateTime)).TotalSeconds < 30)
// LogToGuiSACalibrationDebugMsg($"DEBUG gyro=({gyroAccelX}, {gyroAccelZ}) angle={result / (1.0 * C_WHEEL_ANGLE_PRECISION)}");
//LogToGuiSACalibrationDebugMsg($"DEBUG gyro=({gyroAccelX}, {gyroAccelZ}) angle={result / (1.0 * C_WHEEL_ANGLE_PRECISION)} fullTurns={controller.wheelFullTurnCount}", false);
// Scale input to a raw x360 thumbstick output scale
return (((result - (-180 * C_WHEEL_ANGLE_PRECISION)) * (32767 - (-32768))) / (180 * C_WHEEL_ANGLE_PRECISION - (-180 * C_WHEEL_ANGLE_PRECISION))) + (-32768);
//return (((result - (-180 * C_WHEEL_ANGLE_PRECISION)) * (32767 - (-32768))) / (180 * C_WHEEL_ANGLE_PRECISION - (-180 * C_WHEEL_ANGLE_PRECISION))) + (-32768);
return (( (result - maxRangeLeft) * (32767 - (-32768))) / (maxRangeRight - maxRangeLeft)) + (-32768);
}
}
// END: SixAxis steering wheel emulation logic

View File

@ -724,6 +724,12 @@ namespace DS4Windows
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)
{
@ -1514,6 +1520,7 @@ namespace DS4Windows
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 DS4Controls[] sASteeringWheelEmulationAxis = new DS4Controls[5] { DS4Controls.None, DS4Controls.None, DS4Controls.None, DS4Controls.None, DS4Controls.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 };
@ -1761,6 +1768,7 @@ namespace DS4Windows
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]);
@ -2640,6 +2648,9 @@ namespace DS4Windows
try { Item = m_Xdoc.SelectSingleNode("/" + rootname + "/SASteeringWheelEmulationAxis"); DS4Controls.TryParse(Item.InnerText, out sASteeringWheelEmulationAxis[device]); }
catch { sASteeringWheelEmulationAxis[device] = DS4Controls.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");
@ -3281,6 +3292,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)
@ -3400,6 +3415,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; }
@ -3920,6 +3943,7 @@ namespace DS4Windows
sATriggers[device] = string.Empty;
sATriggerCond[device] = true;
sASteeringWheelEmulationAxis[device] = DS4Controls.None;
sASteeringWheelEmulationRange[device] = 360;
touchDisInvertTriggers[device] = new int[1] { -1 };
lsCurve[device] = rsCurve[device] = 0;
gyroSensitivity[device] = 100;
@ -3941,7 +3965,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>();
@ -4059,6 +4083,10 @@ namespace DS4Windows
type = "MultiAction";
this.details = string.Join(",", macros);
}
else if (type == "SASteeringWheelEmulationCalibrate")
{
typeID = ActionTypeId.SASteeringWheelEmulationCalibrate;
}
else
this.details = details;

View File

@ -873,6 +873,9 @@ namespace DS4Windows
case "MultiAction":
lvi.SubItems.Add(Properties.Resources.MultiAction);
break;
case "SASteeringWheelEmulationCalibrate":
lvi.SubItems.Add(Properties.Resources.SASteeringWheelEmulationCalibrate);
break;
}
if (newp)

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

@ -157,6 +157,9 @@ namespace DS4Windows
return warnInterval;
}
public Int32 wheelPrevPhysicalAngle = 0;
public Int32 wheelFullTurnCount = 0;
public Point wheelCenterPoint;
public Point wheel90DegPointLeft;
public Point wheelCircleCenterPointLeft;
@ -165,13 +168,13 @@ namespace DS4Windows
public DateTime wheelPrevRecalibrateTime;
private bool wheelRecalibrateActive = false;
public bool WheelRecalibrateActive
private int wheelRecalibrateActiveState = 0;
public int WheelRecalibrateActiveState
{
get { return wheelRecalibrateActive; }
get { return wheelRecalibrateActiveState; }
set
{
wheelRecalibrateActive = value;
wheelRecalibrateActiveState = value;
}
}

View File

@ -250,6 +250,7 @@
<Compile Include="HidLibrary\HidDevices.cs" />
<Compile Include="HidLibrary\NativeMethods.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Settings.cs" />
<EmbeddedResource Include="DS4Forms\DS4Form.ar.resx">
<DependentUpon>DS4Form.cs</DependentUpon>
<SubType>Designer</SubType>
@ -874,6 +875,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>

View File

@ -1627,6 +1627,15 @@ namespace DS4Windows.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Calibration of sixaxis wheel emulation.
/// </summary>
internal static string SASteeringWheelEmulationCalibrate {
get {
return ResourceManager.GetString("SASteeringWheelEmulationCalibrate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View File

@ -637,6 +637,9 @@
<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="SixAxisReading" xml:space="preserve">
<value>Click for advanced Sixaxis reading</value>
</data>

28
DS4Windows/Settings.cs Normal file
View File

@ -0,0 +1,28 @@
namespace DS4Windows.Properties {
// This class allows you to handle specific events on the settings class:
// The SettingChanging event is raised before a setting's value is changed.
// The PropertyChanged event is raised after a setting's value is changed.
// The SettingsLoaded event is raised after the setting values are loaded.
// The SettingsSaving event is raised before the setting values are saved.
internal sealed partial class Settings {
public Settings() {
// // To add event handlers for saving and changing settings, uncomment the lines below:
//
// this.SettingChanging += this.SettingChangingEventHandler;
//
// this.SettingsSaving += this.SettingsSavingEventHandler;
//
}
private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
// Add code to handle the SettingChangingEvent event here.
}
private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
// Add code to handle the SettingsSaving event here.
}
}
}