use ctrl+u to clear text from input
This commit is contained in:
@@ -440,7 +440,7 @@ string Window::GetString(const string &base, size_t length, size_t width, bool e
|
|||||||
input = wgetch(itsWindow);
|
input = wgetch(itsWindow);
|
||||||
|
|
||||||
// these key codes are special and should be ignored
|
// 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
|
# ifdef USE_PDCURSES
|
||||||
&& input != KEY_BACKSPACE)
|
&& input != KEY_BACKSPACE)
|
||||||
# else
|
# else
|
||||||
@@ -507,6 +507,11 @@ string Window::GetString(const string &base, size_t length, size_t width, bool e
|
|||||||
}
|
}
|
||||||
case 10:
|
case 10:
|
||||||
break;
|
break;
|
||||||
|
case 21: // CTRL+U
|
||||||
|
tmp.clear();
|
||||||
|
real_maxx = maxx = real_x = x = minx;
|
||||||
|
maxbeginning = beginning = 0;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
if (tmp.length() >= length)
|
if (tmp.length() >= length)
|
||||||
|
|||||||
Reference in New Issue
Block a user