Timelines with three different states

Another thing: if you do end up using the macro, you need to keep one thing in mind. If you press a key and then pause the game and release the key (or vice versa), the action during the pause won’t be registered by the macro, and it can mess up its logic.

You can add more things to it, like a Reset input pin that will set the local integer to 0 and clamp the Int to 0-2.