We can't check for the screen keyboard in the event code because the video system isn't fully initialized yet.
This commit is contained in:
parent
9144abbf82
commit
eda1373611
2 changed files with 18 additions and 6 deletions
|
@ -125,14 +125,10 @@ SDL_StartEventLoop(void)
|
||||||
|
|
||||||
/* No filter to start with, process most event types */
|
/* No filter to start with, process most event types */
|
||||||
SDL_EventOK = NULL;
|
SDL_EventOK = NULL;
|
||||||
|
SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE);
|
||||||
|
SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE);
|
||||||
SDL_EventState(SDL_SYSWMEVENT, SDL_DISABLE);
|
SDL_EventState(SDL_SYSWMEVENT, SDL_DISABLE);
|
||||||
|
|
||||||
/* If text input shows UI onscreen we want to start with it disabled */
|
|
||||||
if (SDL_HasScreenKeyboardSupport()) {
|
|
||||||
SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE);
|
|
||||||
SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Create the lock and set ourselves active */
|
/* Create the lock and set ourselves active */
|
||||||
#if !SDL_THREADS_DISABLED
|
#if !SDL_THREADS_DISABLED
|
||||||
if (!SDL_EventQ.lock) {
|
if (!SDL_EventQ.lock) {
|
||||||
|
|
|
@ -522,6 +522,17 @@ SDL_VideoInit(const char *driver_name)
|
||||||
_this->DestroyWindowFramebuffer = SDL_DestroyWindowTexture;
|
_this->DestroyWindowFramebuffer = SDL_DestroyWindowTexture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If we don't use a screen keyboard, turn on text input by default,
|
||||||
|
otherwise programs that expect to get text events without enabling
|
||||||
|
UNICODE input won't get any events.
|
||||||
|
|
||||||
|
Actually, come to think of it, you needed to call SDL_EnableUNICODE(1)
|
||||||
|
in SDL 1.2 before you got text input events. Hmm...
|
||||||
|
*/
|
||||||
|
if (!SDL_HasScreenKeyboardSupport()) {
|
||||||
|
SDL_StartTextInput();
|
||||||
|
}
|
||||||
|
|
||||||
/* We're ready to go! */
|
/* We're ready to go! */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -2831,7 +2842,12 @@ SDL_HasScreenKeyboardSupport(void)
|
||||||
if (_this && _this->SDL_HasScreenKeyboardSupport) {
|
if (_this && _this->SDL_HasScreenKeyboardSupport) {
|
||||||
return _this->SDL_HasScreenKeyboardSupport(_this);
|
return _this->SDL_HasScreenKeyboardSupport(_this);
|
||||||
}
|
}
|
||||||
|
/* FIXME: The event system queries this before we initialize our video driver */
|
||||||
|
#if __IPHONEOS__ || __ANDROID__
|
||||||
|
return SDL_TRUE;
|
||||||
|
#else
|
||||||
return SDL_FALSE;
|
return SDL_FALSE;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_bool
|
SDL_bool
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue