Skip to content

Modifiers ergonomics improvements #7

@raphlinus

Description

@raphlinus

First, a heads-up, we're in the process of adopting this crate as our standard keyboard event type in druid, see linebender/druid#1049 in particular. We appreciate having the crate are hopeful that it's a small step towards convergence in low-level platform integration the ecosystem.

There are a number of things we've run into as part of the integration. One ergonomics regression is that .shift (the old KeyModifiers was a struct of pub bools) has become .contains(Modifiers::SHIFT). Would you be open to an additional impl block with shift() and friends?

As a much lower priority, we also have an IntoKey trait that will convert any string into Key::Character(...), and this is used primarily to construct hotkeys. This has different semantics than your FromStr because it's not designed to parse strings like "Enter". It would be slightly more convenient for us to upgrade this to an Into, but I completely understand if you wouldn't want that.

There may be other work that makes sense to upstream, and if you're interested I can create additional issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions