From db5e7c99593f9af8e92d7af6db6c4f85330c885d Mon Sep 17 00:00:00 2001 From: n4n5 Date: Mon, 30 Dec 2024 14:27:19 +0100 Subject: [PATCH] add some keys --- crates/egui/src/data/key.rs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/crates/egui/src/data/key.rs b/crates/egui/src/data/key.rs index a075b025a2f..9a7fff8da8a 100644 --- a/crates/egui/src/data/key.rs +++ b/crates/egui/src/data/key.rs @@ -49,13 +49,23 @@ pub enum Key { /// `?` Questionmark, + // '!' + Exclamationmark, + // `[` OpenBracket, // `]` CloseBracket, - /// Also known as "backquote" or "grave" + // `{` + OpenCurlyBracket, + + // `}` + CloseCurlyBracket, + + #[allow(clippy::doc_markdown)] // single backquote + /// '`' Also known as "backquote" or "grave" Backtick, /// `-` @@ -215,11 +225,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 +354,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 +462,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 +509,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",