textbox: delete key support
This commit is contained in:
@@ -365,6 +365,11 @@ void TextBox::keyPressed(int key) {
|
|||||||
caret--;
|
caret--;
|
||||||
validate();
|
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) {
|
} else if (key == keycode::ENTER) {
|
||||||
if (validate() && consumer) {
|
if (validate() && consumer) {
|
||||||
consumer(label->getText());
|
consumer(label->getText());
|
||||||
|
|||||||
Reference in New Issue
Block a user