Skip to content

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

Open

Description

@Redhawk18

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

Activity

  1. gyscos commented on Sep 29, 2023

    @gyscos
    Owner

    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.

  2. Redhawk18 commented on Sep 29, 2023

    @Redhawk18
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions