Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion DS4Windows/DS4Control/ControlService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
new OneEuroFilter3D(), new OneEuroFilter3D(),
};
Thread tempThread;
Thread tempBusThread;
Thread eventDispatchThread;
Dispatcher eventDispatcher;
public bool suspending;
Expand Down Expand Up @@ -1477,7 +1476,7 @@
//Trace.WriteLine(string.Join(" ", reportData));
//Trace.WriteLine("");

bool useRumble = false; bool useLight = false;

Check warning on line 1479 in DS4Windows/DS4Control/ControlService.cs

View workflow job for this annotation

GitHub Actions / build (x64)

The variable 'useRumble' is assigned but its value is never used

Check warning on line 1479 in DS4Windows/DS4Control/ControlService.cs

View workflow job for this annotation

GitHub Actions / build (x64)

The variable 'useRumble' is assigned but its value is never used

Check warning on line 1479 in DS4Windows/DS4Control/ControlService.cs

View workflow job for this annotation

GitHub Actions / build (x86)

The variable 'useRumble' is assigned but its value is never used

Check warning on line 1479 in DS4Windows/DS4Control/ControlService.cs

View workflow job for this annotation

GitHub Actions / build (x86)

The variable 'useRumble' is assigned but its value is never used
byte flashOn = 0; byte flashOff = 0;
DS4Color? color = null;
if ((reportData[1] & DS4OutDevice.RUMBLE_FEATURE_FLAG) != 0)
Expand Down
23 changes: 0 additions & 23 deletions DS4Windows/DS4Control/Mapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,6 @@ public class DeltaSettingsProcessorGroup
50, // DS4Controls.BLP
51, // DS4Controls.BRP
};
private static int macroEndIndex = DS4_CONTROL_MACRO_ARRAY_LEN - 1;

// Special macros
static bool altTabDone = true;
Expand All @@ -849,9 +848,6 @@ public class DeltaSettingsProcessorGroup
public static int prevmouseaccel = 0;
private static double horizontalRemainder = 0.0, verticalRemainder = 0.0;
public const int MOUSESPEEDFACTOR = 48;
private const double MOUSESTICKANTIOFFSET = 0.0128;
private const double MOUSESTICKMINVELOCITY = 67.5;
//private const double MOUSESTICKMINVELOCITY = 40.0;

private static void RequestProfileSwitch(int device, string profileName, bool tempProfile,
bool launchProgram, ControlService ctrl, Action<bool> afterLoad = null)
Expand Down Expand Up @@ -1186,12 +1182,6 @@ public static int DS4ControltoInt(DS4Controls ctrl)
return result;
}

static double TValue(double value1, double value2, double percent)
{
percent /= 100f;
return value1 * percent + value2 * (1 - percent);
}

private static int ClampInt(int min, int value, int max)
{
return (value < min) ? min : (value > max) ? max : value;
Expand Down Expand Up @@ -4044,11 +4034,6 @@ private static void RunLightbarMacro(ObservableCollection<LightbarMacroElement>
}
}

private static bool IfAxisIsNotModified(int device, bool shift, DS4Controls dc)
{
return shift ? false : GetDS4CSetting(device, dc).actionType == DS4ControlSettings.ActionType.Default;
}

private static async void MapCustomAction(int device, DS4State cState, DS4State MappedState,
DS4StateExposed eState, Mouse tp, ControlService ctrl, DS4StateFieldMapping fieldMapping, DS4StateFieldMapping outputfieldMapping)
{
Expand Down Expand Up @@ -5054,14 +5039,6 @@ private static bool PlayMacroCodeValue(int device, bool[] macrocontrol, DS4KeyTy
return doDelayOnCaller;
}

private static void EndMacro(int device, bool[] macrocontrol, string macro, DS4Controls control)
{
if ((macro.StartsWith("164/9/9/164") || macro.StartsWith("18/9/9/18")) && !altTabDone)
AltTabSwappingRelease();

if (control != DS4Controls.None)
macrodone[DS4ControltoInt(control)] = false;
}

private static void EndMacro(int device, bool[] macrocontrol, List<int> macro, DS4Controls control)
{
Expand Down
10 changes: 0 additions & 10 deletions DS4Windows/DS4Control/Mouse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@
}

bool currentToggleGyroControls = false;
bool currentToggleGyroMouse = false;

Check warning on line 217 in DS4Windows/DS4Control/Mouse.cs

View workflow job for this annotation

GitHub Actions / build (x64)

The field 'Mouse.currentToggleGyroMouse' is assigned but its value is never used

Check warning on line 217 in DS4Windows/DS4Control/Mouse.cs

View workflow job for this annotation

GitHub Actions / build (x86)

The field 'Mouse.currentToggleGyroMouse' is assigned but its value is never used

Check warning on line 217 in DS4Windows/DS4Control/Mouse.cs

View workflow job for this annotation

GitHub Actions / build (x86)

The field 'Mouse.currentToggleGyroMouse' is assigned but its value is never used
bool currentToggleGyroStick = false;

Check warning on line 218 in DS4Windows/DS4Control/Mouse.cs

View workflow job for this annotation

GitHub Actions / build (x64)

The field 'Mouse.currentToggleGyroStick' is assigned but its value is never used

Check warning on line 218 in DS4Windows/DS4Control/Mouse.cs

View workflow job for this annotation

GitHub Actions / build (x64)

The field 'Mouse.currentToggleGyroStick' is assigned but its value is never used

Check warning on line 218 in DS4Windows/DS4Control/Mouse.cs

View workflow job for this annotation

GitHub Actions / build (x86)

The field 'Mouse.currentToggleGyroStick' is assigned but its value is never used

bool previousUnchangedTouchJoyFrame = false;
int previousTouchDX = 0;
Expand Down Expand Up @@ -1515,16 +1515,6 @@
return t.HwX >= 1920 * 2 / 5;
}

private void AddEmptyTrackballEntry()
{
int iIndex = trackballBufferTail;
trackballXBuffer[iIndex] = 0;
trackballYBuffer[iIndex] = 0;
trackballBufferTail = (iIndex + 1) % TRACKBALL_BUFFER_LEN;
if (trackballBufferHead == trackballBufferTail)
trackballBufferHead = (trackballBufferHead + 1) % TRACKBALL_BUFFER_LEN;
}

private void ClearTouchMouseTrackballData()
{
Array.Clear(trackballXBuffer, 0, TRACKBALL_BUFFER_LEN);
Expand Down
73 changes: 0 additions & 73 deletions DS4Windows/DS4Control/ScpUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3138,27 +3138,6 @@
return cs;
}

private static Color applyRatio(Color c1, Color c2, uint r)
{
float ratio = r / 100f;
float hue1 = c1.GetHue();
float hue2 = c2.GetHue();
float bri1 = c1.GetBrightness();
float bri2 = c2.GetBrightness();
float sat1 = c1.GetSaturation();
float sat2 = c2.GetSaturation();
float hr = hue2 - hue1;
float br = bri2 - bri1;
float sr = sat2 - sat1;
Color csR;
if (bri1 == 0)
csR = HuetoRGB(hue2, sat2, bri2 - br * ratio);
else
csR = HuetoRGB(hue2 - hr * ratio, sat2 - sr * ratio, bri2 - br * ratio);

return csR;
}

public static Color HuetoRGB(float hue, float sat, float bri)
{
float C = (1 - Math.Abs(2 * bri) - 1) * sat;
Expand Down Expand Up @@ -3204,10 +3183,6 @@
return (value < min) ? min : (value > max) ? max : value;
}

private static int ClampInt(int min, int value, int max)
{
return (value < min) ? min : (value > max) ? max : value;
}

public static void InitOutputKBMHandler(string identifier)
{
Expand Down Expand Up @@ -4404,54 +4379,6 @@
}
}

private string GetGyroOutModeString(GyroOutMode mode)
{
string result = "None";
switch (mode)
{
case GyroOutMode.Controls:
result = "Controls";
break;
case GyroOutMode.Mouse:
result = "Mouse";
break;
case GyroOutMode.MouseJoystick:
result = "MouseJoystick";
break;
case GyroOutMode.Passthru:
result = "Passthru";
break;
default:
break;
}

return result;
}

private GyroOutMode GetGyroOutModeType(string modeString)
{
GyroOutMode result = GyroOutMode.None;
switch (modeString)
{
case "Controls":
result = GyroOutMode.Controls;
break;
case "Mouse":
result = GyroOutMode.Mouse;
break;
case "MouseJoystick":
result = GyroOutMode.MouseJoystick;
break;
case "Passthru":
result = GyroOutMode.Passthru;
break;
default:
break;
}

return result;
}

private string GetLightbarModeString(LightbarMode mode)
{
string result = "DS4Win";
Expand Down Expand Up @@ -8182,7 +8109,7 @@

PostProcessLoad();
}
catch (InvalidOperationException e)

Check warning on line 8112 in DS4Windows/DS4Control/ScpUtil.cs

View workflow job for this annotation

GitHub Actions / build (x64)

The variable 'e' is declared but never used

Check warning on line 8112 in DS4Windows/DS4Control/ScpUtil.cs

View workflow job for this annotation

GitHub Actions / build (x64)

The variable 'e' is declared but never used

Check warning on line 8112 in DS4Windows/DS4Control/ScpUtil.cs

View workflow job for this annotation

GitHub Actions / build (x86)

The variable 'e' is declared but never used

Check warning on line 8112 in DS4Windows/DS4Control/ScpUtil.cs

View workflow job for this annotation

GitHub Actions / build (x86)

The variable 'e' is declared but never used
{
AppLogger.LogToGui("Failed to load Profiles.xml.", false);
loaded = false;
Expand Down
1 change: 0 additions & 1 deletion DS4Windows/DS4Forms/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,6 @@ protected override void OnSourceInitialized(EventArgs e)
private bool inHotPlug = false;
private int hotplugCounter = 0;
private object hotplugCounterLock = new object();
private const int DBT_DEVNODES_CHANGED = 0x0007;
private const int DBT_DEVICEARRIVAL = 0x8000;
private const int DBT_DEVICEREMOVECOMPLETE = 0x8004;
public const int WM_COPYDATA = 0x004A;
Expand Down
11 changes: 0 additions & 11 deletions DS4Windows/DS4Forms/RecordBox.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -432,17 +432,6 @@ private void MacroListBox_MouseDoubleClick(object sender, MouseButtonEventArgs e
}
}

private void RevertListItemTemplate()
{
if (recordBoxVM.EditMacroIndex >= 0)
{
ListBoxItem lbitem = macroListBox.ItemContainerGenerator.ContainerFromIndex(recordBoxVM.EditMacroIndex)
as ListBoxItem;
lbitem.ContentTemplate = this.FindResource("DisplayTemplate") as DataTemplate;
recordBoxVM.EditMacroIndex = -1;
}
}

private void UpdateDataRevertTemplate()
{
ListBoxItem lbitem = macroListBox.ItemContainerGenerator.ContainerFromIndex(recordBoxVM.EditMacroIndex)
Expand Down
41 changes: 0 additions & 41 deletions DS4Windows/DS4Forms/ViewModels/CurrentOutDeviceViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
}
}

public event EventHandler InputSlotNumChanged;

Check warning on line 324 in DS4Windows/DS4Forms/ViewModels/CurrentOutDeviceViewModel.cs

View workflow job for this annotation

GitHub Actions / build (x64)

The event 'SlotDeviceEntry.InputSlotNumChanged' is never used

Check warning on line 324 in DS4Windows/DS4Forms/ViewModels/CurrentOutDeviceViewModel.cs

View workflow job for this annotation

GitHub Actions / build (x64)

The event 'SlotDeviceEntry.InputSlotNumChanged' is never used

Check warning on line 324 in DS4Windows/DS4Forms/ViewModels/CurrentOutDeviceViewModel.cs

View workflow job for this annotation

GitHub Actions / build (x86)

The event 'SlotDeviceEntry.InputSlotNumChanged' is never used

Check warning on line 324 in DS4Windows/DS4Forms/ViewModels/CurrentOutDeviceViewModel.cs

View workflow job for this annotation

GitHub Actions / build (x86)

The event 'SlotDeviceEntry.InputSlotNumChanged' is never used

public string InputSlotDisplayString
{
Expand Down Expand Up @@ -372,26 +372,6 @@
Dirty = true;
}

private int DetermineDesiredChoiceIdx()
{
int result = 0;
switch (outSlotDevice.PermanentType)
{
case OutContType.None:
result = 0;
break;
case OutContType.X360:
result = 1;
break;
case OutContType.DS4:
result = 2;
break;
default:
break;
}
return result;
}

private int DetermineReserveChoiceIdx()
{
int result = 0;
Expand All @@ -410,27 +390,6 @@
return result;
}

private OutContType DetermineDesiredTypeFromIdx()
{
OutContType result = OutContType.None;
switch (desiredTypeChoiceIndex)
{
case 0:
result = OutContType.None;
break;
case 1:
result = OutContType.X360;
break;
case 2:
result = OutContType.DS4;
break;
default:
break;
}

return result;
}

private OutSlotDevice.ReserveStatus DetermineReserveChoiceFromIdx()
{
OutSlotDevice.ReserveStatus result = OutSlotDevice.ReserveStatus.Dynamic;
Expand Down
2 changes: 0 additions & 2 deletions DS4Windows/DS4Forms/ViewModels/TrayIconViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ public class TrayIconViewModel
private MenuItem minimizeItem;
private MenuItem openProgramItem;
private MenuItem closeItem;
private int? prevBattery = null;


public string TooltipText
{
Expand Down
28 changes: 0 additions & 28 deletions DS4Windows/DS4Library/DS4StateExposed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,6 @@ public DS4StateExposed(DS4State state)
_state = state;
}

bool Square { get { return _state.Square; } }
bool Triangle { get { return _state.Triangle; } }
bool Circle { get { return _state.Circle; } }
bool Cross { get { return _state.Cross; } }
bool DpadUp { get { return _state.DpadUp; } }
bool DpadDown { get { return _state.DpadDown; } }
bool DpadLeft { get { return _state.DpadLeft; } }
bool DpadRight { get { return _state.DpadRight; } }
bool L1 { get { return _state.L1; } }
bool L3 { get { return _state.L3; } }
bool R1 { get { return _state.R1; } }
bool R3 { get { return _state.R3; } }
bool Share { get { return _state.Share; } }
bool Options { get { return _state.Options; } }
bool PS { get { return _state.PS; } }
bool Touch1 { get { return _state.Touch1; } }
bool Touch2 { get { return _state.Touch2; } }
bool TouchButton { get { return _state.TouchButton; } }
bool Touch1Finger { get { return _state.Touch1Finger; } }
bool Touch2Fingers { get { return _state.Touch2Fingers; } }
byte LX { get { return _state.LX; } }
byte RX { get { return _state.RX; } }
byte LY { get { return _state.LY; } }
byte RY { get { return _state.RY; } }
byte L2 { get { return _state.L2; } }
byte R2 { get { return _state.R2; } }
int Battery { get { return _state.Battery; } }

public SixAxis Motion
{
get => _state.Motion;
Expand Down
8 changes: 0 additions & 8 deletions DS4Windows/DS4Library/InputDevices/JoyConDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,8 @@ public enum JoyConSide : uint
Right,
}

private const int AMP_REAL_MIN = 0;
//private const int AMP_REAL_MAX = 1003;
private const int AMP_LIMIT_MAX = 404;
private const int AMP_LIMIT_L_MAX = 404;
//private const int AMP_LIMIT_R_MAX = 206;
private const int AMP_LIMIT_R_MAX = 404;

private static RumbleTableData[] fixedRumbleTable = new RumbleTableData[]
{
Expand Down Expand Up @@ -161,8 +157,6 @@ public struct StickAxisData
public const int IMU_YAXIS_IDX = 1, IMU_PITCH_IDX = 1;
public const int IMU_ZAXIS_IDX = 2, IMU_ROLL_IDX = 2;

private const double STICK_AXIS_MAX_CUTOFF = 0.96;
private const double STICK_AXIS_MIN_CUTOFF = 1.04;

private const double STICK_AXIS_LS_X_MAX_CUTOFF = 0.96;
private const double STICK_AXIS_LS_X_MIN_CUTOFF = 1.04;
Expand All @@ -175,7 +169,6 @@ public struct StickAxisData
private const double STICK_AXIS_RS_Y_MAX_CUTOFF = 0.96;
private const double STICK_AXIS_RS_Y_MIN_CUTOFF = 1.14;

private const string BLUETOOTH_HID_GUID = "{00001124-0000-1000-8000-00805F9B34FB}";

private byte frameCount = 0;
public byte FrameCount { get => frameCount; set => frameCount = value; }
Expand Down Expand Up @@ -213,7 +206,6 @@ public struct StickAxisData
// Converts raw gyro input value to dps. Equal to (4588/65535)
private const float GYRO_IN_DEG_SEC_FACTOR = 0.070f;
private new const int WARN_INTERVAL_BT = 40;
private new const int WARN_INTERVAL_USB = 30;
private byte[] inputReportBuffer;
private byte[] outputReportBuffer;
private byte[] rumbleReportBuffer;
Expand Down
5 changes: 0 additions & 5 deletions DS4Windows/DS4Library/InputDevices/SwitchProDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public static class SwitchProSubCmd
public const byte ENABLE_VIBRATION = 0x48;
}

private const int AMP_REAL_MIN = 0;
//private const int AMP_REAL_MAX = 1003;
//private const int AMP_LIMIT_MAX = 404;
private const int AMP_LIMIT_MAX = 800;
Expand Down Expand Up @@ -820,10 +819,6 @@ private void RunUSBSetup()
//result = hidDevice.WriteOutputReportViaInterrupt(command, 500);
}

// Deprecated method. Leave a stub for now
private void RunBluetoothSetup()
{
}

private void EnableFastPollRate()
{
Expand Down
Loading