differentiating different types of inputs from same key

Are there any known good ways of interpreting which of these inputs are being given?

  1. a Key being held down
  2. same Key being rapidly tapped
  3. key being pressed, not rapidly

Just wondering if there’s a common way of dealing with this, before throwing together a makeshift solution
(As for when it would be used, fighting games like street fighter come to mind)

Fighting games usually keep an input history (either on a button event basis or a button state per frame basis) of the last second or so. Then you can start from the current frame and scan backwards looking for certain patterns to find out what action you should start next.

I’d probably go with storing raw key state per frame, since you can easily reconstruct the events (like button edges) from this without too much trouble.

hmm im glad i asked! Thanks a lot!!