Skip to content

✨ keyboard: dispatch key events to focused elements - #25

Closed
cowboyd wants to merge 1 commit into
tree-dispatchfrom
tree-keyboard
Closed

cowboyd wants to merge 1 commit into
tree-dispatchfrom
tree-keyboard

Conversation

@cowboyd

@cowboyd cowboyd commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Raw key events arrive at the Host root, but controls need to receive them at the currently focused node. A dedicated keyboard layer recognizes @bomb.sh/tty key events and translates root dispatch into node-scoped KeyboardApi operations. This lets an input, menu, or third-party control install keyboard semantics exactly where it lives in the tree.

Keeping keyboard routing separate from generic dispatch leaves room for other event families and keeps editing policy out of the terminal scanner. Keydown, keyup, and key-repeat remain distinct semantic operations, while malformed or unrelated events continue through the general dispatch chain.

This PR adds KeyboardApi and useKeyboard(). Valid keydown, keyup, and key-repeat events are routed to the focused node, while non-key and malformed events delegate unchanged.

@cowboyd
cowboyd force-pushed the tree-keyboard branch 2 times, most recently from 0ad0b20 to 8f33f36 Compare August 7, 2026 06:21
@pkg-pr-new

pkg-pr-new Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

commit: 4f8fb36

@cowboyd
cowboyd force-pushed the tree-keyboard branch 3 times, most recently from c6ece67 to 532022e Compare August 11, 2026 04:27
@cowboyd
cowboyd force-pushed the tree-keyboard branch 2 times, most recently from 03d11a7 to c493b8c Compare August 22, 2026 05:24
@cowboyd
cowboyd force-pushed the tree-keyboard branch 2 times, most recently from 1b9f4bb to a8344a2 Compare August 23, 2026 17:28
@cowboyd

cowboyd commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

closing out in favor of a DOM based substrate. See #37

@cowboyd cowboyd closed this Oct 23, 2026
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