Skip to content

Conversation

@waywardmonkeys
Copy link

  • Replace deprecated Key::<Variant> usages with Key::Named(NamedKey::<Variant>)
  • Map unidentified and dead keys to Key::Named(NamedKey::Unidentified) and Key::Named(NamedKey::Dead)
  • Keep Key::Character(String) for printable characters
  • Update platform keymaps (macOS, X11, Windows) to 0.8 API

keyboard-types 0.8 moved non-character keys into NamedKey. This adapts the platform mappings to the new API, aligning emitted KeyboardEvent.key with the spec-compliant representation.

- Replace deprecated `Key::<Variant>` usages with `Key::Named(NamedKey::<Variant>)`
- Map unidentified and dead keys to `Key::Named(NamedKey::Unidentified)` and `Key::Named(NamedKey::Dead)`
- Keep `Key::Character(String)` for printable characters
- Update platform keymaps (macOS, X11, Windows) to 0.8 API

keyboard-types 0.8 moved non-character keys into `NamedKey`. This adapts the
platform mappings to the new API, aligning emitted `KeyboardEvent.key` with
the spec-compliant representation.
Code::Tab => Key::Tab,
Code::Backspace => Key::Backspace,
Code::ContextMenu => Key::ContextMenu,
Code::NumLock => Key::Named(NamedKey::Clear),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I maintained the existing behavior here, but this one seems odd.

@waywardmonkeys
Copy link
Author

I built this on macOS, but I don't use baseview myself, so didn't test it beyond that.

I have a family of crates ui-events and wanted to do a ui-events-baseview adapter and having everyone on the same version of keyboard-types (the current one) would make that easier, so I figured I'd give this a shot.

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

Successfully merging this pull request may close these issues.

1 participant