Hold button to play, release to reverse


I have an animation of picking up an item. I’m trying to make it play the animation if I’m holding a button and then reverse it when the button is released.

I can be done by setting the play rate to -1 and marking Start Position as a pin, but I don’t know how to get the time of the previous animation. Current time (ratio) can be obtained in transition only and there is no way to save it as a variable I could use later for Start Position of the reversed animation.