Skip to content

Add automatic text input and bump Silky to 0.2.0 - #69

Merged
treeform merged 3 commits into
masterfrom
automatic-text-input
Sep 9, 2026
Merged

treeform merged 3 commits into
masterfrom
automatic-text-input

Conversation

@treeform

@treeform treeform commented Sep 9, 2026 •

Copy link
Copy Markdown
Owner

Fast shortcuts and typing can arrive entirely between UI frames, causing text boxes to miss presses or apply them with the wrong modifiers. Silky now records text-input events in order and drains the complete batch before drawing, so a quick Control/Command-A followed by typing reliably replaces the selection.

newSilky(window, ...) installs input handling automatically. Focused text boxes consume application keyboard callbacks and hide keys from Silky's button accessors, preventing controls such as WASD from firing while typing. Callback changes are picked up at the next frame. Native and web builds use the same Windy callbacks, with no browser-specific input adapter in Silky.

Depends on treeform/windy#196 for browser text delivery and modifier state. The lockfile pins that fix so CI exercises the shared input path.

This bumps the library from 0.1.0 to 0.2.0 for the breaking input API change. Applications should remove inputRunes forwarding, manual rune-input enablement, and calls to the old polling-based text-box handler. Use sk.buttonDown, sk.buttonPressed, and sk.buttonReleased for controls that should pause during text entry. Migration details are in docs/text_inputs.md.

The manual demo includes single-line, password, three-line, and resizable multiline fields, plus a QWERTY keyboard display. Queue regression tests are added to CI; browser event delivery is checked manually using Windy's input test and this demo. Mouse handling remains frame-based; IME and platform clipboard changes are outside this PR.

Validation:

  • nim check for production and testing code; ordered-input regression tests, including AltGr characters without accidental Control shortcuts.
  • Existing text-box, layout, clipping, and migrated example tests.
  • Native and Emscripten builds of the migrated examples and manual input demo.
  • Browser checks for typing, quick replacement, masking, scrolling, resizing, and keyboard-control suppression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant