Skip to content

v0.2.1 InputForge

Choose a tag to compare

@KerimCETINBAS KerimCETINBAS released this 01 Jul 00:31
c9456de

InputForge 0.2.1

Multiple callbacks can now bind to the same action — a drop-in,
backwards-compatible change with no public API differences.

Added

  • Multiple subscribers per action. InputMappingContext stores
    per-type subscriber lists (bool / float / Vector2 / Vector3 /
    ContextualInputEvent), keyed case-insensitively by action name.
    Several callbacks can BindAction to one action and all fire on
    dispatch; UnbindAction removes a single callback. Lists are
    allocated lazily on first bind of each type.

Internal

  • SubscriberListExtensions.Invoke<T> — null/empty-safe indexed-loop
    dispatch helper (no enumerator allocation, no per-event type switch).
    internal, not part of the public API.

Design note

The per-type split trades a recurring per-event cost (scanning one mixed
list + switching on each delegate's Action<> type + boxing the value)
for at most five one-time lazy list allocations, then dispatches each
typed list directly with the pre-computed value.

Compatibility

No public signature changes. Existing single-subscriber code behaves
identically. Requires Godot 4.7+ (.NET build).

Install

npx degit pandoraoyun/InputForge/addons/input_forge addons/input_forge

Full changelog: see CHANGELOG.md