mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-22 18:59:59 +08:00
Implement key Delete in component > Input.
The BS key is used to delete the character on the left of the cursor. The DEL key is used to delete the character on the right of the cursor. BackSpace was already implemented. This CL implements DEL. This is related to bug: https://github.com/ArthurSonzogni/FTXUI/issues/4
This commit is contained in:
parent
32871fcc6b
commit
01ab335919
@ -52,6 +52,14 @@ bool Input::OnEvent(Event event) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Delete
|
||||
if (event == Event::Delete) {
|
||||
if (cursor_position == int(content.size()))
|
||||
return false;
|
||||
content.erase(cursor_position, 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Enter.
|
||||
if (event == Event::Return) {
|
||||
on_enter();
|
||||
|
Loading…
Reference in New Issue
Block a user