Skip to content
Project referenceDevelopmentEngine ccf7d03f
Authored
  • Compose input providers and route neutral events to isolated session backends.

This project supplies an open input-provider catalog and an event-backed implementation using Core Events. Platform adapters translate native events into that shared protocol. The event source, backend and bundled provider do not depend on SDL or Native bindings.

InputBackendCatalog captures a provider set without creating a service. IDs are open, stable values; the bundled provider uses inno.input.events. Null providers, unassigned IDs and duplicate registrations fail at construction. An unknown selected ID fails explicitly, and a provider must not return a null source.

The composition owner retains provider lifetime. A caller owns each created IInputEventSource, and each backend created from that source has its own session owner. The catalog does not become a second service lifetime manager.

EventInputSource uses Core Events to distribute translated events to independently subscribed session backends. A nonzero window ID accepts that window; zero accepts all windows. CreateBackend starts receiving subsequent events and rejects calls after source disposal.

EventInputBackend.ProcessEvent ignores globally consumed events and events outside its window policy. Keyboard, pointer, wheel and text use the same neutral entry. Non-repeat key presses create transitions; capture clears transient transitions and deltas after producing the immutable snapshot. Repeated queries of that snapshot do not consume its values.

Focus loss, hidden windows and application suspension release held keys/buttons, clear pending presses, text and deltas, and reset modifiers. While suspended, key, mouse and text events do not accumulate. These rules prevent a held key from remaining stuck after the application loses its active input surface.

The Editor’s presentation boundary additionally filters GameView input. A modal, popup or foreground window can prevent input from reaching the underlying game. Physical input does not decide Editor focus policy itself.

Each session backend owns its subscription. Disposing it removes that backend while other sessions remain usable. Disposing a source disconnects its backends and rejects later delivery; backend owners still retain their own disposal obligations. Disconnecting the source is not a transfer of session ownership.

The backend synchronizes event accumulation and capture. The source’s composition and subscription lifecycle remain host-controlled; do not infer that all source/catalog operations are freely concurrent because the backend locks its state. Native window and event-pump thread restrictions belong to the platform adapter.

A new provider implements the neutral creation boundary and registers a stable ID in the actual composition. Do not add a second event bus or have every session consume a global destructive queue. Input runtime, Shell lifecycle and Editor GameView capture tests cover different parts of consumption, focus, window and session isolation.

See frame snapshots and runtime ownership before implementing a provider. Native translation needs the relevant platform integration evidence in addition to neutral tests.

The exact reference includes provider, source, backend and catalog contracts. Registration describes a capability; it does not certify a platform device.

Browse input adapter types.

Project: Inno.Adapter.Input
Source: src/adapters/input/Inno.Adapter.Input/Inno.Adapter.Input.csproj

Type API Description
EventInputBackend engine Accumulates backend-neutral platform events into complete runtime input snapshots.
EventInputBackendProvider engine Supplies the common event implementation through the neutral input creation boundary.
EventInputSource engine Routes backend-neutral platform events through Core Events to isolated runtime-session input backends.
IInputBackendFactory engine Creates host-level input event sources from explicit backend selections.
IInputEventSource engine Routes backend-neutral platform events into isolated runtime input backends.
InputBackendCatalog engine Resolves input providers from one immutable, composition-owned registration snapshot.
InputBackendId engine Identifies a input implementation without closing the set of supported backends.
InputBackendProvider engine Describes one explicitly composed input implementation and its creation boundary.