mirror of
https://github.com/rensbreur/SwiftTUI.git
synced 2026-04-03 00:18:31 -06:00
Subscribing to Keyboard Presses #10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @DandyLyons on 10/18/2024
This library is phenomenal. Thank you for creating it!
I would like to subscribe to keyboard presses so that the user can press a key on the keyboard at any time and we can respond in code (with or without a UI update).
I'm attempting to follow the same strategy that you use in
handleInput()here:537133031b/Sources/SwiftTUI/RunLoop/Application.swift (L92)It would be nice if the library had this built-in ("I'd be willing to submit a PR.). It would be nice if there was a way for the library user to declare which key presses they would like to subscribe to and to give handlers for each subscription.