if (keyCode == Keyboard.KeyCode.DELETE && textInput.isEditable()) {
int index = textInput.getSelectionStart();
if (index < textInput.getCharacterCount()) {
int count = Math.max(textInput.getSelectionLength(), 1);
textInput.removeText(index, count);
consumed = true;
}
} else if (keyCode == Keyboard.KeyCode.BACKSPACE && textInput.isEditable()) {
int index = textInput.getSelectionStart();