Synchronized the on-screen keyboard state with whether we are accepting text input.

The functions to show/hide/toggle the on-screen keyboard have been folded into the text input state.
Calling SDL_StartTextInput() will automatically show the on-screen keyboard if it's available.
Calling SDL_StopTextInput() will automatically hide the on-screen keyboard if it's available.
There is a new API function SDL_IsTextInputActive() which will return whether text input is currently active.
Text input is disabled by default, you must call SDL_StartTextInput() when you are ready to accept text input.
SDL_HasScreenKeyboardSupport() no longer needs to be passed a window.
The iPhone-specific on-screen keyboard functions have been removed.
This commit is contained in:
Sam Lantinga 2012-11-04 21:53:28 -08:00
parent 2228e50b28
commit e7b4458d8b
18 changed files with 97 additions and 219 deletions

View file

@ -291,7 +291,11 @@ main(int argc, char *argv[])
break;
case SDL_MOUSEBUTTONUP:
/* mouse up toggles onscreen keyboard visibility */
SDL_ToggleScreenKeyboard(window);
if (SDL_IsTextInputActive()) {
SDL_StopTextInput();
} else {
SDL_StartTextInput();
}
break;
}
}