SDL: more fixes to async text input

This commit is contained in:
Sergii Pylypenko
2017-01-10 21:14:33 +02:00
parent a826416f74
commit 5887c3cc0d
4 changed files with 6 additions and 10 deletions

View File

@@ -791,7 +791,6 @@ public class MainActivity extends Activity
public void showScreenKeyboard(final String oldText)
{
Log.i("SDL", "showScreenKeyboard()");
if(Globals.CompatibilityHacksTextInputEmulatesHwKeyboard)
{
showScreenKeyboardWithoutTextInputField(Globals.TextInputKeyboard);
@@ -799,7 +798,6 @@ public class MainActivity extends Activity
}
if(_screenKeyboard != null)
return;
Log.i("SDL", "showScreenKeyboard() - adding keyboard view");
class simpleKeyListener implements OnKeyListener
{
MainActivity _parent;
@@ -819,7 +817,6 @@ public class MainActivity extends Activity
keyCode == KeyEvent.KEYCODE_BUTTON_3 ||
keyCode == KeyEvent.KEYCODE_BUTTON_4 ))
{
Log.i("SDL", "_parent.hideScreenKeyboard()");
_parent.hideScreenKeyboard();
return true;
}
@@ -907,7 +904,6 @@ public class MainActivity extends Activity
public void hideScreenKeyboard()
{
Log.i("SDL", "hideScreenKeyboard()");
if( keyboardWithoutTextInputShown )
showScreenKeyboardWithoutTextInputField(Globals.TextInputKeyboard);
@@ -922,7 +918,6 @@ public class MainActivity extends Activity
DemoRenderer.nativeTextInput( (int)text.charAt(i), (int)text.codePointAt(i) );
}
}
Log.i("SDL", "hideScreenKeyboard() nativeTextInputFinished()");
DemoRenderer.nativeTextInputFinished();
_inputManager.hideSoftInputFromWindow(_screenKeyboard.getWindowToken(), 0);
_videoLayout.removeView(_screenKeyboard);

View File

@@ -327,7 +327,7 @@ void SDL_ANDROID_CallJavaHideScreenKeyboard()
int SDL_ANDROID_IsScreenKeyboardShown()
{
return SDL_ANDROID_IsScreenKeyboardShownFlag;
return SDL_ANDROID_IsScreenKeyboardShownFlag || SDL_ANDROID_AsyncTextInputActive;
}
JNIEXPORT void JNICALL

View File

@@ -71,6 +71,7 @@ extern void SDL_ANDROID_CallJavaHideScreenKeyboard();
extern void SDL_ANDROID_CallJavaSetScreenKeyboardHintMessage(const char *hint);
extern int SDL_ANDROID_IsScreenKeyboardShown();
extern int SDL_ANDROID_IsScreenKeyboardShownFlag;
extern int SDL_ANDROID_AsyncTextInputActive;
extern int SDL_ANDROID_drawTouchscreenKeyboard();
extern void SDL_ANDROID_VideoContextLost();
extern void SDL_ANDROID_VideoContextRecreated();

View File

@@ -96,7 +96,7 @@ static int themeType = 0;
static int joystickTouchPoints[MAX_JOYSTICKS*2];
static int floatingScreenJoystick = 0;
static int asyncTextInputActive = 0;
int SDL_ANDROID_AsyncTextInputActive = 0;
static void R_DumpOpenGlState(void);
@@ -1249,12 +1249,12 @@ SDL_AndroidTextInputAsyncStatus_t SDLCALL SDL_ANDROID_GetScreenKeyboardTextInput
if( SDL_ANDROID_TextInputFinished )
{
SDL_ANDROID_TextInputFinished = 0;
asyncTextInputActive = 0;
SDL_ANDROID_AsyncTextInputActive = 0;
return SDL_ANDROID_TEXTINPUT_ASYNC_FINISHED;
}
if( !SDL_ANDROID_IsScreenKeyboardShownFlag && !asyncTextInputActive )
if( !SDL_ANDROID_IsScreenKeyboardShownFlag && !SDL_ANDROID_AsyncTextInputActive )
{
asyncTextInputActive = 1;
SDL_ANDROID_AsyncTextInputActive = 1;
SDL_ANDROID_CallJavaShowScreenKeyboard(textBuf, textBuf, textBufSize, 1);
}
return SDL_ANDROID_TEXTINPUT_ASYNC_IN_PROGRESS;