MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / LInput_Delete

Function LInput_Delete

src/LWidgets.c:271–280  ·  view source on GitHub ↗

Removes the character at the caret in the currently entered text */

Source from the content-addressed store, hash-verified

269
270/* Removes the character at the caret in the currently entered text */
271static void LInput_Delete(struct LInput* w) {
272 if (!w->text.length || w->caretPos == -1) return;
273
274 String_DeleteAt(&w->text, w->caretPos);
275 if (w->caretPos == -1) w->caretPos = 0;
276
277 if (w->TextChanged) w->TextChanged(w);
278 LInput_ClampCaret(w);
279 LBackend_InputUpdate(w);
280}
281
282static cc_bool LInput_KeyDown(void* widget, int key, cc_bool was, struct InputDevice* device) {
283 struct LInput* w = (struct LInput*)widget;

Callers 1

LInput_KeyDownFunction · 0.85

Calls 3

String_DeleteAtFunction · 0.85
LInput_ClampCaretFunction · 0.85
LBackend_InputUpdateFunction · 0.70

Tested by

no test coverage detected