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

[FEATURE] more keys in event::Keys #756

Open
Redhawk18 opened this issue Sep 21, 2023 · 2 comments
Open

[FEATURE] more keys in event::Keys #756

Redhawk18 opened this issue Sep 21, 2023 · 2 comments

Comments

@Redhawk18
Copy link

Is your feature request related to a problem? Please describe.
I'd like to use the Alt key to show my menubar.

Describe the solution you'd like
Adding more key presses to the event and the Key's enum

Describe alternatives you've considered
Using different keys

@gyscos
Copy link
Owner

gyscos commented Sep 29, 2023

Hi, and thanks for the report!

We could add these keys to the enum, but the main issue is going to be backend support. As far as I know, there is no easy way for a terminal application to know when the Alt key was pressed by itself. It's unfortunate, but is a result of the very limiting interface between a terminal emulator and the application running inside.

In theory, other backends (like BearLibTerminal, or some javascript canvas backends) would be free of these limitations and could catch and return these events. I'm just worried that because it would be unsupported for most "regular" backends, it would be confusing for most users. Rather, I'm thinking of allowing backends to define custom events for users who know they're using this backend.

But in the general case or running inside a terminal, we just have to accept that some key events are just not available. :(

Note that if you find an event that is sent to the application by the terminal and is not currently supported, then I'm absolutely open to adding support! Especially if ncurses/crossterm/... detects it.

@Redhawk18
Copy link
Author

is there a way to directly access the backend im using? Im using crossterm, it seems like this would be a lower level feature and it would involve a lot of conditional compiling. But it feels like its worth exploring

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

No branches or pull requests

2 participants