From e18890ab0033583e67d0a81d185e93d4fbcb01f6 Mon Sep 17 00:00:00 2001 From: Luis Ferro Date: Tue, 12 Nov 2019 11:27:47 +0100 Subject: Add noecho to supress keys going to screen --- src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.rs b/src/main.rs index 4426a93..df82f42 100644 --- a/src/main.rs +++ b/src/main.rs @@ -87,6 +87,9 @@ fn main() { render_level(&window, &dungeon.levels[0]); + window.keypad(true); + noecho(); + loop { // update actors // update character -- cgit v1.2.3 From 1c2ffcff2371182c83ff411c27ce742a4b9432a8 Mon Sep 17 00:00:00 2001 From: Luis Ferro Date: Tue, 12 Nov 2019 11:32:24 +0100 Subject: The actual fix. --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index df82f42..49e8a8c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -98,12 +98,12 @@ fn main() { // get input and execute it match window.getch() { - Some(Input::Character('h')) => { window.addstr("DEL: quit\n"); }, + Some(Input::Character('h')) => { window.addstr("q: quit\n"); }, // Some(Input::KeyDown) => { window.addstr("down\n"); }, // Some(Input::KeyUp) => { window.addch('b'); }, // Some(Input::KeyLeft) => { window.addch('c'); }, // Some(Input::KeyRight) => { window.addch('d'); }, - Some(Input::KeyDC) => break, + Some(Input::Character('q')) => break, Some(_) => (), None => (), } -- cgit v1.2.3