java: remove KEYCODE_BACK as its not needed here and use != operator here

This one propably deserves an SDL Patch Upstream
This commit is contained in:
rafal1137 2021-04-14 01:19:07 +02:00
parent 42506bfe20
commit b908446c36
2 changed files with 2 additions and 8 deletions

View file

@ -490,12 +490,6 @@ public class ETLActivity extends SDLActivity implements JoyStickListener {
}
@Override
public void superOnBackPressed() {
super.superOnBackPressed();
mLayout.requestFocus();
}
@Override
protected String[] getLibraries() {
return new String[] {

View file

@ -2183,8 +2183,8 @@ class DummyEdit extends View implements View.OnKeyListener {
// FIXME: A more effective solution would be to assume our Layout to be RelativeLayout or LinearLayout
// FIXME: And determine the keyboard presence doing this: http://stackoverflow.com/questions/2150078/how-to-check-visibility-of-software-keyboard-in-android
// FIXME: An even more effective way would be if Android provided this out of the box, but where would the fun be in that :)
if (event.getAction()==KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK) {
if (SDLActivity.mTextEdit != null && SDLActivity.mTextEdit.getVisibility() == View.VISIBLE) {
if (event.getAction()==KeyEvent.ACTION_UP) {
if (SDLActivity.mTextEdit != null && SDLActivity.mTextEdit.getVisibility() != View.VISIBLE) {
SDLActivity.onNativeKeyboardFocusLost();
}
}