quasilyte / ebitengine-input

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

add experimental virtual/simulated input support #9

Closed quasilyte closed 1 year ago

quasilyte commented 1 year ago

If event is emitted on every frame, ActionIsPressed will always be true, while ActionIsJustPressed will trigger only for the first frame.

The current implementation tries to make virtual input/events almost identical to the physical inputs. So, if key is "pressed" by the virtual input, it can't be released or pressed again by the physical input. In practice, it also means that if ActionIsJustPressed reports true for the virtual input, it will not report true for the physical input unless the virtual events stopped and the key is considered to be in unpressed state.

This is an experimental API. I haven't tested it in any of my games.

Refs #3