Fixed Return key not sent in the SDL_ANDROID text input
This commit is contained in:
2
bugs.txt
2
bugs.txt
@@ -9,8 +9,6 @@ Known bugs
|
|||||||
|
|
||||||
- SDL_FillRect() does not work in SDL 1.2 HW mode.
|
- SDL_FillRect() does not work in SDL 1.2 HW mode.
|
||||||
|
|
||||||
- Return key does not work for text input (worked before, regression).
|
|
||||||
|
|
||||||
Requested features
|
Requested features
|
||||||
==================
|
==================
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ RedefinedKeys="SPACE"
|
|||||||
AppTouchscreenKeyboardKeysAmount=0
|
AppTouchscreenKeyboardKeysAmount=0
|
||||||
AppTouchscreenKeyboardKeysAmountAutoFire=0
|
AppTouchscreenKeyboardKeysAmountAutoFire=0
|
||||||
RedefinedKeysScreenKb="1 2 3 4 5 6 1 2 3 4"
|
RedefinedKeysScreenKb="1 2 3 4 5 6 1 2 3 4"
|
||||||
|
StartupMenuButtonTimeout=3000
|
||||||
|
HiddenMenuOptions=''
|
||||||
MultiABI=y
|
MultiABI=y
|
||||||
AppVersionCode=101
|
AppVersionCode=101
|
||||||
AppVersionName="1.01"
|
AppVersionName="1.01"
|
||||||
|
|||||||
@@ -509,12 +509,12 @@ int main(int argc, char* argv[])
|
|||||||
SDL_Event evt;
|
SDL_Event evt;
|
||||||
while( SDL_PollEvent(&evt) )
|
while( SDL_PollEvent(&evt) )
|
||||||
{
|
{
|
||||||
if(evt.type & (SDL_KEYUP | SDL_KEYDOWN))
|
if(evt.type == SDL_KEYUP || evt.type == SDL_KEYDOWN)
|
||||||
{
|
{
|
||||||
Uint8 *keys = SDL_GetKeyState(&i);
|
Uint8 *keys = SDL_GetKeyState(&i);
|
||||||
if(keys[SDLK_ESCAPE])
|
if(keys[SDLK_ESCAPE])
|
||||||
return 0;
|
return 0;
|
||||||
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "SDL key event: state %d key %d mod %d unicode %d", evt.key.state, (int)evt.key.keysym.sym, (int)evt.key.keysym.mod, (int)evt.key.keysym.unicode);
|
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "SDL key event: evt %s state %s key %d RETURN %d mod %d unicode %d", evt.type == SDL_KEYUP ? "UP " : "DOWN" , evt.key.state == SDL_PRESSED ? "PRESSED " : "RELEASED", (int)evt.key.keysym.sym, int(evt.key.keysym.sym == SDLK_RETURN), (int)evt.key.keysym.mod, (int)evt.key.keysym.unicode);
|
||||||
}
|
}
|
||||||
if(evt.type == SDL_VIDEORESIZE)
|
if(evt.type == SDL_VIDEORESIZE)
|
||||||
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "SDL resize event: %d x %d", evt.resize.w, evt.resize.h);
|
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "SDL resize event: %d x %d", evt.resize.w, evt.resize.h);
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ RedefinedKeysScreenKb="LCTRL M T H E C SPACE C S L"
|
|||||||
StartupMenuButtonTimeout=3000
|
StartupMenuButtonTimeout=3000
|
||||||
HiddenMenuOptions='KeyboardConfigMainMenu ScreenKeyboardThemeConfig ScreenKeyboardTransparencyConfig'
|
HiddenMenuOptions='KeyboardConfigMainMenu ScreenKeyboardThemeConfig ScreenKeyboardTransparencyConfig'
|
||||||
MultiABI=n
|
MultiABI=n
|
||||||
AppVersionCode=235014
|
AppVersionCode=235815
|
||||||
AppVersionName="2350.14"
|
AppVersionName="2358.15"
|
||||||
CompiledLibraries="sdl_net sdl_mixer sdl_image sdl_ttf png intl"
|
CompiledLibraries="sdl_net sdl_mixer sdl_image sdl_ttf png intl"
|
||||||
CustomBuildScript=n
|
CustomBuildScript=n
|
||||||
AppCflags='-finline-functions -O2 -DWITH_ZLIB -DWITH_MIXER -DWITH_XML -DWITH_IMAGE -DWITH_TTF -DWITH_AI=simple -DWITH_NET'
|
AppCflags='-finline-functions -O2 -DWITH_ZLIB -DWITH_MIXER -DWITH_XML -DWITH_IMAGE -DWITH_TTF -DWITH_AI=simple -DWITH_NET'
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
ufoai
|
ballfield
|
||||||
@@ -696,6 +696,8 @@ void SDL_ANDROID_TextInputInit(char * buffer, int len)
|
|||||||
JNIEXPORT void JNICALL
|
JNIEXPORT void JNICALL
|
||||||
JAVA_EXPORT_NAME(DemoRenderer_nativeTextInput) ( JNIEnv* env, jobject thiz, jint ascii, jint unicode )
|
JAVA_EXPORT_NAME(DemoRenderer_nativeTextInput) ( JNIEnv* env, jobject thiz, jint ascii, jint unicode )
|
||||||
{
|
{
|
||||||
|
if( ascii == 10 )
|
||||||
|
ascii = SDLK_RETURN;
|
||||||
if( !textInputBuffer )
|
if( !textInputBuffer )
|
||||||
SDL_ANDROID_MainThreadPushText(ascii, unicode);
|
SDL_ANDROID_MainThreadPushText(ascii, unicode);
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user