quasilyte / ebitengine-input

A Godot-inspired action input handling system for Ebitengine
MIT License
66 stars 8 forks source link

KeyPressDuration in EventInfo #32

Closed phalasz closed 8 months ago

phalasz commented 9 months ago

Would be great to have key press duration made available in the EventInfo object. Would make it easier to handle checks on how long a key was pressed for. Maybe only adding it in for PressedActionInfo

If there is interest I'm happy to draft a PR with some proposed changes for discussion.

quasilyte commented 9 months ago

This feature can be useful indeed. I wonder if it can be implemented efficiently.

quasilyte commented 8 months ago

Am I right that tick/frame based duration is good enough for your use case? I was thinking about the time-based duration since Update has this information, but it would require more efforts from this library part (I'm almost sure the inpututil stores this information uses global-ish maps with mutexes, lol)

phalasz commented 8 months ago

Yeah, for me the tick based duration is good enough for now.