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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FS.GG.UI.KeyboardInput" Version="0.31.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FS.GG.UI.KeyboardInput" Version="0.31.0" />
                    
Directory.Packages.props
<PackageReference Include="FS.GG.UI.KeyboardInput" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FS.GG.UI.KeyboardInput --version 0.31.0
                    
#r "nuget: FS.GG.UI.KeyboardInput, 0.31.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FS.GG.UI.KeyboardInput@0.31.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FS.GG.UI.KeyboardInput&version=0.31.0
                    
Install as a Cake Addin
#tool nuget:?package=FS.GG.UI.KeyboardInput&version=0.31.0
                    
Install as a Cake Tool

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 initial KeyboardModel from a KeyboardBinding list and returns startup KeyboardEffects.
  • Keyboard.update — the Elmish reducer; applies a KeyboardMsg (key down/up, focus lost, layout/mode changes, sequence resolution) and returns the new model plus emitted effects.
  • Keyboard.stateDisplay — projects a KeyboardStateDisplay snapshot (pressed keys, active layout, mode stack, pending sequence, last command) for rendering.
  • ViewerKeyboard.normalize / normalizeEvent — turn a raw host key string or ViewerKeyEvent into a typed ViewerKey (plus direction flag).
  • ViewerKeyboard.toKeyId — converts a ViewerKey into the KeyId used 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, optional Key) 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.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed