fix(input): map POSIX stick endpoints exactly (#244)

This commit is contained in:
999sian
2026-07-16 14:19:33 +01:00
committed by GitHub
parent 2196a1f786
commit 26dbad8ac8
2 changed files with 21 additions and 2 deletions
+2 -2
View File
@@ -253,9 +253,9 @@ public static class HostWindowInput
};
}
private static byte ToStickByte(float value)
internal static byte ToStickByte(float value)
{
return (byte)Math.Clamp((int)(128.0f + value * 127.0f), 0, 255);
return (byte)Math.Clamp((int)MathF.Round((value + 1.0f) * 127.5f), 0, 255);
}
private static HostGamepadButtons MapButton(ButtonName name) => name switch