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.Avalonia.Input.Keyboard.AvaloniaKeyboardAdapter Class Referencesealed

Global Avalonia key state collector that feeds the KeyboardEventPoller. Attaches tunnel-phase handlers at the TopLevel so it sees ALL key messages regardless of which control has focus, mirroring the WinForms IMessageFilter approach. Key codes are Key values cast to int. More...

Inheritance diagram for Gondwana.Avalonia.Input.Keyboard.AvaloniaKeyboardAdapter:
Gondwana.Input.Keyboard.IKeyboardAdapter

Public Member Functions

 AvaloniaKeyboardAdapter (Control lifetimeOwner)
 Initializes a new instance of the AvaloniaKeyboardAdapter class.
bool IsDown (int keyCode)
 Returns true if the key represented by keyCode (an Key value cast to int) is currently pressed.
void Dispose ()
 Releases all resources and removes all event handlers registered by this adapter.

Static Public Member Functions

static ? int GetKeyCodeFromString (string keyName)
 Converts an Avalonia Key name (case-insensitive) to its integer key code.

Properties

KeyboardModifierState CurrentKeyboardModifiers [get]
 Gets the current state of keyboard modifiers (Shift, Ctrl, Alt).

Detailed Description

Global Avalonia key state collector that feeds the KeyboardEventPoller. Attaches tunnel-phase handlers at the TopLevel so it sees ALL key messages regardless of which control has focus, mirroring the WinForms IMessageFilter approach. Key codes are Key values cast to int.

Definition at line 17 of file AvaloniaKeyboardAdapter.cs.

Constructor & Destructor Documentation

◆ AvaloniaKeyboardAdapter()

Gondwana.Avalonia.Input.Keyboard.AvaloniaKeyboardAdapter.AvaloniaKeyboardAdapter ( Control lifetimeOwner)

Initializes a new instance of the AvaloniaKeyboardAdapter class.

Parameters
lifetimeOwnerThe control whose visual-tree lifetime governs this adapter. Key events are captured at the TopLevel that owns this control.
Exceptions
ArgumentNullExceptionThrown when lifetimeOwner is null.

Definition at line 58 of file AvaloniaKeyboardAdapter.cs.

Member Function Documentation

◆ Dispose()

void Gondwana.Avalonia.Input.Keyboard.AvaloniaKeyboardAdapter.Dispose ( )

Releases all resources and removes all event handlers registered by this adapter.

Definition at line 146 of file AvaloniaKeyboardAdapter.cs.

◆ GetKeyCodeFromString()

? int Gondwana.Avalonia.Input.Keyboard.AvaloniaKeyboardAdapter.GetKeyCodeFromString ( string keyName)
static

Converts an Avalonia Key name (case-insensitive) to its integer key code.

Parameters
keyNameThe name of the key, matching a Key enumeration value.
Returns
The integer key code if the name is valid; otherwise null.

Definition at line 24 of file AvaloniaKeyboardAdapter.cs.

◆ IsDown()

bool Gondwana.Avalonia.Input.Keyboard.AvaloniaKeyboardAdapter.IsDown ( int keyCode)

Returns true if the key represented by keyCode (an Key value cast to int) is currently pressed.

Parameters
keyCodeAn Key value cast to int.
Returns
true if the key is currently pressed; otherwise, false.

Implements Gondwana.Input.Keyboard.IKeyboardAdapter.

Definition at line 120 of file AvaloniaKeyboardAdapter.cs.

Property Documentation

◆ CurrentKeyboardModifiers

KeyboardModifierState Gondwana.Avalonia.Input.Keyboard.AvaloniaKeyboardAdapter.CurrentKeyboardModifiers
get

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

Implements Gondwana.Input.Keyboard.IKeyboardAdapter.

Definition at line 47 of file AvaloniaKeyboardAdapter.cs.