Gondwana Game Engine Version 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
Loading...
Searching...
No Matches
Gondwana.Widgets.WidgetInputRouter Class Referencesealed

Routes mouse, touch, and keyboard input to registered widgets for a render surface host. More...

Inheritance diagram for Gondwana.Widgets.WidgetInputRouter:

Public Member Functions

 WidgetInputRouter (RenderSurfaceHostBase renderSurfaceHost, KeyboardEventPoller? keyboardEventPoller, MouseEventPoller? mouseEventPoller, TouchEventPoller? touchEventPoller)
 Initializes a new instance of the WidgetInputRouter class.
void Register (WidgetBase widget)
 Registers a widget so that it can receive routed input.
void Unregister (WidgetBase widget)
 Unregisters a widget so that it no longer receives routed input.
void BringToFront (WidgetBase widget)
 Moves a registered widget to the front of the input routing order.
void Focus (WidgetBase? widget)
 Assigns keyboard focus to the specified widget.
void ClearFocus ()
 Clears the current keyboard focus.
void Start ()
 Starts routing input events from the configured pollers to registered widgets.
void Stop ()
 Stops routing input events and releases current pointer and focus state.
void Dispose ()
 Releases the resources used by the router and unregisters all widgets.

Static Public Attributes

const int MousePointerId = -1
 Identifies mouse pointer events in routed widget input.

Properties

WidgetBase? FocusedWidget [get]
 Gets the widget that currently has keyboard focus.

Detailed Description

Routes mouse, touch, and keyboard input to registered widgets for a render surface host.

Definition at line 15 of file WidgetInputRouter.cs.

Constructor & Destructor Documentation

◆ WidgetInputRouter()

Gondwana.Widgets.WidgetInputRouter.WidgetInputRouter ( RenderSurfaceHostBase renderSurfaceHost,
KeyboardEventPoller? keyboardEventPoller,
MouseEventPoller? mouseEventPoller,
TouchEventPoller? touchEventPoller )

Initializes a new instance of the WidgetInputRouter class.

Parameters
renderSurfaceHostThe render surface host whose widgets will receive routed input.
keyboardEventPollerThe keyboard event poller that supplies keyboard input, or null.
mouseEventPollerThe mouse event poller that supplies mouse input, or null.
touchEventPollerThe touch event poller that supplies touch input, or null.

Definition at line 52 of file WidgetInputRouter.cs.

Member Function Documentation

◆ BringToFront()

void Gondwana.Widgets.WidgetInputRouter.BringToFront ( WidgetBase widget)

Moves a registered widget to the front of the input routing order.

Parameters
widgetThe widget to move to the front.

Definition at line 110 of file WidgetInputRouter.cs.

◆ ClearFocus()

void Gondwana.Widgets.WidgetInputRouter.ClearFocus ( )

Clears the current keyboard focus.

Definition at line 146 of file WidgetInputRouter.cs.

◆ Dispose()

void Gondwana.Widgets.WidgetInputRouter.Dispose ( )

Releases the resources used by the router and unregisters all widgets.

Definition at line 217 of file WidgetInputRouter.cs.

◆ Focus()

void Gondwana.Widgets.WidgetInputRouter.Focus ( WidgetBase? widget)

Assigns keyboard focus to the specified widget.

Parameters
widgetThe widget to focus, or null to clear focus.

Definition at line 128 of file WidgetInputRouter.cs.

◆ Register()

void Gondwana.Widgets.WidgetInputRouter.Register ( WidgetBase widget)

Registers a widget so that it can receive routed input.

Parameters
widgetThe widget to register.

Definition at line 76 of file WidgetInputRouter.cs.

◆ Start()

void Gondwana.Widgets.WidgetInputRouter.Start ( )

Starts routing input events from the configured pollers to registered widgets.

Definition at line 154 of file WidgetInputRouter.cs.

◆ Stop()

void Gondwana.Widgets.WidgetInputRouter.Stop ( )

Stops routing input events and releases current pointer and focus state.

Definition at line 184 of file WidgetInputRouter.cs.

◆ Unregister()

void Gondwana.Widgets.WidgetInputRouter.Unregister ( WidgetBase widget)

Unregisters a widget so that it no longer receives routed input.

Parameters
widgetThe widget to unregister.

Definition at line 100 of file WidgetInputRouter.cs.

Member Data Documentation

◆ MousePointerId

const int Gondwana.Widgets.WidgetInputRouter.MousePointerId = -1
static

Identifies mouse pointer events in routed widget input.

Definition at line 20 of file WidgetInputRouter.cs.

Property Documentation

◆ FocusedWidget

WidgetBase? Gondwana.Widgets.WidgetInputRouter.FocusedWidget
get

Gets the widget that currently has keyboard focus.

The focused widget, or null if no widget currently has focus.

Definition at line 70 of file WidgetInputRouter.cs.