Removes the character at the caret in the currently entered text */
| 269 | |
| 270 | /* Removes the character at the caret in the currently entered text */ |
| 271 | static 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 | |
| 282 | static cc_bool LInput_KeyDown(void* widget, int key, cc_bool was, struct InputDevice* device) { |
| 283 | struct LInput* w = (struct LInput*)widget; |
no test coverage detected