Invert Y on the wire, not in the router: the panel keeps tracking the stick

InputRouter.InvertJoystickY flipped the stored axis, so the X/Y dot and
readout moved opposite the physical stick. The toggle now lives on
VRioDevice and negates joystick Y only while building AnalogReply: local
state keeps the physical direction for every source (pad, keys, panel
drags) and only the host sees the flip. Negating a full -8192 deflection
lands one past the 14-bit Max, so the reply clamps it to 8191.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-06 19:21:57 -05:00
co-authored by Claude Fable 5
parent 41f6ef364d
commit ce5ed1117a
5 changed files with 32 additions and 31 deletions
-20
View File
@@ -191,26 +191,6 @@ public class InputRouterTests
Assert.Equal(0, _device.GetAxis(RioAxis.JoystickY));
}
[Fact]
public void InvertJoystickY_flips_the_composed_value_for_all_sources()
{
UseProfile("key Up axis JoystickY deflect 1\npadaxis LeftStickY axis JoystickY");
_router.InvertJoystickY = true;
_router.KeyDown("Up");
_router.Tick(0.016);
Assert.Equal(-RioAxisRange.JoystickExtent, _device.GetAxis(RioAxis.JoystickY));
_router.KeyUp("Up");
_router.SetPadState(new PadState(PadButtons.None, 0, 0.5f, 0, 0, 0, 0));
_router.Tick(0.016);
Assert.Equal(-RioAxisRange.JoystickExtent / 2, _device.GetAxis(RioAxis.JoystickY));
_router.InvertJoystickY = false; // toggling back re-sends the upright value
_router.Tick(0.016);
Assert.Equal(RioAxisRange.JoystickExtent / 2, _device.GetAxis(RioAxis.JoystickY));
}
[Fact]
public void Rate_key_walks_the_throttle_and_position_sticks()
{