mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-04-05 06:15:26 +00:00
Introduce X360 Haptic Profile (in DEBUG)
This commit is contained in:
parent
a92a0661df
commit
8ffa5d967f
4 changed files with 82 additions and 9 deletions
35
SteamController/Profiles/X360HapticProfile.cs
Normal file
35
SteamController/Profiles/X360HapticProfile.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
using CommonHelpers;
|
||||
using Nefarius.ViGEm.Client.Targets.Xbox360;
|
||||
|
||||
namespace SteamController.Profiles
|
||||
{
|
||||
public class X360HapticProfile : X360Profile
|
||||
{
|
||||
private ProfilesSettings.X360HapticSettings HapticSettings
|
||||
{
|
||||
get { return ProfilesSettings.X360HapticSettings.Default; }
|
||||
}
|
||||
|
||||
public override Status Run(Context context)
|
||||
{
|
||||
if (base.Run(context).IsDone)
|
||||
{
|
||||
return Status.Done;
|
||||
}
|
||||
|
||||
if (context.X360.FeedbackLargeMotor.GetValueOrDefault() > 0)
|
||||
{
|
||||
context.Steam.SendHaptic(1, 0);
|
||||
}
|
||||
|
||||
if (context.X360.FeedbackSmallMotor.GetValueOrDefault() > 0)
|
||||
{
|
||||
context.Steam.SendHaptic(0, 0);
|
||||
}
|
||||
|
||||
context.X360.ResetFeedback();
|
||||
|
||||
return Status.Continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue