How to change input value upon its input event. I.e. If W, then S.

Hi!
I want an input playback effect for the player (like reverse walking after they walked a distance). This was fairly easy to start considering Unity has an InputRecorder wrapper class. Yet the desired effect actually implies using the opposite input. So if player does W, then E, then W. Then the desired recorded input would be S, then A, then S.

A solution that comes to mind is to “hijack” the input upon its event starting, and if we are recording the player’s input, then store the opposite axis. The methods that come to mind to access the input events is

InputSystem.onEvent += (eventPtr, device) = > {};

and in here somehow change the input value. My question is how?

I don’t understand you examples, but you can route all the input though your own manager and apply logic there and then send it / make it available to all the systems.

if you just want to inverse an axis you can just use a minus sign while reading it, you don’t have to mess with the input itself.