Fix examples on windows (#775)
This commit is contained in:
parent
03c25178af
commit
923aaf517b
@ -2,6 +2,7 @@
|
||||
|
||||
use std::io::{self, Write};
|
||||
|
||||
use crossterm::event::KeyEventKind;
|
||||
pub use crossterm::{
|
||||
cursor,
|
||||
event::{self, Event, KeyCode, KeyEvent},
|
||||
@ -61,7 +62,10 @@ where
|
||||
'3' => test::attribute::run(w)?,
|
||||
'4' => test::event::run(w)?,
|
||||
'5' => test::synchronized_output::run(w)?,
|
||||
'q' => break,
|
||||
'q' => {
|
||||
execute!(w, cursor::SetCursorStyle::DefaultUserShape).unwrap();
|
||||
break;
|
||||
}
|
||||
_ => {}
|
||||
};
|
||||
}
|
||||
@ -80,7 +84,9 @@ pub fn read_char() -> Result<char> {
|
||||
loop {
|
||||
if let Ok(Event::Key(KeyEvent {
|
||||
code: KeyCode::Char(c),
|
||||
..
|
||||
kind: KeyEventKind::Press,
|
||||
modifiers: _,
|
||||
state: _,
|
||||
})) = event::read()
|
||||
{
|
||||
return Ok(c);
|
||||
|
Loading…
Reference in New Issue
Block a user