![]() |
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.
|
Keyboard adapter for Blazor applications that feeds the Gondwana KeyboardEventPoller by translating browser KeyboardEvent.code values into BlazorKey integer codes.
More...
Public Member Functions | |||
| BlazorKeyboardAdapter (BlazorBitmapRenderSurfaceComponent component) | |||
| Initializes a new instance of BlazorKeyboardAdapter and attaches it to the keyboard events on the specified render surface component. | |||
| BlazorKeyboardAdapter (BlazorRenderSurfaceComponentBase component) | |||
| Initializes a new instance of BlazorKeyboardAdapter for any Gondwana Blazor render surface. | |||
| bool | IsDown (int keyCode) | ||
Returns true if the specified platform-agnostic key code is currently down. Key codes should be stable integers agreed upon by the adapter and the engine. For WinForms, this should be the Windows Virtual-Key code (0..255).
| |||
| void | Dispose () | ||
| Releases all resources and removes event handlers registered by this adapter. | |||
Static Public Member Functions | |
| static ? int | GetKeyCodeFromString (string keyName) |
Converts a key name (a BlazorKey member name or a browser KeyboardEvent.code string) to its integer key code. | |
Properties | |
| KeyboardModifierState | CurrentKeyboardModifiers [get] |
| Gets the current state of modifier keys, such as Shift, Ctrl, and Alt. Must be safe to read from the Engine thread at high frequency. | |
Keyboard adapter for Blazor applications that feeds the Gondwana KeyboardEventPoller by translating browser KeyboardEvent.code values into BlazorKey integer codes.
Key codes correspond to BlazorKey values cast to int. Use GetKeyCodeFromString to resolve a key name at runtime, or use (int)BlazorKey.Space directly in game code.
Keyboard events are captured on the canvas element owned by BlazorRenderSurfaceComponentBase. The canvas must have focus for events to be received; the component requests focus automatically on first render.
Definition at line 26 of file BlazorKeyboardAdapter.cs.
| Gondwana.Blazor.Input.Keyboard.BlazorKeyboardAdapter.BlazorKeyboardAdapter | ( | BlazorBitmapRenderSurfaceComponent | component | ) |
Initializes a new instance of BlazorKeyboardAdapter and attaches it to the keyboard events on the specified render surface component.
| component | The render surface component to capture keyboard input from. |
| ArgumentNullException | Thrown when component is null. |
Definition at line 45 of file BlazorKeyboardAdapter.cs.
| Gondwana.Blazor.Input.Keyboard.BlazorKeyboardAdapter.BlazorKeyboardAdapter | ( | BlazorRenderSurfaceComponentBase | component | ) |
Initializes a new instance of BlazorKeyboardAdapter for any Gondwana Blazor render surface.
| component | The render surface component to capture keyboard input from. |
| ArgumentNullException | Thrown when component is null. |
Definition at line 56 of file BlazorKeyboardAdapter.cs.
| void Gondwana.Blazor.Input.Keyboard.BlazorKeyboardAdapter.Dispose | ( | ) |
Releases all resources and removes event handlers registered by this adapter.
Definition at line 124 of file BlazorKeyboardAdapter.cs.
|
static |
Converts a key name (a BlazorKey member name or a browser KeyboardEvent.code string) to its integer key code.
| keyName | The key name to resolve. |
null if the name is not recognized.Definition at line 81 of file BlazorKeyboardAdapter.cs.
| bool Gondwana.Blazor.Input.Keyboard.BlazorKeyboardAdapter.IsDown | ( | int | keyCode | ) |
Returns true if the specified platform-agnostic key code is currently down. Key codes should be stable integers agreed upon by the adapter and the engine. For WinForms, this should be the Windows Virtual-Key code (0..255).
| keyCode | The key code to query. |
true if the key is currently pressed; otherwise, false.Implements Gondwana.Input.Keyboard.IKeyboardAdapter.
Definition at line 69 of file BlazorKeyboardAdapter.cs.
|
get |
Gets the current state of modifier keys, such as Shift, Ctrl, and Alt. Must be safe to read from the Engine thread at high frequency.
Implements Gondwana.Input.Keyboard.IKeyboardAdapter.
Definition at line 36 of file BlazorKeyboardAdapter.cs.