Skip to content

Commit

Permalink
Fix analog triggers depressed on idle (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErykDarnowski committed Dec 13, 2023
1 parent a75633a commit 48d4b34
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/hal/Usb/Client/Hid/UsbGamepad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ void UsbGamepad::setAnalogThumbY(bool isLeft, int8_t y)

void UsbGamepad::setAnalogTrigger(bool isLeft, int8_t z)
{
z = limit_value(z, MIN_ANALOG_VALUE, MAX_ANALOG_VALUE);
z = (limit_value(z, MIN_ANALOG_VALUE, MAX_ANALOG_VALUE) + 127) / 2;
// ^ This fixes the ratios of trigers on Windows + breaks the LED a little bit (but in a good way, cause it's less annoying)
int8_t lastZ = 0;
if (isLeft)
{
Expand Down

0 comments on commit 48d4b34

Please sign in to comment.