Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kitty Keyboard Protocol #869

Open
Broderick-Westrope opened this issue Nov 14, 2023 · 2 comments
Open

Kitty Keyboard Protocol #869

Broderick-Westrope opened this issue Nov 14, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@Broderick-Westrope
Copy link

Is your feature request related to a problem? Please describe.
It would be nice to see a solution to detecting key release events. Currently, for any action that requires this functionality in my Bubbletea apps I have replaced it with pressing the key to toggle which is less than ideal.

Describe the solution you'd like
The ideal solution would be to have an actionType (or similar) field that determines what happened (press, release, etc). Unfortunately, this would likely break a lot of existing code, so another solution would be to add release versions of all the basic keys.

Describe alternatives you've considered
I've considered cloning the Bubbletea package for projects that require it, and adding the functionality using solutions such as gohook. I am unsure of other potential solutions.

Additional context
If anyone has other ideas of how this could be achieved, either on my own or how I could implement this better into the Bubbletea package, please let me know!

@Broderick-Westrope Broderick-Westrope added the enhancement New feature or request label Nov 14, 2023
@meowgorithm meowgorithm changed the title Detect Key Release Kitty Keyboard Protocol Nov 15, 2023
@meowgorithm
Copy link
Member

meowgorithm commented Nov 15, 2023

Hi! So if you're targeting all terminals you simply cannot detect release events as terminal input handing is rather archaic.

Adding support for the Kitty keyboard protocol would add support for release events and a bunch of other nice things, but bear in mind that there are only a few terminals that support the protocol at the moment.

Maintainer's notes:

fixterms/CSI u (#293), also proposed, does not support key release events. The Kitty keyboard is mostly backwards compatible with this protocol, but not entirely.

A large, high fidelity range of input options, including key release, are available in Windows as evidenced in #140. We didn't merge that because of the large amount of Windows-only code and the maintenance burden that would come with it.

@meowgorithm
Copy link
Member

Just a note that this is currently in development on the term-input branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants