mirror of
https://github.com/rust-lang/rustlings
synced 2024-11-03 03:40:13 +00:00
Accept repeat keyboard events
This commit is contained in:
parent
d1a965f019
commit
c9a5fa6097
11
src/list.rs
11
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
|
||||
|
Loading…
Reference in New Issue
Block a user