Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add some more keyboard mappings #173

Merged
merged 2 commits into from
Sep 3, 2024
Merged

Conversation

ByteBaker
Copy link
Contributor

@ByteBaker ByteBaker commented Aug 30, 2024

Part of #69 to support more key mappings

Also

  • bump env_logger: 0.10 -> 0.11,
  • add macros to generate code in keyboard.rs to conveniently generate mappings

@ByteBaker ByteBaker changed the title feat: add some more mappings as in #69 feat: add some more keyboard mappings Aug 30, 2024
@pewsheen
Copy link
Collaborator

pewsheen commented Sep 2, 2024

It looks good overall
I am just a little concerned about whether there are keys that are not 1:1 matched, then we'll need this old way back in the future...

@ByteBaker
Copy link
Contributor Author

Fair point. I think I'll just modify the macro to accept raw pattern blocks as well. This way if we ever need to, we can just add those patterns inside the macro invocation alongside the rest of the items as they're now.

@ByteBaker
Copy link
Contributor Author

I've modified the macros and added documentation.

Now they also support calls like logical_to_winit_key!(key, Escape, F13 => F1) to map custom variants when one-one mappings aren't available.

This one in example maps Escape => Escape and F13 => F1.

also add macros to generate code in `keyboard.rs` to
conveniently generate mappings
- support custom match cases in key-mapping macros for when one-one
  mappings of keys aren't available
- add docs to the macros
Copy link
Collaborator

@pewsheen pewsheen left a comment

Choose a reason for hiding this comment

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

awesome

@pewsheen pewsheen added this pull request to the merge queue Sep 3, 2024
Merged via the queue into versotile-org:main with commit d8af7c4 Sep 3, 2024
6 checks passed
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.

2 participants