Skip to content

Commit

Permalink
Allow use keyboard by dpad or controller.
Browse files Browse the repository at this point in the history
  • Loading branch information
Serguncheouss authored and Karim Mreisi committed Jul 8, 2023
1 parent c1e4456 commit 87ccc69
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/src/main/java/com/limelight/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ protected void onCreate(Bundle savedInstanceState) {
// Inflate the content
setContentView(R.layout.activity_game);

// Hack: allows use keyboard by dpad or controller
getWindow().getDecorView().findViewById(android.R.id.content).setFocusable(true);

// Start the spinner
spinner = SpinnerDialog.displayDialog(this, getResources().getString(R.string.conn_establishing_title),
getResources().getString(R.string.conn_establishing_msg), true);
Expand Down Expand Up @@ -1463,6 +1466,10 @@ private TouchContext getTouchContext(int actionIndex)
@Override
public void toggleKeyboard() {
LimeLog.info("Toggling keyboard overlay");

// Hack: allows use keyboard by dpad or controller
streamView.clearFocus();

InputMethodManager inputManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.toggleSoftInput(0, 0);
}
Expand Down

0 comments on commit 87ccc69

Please sign in to comment.