FS.GG.UI.KeyboardInput
0.31.0
Prefix Reserved
dotnet add package FS.GG.UI.KeyboardInput --version 0.31.0
NuGet\Install-Package FS.GG.UI.KeyboardInput -Version 0.31.0
<PackageReference Include="FS.GG.UI.KeyboardInput" Version="0.31.0" />
<PackageVersion Include="FS.GG.UI.KeyboardInput" Version="0.31.0" />
<PackageReference Include="FS.GG.UI.KeyboardInput" />
paket add FS.GG.UI.KeyboardInput --version 0.31.0
#r "nuget: FS.GG.UI.KeyboardInput, 0.31.0"
#:package FS.GG.UI.KeyboardInput@0.31.0
#addin nuget:?package=FS.GG.UI.KeyboardInput&version=0.31.0
#tool nuget:?package=FS.GG.UI.KeyboardInput&version=0.31.0
FS.GG.UI.KeyboardInput
CommandInput.compile validates one product catalog and ordered input profile
before any dispatch state is constructed. Profiles preserve logical key values,
physical codes, complete modifiers including AltGraph, key sequences, pointer,
touch and gamepad controls. Overrides distinguish replacement, aliases and an
explicitly unbound command.
InputProfileCodec round-trips the ordered fsgg.input-profile/1 envelope in
.NET and Fable. CommandInput.ofKeymap migrates the existing fsgg.keymap v1
surface as logical-key defaults; the old reader and last-wins behavior remain
unchanged. Products still own command meanings and availability projections.
CommandResolver.update consumes ordered input observations as a pure reducer.
It resolves exclusive modal contexts, opt-in key-sequence prefixes and injected
deadlines, suppresses destructive repeats, and tracks held actions by source.
Focus loss, composition, modal takeover, context/profile replacement, source
disconnect and disposal cancel transient work and neutralize owned holds. Hosts
interpret the returned invocation, deadline, focus, capture and prevent-default
effects; the package reads no clock or browser state.
Package-owned keyboard input runtime, reducer, effect, diagnostics, and state display contracts for FS.GG.UI products.
FS.GG.UI.KeyboardInput is one of the FS.GG.UI distribution packages — an F# / Elmish UI and 2D
scene-graph framework for .NET 10 desktop, rendered through Vulkan + SkiaSharp.
Install
dotnet add package FS.GG.UI.KeyboardInput
Or scaffold a full governed project that wires the FS.GG.UI packages together:
dotnet new install FS.GG.UI.Template
dotnet new fs-gg-ui -o MyApp
Usage
open FS.GG.UI.KeyboardInput
// Bind host keys to product commands.
let bindings =
[ { Key = "ArrowUp"; Command = "move-up" }
{ Key = "Enter"; Command = "confirm" } ]
// Initialise the keyboard runtime model + startup effects.
let model, _initEffects = Keyboard.init bindings
// Normalise a raw host key event, then feed it to the reducer.
let viewerKey, isDown = ViewerKeyboard.normalizeEvent { RawKey = "ArrowUp"; Direction = KeyDown }
let keyId = ViewerKeyboard.toKeyId viewerKey
let model, effects = Keyboard.update (KeyboardMsg.KeyDown keyId) model
// React to resolved commands and surface diagnostics.
for effect in effects do
match effect with
| CommandResolved cmd -> printfn "command resolved: %s" cmd
| ReportKeyboardDiagnostic d -> printfn "[%s] %s" d.Severity d.Message
| _ -> ()
// Project a snapshot for HUD / state display rendering.
let display = Keyboard.stateDisplay model
printfn "pressed: %A active layout: %s" display.PressedKeys display.ActiveLayout
API at a glance
Keyboard.init— builds the initialKeyboardModelfrom aKeyboardBinding listand returns startupKeyboardEffects.Keyboard.update— the Elmish reducer; applies aKeyboardMsg(key down/up, focus lost, layout/mode changes, sequence resolution) and returns the new model plus emitted effects.Keyboard.stateDisplay— projects aKeyboardStateDisplaysnapshot (pressed keys, active layout, mode stack, pending sequence, last command) for rendering.ViewerKeyboard.normalize/normalizeEvent— turn a raw host key string orViewerKeyEventinto a typedViewerKey(plus direction flag).ViewerKeyboard.toKeyId— converts aViewerKeyinto theKeyIdused by bindings and the reducer.KeyboardEffect— the effects the runtime emits:CommandResolved,KeyStateChanged,LayoutChanged,ModeChanged,StateDisplayChanged,ReportKeyboardDiagnostic,RequestHostKeyCapture, and more.KeyboardModel/KeyboardMsg— the runtime state record and the message set driving the reducer.KeyboardDiagnostic— a structured diagnostic (Code,Severity,Message, optionalKey) reported via effects.
Versioning
All FS.GG.UI.* libraries share one version and move together. In a generated project a
single <FsGgUiVersion> in Directory.Packages.props pins every package — upgrading is one
edit; see docs/UPGRADING.md. Pre-release versions use a -preview.N suffix.
Links
- Repository & issues: https://github.com/FS-Skia-UI/FS-Skia-UI
- License: MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- FS.GG.UI.Scene (>= 0.31.0)
- FSharp.Core (>= 10.1.302)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on FS.GG.UI.KeyboardInput:
| Package | Downloads |
|---|---|
|
FS.GG.UI.SkiaViewer
Skia viewer host workflow contracts for FS.GG.UI V3 products. |
|
|
FS.GG.UI.Controls
Declarative Skia controls, rich rendering, chart controls, graph controls, DataGrid, and product-owned control runtime contracts. |
|
|
FS.GG.UI.Controls.Elmish
Elmish command, subscription, and program adapters for Controls and KeyboardInput runtime effects. |
|
|
FS.GG.UI
Optional BOM / metapackage for the FS.GG.UI framework. Reference this single package at one version to pin the entire coherent FS.GG.UI.* set to that version; any attempt to mix a member at a different version fails loudly at restore/build. Ships no assembly — dependencies only. |
|
|
FS.GG.Game.Render
Pure Scene adapter and input policy for FS.GG.Game — projects FS.GG.Game.Core simulation primitives (Point/Rect/Cell and pathfinding routes) onto FS.GG.UI.Scene drawables at the render edge, and ships the default command→key keymap binding the Game.Core command vocabulary onto FS.GG.UI.KeyboardInput's keymap mechanism. Reaches UP to FS.GG.UI.*; no Skia, deterministic. Per ADR-0022 §2. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.31.0 | 51 | 9/14/2026 |
| 0.30.0 | 202 | 9/13/2026 |
| 0.29.0 | 692 | 9/12/2026 |
| 0.28.0 | 1,069 | 8/24/2026 |
| 0.27.0 | 354 | 8/22/2026 |
| 0.26.0 | 971 | 8/3/2026 |
| 0.21.1 | 1,540 | 7/26/2026 |
| 0.21.0 | 233 | 7/26/2026 |
| 0.20.0 | 234 | 7/26/2026 |
| 0.19.0 | 370 | 7/23/2026 |
| 0.18.6 | 232 | 7/23/2026 |
| 0.18.5 | 228 | 7/22/2026 |
| 0.18.4 | 209 | 7/22/2026 |
| 0.18.0 | 310 | 7/22/2026 |
| 0.15.0 | 390 | 7/20/2026 |
| 0.14.0 | 246 | 7/19/2026 |
| 0.13.0 | 260 | 7/18/2026 |
| 0.12.0 | 393 | 7/17/2026 |
| 0.11.0 | 457 | 7/16/2026 |
| 0.10.0 | 6,886 | 7/14/2026 |