Allow backspace or delete to clear the contents of an input box.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2574
This commit is contained in:
parent
9963de836f
commit
daa0897ec9
1 changed files with 9 additions and 0 deletions
|
|
@ -216,6 +216,15 @@ static int TXT_InputBoxKeyPress(TXT_UNCAST_ARG(inputbox), int key)
|
|||
return 1;
|
||||
}
|
||||
|
||||
// Backspace or delete erases the contents of the box.
|
||||
|
||||
if ((key == KEY_DEL || key == KEY_BACKSPACE)
|
||||
&& inputbox->widget.widget_class == &txt_inputbox_class)
|
||||
{
|
||||
free(*((char **)inputbox->value));
|
||||
*((char **) inputbox->value) = strdup("");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue