1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 19:13:07 +01:00

Merge pull request #2435 from samdroid-apps/ctrl-backspace-clear-inputs-try2

Implement CTRL-Backspace shortcut for clearing inputs, fixes #2355
This commit is contained in:
Ted John
2015-12-14 14:46:56 +00:00

View File

@@ -531,6 +531,17 @@ void platform_process_messages()
// Text input
// Clear the input on <CTRL>Backspace
if (gTextInput != NULL
&& e.key.keysym.sym == SDLK_BACKSPACE
&& e.key.keysym.mod & KMOD_CTRL) {
memset(gTextInput, '\0', gTextInputMaxLength);
gTextInputCursorPosition = 0;
gTextInputLength = 0;
console_refresh_caret();
window_update_textbox();
}
// If backspace and we have input text with a cursor position none zero
if (e.key.keysym.sym == SDLK_BACKSPACE && gTextInputLength > 0 && gTextInput != NULL && gTextInputCursorPosition) {
int dstIndex = gTextInputCursorPosition;