| 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; |
| 284 | if (key == CCKEY_BACKSPACE) { |
| 285 | LInput_Backspace(w); |
| 286 | } else if (key == CCKEY_DELETE) { |
| 287 | LInput_Delete(w); |
| 288 | } else if (key == INPUT_CLIPBOARD_COPY) { |
| 289 | if (w->text.length) Clipboard_SetText(&w->text); |
| 290 | } else if (key == INPUT_CLIPBOARD_PASTE) { |
| 291 | LInput_CopyFromClipboard(w); |
| 292 | } else if (key == device->escapeButton) { |
| 293 | if (w->text.length) LInput_SetString(w, &String_Empty); |
| 294 | } else if (key == device->leftButton) { |
| 295 | LInput_AdvanceCaretPos(w, false); |
| 296 | } else if (key == device->rightButton) { |
| 297 | LInput_AdvanceCaretPos(w, true); |
| 298 | } else { return false; } |
| 299 | |
| 300 | return true; |
| 301 | } |
| 302 | |
| 303 | static cc_bool LInput_CanAppend(struct LInput* w, char c) { |
| 304 | switch (w->inputType) { |
nothing calls this directly
no test coverage detected