diff --git a/RELEASE.md b/RELEASE.md index 48baa93..bd90fe3 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -9,6 +9,7 @@ - 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 - Hide `Use Lizard Mouse/Buttons` as it does something different than people are used to +- Fix `LT/RT` to trigger up to 50%, instead of 100% ## 0.4.x diff --git a/SteamController/Devices/Xbox360Controller.cs b/SteamController/Devices/Xbox360Controller.cs index d663540..68de487 100644 --- a/SteamController/Devices/Xbox360Controller.cs +++ b/SteamController/Devices/Xbox360Controller.cs @@ -178,11 +178,8 @@ namespace SteamController.Devices public void SetSliderValue(Xbox360Slider slider, short value) { - // rescale from -32767..32768 to 0..255 - int result = value; - result -= short.MinValue; - result *= byte.MaxValue; - result /= ushort.MaxValue; + // rescale from 0..32767 to 0..255 + int result = Math.Clamp(value, (short)0, short.MaxValue) * byte.MaxValue / short.MaxValue; device?.SetSliderValue(slider, (byte)result); submitReport = true; }