Skip to content
Project referenceDevelopmentEngine ccf7d03f
Authored
  • Ordered event hubs, routed consumption and bounded event admission.

This project owns event values, ordered hubs and the bounded dispatcher used by engine and script callers. It does not store current diagnostic state or persistent object identity. Start with route and consume events.

The dispatcher publishes ordered hub snapshots; each hub publishes listener buckets. Hub order descends, then creation sequence; dispatch visits the concrete event type and its base types in that order. Listener priority descends within each type bucket, with registration sequence breaking ties. Mutations publish a later snapshot rather than rewriting the one already traversed.

Thread-safe admission and snapshot management do not serialize arbitrary user handlers. Emit, Announce, Flush and completion observers execute on their caller’s dispatch thread. Owners must coordinate their own state and quiescent retirement. A disposed hub removes its listeners and detaches; it does not promise to interrupt a callback already executing.

Listener delegates and subscription tokens can retain extension instances. Dispose every externally registered token and unregister dispatched observers before unload. A Layer owns subscriptions made through its protected convenience boundary; independently registered subscriptions remain the caller’s responsibility. The dispatcher itself is not IDisposable.

ListenOnce unregisters after its first invocation and can be canceled by disposing its token. Base event constructors distinguish independent consumption from a routed representation sharing its source’s global state. Hub consumption remains local to a valid dispatch stack.

Family Data
Application Quit and suspension state.
Keyboard Window identity, key and modifiers; presses also carry repeat state.
Mouse Window identity, movement coordinates, wheel offsets or button.
Window Resize dimensions, close, focus or effective visibility state.

Keyboard/mouse values use Inno.Core.Input. The actual script export declaration selects Event, EventDispatcher and EventHub into InnoEngine.Events; the presence of other public CLR event types does not automatically export them to scripts.

Positive queue/flush budgets are required. Null events fail explicitly. Queue exhaustion rejects admission, and finite flushes leave recursively queued work for a later pass. Listener failures propagate; dispatched reports only completed hub traversal. An already globally consumed event skips hubs but still reaches completion observers.

The task guide explains explicit rejection, the valid use of DiscardPending, and routed-input consumption. These obligations apply to the reference members as a shared contract.

Browse exact event, dispatcher and hub declarations.

The compiler-selected script declarations are separate from this project’s host CLR surface. Read the script calling guide and the associated module contracts before using a projected member.

Project: Inno.Core.Events
Source: src/foundation/core/Inno.Core.Events/Inno.Core.Events.csproj

Type API Description
ApplicationEvent engine Base class for application lifecycle events.
ApplicationQuitEvent engine Raised when the application requests shutdown.
ApplicationSuspensionChangedEvent engine Reports whether the application must stop advancing frames until the platform resumes it.
Event engine Base type for all engine events.
EventDispatcher engine Thread-safe event dispatcher that owns a set of T:Inno.Core.Events.EventHub instances and routes events to hubs in descending P:Inno.Core.Events.EventHub.order.
EventHub engine A disposable subscription hub bound to a single T:Inno.Core.Events.EventDispatcher.
KeyEvent engine Base class for keyboard events.
KeyPressedEvent engine Raised when a key is pressed.
KeyReleasedEvent engine Raised when a key is released.
MouseButtonEvent engine Base class for mouse button events.
MouseButtonPressedEvent engine Raised when a mouse button is pressed.
MouseButtonReleasedEvent engine Raised when a mouse button is released.
MouseEvent engine Base class for mouse events.
MouseMovedEvent engine Raised when the cursor moves.
MouseScrolledEvent engine Raised when mouse wheel scrolls.
TextInputEvent engine Raised when the platform commits UTF-8 text through keyboard, IME, or virtual-keyboard input.
WindowCloseEvent engine Raised when the window requests close.
WindowEvent engine Base class for window lifecycle events.
WindowFocusChangedEvent engine Raised when a window gains or loses input focus.
WindowResizeEvent engine Raised when the window size changes.
WindowVisibilityChangedEvent engine Reports whether a platform window can present visible content.
Event Runtime Base type for all engine events.
EventDispatcher Runtime Thread-safe event dispatcher that owns a set of T:InnoEngine.Events.EventHub instances and routes events to hubs in descending P:InnoEngine.Events.EventHub.order.
EventHub Runtime A disposable subscription hub bound to a single T:InnoEngine.Events.EventDispatcher.