Repository navigation
Add automatic text input and bump Silky to 0.2.0 - #69
Merged
Merged
Conversation
This was referenced Sep 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
inputRunesforwarding, manual rune-input enablement, and calls to the old polling-based text-box handler. Usesk.buttonDown,sk.buttonPressed, andsk.buttonReleasedfor controls that should pause during text entry. Migration details are indocs/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 checkfor production and testing code; ordered-input regression tests, including AltGr characters without accidental Control shortcuts.