Skip to content

Commit

Permalink
Add keys for !, {, } (#5548)
Browse files Browse the repository at this point in the history
<!--
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 test and 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!
-->

* Help on #3653 
* [x] I have followed the instructions in the PR template
  • Loading branch information
Its-Just-Nans authored Jan 22, 2025
1 parent e53bb53 commit bdf7bfd
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions crates/egui/src/data/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,21 @@ pub enum Key {
/// `?`
Questionmark,

// '!'
Exclamationmark,

// `[`
OpenBracket,

// `]`
CloseBracket,

// `{`
OpenCurlyBracket,

// `}`
CloseCurlyBracket,

/// Also known as "backquote" or "grave"
Backtick,

Expand Down Expand Up @@ -215,11 +224,14 @@ impl Key {
Self::Semicolon,
Self::OpenBracket,
Self::CloseBracket,
Self::OpenCurlyBracket,
Self::CloseCurlyBracket,
Self::Backtick,
Self::Backslash,
Self::Slash,
Self::Pipe,
Self::Questionmark,
Self::Exclamationmark,
Self::Quote,
// Digits:
Self::Num0,
Expand Down Expand Up @@ -341,8 +353,11 @@ impl Key {
"/" | "Slash" => Self::Slash,
"|" | "Pipe" => Self::Pipe,
"?" | "Questionmark" => Self::Questionmark,
"!" | "Exclamationmark" => Self::Exclamationmark,
"[" | "OpenBracket" => Self::OpenBracket,
"]" | "CloseBracket" => Self::CloseBracket,
"{" | "OpenCurlyBracket" => Self::OpenCurlyBracket,
"}" | "CloseCurlyBracket" => Self::CloseCurlyBracket,
"`" | "Backtick" | "Backquote" | "Grave" => Self::Backtick,
"'" | "Quote" => Self::Quote,

Expand Down Expand Up @@ -446,8 +461,11 @@ impl Key {
Self::Slash => "/",
Self::Pipe => "|",
Self::Questionmark => "?",
Self::Exclamationmark => "!",
Self::OpenBracket => "[",
Self::CloseBracket => "]",
Self::OpenCurlyBracket => "{",
Self::CloseCurlyBracket => "}",
Self::Backtick => "`",

_ => self.name(),
Expand Down Expand Up @@ -490,8 +508,11 @@ impl Key {
Self::Slash => "Slash",
Self::Pipe => "Pipe",
Self::Questionmark => "Questionmark",
Self::Exclamationmark => "Exclamationmark",
Self::OpenBracket => "OpenBracket",
Self::CloseBracket => "CloseBracket",
Self::OpenCurlyBracket => "OpenCurlyBracket",
Self::CloseCurlyBracket => "CloseCurlyBracket",
Self::Backtick => "Backtick",
Self::Quote => "Quote",

Expand Down

0 comments on commit bdf7bfd

Please sign in to comment.