1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 06:10:06 -04:00

Add Key::Quote (#4683)

* Part of https://github.com/emilk/egui/issues/3653

<!--
Please read the "Making a PR" section of
[`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md)
before opening a Pull Request!

* Keep your PR:s small and focused.
* The PR title is what ends up in the changelog, so make it descriptive!
* If applicable, add a screenshot or gif.
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`, or a new example.
* Do NOT open PR:s from your `master` branch, as that makes it hard for
maintainers to add commits to your PR.
* Remember to run `cargo fmt` and `cargo clippy`.
* Open the PR as a draft until you have self-reviewed it and run
`./scripts/check.sh`.
* When you have addressed a PR comment, mark it as resolved.

Please be patient! I will review your PR, but my time is limited!
-->

It was surprising to me that this key wasn't sending `Event::Key` events
(only `Event::Text`), so I added a `Key` for it.

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This commit is contained in:
Matt Keeter
2024-06-23 05:36:32 -04:00
committed by GitHub
parent 44f49713eb
commit d7ccf4d341
2 changed files with 7 additions and 0 deletions

View File

@@ -1137,6 +1137,7 @@ fn key_from_key_code(key: winit::keyboard::KeyCode) -> Option<egui::Key> {
KeyCode::BracketLeft => Key::OpenBracket,
KeyCode::BracketRight => Key::CloseBracket,
KeyCode::Backquote => Key::Backtick,
KeyCode::Quote => Key::Quote,
KeyCode::Cut => Key::Cut,
KeyCode::Copy => Key::Copy,