diff --git a/RELEASE.md b/RELEASE.md index a7c4447..eb94562 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -9,17 +9,11 @@ It does help this project on being supported. - Introduce SteamController that provides 3 main modes of operation Desktop, X360 and Steam - Try to disable usage of Kernel Drivers (when FAN in Default, and OSD Kernel Drivers are disabled) to allow apps to work with Anti-Cheat detections -- Add mapping for `STEAM+DPadUp` - Configure Steam to switch between Steam Input or X360 Controller mode -- Steam Games detection also works for X360 Controller mode -- Allow to configure `StartupProfile` in `SteamController.dll.config` - STEAM + 3 dots brings Task Manager (CTRL+SHIFT+ESCAPE) - Add configurable BackPanel keys (allowed mappings are subject to change) -- Provide currated list of mapping keys in settings (might be extended in the future) -- Improve performance on critical loop (code is lock-less) -- Reduce hold for `Toggle desktop mode` to 2s -- Fix `Process Kill` action (STEAM+B for 3s) -- Go back to `Startup Profile` on `Toggle deskptop mode` +- Go back to `Startup Profile` on `Toggle deskotop mode` - The `X360.Beep()` cycles currently connected device (fixes Playnite error) - Fix using Playnite to launch Steam game where on exit Desktop was activated - Build DEBUG that has all experimental features +- Introduce X360 Haptic profile to improve vibration (in DEBUG) diff --git a/SteamController/Controller.cs b/SteamController/Controller.cs index 3f67ac6..5512ddb 100644 --- a/SteamController/Controller.cs +++ b/SteamController/Controller.cs @@ -22,7 +22,10 @@ namespace SteamController new Profiles.SteamProfile() { Name = "Steam", Visible = false }, new Profiles.SteamWithShorcutsProfile() { Name = "Steam with Shortcuts", Visible = false }, new Profiles.X360Profile() { Name = "X360" }, - new Profiles.X360RumbleProfile() { Name = "X360 with Rumble" } + new Profiles.X360RumbleProfile() { Name = "X360 with Rumble" }, + #if DEBUG + new Profiles.X360HapticProfile() { Name = "X360 with Haptic" } + #endif }, Managers = { new Managers.ProcessManager(), @@ -305,6 +308,9 @@ namespace SteamController Desktop = ProfilesSettings.BackPanelSettings.Desktop, X360 = ProfilesSettings.BackPanelSettings.X360, X360Rumble = ProfilesSettings.X360RumbleSettings.Default, +#if DEBUG + X360Haptic = ProfilesSettings.X360HapticSettings.Default, +#endif Application = Settings.Default } }; diff --git a/SteamController/Profiles/X360HapticProfile.cs b/SteamController/Profiles/X360HapticProfile.cs new file mode 100644 index 0000000..c68f1a3 --- /dev/null +++ b/SteamController/Profiles/X360HapticProfile.cs @@ -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; + } + } +} diff --git a/SteamController/ProfilesSettings/X360HapticSettings.cs b/SteamController/ProfilesSettings/X360HapticSettings.cs new file mode 100644 index 0000000..552df56 --- /dev/null +++ b/SteamController/ProfilesSettings/X360HapticSettings.cs @@ -0,0 +1,38 @@ +using System.ComponentModel; +using System.Configuration; +using WindowsInput; + +namespace SteamController.ProfilesSettings +{ + [Category("Settings")] + internal sealed class X360HapticSettings : BaseSettings + { + public const sbyte MinIntensity = -2; + public const sbyte MaxIntensity = 10; + + public static X360HapticSettings Default { get; } = (X360HapticSettings)ApplicationSettingsBase.Synchronized( + new X360HapticSettings("X360HapticSettings")); + + public X360HapticSettings(String settingsKey) : base(settingsKey) + { + } + + [UserScopedSettingAttribute()] + [DefaultSettingValueAttribute("0")] + [Description("Haptic intensity between -2dB and 10dB")] + public sbyte LeftIntensity + { + get { return ((sbyte)(this["LeftIntensity"])); } + set { this["LeftIntensity"] = Math.Clamp(value, MinIntensity, MaxIntensity); } + } + + [UserScopedSettingAttribute()] + [DefaultSettingValueAttribute("0")] + [Description("Haptic intensity between -2dB and 10dB")] + public sbyte RightIntensity + { + get { return ((sbyte)(this["RightIntensity"])); } + set { this["RightIntensity"] = Math.Clamp(value, MinIntensity, MaxIntensity); } + } + } +}