Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Philipp Wiesemann implemented a general on-screen keyboard API for SDL, and I switched iOS code over to use it.
This commit is contained in:
parent
5570852b58
commit
bf2304785f
19 changed files with 332 additions and 131 deletions
|
@ -171,6 +171,78 @@ extern DECLSPEC void SDLCALL SDL_StopTextInput(void);
|
|||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect);
|
||||
|
||||
/**
|
||||
* \brief Returns whether the platform has some screen keyboard support.
|
||||
*
|
||||
* \param window The window for which screen keyboard should be checked.
|
||||
*
|
||||
* \return SDL_TRUE if some keyboard support is available else SDL_FALSE.
|
||||
*
|
||||
* \note Not all screen keyboard functions are supported on all platforms.
|
||||
*
|
||||
* \sa SDL_ShowScreenKeyboard()
|
||||
* \sa SDL_HideScreenKeyboard()
|
||||
* \sa SDL_IsScreenKeyboardShown()
|
||||
* \sa SDL_ToggleScreenKeyboard()
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* \brief Requests to show a screen keyboard for given window.
|
||||
*
|
||||
* \param window The window for which screen keyboard should be shown.
|
||||
*
|
||||
* \return 0 if request will be processed or -1 on error (e.g. no support).
|
||||
*
|
||||
* \note Showing screen keyboards is asynchronous on some platforms.
|
||||
*
|
||||
* \sa SDL_HasScreenKeyboardSupport()
|
||||
* \sa SDL_HideScreenKeyboard()
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ShowScreenKeyboard(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* \brief Requests to hide a screen keyboard for given window.
|
||||
*
|
||||
* \param window The window for which screen keyboard should be shown.
|
||||
*
|
||||
* \return 0 if request will be processed or -1 on error (e.g. no support).
|
||||
*
|
||||
* \note Hiding screen keyboards is asynchronous on some platforms.
|
||||
*
|
||||
* \sa SDL_HasScreenKeyboardSupport()
|
||||
* \sa SDL_ShowScreenKeyboard()
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HideScreenKeyboard(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* \brief Requests to toggle a screen keyboard for given window.
|
||||
*
|
||||
* \param window The window for which screen keyboard should be toggled.
|
||||
*
|
||||
* \return 0 if request will be processed or -1 on error (e.g. no support).
|
||||
*
|
||||
* \note Showing and hiding screen keyboards is asynchronous on some platforms.
|
||||
*
|
||||
* \sa SDL_HasScreenKeyboardSupport()
|
||||
* \sa SDL_IsScreenKeyboardShown()
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ToggleScreenKeyboard(SDL_Window * window);
|
||||
|
||||
/**
|
||||
* \brief Returns whether the screen keyboard is shown for given window.
|
||||
*
|
||||
* \param window The window for which screen keyboard should be queried.
|
||||
*
|
||||
* \return SDL_TRUE if screen keyboard is shown else SDL_FALSE.
|
||||
*
|
||||
* \note May always return SDL_FALSE on some platforms (not implemented there).
|
||||
*
|
||||
* \sa SDL_HasScreenKeyboardSupport()
|
||||
* \sa SDL_ShowScreenKeyboard()
|
||||
* \sa SDL_HideScreenKeyboard()
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown(SDL_Window *window);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -30,6 +30,11 @@
|
|||
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
#if __IPHONEOS__
|
||||
#include "SDL_video.h"
|
||||
#include "SDL_keyboard.h"
|
||||
#endif
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
@ -40,15 +45,13 @@ extern "C" {
|
|||
|
||||
#if __IPHONEOS__
|
||||
|
||||
#include "SDL_video.h"
|
||||
|
||||
extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
|
||||
extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
|
||||
|
||||
extern DECLSPEC int SDLCALL SDL_iPhoneKeyboardShow(SDL_Window * window);
|
||||
extern DECLSPEC int SDLCALL SDL_iPhoneKeyboardHide(SDL_Window * window);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_iPhoneKeyboardIsShown(SDL_Window * window);
|
||||
extern DECLSPEC int SDLCALL SDL_iPhoneKeyboardToggle(SDL_Window * window);
|
||||
#define SDL_iPhoneKeyboardShow SDL_ShowScreenKeyboard
|
||||
#define SDL_iPhoneKeyboardHide SDL_HideScreenKeyboard
|
||||
#define SDL_iPhoneKeyboardToggle SDL_ToggleScreenKeyboard
|
||||
#define SDL_iPhoneKeyboardIsShown SDL_IsScreenKeyboardShown
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue