My game offers separate move forward/back/left/right bindings, because I want to support binding four separate keyboard keys to these commands as well as a gamepad.
Taking Move Forward as an example I have bindings in my Input Actions asset for “W [Keyboard]” and “Left Stick/Up [Gamepad]”. This works fine. But after following the Rebinding example and implementing a screen that calls PerformInteractiveRebinding, pushing up on the left gamepad stick simply maps “LS” to my forward command.
PerformInteractiveRebinding is very configurable but I do not immediately see a way to restrict the rebinding to a single direction of an axial input.
Is this possible?
Note that I tried using WithControlsExcluding to exclude “/leftStick”, but this also excludes “/leftStick/up” …
Continuing my conversation with myself: it seems possible to do this using OnPotentialMatch and manually filtering out any candidate that ends with “leftStick” or “rightStick”!
But I wonder if there could be a general way to filter out certain classes, such as all axes, all device-brand-specific (for example I don’t want leftStick/Y to be an option just b/c I have an Xbox controller attached; generic leftStick/up seems better).