textbox: delete key support
This commit is contained in:
parent
4abe775c5b
commit
c674bd4ec5
@ -365,6 +365,11 @@ void TextBox::keyPressed(int key) {
|
||||
caret--;
|
||||
validate();
|
||||
}
|
||||
} else if (key == keycode::DELETE) {
|
||||
if (caret < input.length()) {
|
||||
input = input.substr(0, caret) + input.substr(caret + 1);
|
||||
validate();
|
||||
}
|
||||
} else if (key == keycode::ENTER) {
|
||||
if (validate() && consumer) {
|
||||
consumer(label->getText());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user