diff --git a/examples/hello.rs b/examples/hello.rs index ae9b11821..725618411 100644 --- a/examples/hello.rs +++ b/examples/hello.rs @@ -41,11 +41,18 @@ fn main() -> Result<(), Error> { match buf.terminal().poll_input(Blocking::Yes) { Ok(Some(input)) => match input { InputEvent::Key(KeyEvent { - key: KeyCode::Char('q'), + key: KeyCode::Escape, .. }) => { break; } + InputEvent::Key(KeyEvent { + key: KeyCode::Char(c), + .. + }) => { + buf.add_change(format!("{}", c)); + buf.flush()?; + } _ => { print!("{:?}\r\n", input); }