Gondwana Game Engine Development (master) - 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.Blazor.Input.Mouse.BlazorMouseAdapter Class Referencesealed

Provides a mouse/pointer input adapter for Blazor applications, tracking pointer position, button states, modifier keys, and scroll wheel input. More...

Inheritance diagram for Gondwana.Blazor.Input.Mouse.BlazorMouseAdapter:
Gondwana.Input.Mouse.IMouseAdapter

Public Member Functions

 BlazorMouseAdapter (BlazorBitmapRenderSurfaceComponent component)
 Initializes a new instance of BlazorMouseAdapter and attaches it to the mouse events on the specified render surface component.
 BlazorMouseAdapter (BlazorRenderSurfaceComponentBase component)
 Initializes a new instance of BlazorMouseAdapter for any Gondwana Blazor render surface.
void Dispose ()
 Unsubscribes from the render component's mouse events.

Properties

Point CurrentPosition [get]
 Gets the current position of the mouse cursor in screen or client coordinates, depending on the implementation. This position is typically updated continuously as the user moves the mouse and represents the pixel coordinates where the cursor is currently located.
HashSet< GondwanaMouseButton > PressedButtons [get]
 Gets the set of mouse buttons that are currently pressed. This collection includes identifiers for all buttons that are in the down state, such as MouseButton.Left, MouseButton.Right, MouseButton.Middle, and additional buttons if supported by the hardware. The collection is empty when no buttons are pressed.
KeyboardModifierState CurrentKeyboardModifiers [get]
 Gets the current state of keyboard modifier keys (Shift, Ctrl, Alt) at the time of mouse input. This allows mouse event handlers to respond to modified mouse actions, such as Ctrl+Click or Shift+Drag. The state can be a combination of multiple modifiers using bitwise flags.
int ScrollDelta [get]
 Gets the accumulated scroll wheel delta since the last poll, measured in implementation-defined units. Positive values indicate upward scrolling (scrolling away from the user), while negative values indicate downward scrolling (scrolling toward the user). The magnitude represents the distance or speed of the scroll. Reading consumes the accumulated delta and resets it to zero.

Detailed Description

Provides a mouse/pointer input adapter for Blazor applications, tracking pointer position, button states, modifier keys, and scroll wheel input.

Definition at line 15 of file BlazorMouseAdapter.cs.

Constructor & Destructor Documentation

◆ BlazorMouseAdapter() [1/2]

Gondwana.Blazor.Input.Mouse.BlazorMouseAdapter.BlazorMouseAdapter ( BlazorBitmapRenderSurfaceComponent component)

Initializes a new instance of BlazorMouseAdapter and attaches it to the mouse events on the specified render surface component.

Parameters
componentThe render surface component to capture mouse input from.
Exceptions
ArgumentNullExceptionThrown when component is null.

Definition at line 48 of file BlazorMouseAdapter.cs.

◆ BlazorMouseAdapter() [2/2]

Gondwana.Blazor.Input.Mouse.BlazorMouseAdapter.BlazorMouseAdapter ( BlazorRenderSurfaceComponentBase component)

Initializes a new instance of BlazorMouseAdapter for any Gondwana Blazor render surface.

Parameters
componentThe render surface component to capture mouse input from.
Exceptions
ArgumentNullExceptionThrown when component is null.

Definition at line 59 of file BlazorMouseAdapter.cs.

Member Function Documentation

◆ Dispose()

void Gondwana.Blazor.Input.Mouse.BlazorMouseAdapter.Dispose ( )

Unsubscribes from the render component's mouse events.

Definition at line 112 of file BlazorMouseAdapter.cs.

Property Documentation

◆ CurrentKeyboardModifiers

KeyboardModifierState Gondwana.Blazor.Input.Mouse.BlazorMouseAdapter.CurrentKeyboardModifiers
get

Gets the current state of keyboard modifier keys (Shift, Ctrl, Alt) at the time of mouse input. This allows mouse event handlers to respond to modified mouse actions, such as Ctrl+Click or Shift+Drag. The state can be a combination of multiple modifiers using bitwise flags.

Implements Gondwana.Input.Mouse.IMouseAdapter.

Definition at line 37 of file BlazorMouseAdapter.cs.

◆ CurrentPosition

Point Gondwana.Blazor.Input.Mouse.BlazorMouseAdapter.CurrentPosition
get

Gets the current position of the mouse cursor in screen or client coordinates, depending on the implementation. This position is typically updated continuously as the user moves the mouse and represents the pixel coordinates where the cursor is currently located.

Implements Gondwana.Input.Mouse.IMouseAdapter.

Definition at line 25 of file BlazorMouseAdapter.cs.

◆ PressedButtons

HashSet<GondwanaMouseButton> Gondwana.Blazor.Input.Mouse.BlazorMouseAdapter.PressedButtons
get

Gets the set of mouse buttons that are currently pressed. This collection includes identifiers for all buttons that are in the down state, such as MouseButton.Left, MouseButton.Right, MouseButton.Middle, and additional buttons if supported by the hardware. The collection is empty when no buttons are pressed.

Implements Gondwana.Input.Mouse.IMouseAdapter.

Definition at line 28 of file BlazorMouseAdapter.cs.

◆ ScrollDelta

int Gondwana.Blazor.Input.Mouse.BlazorMouseAdapter.ScrollDelta
get

Gets the accumulated scroll wheel delta since the last poll, measured in implementation-defined units. Positive values indicate upward scrolling (scrolling away from the user), while negative values indicate downward scrolling (scrolling toward the user). The magnitude represents the distance or speed of the scroll. Reading consumes the accumulated delta and resets it to zero.

Implements Gondwana.Input.Mouse.IMouseAdapter.

Definition at line 40 of file BlazorMouseAdapter.cs.