quasilyte / ebitengine-input

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

Request: Add a way to subscribe to an action #17

Open mcarpenter622 opened 1 year ago

mcarpenter622 commented 1 year ago

The library works well as is, but I personally have a preference to attach an event listener and have the library call my function when the action occurs rather than having to check it manually in the update loop. It essentially does the same thing but eliminates some boilerplate for the users of the library.

quasilyte commented 1 year ago

One issue is to choose how to represent these listeners. The ebitenui uses its own listener pattern. I'm using gsignal library for my games (but I don't want to add it as a dependency of ebitengine-input). I feel like people should use whatever events system they have available in their game/app.

But I can add some fundamental primitive to make such an event-driven wrapper possible.