mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-01-23 05:31:12 +01:00
parent
4a7e233bd1
commit
ff870230a6
@ -369,8 +369,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())
|
||||
@ -604,8 +605,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;
|
||||
|
@ -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;
|
||||
@ -419,6 +420,7 @@ namespace DS4Windows
|
||||
}
|
||||
|
||||
public bool dragging, dragging2;
|
||||
|
||||
private void synthesizeMouseButtons()
|
||||
{
|
||||
if (Global.GetDS4Action(deviceNum, DS4Controls.TouchLeft, false) == null && leftDown)
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -778,6 +778,17 @@ namespace DS4Windows
|
||||
return m_Config.gyroMouseHorizontalAxis[index];
|
||||
}
|
||||
|
||||
public static int[] GyroMouseDeadZone => m_Config.gyroMouseDZ;
|
||||
public static int GetGyroMouseDeadZone(int index)
|
||||
{
|
||||
return m_Config.gyroMouseDZ[index];
|
||||
}
|
||||
|
||||
public static void SetGyroMouseDeadZone(int index, int value, ControlService control)
|
||||
{
|
||||
m_Config.SetGyroMouseDZ(index, value, control);
|
||||
}
|
||||
|
||||
public static DS4Color[] MainColor => m_Config.m_Leds;
|
||||
public static DS4Color getMainColor(int index)
|
||||
{
|
||||
@ -1437,6 +1448,9 @@ 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 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 };
|
||||
@ -1656,6 +1670,13 @@ 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 bool SaveProfile(int device, string propath)
|
||||
{
|
||||
bool Saved = true;
|
||||
@ -1757,6 +1778,7 @@ 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 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);
|
||||
@ -2656,6 +2678,10 @@ 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 + "/LSCurve"); int.TryParse(Item.InnerText, out lsCurve[device]); }
|
||||
catch { lsCurve[device] = 0; missingSetting = true; }
|
||||
|
||||
|
24
DS4Windows/DS4Forms/Options.Designer.cs
generated
24
DS4Windows/DS4Forms/Options.Designer.cs
generated
@ -315,6 +315,8 @@
|
||||
this.rBSAControls = new System.Windows.Forms.RadioButton();
|
||||
this.rBSAMouse = new System.Windows.Forms.RadioButton();
|
||||
this.pnlSAMouse = new System.Windows.Forms.Panel();
|
||||
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();
|
||||
@ -470,6 +472,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();
|
||||
@ -3392,6 +3395,8 @@
|
||||
//
|
||||
// pnlSAMouse
|
||||
//
|
||||
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);
|
||||
@ -3414,6 +3419,22 @@
|
||||
resources.ApplyResources(this.pnlSAMouse, "pnlSAMouse");
|
||||
this.pnlSAMouse.Name = "pnlSAMouse";
|
||||
//
|
||||
// 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");
|
||||
@ -4240,6 +4261,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();
|
||||
@ -4620,5 +4642,7 @@
|
||||
private System.Windows.Forms.CheckBox trackballCk;
|
||||
private System.Windows.Forms.Label label26;
|
||||
private System.Windows.Forms.ComboBox triggerCondAndCombo;
|
||||
private System.Windows.Forms.Label label27;
|
||||
private System.Windows.Forms.NumericUpDown gyroMouseDzNUD;
|
||||
}
|
||||
}
|
@ -718,6 +718,7 @@ namespace DS4Windows
|
||||
nUDGyroSmoothWeight.Value = (decimal)(GyroSmoothingWeight[device]);
|
||||
cBGyroMouseXAxis.SelectedIndex = GyroMouseHorizontalAxis[device];
|
||||
triggerCondAndCombo.SelectedIndex = SATriggerCond[device] ? 0 : 1;
|
||||
gyroMouseDzNUD.Value = GyroMouseDeadZone[device];
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -834,6 +835,7 @@ namespace DS4Windows
|
||||
cBGyroInvertY.Checked = false;
|
||||
cBGyroSmooth.Checked = false;
|
||||
nUDGyroSmoothWeight.Value = 0.5m;
|
||||
gyroMouseDzNUD.Value = MouseCursor.GYRO_MOUSE_DEADZONE;
|
||||
cBGyroMouseXAxis.SelectedIndex = 0;
|
||||
triggerCondAndCombo.SelectedIndex = 0;
|
||||
Set();
|
||||
@ -1334,6 +1336,7 @@ namespace DS4Windows
|
||||
GyroSmoothing[device] = cBGyroSmooth.Checked;
|
||||
GyroSmoothingWeight[device] = (double)nUDGyroSmoothWeight.Value;
|
||||
GyroMouseHorizontalAxis[device] = cBGyroMouseXAxis.SelectedIndex;
|
||||
SetGyroMouseDeadZone(device, (int)gyroMouseDzNUD.Value, Program.rootHub);
|
||||
|
||||
int invert = 0;
|
||||
if (cBGyroInvertX.Checked)
|
||||
@ -2989,6 +2992,15 @@ namespace DS4Windows
|
||||
}
|
||||
}
|
||||
|
||||
private void gyroMouseDzNUD_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (loading == false)
|
||||
{
|
||||
SetGyroMouseDeadZone(device, (int)gyroMouseDzNUD.Value,
|
||||
Program.rootHub);
|
||||
}
|
||||
}
|
||||
|
||||
private void trackFrictionNUD_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (loading == false)
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user