How to do a pulse signal?

Hello, I'm starting on EU5. My idea is based on old plateformers, I want to attack during a short time after I activated running. How could "Attack" be only activated during a set time even if running is still activated ?

I haven't found what I'm searching for on YT or this sub. Can you help me?

Thanks