Action while the key is held down

I am new to UE 5. I have a very simple question, I need to show the menu when the key is pressed and hide the menu when the key is released. But apparently I’ve mixed up something or did something wrong. If you have a solution I will be glad to hear it).
It is important that the menu would be active if the key is only pressed.

This is all you need:

If that’s not the expected result,

could you explain this a bit more?

I need to make it so that when the key is held down then the widget is active, once the player releases the key hide the widget. I have tried using as you have shown in the screenshot, however it just toggles the menu. I want the menu to be active when the key is held down. Thank you for your efforts