From bdf7bfddd730d9178458a7014206e95d832788ce Mon Sep 17 00:00:00 2001 From: n4n5 <56606507+Its-Just-Nans@users.noreply.github.com> Date: Wed, 22 Jan 2025 15:20:06 +0100 Subject: [PATCH] Add keys for `!`, `{`, `}` (#5548) * Help on https://github.com/emilk/egui/issues/3653 * [x] I have followed the instructions in the PR template --- crates/egui/src/data/key.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/crates/egui/src/data/key.rs b/crates/egui/src/data/key.rs index a075b025a2f..602ec5bda47 100644 --- a/crates/egui/src/data/key.rs +++ b/crates/egui/src/data/key.rs @@ -49,12 +49,21 @@ pub enum Key { /// `?` Questionmark, + // '!' + Exclamationmark, + // `[` OpenBracket, // `]` CloseBracket, + // `{` + OpenCurlyBracket, + + // `}` + CloseCurlyBracket, + /// Also known as "backquote" or "grave" Backtick, @@ -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, @@ -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, @@ -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(), @@ -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",