diff --git a/BizHawk.Client.EmuHawk/Input/GamePad360.cs b/BizHawk.Client.EmuHawk/Input/GamePad360.cs index 00078cdeac..2d77a44485 100644 --- a/BizHawk.Client.EmuHawk/Input/GamePad360.cs +++ b/BizHawk.Client.EmuHawk/Input/GamePad360.cs @@ -169,15 +169,18 @@ namespace BizHawk.Client.EmuHawk //constant for adapting a +/- 32768 range to a +/-10000-based range const float f = 32768 / 10000.0f; - //constant for adapting a 0-255 range to a 0-10000-based range - const float f255 = 255 / 10000.0f; + //since our whole input framework really only understands whole axes, let's make the triggers look like an axis + float ltrig = g.bLeftTrigger / 255.0f * 2 - 1; + float rtrig = g.bRightTrigger / 255.0f * 2 - 1; + ltrig *= 10000; + rtrig *= 10000; yield return new Tuple("LeftThumbX", g.sThumbLX / f); yield return new Tuple("LeftThumbY", g.sThumbLY / f); yield return new Tuple("RightThumbX", g.sThumbRX / f); yield return new Tuple("RightThumbY", g.sThumbRY / f); - yield return new Tuple("LeftTrigger", g.bLeftTrigger / f255); - yield return new Tuple("RightTrigger", g.bRightTrigger / f255); + yield return new Tuple("LeftTrigger", ltrig); + yield return new Tuple("RightTrigger", rtrig); yield break; }