File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
pythonforandroid/bootstraps/sdl2/build/src
main/java/org/kivy/android Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -404,6 +404,16 @@ public void run() {
404404 }
405405 });
406406 }
407+
408+
409+ public void requestFocusForMainView () {
410+ runOnUiThread (new Runnable () {
411+ public void run () {
412+ Log .v (TAG , "requestFocusForMainView is getting focus now." );
413+ getSurface ().requestFocus ();
414+ }
415+ });
416+ }
407417
408418 public void removeLoadingScreen () {
409419 runOnUiThread (new Runnable () {
Original file line number Diff line number Diff line change 8181 SDLActivity.nativeRunMain(library, function, arguments);
8282
8383 Log.v("SDL", "Finished main function");
84+ @@ -1993,6 +2018,9 @@ class DummyEdit extends View implements View.OnKeyListener {
85+ if (event.getAction()==KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK) {
86+ if (SDLActivity.mTextEdit != null && SDLActivity.mTextEdit.getVisibility() == View.VISIBLE) {
87+ SDLActivity.onNativeKeyboardFocusLost();
88+ + // if targetSdkVersion >= 28, we explicitly need to give back focus
89+ + // see https://github.com/spesmilo/electrum/issues/6276
90+ + SDLActivity.mSurface.requestFocus();
91+ }
92+ }
93+ return super.onKeyPreIme(keyCode, event);
8494@@ -2002,7 +2028,7 @@
8595 public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
8696 ic = new SDLInputConnection(this, true);
You can’t perform that action at this time.
0 commit comments