Skip to content

Add some convenience constructors #80

@PoignardAzur

Description

@PoignardAzur

Creating types like TextEvent and KeyboardEvent is kind of cumbersome. In Masonry's unit tests, the full expression ends up looking like:

let event = MyTextEvent::Keyboard(KeyboardEvent {
    key: Key::Named(NamedKey::Tab),
    ..Default::default()
})

Some quality-of-life feature I'd like:

  • impl From<String> for Key
  • impl From<NamedKey> for Key
  • KeyboardEvent::key_down() and KeyboardEvent::key_up() constructors.

Thanks for your work!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions