ZEvent Queue
Event queue that accumulates user input events and processes them synchronously during the game loop frame update phase.
This class replaces ZEventBus by providing both event queuing and distribution functionality. Events are enqueued asynchronously when they arrive from the input system, and then processed synchronously during processAll() which is called from the renderer's update phase.
This ensures that all events are processed at the correct time in the frame, synchronized with the game loop, similar to how Unity, Unreal, and Godot handle input events.
Parameters
The ZContext containing the scene to distribute events to
Properties
Functions
Enqueues a keyboard event to be processed during the next frame update.
Enqueues a mouse event to be processed during the next frame update.
Enqueues a touch event to be processed during the next frame update.
Called when a keyboard event occurs. Enqueues the event for processing during the next frame update.
Called when a mouse event occurs. Enqueues the event for processing during the next frame update.
Called when a touch event occurs. Enqueues the event for processing during the next frame update.
Processes all enqueued events by distributing them to objects in the scene that have registered listeners. This method should be called from the renderer's update phase to ensure events are processed synchronously with the game loop.