Skip to content

Update to keyboard-types 0.8#940

Merged
waywardmonkeys merged 2 commits into
linebender:mainfrom
waywardmonkeys:update-to-keyboard-types-0.8
May 5, 2025
Merged

Update to keyboard-types 0.8#940
waywardmonkeys merged 2 commits into
linebender:mainfrom
waywardmonkeys:update-to-keyboard-types-0.8

Conversation

@waywardmonkeys
Copy link
Copy Markdown
Contributor

With W3C specs, I think we should be mapping meta / super differently than we were before. This will change again with winit 0.31 where the names of those keys on the winit side will have changed. (And also, much of this particular mapping won't be necessary.)

The bulk of this change is that in keyboard-types 0.8, the Key enumeration has changed to have a separate enumeration for NamedKey values.

WinitKeyCode::SuperLeft => Code::Super,
WinitKeyCode::SuperRight => Code::Super,
WinitKeyCode::SuperLeft => Code::MetaLeft,
WinitKeyCode::SuperRight => Code::MetaRight,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@madsmtm This part is the main part that I'm sure about here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it's correct. Note that WinitKeyCode::Meta isn't actually emitted in Winit v0.30.x as far as I know.

See also rust-windowing/winit#4018.

@waywardmonkeys waywardmonkeys force-pushed the update-to-keyboard-types-0.8 branch 2 times, most recently from 2febd8e to 0fb3cec Compare April 29, 2025 13:56
Comment thread masonry/src/convert_winit_event.rs Outdated
With W3C specs, I think we should be mapping meta / super differently
than we were before. This will change again with winit 0.31 where
the names of those keys on the winit side will have changed. (And
also, much of this particular mapping won't be necessary.)

The bulk of this change is that in `keyboard-types` 0.8, the `Key`
enumeration has changed to have a separate enumeration for `NamedKey`
values.
@waywardmonkeys waywardmonkeys force-pushed the update-to-keyboard-types-0.8 branch from 4b65b0f to ebba863 Compare May 4, 2025 17:01
Co-authored-by: Mads Marquart <mads@marquart.dk>
@waywardmonkeys waywardmonkeys force-pushed the update-to-keyboard-types-0.8 branch from ebba863 to 189d528 Compare May 4, 2025 17:44
@waywardmonkeys waywardmonkeys added this pull request to the merge queue May 5, 2025
Merged via the queue into linebender:main with commit 9c969ed May 5, 2025
18 checks passed
@waywardmonkeys waywardmonkeys deleted the update-to-keyboard-types-0.8 branch May 5, 2025 01:46
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.

3 participants