mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-25 14:57:32 -05:00
Accept repeat keyboard events
This commit is contained in:
parent
d1a965f019
commit
c9a5fa6097
1 changed files with 4 additions and 7 deletions
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 {
|
let key = loop {
|
||||||
match event::read()? {
|
match event::read()? {
|
||||||
Event::Key(key) => {
|
Event::Key(key) => match key.kind {
|
||||||
if key.kind != KeyEventKind::Press {
|
KeyEventKind::Press | KeyEventKind::Repeat => break key,
|
||||||
continue;
|
KeyEventKind::Release => (),
|
||||||
}
|
},
|
||||||
|
|
||||||
break key;
|
|
||||||
}
|
|
||||||
// Redraw
|
// Redraw
|
||||||
Event::Resize(_, _) => continue 'outer,
|
Event::Resize(_, _) => continue 'outer,
|
||||||
// Ignore
|
// Ignore
|
||||||
|
|
Loading…
Reference in a new issue