mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 13:31:49 +00:00
textbox: delete key support
This commit is contained in:
parent
4abe775c5b
commit
c674bd4ec5
1 changed files with 5 additions and 0 deletions
|
|
@ -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());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue