Android: Fix game controller input being ignored

This commit is contained in:
Connor McLaughlin 2020-10-11 14:39:14 +10:00
parent 6716b8e8ba
commit 7775774761
1 changed files with 4 additions and 0 deletions

View File

@ -182,6 +182,8 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
mContentView = findViewById(R.id.fullscreen_content);
mContentView.getHolder().addCallback(this);
mContentView.setFocusable(true);
mContentView.requestFocus();
// Hook up controller input.
updateControllers();
@ -254,6 +256,8 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_FULLSCREEN |
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
if (mContentView != null)
mContentView.requestFocus();
}
private static final int REQUEST_CODE_SETTINGS = 0;