From f92b0101aa7b4aed8da616daf267ee4f9fc8b305 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Thu, 7 May 2009 00:41:48 +0200 Subject: [PATCH] use ctrl+u to clear text from input --- src/window.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/window.cpp b/src/window.cpp index 8024f32c..934fa6ed 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -440,7 +440,7 @@ string Window::GetString(const string &base, size_t length, size_t width, bool e input = wgetch(itsWindow); // these key codes are special and should be ignored - if ((input < 10 || (input > 10 && input < 32)) + if ((input < 10 || (input > 10 && input != 21 && input < 32)) # ifdef USE_PDCURSES && input != KEY_BACKSPACE) # else @@ -507,6 +507,11 @@ string Window::GetString(const string &base, size_t length, size_t width, bool e } case 10: break; + case 21: // CTRL+U + tmp.clear(); + real_maxx = maxx = real_x = x = minx; + maxbeginning = beginning = 0; + break; default: { if (tmp.length() >= length)