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

@ -80,14 +80,12 @@ Notes -- Keyboard
The SDL keyboard API has been extended to support on-screen keyboards:
int SDL_ShowScreenKeyboard(SDL_Window * window)
-- reveals the onscreen keyboard. Returns 0 on success and -1 on error.
int SDL_HideScreenKeyboard(SDL_Window * window)
-- hides the onscreen keyboard. Returns 0 on success and -1 on error.
SDL_bool SDL_IsScreenKeyboardShown(SDL_Window * window)
-- returns whether or not the onscreen keyboard is currently visible.
int SDL_ToggleScreenKeyboard(SDL_Window * window)
-- toggles the visibility of the onscreen keyboard. Returns 0 on success and -1 on error.
void SDL_StartTextInput()
-- enables text events and reveals the onscreen keyboard.
void SDL_StopTextInput()
-- disables text events and hides the onscreen keyboard.
SDL_bool SDL_IsTextInputActive()
-- returns whether or not text events are enabled (and the onscreen keyboard is visible)
==============================================================================
Notes -- Reading and Writing files