Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build 0.13.0.0 #301

Merged
merged 34 commits into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c22ac16
rebase (#298)
Valkirie Nov 20, 2022
5ba69c0
oups
Valkirie Nov 20, 2022
4ca630e
added XInputController Gamepad.TriggerThreshold
Valkirie Nov 20, 2022
0ac5759
qol
Valkirie Nov 20, 2022
000c90f
cleanup
Valkirie Nov 20, 2022
e303d18
add input listener to quickprofilespage
Valkirie Nov 20, 2022
7b36348
qol
Valkirie Nov 20, 2022
e6fdbba
Prevent crash on null profile
Valkirie Nov 20, 2022
1bc47fb
more work on AOKZOE A1
Valkirie Nov 21, 2022
1fcb392
more work on AYANEO Next
Valkirie Nov 21, 2022
4e2207e
Fix special key colors for DualSense and Xbox One controller models.
CasperH2O Nov 21, 2022
40473d0
more work on process priority
Valkirie Nov 21, 2022
4e0e517
fixed gyro injection when target is Xbox360
Valkirie Nov 22, 2022
3ecd875
fix quickprofiles hotkey label update on profile change
Valkirie Nov 22, 2022
a4f4793
fix profile pipe update to service
Valkirie Nov 22, 2022
4a7c7df
fix vibrationstrength value
Valkirie Nov 22, 2022
8d11548
no-longer manage HIDmode at UI level
Valkirie Nov 22, 2022
51a1f72
improve lock mechanism on quickprofilespage
Valkirie Nov 22, 2022
5612ad7
misc UI improvements
Valkirie Nov 22, 2022
94a590a
add supports for AOKZOE A1 (Home, long-press) through OEM6
Valkirie Nov 22, 2022
0b909e8
implement SetVibration
Valkirie Nov 22, 2022
1fea4f3
force ShowActivated on Quicktools
Valkirie Nov 22, 2022
a5e0c20
SerializeProfile on UpdateOrCreate
Valkirie Nov 22, 2022
fe9f3ab
Update Ayaneo 2021 OEM keys as hotkeys and 3D overlay highlight.
CasperH2O Nov 22, 2022
a8a77b0
Quicktools prefix TDP and motion sensitivity sliders with text info.
CasperH2O Nov 23, 2022
7519b7a
Add UMC default activation to QuickTools.
CasperH2O Nov 23, 2022
d431d83
prevent running profile from being deleted
Valkirie Nov 23, 2022
39b21ee
brings back separator and improve quicktools TDP readability
Valkirie Nov 23, 2022
fac09e1
implement device specific min/max GfxClock
Valkirie Nov 23, 2022
d1bc380
prevent a crash with gfxLock
Valkirie Nov 23, 2022
67d7fc9
improve suspender UI interface
Valkirie Nov 23, 2022
7ca6898
improve overall quickpages readability with reduced top/bottom margins
Valkirie Nov 23, 2022
ab4ac70
beta build 0.13.0.0
Valkirie Nov 23, 2022
3ac77d4
Merge branch 'main' into controllers
Valkirie Nov 23, 2022
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
10 changes: 1 addition & 9 deletions ControllerCommon/Controllers/DInputController.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
using ControllerCommon.Managers;
using SharpDX.DirectInput;
using SharpDX.XInput;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using SharpDX.DirectInput;

namespace ControllerCommon.Controllers
{
Expand Down
13 changes: 3 additions & 10 deletions ControllerCommon/Controllers/DS4Controller.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
using ControllerCommon.Managers;
using SharpDX.DirectInput;
using SharpDX.XInput;
using SharpDX.DirectInput;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;

namespace ControllerCommon.Controllers
{
public class DS4Controller : DInputController
{
public DS4Controller(Joystick joystick, PnPDetails details) : base (joystick, details)
public DS4Controller(Joystick joystick, PnPDetails details) : base(joystick, details)
{
if (!IsConnected())
return;
Expand Down Expand Up @@ -77,7 +70,7 @@ public override void UpdateReport()
if (State.Buttons[13]) // TouchpadClick
Inputs.Buttons |= ControllerButtonFlags.Special;

switch(State.PointOfViewControllers[0])
switch (State.PointOfViewControllers[0])
{
case 0:
Inputs.Buttons |= ControllerButtonFlags.DPadUp;
Expand Down
10 changes: 7 additions & 3 deletions ControllerCommon/Controllers/IController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public enum ControllerButtonFlags : ulong
OEM2 = 1073741824,
OEM3 = 2147483648,
OEM4 = 4294967296,
OEM5 = 8589934592
OEM5 = 8589934592,
OEM6 = 17179869184
}

[Serializable]
Expand All @@ -72,7 +73,7 @@ public abstract class IController
public ControllerButtonFlags prevInjectedButtons;

protected int UserIndex;
protected double VibrationStrength = 100.0d;
protected double VibrationStrength = 1.0d;

public const short UPDATE_INTERVAL = 5;

Expand Down Expand Up @@ -138,9 +139,12 @@ public void InjectButton(ControllerButtonFlags button, bool IsKeyDown, bool IsKe

public void SetVibrationStrength(double value)
{
VibrationStrength = value;
VibrationStrength = value / 100;
}

public virtual void SetVibration(ushort LargeMotor, ushort SmallMotor)
{ }

public virtual bool IsConnected()
{
return false;
Expand Down
3 changes: 1 addition & 2 deletions ControllerCommon/Controllers/NetpuneController.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using ControllerCommon.Managers;
using neptune_hidapi.net;
using neptune_hidapi.net;
using SharpDX.DirectInput;
using System;
using System.Threading.Tasks;
Expand Down
27 changes: 15 additions & 12 deletions ControllerCommon/Controllers/XInputController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ ref XInputCapabilitiesEx pCapabilities // [out] Receives the capabilities
private XInputStateSecret State;
private XInputStateSecret prevState;

private Vibration Vibration = new Vibration() { LeftMotorSpeed = ushort.MaxValue, RightMotorSpeed = ushort.MaxValue };

public XInputController(int index)
{
Controller = new Controller((UserIndex)index);
Expand Down Expand Up @@ -191,9 +189,9 @@ public override void UpdateReport()
if (Gamepad.Buttons.HasFlag(GamepadButtonFlags.Back))
Inputs.Buttons |= ControllerButtonFlags.Back;

if (Gamepad.LeftTrigger > 0)
if (Gamepad.LeftTrigger > Gamepad.TriggerThreshold)
Inputs.Buttons |= ControllerButtonFlags.LeftTrigger;
if (Gamepad.RightTrigger > 0)
if (Gamepad.RightTrigger > Gamepad.TriggerThreshold)
Inputs.Buttons |= ControllerButtonFlags.RightTrigger;

if (Gamepad.Buttons.HasFlag(GamepadButtonFlags.LeftThumb))
Expand Down Expand Up @@ -261,13 +259,23 @@ public override bool IsConnected()
return (bool)(Controller?.IsConnected);
}

public override void SetVibration(ushort LargeMotor, ushort SmallMotor)
{
ushort LeftMotorSpeed = (ushort)((LargeMotor * ushort.MaxValue / byte.MaxValue) * VibrationStrength);
ushort RightMotorSpeed = (ushort)((SmallMotor * ushort.MaxValue / byte.MaxValue) * VibrationStrength);

Vibration vibration = new Vibration() { LeftMotorSpeed = LeftMotorSpeed, RightMotorSpeed = RightMotorSpeed };
Controller.SetVibration(vibration);
}

public override async void Rumble()
{
for (int i = 0; i < 2; i++)
{
Controller.SetVibration(Vibration);
SetVibration(ushort.MaxValue, ushort.MaxValue);
await Task.Delay(100);
Controller.SetVibration(new Vibration());

SetVibration(0, 0);
await Task.Delay(100);
}
base.Rumble();
Expand All @@ -292,12 +300,7 @@ private void OnServerMessage(PipeMessage message)
case PipeCode.SERVER_VIBRATION:
{
PipeClientVibration e = (PipeClientVibration)message;

ushort LeftMotorSpeed = (ushort)((e.LargeMotor * ushort.MaxValue / byte.MaxValue) * VibrationStrength);
ushort RightMotorSpeed = (ushort)((e.SmallMotor * ushort.MaxValue / byte.MaxValue) * VibrationStrength);

Vibration vibration = new Vibration() { LeftMotorSpeed = LeftMotorSpeed, RightMotorSpeed = RightMotorSpeed };
Controller.SetVibration(vibration);
SetVibration(e.LargeMotor, e.SmallMotor);
}
break;
}
Expand Down
31 changes: 22 additions & 9 deletions ControllerCommon/Devices/AOKZOEA1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public AOKZOEA1() : base()
// https://www.amd.com/en/products/apu/amd-ryzen-7-6800u
this.nTDP = new double[] { 15, 15, 20 };
this.cTDP = new double[] { 10, 28 };
this.GfxClock = new double[] { 100, 2200 };

this.AngularVelocityAxisSwap = new()
{
Expand All @@ -25,7 +26,7 @@ public AOKZOEA1() : base()
{ 'Z', 'Y' },
};

this.AccelerationAxis = new Vector3(-1.0f, -1.0f, 1.0f);
this.AccelerationAxis = new Vector3(-1.0f, 1.0f, -1.0f);
this.AccelerationAxisSwap = new()
{
{ 'X', 'X' },
Expand All @@ -34,33 +35,45 @@ public AOKZOEA1() : base()
};

// Home
listeners.Add(new DeviceChord("Home key",
listeners.Add(new DeviceChord("Home",
new List<KeyCode>() { KeyCode.LWin, KeyCode.D },
new List<KeyCode>() { KeyCode.LWin, KeyCode.D }
new List<KeyCode>() { KeyCode.LWin, KeyCode.D },
false, Controllers.ControllerButtonFlags.OEM1
));

// Home (long press 1.5s)
listeners.Add(new DeviceChord("Home, Long-press",
new List<KeyCode>() { KeyCode.LWin, KeyCode.G },
new List<KeyCode>() { KeyCode.LWin, KeyCode.G },
false, Controllers.ControllerButtonFlags.OEM6
));

// Keyboard
listeners.Add(new DeviceChord("Keyboard key",
listeners.Add(new DeviceChord("Keyboard",
new List<KeyCode>() { KeyCode.RControlKey, KeyCode.LWin, KeyCode.O },
new List<KeyCode>() { KeyCode.O, KeyCode.LWin, KeyCode.RControlKey }
new List<KeyCode>() { KeyCode.O, KeyCode.LWin, KeyCode.RControlKey },
false, Controllers.ControllerButtonFlags.OEM2
));

// Turbo
listeners.Add(new DeviceChord("Turbo key",
listeners.Add(new DeviceChord("Turbo",
new List<KeyCode>() { KeyCode.LControl, KeyCode.LWin, KeyCode.LMenu },
new List<KeyCode>() { KeyCode.LControl, KeyCode.LWin, KeyCode.LMenu },
new List<KeyCode>() { KeyCode.LControl, KeyCode.LWin, KeyCode.LMenu }
false, Controllers.ControllerButtonFlags.OEM3
));

// Home + Keyboard
listeners.Add(new DeviceChord("Home + Keyboard",
new List<KeyCode>() { KeyCode.RAlt, KeyCode.RControlKey, KeyCode.Delete },
new List<KeyCode>() { KeyCode.Delete, KeyCode.RControlKey, KeyCode.RAlt }
new List<KeyCode>() { KeyCode.Delete, KeyCode.RControlKey, KeyCode.RAlt },
false, Controllers.ControllerButtonFlags.OEM4
));

// Home + Turbo
listeners.Add(new DeviceChord("Home + Turbo",
new List<KeyCode>() { KeyCode.LWin, KeyCode.Snapshot },
new List<KeyCode>() { KeyCode.Snapshot, KeyCode.LWin }
new List<KeyCode>() { KeyCode.Snapshot, KeyCode.LWin },
false, Controllers.ControllerButtonFlags.OEM5
));
}
}
Expand Down
12 changes: 8 additions & 4 deletions ControllerCommon/Devices/AYANEO2021.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public AYANEO2021() : base()

// https://www.amd.com/fr/products/apu/amd-ryzen-5-4500u
this.nTDP = new double[] { 15, 15, 20 };
this.cTDP = new double[] { 10, 25 };
this.cTDP = new double[] { 10, 25 };
this.GfxClock = new double[] { 100, 1750 };

this.AngularVelocityAxisSwap = new()
{
Expand All @@ -33,21 +34,24 @@ public AYANEO2021() : base()

listeners.Add(new DeviceChord("WIN key",
new List<KeyCode>() { KeyCode.LWin },
new List<KeyCode>() { KeyCode.LWin }
new List<KeyCode>() { KeyCode.LWin },
false, Controllers.ControllerButtonFlags.OEM1
));

// Conflicts with OS
//listeners.Add("TM key", new ChordClick(KeyCode.RAlt, KeyCode.RControlKey, KeyCode.Delete));

listeners.Add(new DeviceChord("ESC key",
new List<KeyCode>() { KeyCode.Escape },
new List<KeyCode>() { KeyCode.Escape }
new List<KeyCode>() { KeyCode.Escape },
false, Controllers.ControllerButtonFlags.OEM2
));

// Conflicts with Ayaspace when installed
listeners.Add(new DeviceChord("KB key",
new List<KeyCode>() { KeyCode.RControlKey, KeyCode.LWin, KeyCode.O },
new List<KeyCode>() { KeyCode.O, KeyCode.LWin, KeyCode.RControlKey }
new List<KeyCode>() { KeyCode.O, KeyCode.LWin, KeyCode.RControlKey },
false, Controllers.ControllerButtonFlags.OEM3
));
}
}
Expand Down
10 changes: 7 additions & 3 deletions ControllerCommon/Devices/AYANEO2021Pro.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public AYANEO2021Pro() : base()
// https://www.amd.com/fr/products/apu/amd-ryzen-7-4800u
this.nTDP = new double[] { 15, 15, 20 };
this.cTDP = new double[] { 10, 25 };
this.GfxClock = new double[] { 100, 1750 };

this.AngularVelocityAxisSwap = new()
{
Expand All @@ -33,21 +34,24 @@ public AYANEO2021Pro() : base()

listeners.Add(new DeviceChord("WIN key",
new List<KeyCode>() { KeyCode.LWin },
new List<KeyCode>() { KeyCode.LWin }
new List<KeyCode>() { KeyCode.LWin },
false, Controllers.ControllerButtonFlags.OEM1
));

// Conflicts with OS
//listeners.Add("TM key", new ChordClick(KeyCode.RAlt, KeyCode.RControlKey, KeyCode.Delete));

listeners.Add(new DeviceChord("ESC key",
new List<KeyCode>() { KeyCode.Escape },
new List<KeyCode>() { KeyCode.Escape }
new List<KeyCode>() { KeyCode.Escape },
false, Controllers.ControllerButtonFlags.OEM2
));

// Conflicts with Ayaspace when installed
listeners.Add(new DeviceChord("KB key",
new List<KeyCode>() { KeyCode.RControlKey, KeyCode.LWin, KeyCode.O },
new List<KeyCode>() { KeyCode.O, KeyCode.LWin, KeyCode.RControlKey }
new List<KeyCode>() { KeyCode.O, KeyCode.LWin, KeyCode.RControlKey },
false, Controllers.ControllerButtonFlags.OEM3
));
}
}
Expand Down
3 changes: 2 additions & 1 deletion ControllerCommon/Devices/AYANEOAIR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public AYANEOAIR() : base()

// https://www.amd.com/en/products/apu/amd-ryzen-5-5560u
this.nTDP = new double[] { 12, 12, 15 };
this.cTDP = new double[] { 8, 15 };
this.cTDP = new double[] { 8, 15 };
this.GfxClock = new double[] { 100, 1600 };

this.AngularVelocityAxisSwap = new()
{
Expand Down
3 changes: 2 additions & 1 deletion ControllerCommon/Devices/AYANEOAIRLite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public AYANEOAIRLite() : base()

// https://www.amd.com/en/products/apu/amd-ryzen-5-5560u
this.nTDP = new double[] { 8, 8, 12 };
this.cTDP = new double[] { 8, 12 };
this.cTDP = new double[] { 8, 12 };
this.GfxClock = new double[] { 100, 1600 };

this.AngularVelocityAxisSwap = new()
{
Expand Down
3 changes: 2 additions & 1 deletion ControllerCommon/Devices/AYANEOAIRPro.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public AYANEOAIRPro() : base()

// https://www.amd.com/en/products/apu/amd-ryzen-7-5825u
this.nTDP = new double[] { 12, 12, 15 };
this.cTDP = new double[] { 8, 18 };
this.cTDP = new double[] { 8, 18 };
this.GfxClock = new double[] { 100, 2000 };

this.AngularVelocityAxisSwap = new()
{
Expand Down
7 changes: 5 additions & 2 deletions ControllerCommon/Devices/AYANEONEXT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public AYANEONEXT() : base()
// https://www.amd.com/fr/products/apu/amd-ryzen-7-5825u
this.nTDP = new double[] { 15, 15, 20 };
this.cTDP = new double[] { 10, 25 };
this.GfxClock = new double[] { 100, 2000 };

this.AngularVelocityAxisSwap = new()
{
Expand All @@ -34,12 +35,14 @@ public AYANEONEXT() : base()

listeners.Add(new DeviceChord("Custom key BIG",
new List<KeyCode>() { KeyCode.RControlKey, KeyCode.LWin, KeyCode.F12 },
new List<KeyCode>() { KeyCode.F12, KeyCode.LWin, KeyCode.RControlKey }
new List<KeyCode>() { KeyCode.F12, KeyCode.LWin, KeyCode.RControlKey },
false, Controllers.ControllerButtonFlags.OEM1
));

listeners.Add(new DeviceChord("Custom key Small",
new List<KeyCode>() { KeyCode.LWin, KeyCode.D },
new List<KeyCode>() { KeyCode.LWin, KeyCode.D }
new List<KeyCode>() { KeyCode.LWin, KeyCode.D },
false, Controllers.ControllerButtonFlags.OEM2
));
}
}
Expand Down
7 changes: 0 additions & 7 deletions ControllerCommon/Devices/DefaultDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ public class DefaultDevice : Device
{
public DefaultDevice() : base()
{
for (int i = (int)KeyCode.F1; i < (int)KeyCode.F12; i++)
{
listeners.Add(new DeviceChord($"Function {i}",
new List<KeyCode>() { (KeyCode)i },
new List<KeyCode>() { (KeyCode)i }
));
}
}
}
}
2 changes: 2 additions & 0 deletions ControllerCommon/Devices/Device.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public abstract class Device
public double[] nTDP = { 15, 15, 20 };
// device configurable TDP (down, up)
public double[] cTDP = { 10, 25 };
// device GfxClock frequency limits
public double[] GfxClock = { 100, 1800 };

public Vector3 AngularVelocityAxis = new Vector3(1.0f, 1.0f, 1.0f);
public Dictionary<char, char> AngularVelocityAxisSwap = new()
Expand Down
1 change: 1 addition & 0 deletions ControllerCommon/Devices/GPDWinMax2AMD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public GPDWinMax2AMD() : base()
// https://www.amd.com/fr/products/apu/amd-ryzen-7-6800u
this.nTDP = new double[] { 15, 15, 28 };
this.cTDP = new double[] { 15, 28 };
this.GfxClock = new double[] { 100, 2200 };

this.AngularVelocityAxis = new Vector3(1.0f, 1.0f, -1.0f);
this.AngularVelocityAxisSwap = new()
Expand Down
2 changes: 2 additions & 0 deletions ControllerCommon/Devices/GPDWinMax2Intel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ public GPDWinMax2Intel() : base()
// device specific settings
this.ProductIllustration = "device_gpd_winmax2";

// https://ark.intel.com/content/www/us/en/ark/products/226254/intel-core-i71260p-processor-18m-cache-up-to-4-70-ghz.html
this.nTDP = new double[] { 15, 15, 20 };
this.cTDP = new double[] { 15, 28 };
this.GfxClock = new double[] { 100, 1400 };

this.AngularVelocityAxis = new Vector3(1.0f, -1.0f, 1.0f);
this.AngularVelocityAxisSwap = new()
Expand Down
1 change: 1 addition & 0 deletions ControllerCommon/Devices/OneXPlayerMiniAMD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public OneXPlayerMiniAMD() : base()
// https://www.amd.com/fr/products/apu/amd-ryzen-7-5800u
this.nTDP = new double[] { 15, 15, 20 };
this.cTDP = new double[] { 10, 25 };
this.GfxClock = new double[] { 100, 2000 };

this.AngularVelocityAxisSwap = new()
{
Expand Down
Loading