mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +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--;
|
||||
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…
Add table
Add a link
Reference in a new issue