From bf71a01b1cfab1c48d75ae659508d652549e7ab9 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sun, 22 Mar 2009 15:14:12 +0100 Subject: [PATCH] ignore keycodes <10 || >10 && <32 in Window::GetString() --- src/window.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/window.cpp b/src/window.cpp index 8c48c188..9b691493 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -423,6 +423,10 @@ string Window::GetString(const string &base, size_t length, size_t width, bool e prefresh(itsWindow, 0, 0, itsStartY, itsStartX, itsStartY+itsHeight-1, itsStartX+itsWidth-1); input = wgetch(itsWindow); + // these key codes are special and should be ignored + if (input < 10 || (input > 10 && input < 32)) + continue; + switch (input) { case ERR: