Implement going to the next exercise

This commit is contained in:
mo8it
2024-04-12 15:27:29 +02:00
parent 98c5088a39
commit a534de0312
3 changed files with 31 additions and 5 deletions
+2
View File
@@ -4,6 +4,7 @@ use std::sync::mpsc::Sender;
use super::WatchEvent;
pub enum InputEvent {
Next,
Hint,
List,
Quit,
@@ -38,6 +39,7 @@ pub fn terminal_event_handler(tx: Sender<WatchEvent>) {
match key.code {
KeyCode::Enter => {
let input_event = match input.trim() {
"n" | "next" => InputEvent::Next,
"h" | "hint" => InputEvent::Hint,
"l" | "list" => break InputEvent::List,
"q" | "quit" => break InputEvent::Quit,