How to open a Gate when there's movement input, and close it when there isn't?

Hi! I’m trying to make a directional dash function that can only be activated when there’s movement input (eg. player can only dash forward when W key is pressed). This is what I have so far:

I’m not entirely sure how to do the Gate here - I could of course get all four WASD keys to Pressed=Open and Released=Close, though I feel like it would probably break something when doing rapid movement inputs. Not mentioning that I haven’t even added controller input yet.

Is there any way to do it more elegantly and more bug-proof? Thanks! (criticism to the BP itself is also welcomed)

EDIT: I figured it out! Using AND Bool -

Perhaps you do not need a gate at all, maybe it’s just enough to ask the controller whether W is being pressed:

And launch character after this check.

Or plug in the W input Pressed / Released into the gate’s Open / Close

Don’t forget to mark the correct answer if someone helped you!

TLDR: To Use Gate, you need to connect Pressed pin of InputAction to Open pin of Gate, Released to Close and trigger event’s (usually Event Tick) then (white output) pin to Enter.

What is a trigger event and how do Gates work:

You can define initial state of the gate by the boolean pin StartClosed. By default it is checked making the gate Closed. If gate receives input on it’s Open pin, it’s state becomes Open, and if it receives input on Close pin, it becomes Closed. Gate will remember it’s state as long as Actor continuously exists.

Input to both Open and Close pins does not carry through Exit pin, they only change internal state of the Gate, controlling flow (hence Gate is a flow control category node).

Every time Enter pin of Gate receives an input, gate evaluates, whether to let it through to the Exit based on if it is open at that moment. If the Gate is Open, Exit is outputing, if it’s Closed - no output.

Trigger event is an event, that enters the Gate and based on Gate’s state, the logic after Exit will or won’t be executed.

In your case, you want a certain action to be executed continuously, as long a you press certain button. Gate is a perfect node for this job, because with ActionInput you can easily control when to close it or to open it. Trigger event in this case would be an EventTick (because you want pawn to move every tick as long as you press the button).
Hope, I explained it well enough.