working perfectly well

This commit is contained in:
filipriec
2025-02-28 11:45:45 +01:00
parent f3ae029259
commit 2c43f22df6
3 changed files with 28 additions and 13 deletions

View File

@@ -48,6 +48,12 @@ impl KeySequenceTracker {
pub fn sequence_to_string(&self) -> String {
self.current_sequence.iter().map(|k| match k {
KeyCode::Char(c) => c.to_string(),
KeyCode::Left => "Left".into(),
KeyCode::Right => "Right".into(),
KeyCode::Up => "Up".into(),
KeyCode::Down => "Down".into(),
KeyCode::Esc => "Esc".into(),
KeyCode::Enter => "Enter".into(),
_ => String::new(),
}).collect()
}
@@ -95,10 +101,10 @@ fn parse_key_part(part: &str) -> Option<ParsedKey> {
"shift" => modifiers |= KeyModifiers::SHIFT,
"alt" => modifiers |= KeyModifiers::ALT,
"esc" => code = Some(KeyCode::Esc),
"up" => code = Some(KeyCode::Up),
"down" => code = Some(KeyCode::Down),
"left" => code = Some(KeyCode::Left),
"right" => code = Some(KeyCode::Right),
"up" => code = Some(KeyCode::Up),
"down" => code = Some(KeyCode::Down),
"enter" => code = Some(KeyCode::Enter),
"backspace" => code = Some(KeyCode::Backspace),
"delete" => code = Some(KeyCode::Delete),