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.WinForms.Input.Mouse.WinFormsMouseAdapter Class Referencesealed

Provides a mouse input adapter for WinForms applications, tracking mouse position, button states, and scroll events. More...

Inheritance diagram for Gondwana.WinForms.Input.Mouse.WinFormsMouseAdapter:
Gondwana.Input.Mouse.IMouseAdapter

Public Member Functions

 WinFormsMouseAdapter (Control control)
 Initializes a new instance of the WinFormsMouseAdapter class attached to the specified control.
void Dispose ()
 Unsubscribes from the control's mouse events.

Properties

Point CurrentPosition [get]
 Gets the current position of the mouse cursor.
HashSet< MouseButton > PressedButtons [get]
 Gets the set of currently pressed mouse buttons, reconciled against the actual OS button state to prevent stale "button down" entries that can occur when a MouseUp event is not received (e.g. because the parent form was temporarily disabled while a modal dialog was shown). Returns a snapshot copy safe for the caller to iterate.
KeyboardModifierState CurrentKeyboardModifiers [get]
 Gets the current state of keyboard modifiers (Shift, Ctrl, Alt).
int ScrollDelta [get]
 Gets the accumulated scroll wheel delta since the last read, then resets it to zero.

Detailed Description

Provides a mouse input adapter for WinForms applications, tracking mouse position, button states, and scroll events.

Definition at line 10 of file WinFormsMouseAdapter.cs.

Constructor & Destructor Documentation

◆ WinFormsMouseAdapter()

Gondwana.WinForms.Input.Mouse.WinFormsMouseAdapter.WinFormsMouseAdapter ( Control control)

Initializes a new instance of the WinFormsMouseAdapter class attached to the specified control.

Parameters
controlThe control to monitor for mouse events.
Exceptions
ArgumentNullExceptionThrown when control is null.

Definition at line 65 of file WinFormsMouseAdapter.cs.

Member Function Documentation

◆ Dispose()

void Gondwana.WinForms.Input.Mouse.WinFormsMouseAdapter.Dispose ( )

Unsubscribes from the control's mouse events.

Definition at line 118 of file WinFormsMouseAdapter.cs.

Property Documentation

◆ CurrentKeyboardModifiers

KeyboardModifierState Gondwana.WinForms.Input.Mouse.WinFormsMouseAdapter.CurrentKeyboardModifiers
get

Gets the current state of keyboard modifiers (Shift, Ctrl, Alt).

Implements Gondwana.Input.Mouse.IMouseAdapter.

Definition at line 53 of file WinFormsMouseAdapter.cs.

◆ CurrentPosition

Point Gondwana.WinForms.Input.Mouse.WinFormsMouseAdapter.CurrentPosition
get

Gets the current position of the mouse cursor.

Implements Gondwana.Input.Mouse.IMouseAdapter.

Definition at line 22 of file WinFormsMouseAdapter.cs.

◆ PressedButtons

HashSet<MouseButton> Gondwana.WinForms.Input.Mouse.WinFormsMouseAdapter.PressedButtons
get

Gets the set of currently pressed mouse buttons, reconciled against the actual OS button state to prevent stale "button down" entries that can occur when a MouseUp event is not received (e.g. because the parent form was temporarily disabled while a modal dialog was shown). Returns a snapshot copy safe for the caller to iterate.

Implements Gondwana.Input.Mouse.IMouseAdapter.

Definition at line 35 of file WinFormsMouseAdapter.cs.

◆ ScrollDelta

int Gondwana.WinForms.Input.Mouse.WinFormsMouseAdapter.ScrollDelta
get

Gets the accumulated scroll wheel delta since the last read, then resets it to zero.

Implements Gondwana.Input.Mouse.IMouseAdapter.

Definition at line 58 of file WinFormsMouseAdapter.cs.