Subscribing to Keyboard Presses #10

Open
opened 2025-10-14 15:43:18 -06:00 by navan · 0 comments
Owner

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.

*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: https://github.com/rensbreur/SwiftTUI/blob/537133031bc2b2731048d00748c69700e1b48185/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.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github/SwiftTUI#10
No description provided.