From c9a5fa6097997e95bc415cd76ef931a1a4bb1510 Mon Sep 17 00:00:00 2001 From: mo8it Date: Wed, 10 Apr 2024 02:19:14 +0200 Subject: [PATCH] Accept repeat keyboard events --- src/list.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/list.rs b/src/list.rs index c92b3692..560b85a8 100644 --- a/src/list.rs +++ b/src/list.rs @@ -28,13 +28,10 @@ pub fn list(state_file: &mut StateFile, exercises: &'static [Exercise]) -> Resul let key = loop { match event::read()? { - Event::Key(key) => { - if key.kind != KeyEventKind::Press { - continue; - } - - break key; - } + Event::Key(key) => match key.kind { + KeyEventKind::Press | KeyEventKind::Repeat => break key, + KeyEventKind::Release => (), + }, // Redraw Event::Resize(_, _) => continue 'outer, // Ignore