How to replace Event tick? What to use?

Greetings! Iv’e got a question while I was creating a sprint via blueprint.

I need to check if two buttons are pressed at the same time during gameplay. Is there any other way for doing this, except “Event Tick”?
What I am doing is :
Onpressed shift → set is_shift_pressed = True
Onreleased shift → set is_shift_pressed = False,
The same thing for W button.
Then I am checking if both buttons are pressed, what I am getting is :
if I release shift button but still holding W button → sprint is working.
What I want is : if shift and w are pressed = sprint, if any of both are released = do not sprint.

What should I paste at the “green arrow”? Thank you

I’ve tried to use TimeLine and it works well until I start pressing shift a lot of times → it causes branch stuck. (If I hold W and Shift both, then starting press Shift too often I will have always True or always False until I release them both)

I see the problem.

You are only changing the character sprint with the W button.

Your character will only sprint if you first pressed the G key and then pressed the W key.
This happens because the Pressed/Released for W is the one that actually changes the sprinting velocity and it only fires once, you will only notice differences when you press / release the W.
If you have the W pressed and press G after W, the character won’t sprint until you release and press W again.

What you want to do is, connect the node that is setting GIsShiftPressed to “true” into your branch node
and connect the node that is setting GIsShiftPressed to “false” into the reverse input of your animation timeline.

That should do it.

Wow, that “does the trick”. Thank you a lot!