File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -345,17 +345,22 @@ pub fn key_event_to_string(event: KeyEvent) -> String {
345345 match event. code {
346346 KeyCode :: Char ( c) => {
347347 if event. modifiers == KeyModifiers :: CONTROL {
348- // Sonderfall: Nur Control -> Großbuchstabe
348+ // Special case for Control + Char -> "Ctrl + UPPERCASE_CHAR"
349349 format ! ( "Ctrl + {}" , c. to_ascii_uppercase( ) )
350350 } else if event. modifiers == KeyModifiers :: SHIFT {
351- // Shift + Char -> Nur Char (Groß-/Sonderzeichen bereits berücksichtigt )
351+ // Shift + Char -> Only the char (because Shift is usually handled by the char itself, e.g. 'a' with Shift becomes 'A' )
352352 c. to_string ( )
353353 } else if event. modifiers != KeyModifiers :: NONE {
354- // Andere Modifier -> Modifier + Char
354+ // Other Modifier -> Modifier + Char
355355 format ! ( "{} + {}" , modifiers_str, c)
356356 } else {
357- // Kein Modifier -> Nur Char
358- c. to_string ( )
357+ // No modifier -> Just the char
358+ // handle case Space char
359+ if c == ' ' {
360+ "Space" . to_string ( )
361+ } else {
362+ c. to_string ( )
363+ }
359364 }
360365 }
361366 KeyCode :: Left => format_arrow_key ( "Left Arrow" , & modifiers_str) ,
You can’t perform that action at this time.
0 commit comments