How can I disable widget animation if widget is at specific state?

So I have a widget in its 1st state, and when ever a specific key is pressed, an animation plays and opens into the second state with new possible button options…Now if that specific key is pressed, then the widget animation still plays at 2nd state. How can I disable widget animation if the widget is in second state?

Would appreciate any help.

You can find the animations as variable (under Animations) and use Stop Animation.

Thanks for your reply. I connected an event to the animation variable and the stop animation node but for some reason wasn’t working for me. I found out an alternative way experimenting with functions.