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.Keyboard.WinFormsKeyboardAdapter Class Referencesealed

Global WinForms key state collector that feeds the KeyboardHandler. Uses IMessageFilter so it sees ALL key messages (including arrows), regardless of which control has focus or how WinForms classifies them. More...

Inheritance diagram for Gondwana.WinForms.Input.Keyboard.WinFormsKeyboardAdapter:
Gondwana.Input.Keyboard.IKeyboardAdapter

Public Member Functions

bool PreFilterMessage (ref Message m)
 Filters Windows messages to capture keyboard state changes for all key events.
bool IsDown (int keyCode)
 Determines whether the specified key is currently pressed.
void Dispose ()
 Releases all resources used by the WinFormsKeyboardAdapter and removes the message filter.

Static Public Member Functions

static ? Keys GetKeyFromString (string keyName)
 Attempts to convert a string representation of a key into its corresponding Keys value.

Properties

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

Detailed Description

Global WinForms key state collector that feeds the KeyboardHandler. Uses IMessageFilter so it sees ALL key messages (including arrows), regardless of which control has focus or how WinForms classifies them.

Definition at line 12 of file WinFormsKeyboardAdapter.cs.

Member Function Documentation

◆ Dispose()

void Gondwana.WinForms.Input.Keyboard.WinFormsKeyboardAdapter.Dispose ( )

Releases all resources used by the WinFormsKeyboardAdapter and removes the message filter.

Definition at line 142 of file WinFormsKeyboardAdapter.cs.

◆ GetKeyFromString()

? Keys Gondwana.WinForms.Input.Keyboard.WinFormsKeyboardAdapter.GetKeyFromString ( string keyName)
static

Attempts to convert a string representation of a key into its corresponding Keys value.

The comparison is case-insensitive. If the provided keyName does not match a valid Keys enumeration value, a warning is logged and null is returned.

Parameters
keyNameThe name of the key to parse. This should match a value from the Keys enumeration (e.g., "A", "Enter", "Escape").
Returns
A nullable Keys value representing the parsed key if successful; otherwise, null if the input string is not a valid key name.

Definition at line 29 of file WinFormsKeyboardAdapter.cs.

◆ IsDown()

bool Gondwana.WinForms.Input.Keyboard.WinFormsKeyboardAdapter.IsDown ( int keyCode)

Determines whether the specified key is currently pressed.

Parameters
keyCodeThe virtual key code to check.
Returns
true if the key is currently pressed; otherwise, false.

Implements Gondwana.Input.Keyboard.IKeyboardAdapter.

Definition at line 105 of file WinFormsKeyboardAdapter.cs.

◆ PreFilterMessage()

bool Gondwana.WinForms.Input.Keyboard.WinFormsKeyboardAdapter.PreFilterMessage ( ref Message m)

Filters Windows messages to capture keyboard state changes for all key events.

Parameters
mThe Windows message to filter.
Returns
Always returns false to allow the message to continue processing.

Definition at line 73 of file WinFormsKeyboardAdapter.cs.

Property Documentation

◆ CurrentKeyboardModifiers

KeyboardModifierState Gondwana.WinForms.Input.Keyboard.WinFormsKeyboardAdapter.CurrentKeyboardModifiers
get

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

Implements Gondwana.Input.Keyboard.IKeyboardAdapter.

Definition at line 52 of file WinFormsKeyboardAdapter.cs.