Skip to content

Commit

Permalink
Standard rumble via Bluetooth
Browse files Browse the repository at this point in the history
  • Loading branch information
WujekFoliarz authored Jun 15, 2024
1 parent 718881f commit 937a28b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions DL1-Dualsense/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ private static void Main(string[] args)
bool firstTimeAirdrop = true;

dualsense.Start();
dualsense.SetVibrationType(Vibrations.VibrationType.Haptic_Feedback);

if(dualsense.ConnectionType == ConnectionType.USB)
dualsense.SetVibrationType(Vibrations.VibrationType.Haptic_Feedback);
else if (dualsense.ConnectionType == ConnectionType.BT)
dualsense.SetVibrationType(Vibrations.VibrationType.Standard_Rumble);

dualshock4.Connect();
dualshock4.FeedbackReceived += Dualshock4_FeedbackReceived;

Expand Down Expand Up @@ -133,7 +138,7 @@ private static void Main(string[] args)
weapon = game.getWeaponType();
walkSpeed = game.getPlayerWalkSpeed();

Console.WriteLine(weapon);
//Console.WriteLine(weapon);
if (weapon == 2058 || weapon >= 2024 && weapon <= 2029) // 1H sharp weapon (machete etc.)
{
triggerThreshold = 120;
Expand Down Expand Up @@ -849,8 +854,8 @@ private static void Main(string[] args)
else
{
triggerThreshold = 0;
dualsense.SetLeftTrigger(TriggerType.TriggerModes.Rigid_B, 0, 0, 0, 0, 0, 0, 0);
dualsense.SetRightTrigger(TriggerType.TriggerModes.Rigid_B, 0, 0, 0, 0, 0, 0, 0);
dualsense.SetLeftTrigger(TriggerType.TriggerModes.Off, 0, 0, 0, 0, 0, 0, 0);
dualsense.SetRightTrigger(TriggerType.TriggerModes.Off, 0, 0, 0, 0, 0, 0, 0);
}

if (weapon <= 2730 || weapon >= 2738)
Expand Down Expand Up @@ -1208,6 +1213,8 @@ private static void Dualshock4_FeedbackReceived(object sender, DualShock4Feedbac
int l_rotor = e.SmallMotor;
int r_rotor = e.LargeMotor;

dualsense.SetStandardRumble((byte)l_rotor, (byte)r_rotor);

//Console.WriteLine(l_rotor + " " + r_rotor);

if (l_rotor == 0 && r_rotor == 2 || l_rotor == 38 && r_rotor == 25)
Expand Down

0 comments on commit 937a28b

Please sign in to comment.