Allow to delete a char in TextEdit with PAGE key

This commit is contained in:
Bertrand Songis
2021-03-26 19:15:45 +01:00
parent 6fbe5c4547
commit 40770e6044
+10
View File
@@ -204,6 +204,16 @@ void TextEdit::onEvent(event_t event)
killEvents(KEY_LEFT);
}
break;
case EVT_KEY_BREAK(KEY_PGDN):
memmove(&value[cursorPos], &value[cursorPos + 1], length - cursorPos - 1);
value[length - 1] = '\0';
changed = true;
if (cursorPos > 0 && value[cursorPos] == '\0') {
cursorPos = cursorPos - 1;
}
invalidate();
break;
}
if (c != v) {