Update to keyboard-types 0.8.3; migrate to NamedKey across platforms#214
Update to keyboard-types 0.8.3; migrate to NamedKey across platforms#214waywardmonkeys wants to merge 2 commits intoRustAudio:masterfrom
keyboard-types 0.8.3; migrate to NamedKey across platforms#214Conversation
- 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), |
There was a problem hiding this comment.
I maintained the existing behavior here, but this one seems odd.
|
I built this on macOS, but I don't use I have a family of crates |
RustAudio#214 from branch 'update-keyboard-events' of github.com:waywardmonkeys/baseview
|
FYI, I am working on making the UI framework floem support baseview, as described here. It would be helpful if this could be integrated, as it is very helpful for compatibility, and it would be more likely for the patches to be accepted if they don't require my fork of baseview. |
|
Looks like there's one remaining place that needs to be updated in the X11 backend ( |
Key::<Variant>usages withKey::Named(NamedKey::<Variant>)Key::Named(NamedKey::Unidentified)andKey::Named(NamedKey::Dead)Key::Character(String)for printable characterskeyboard-types 0.8 moved non-character keys into
NamedKey. This adapts the platform mappings to the new API, aligning emittedKeyboardEvent.keywith the spec-compliant representation.