diff --git a/shell/android/src/com/reicast/emulator/GL2JNIActivity.java b/shell/android/src/com/reicast/emulator/GL2JNIActivity.java index b180bea4e..cea32c99c 100644 --- a/shell/android/src/com/reicast/emulator/GL2JNIActivity.java +++ b/shell/android/src/com/reicast/emulator/GL2JNIActivity.java @@ -150,11 +150,7 @@ public class GL2JNIActivity extends Activity { String id = pad.portId[playerNum]; pad.custom[playerNum] = prefs.getBoolean(Gamepad.pref_js_modified + id, false); pad.compat[playerNum] = prefs.getBoolean(Gamepad.pref_js_compat + id, false); - if (pad.custom[playerNum] || pad.compat[playerNum]) { - pad.joystick[playerNum] = prefs.getBoolean(Gamepad.pref_js_separate + id, false); - } else { - pad.joystick[playerNum] = true; - } + pad.joystick[playerNum] = prefs.getBoolean(Gamepad.pref_js_merged + id, false); if (InputDevice.getDevice(joy).getName() .contains(Gamepad.controllers_gamekey)) { if (pad.custom[playerNum]) { diff --git a/shell/android/src/com/reicast/emulator/GL2JNINative.java b/shell/android/src/com/reicast/emulator/GL2JNINative.java index 8d69f40cc..b48de67d4 100644 --- a/shell/android/src/com/reicast/emulator/GL2JNINative.java +++ b/shell/android/src/com/reicast/emulator/GL2JNINative.java @@ -162,11 +162,7 @@ public class GL2JNINative extends NativeActivity { String id = pad.portId[playerNum]; pad.custom[playerNum] = prefs.getBoolean(Gamepad.pref_js_modified + id, false); pad.compat[playerNum] = prefs.getBoolean(Gamepad.pref_js_compat + id, false); - if (pad.custom[playerNum] || pad.compat[playerNum]) { - pad.joystick[playerNum] = prefs.getBoolean(Gamepad.pref_js_separate + id, false); - } else { - pad.joystick[playerNum] = true; - } + pad.joystick[playerNum] = prefs.getBoolean(Gamepad.pref_js_merged + id, false); if (InputDevice.getDevice(joy).getName() .contains(Gamepad.controllers_gamekey)) { // if (pad.custom[playerNum]) { diff --git a/shell/android/src/com/reicast/emulator/config/InputModFragment.java b/shell/android/src/com/reicast/emulator/config/InputModFragment.java index aa75564fc..2a4d131bd 100644 --- a/shell/android/src/com/reicast/emulator/config/InputModFragment.java +++ b/shell/android/src/com/reicast/emulator/config/InputModFragment.java @@ -105,7 +105,7 @@ public class InputModFragment extends Fragment { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { mPrefs.edit() - .putBoolean(Gamepad.pref_js_separate + player, + .putBoolean(Gamepad.pref_js_merged + player, isChecked).commit(); } }; @@ -118,11 +118,6 @@ public class InputModFragment extends Fragment { mPrefs.edit() .putBoolean(Gamepad.pref_js_modified + player, isChecked).commit(); - if (isChecked) { - switchJoystickDpadEnabled.setEnabled(true); - } else if (!switchCompatibilityEnabled.isChecked()) { - switchJoystickDpadEnabled.setEnabled(false); - } } }; @@ -576,7 +571,7 @@ public class InputModFragment extends Fragment { private void updateController(String player) { switchJoystickDpadEnabled.setChecked(mPrefs.getBoolean( - Gamepad.pref_js_separate + player, false)); + Gamepad.pref_js_merged + player, false)); switchModifiedLayoutEnabled.setChecked(mPrefs.getBoolean( Gamepad.pref_js_modified + player, false)); switchCompatibilityEnabled.setChecked(mPrefs.getBoolean( diff --git a/shell/android/src/com/reicast/emulator/emu/GL2JNIView.java b/shell/android/src/com/reicast/emulator/emu/GL2JNIView.java index 45c4f9480..dfaf026d3 100644 --- a/shell/android/src/com/reicast/emulator/emu/GL2JNIView.java +++ b/shell/android/src/com/reicast/emulator/emu/GL2JNIView.java @@ -122,6 +122,7 @@ public class GL2JNIView extends GLSurfaceView SYSTEM_UI_FLAG_IMMERSIVE_STICKY | SYSTEM_UI_FLAG_FULLSCREEN | SYSTEM_UI_FLAG_HIDE_NAVIGATION); + requestLayout(); } } }); @@ -741,7 +742,9 @@ public class GL2JNIView extends GLSurfaceView | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN - | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);} + | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); + requestLayout(); + } } private boolean takeScreenshot = false; diff --git a/shell/android/src/com/reicast/emulator/periph/Gamepad.java b/shell/android/src/com/reicast/emulator/periph/Gamepad.java index 02a81eff5..116c43f5e 100644 --- a/shell/android/src/com/reicast/emulator/periph/Gamepad.java +++ b/shell/android/src/com/reicast/emulator/periph/Gamepad.java @@ -21,7 +21,7 @@ public class Gamepad { public static final String pref_js_modified = "modified_key_layout"; public static final String pref_js_compat = "controller_compat"; - public static final String pref_js_separate = "separate_joystick"; + public static final String pref_js_merged = "merged_joystick"; public static final String pref_js_rbuttons = "right_buttons"; public static final String pref_button_a = "a_button"; @@ -226,7 +226,7 @@ public class Gamepad { for (int n = 0; n < 4; n++) { if (compat[n]) { String id = portId[n]; - joystick[n] = prefs.getBoolean(Gamepad.pref_js_separate + id, false); + joystick[n] = prefs.getBoolean(Gamepad.pref_js_merged + id, false); getCompatibilityMap(n, portId[n], prefs); initJoyStickLayout(n); } diff --git a/shell/android/src/com/reicast/emulator/periph/MOGAInput.java b/shell/android/src/com/reicast/emulator/periph/MOGAInput.java index 5ad99674e..5023f9fae 100644 --- a/shell/android/src/com/reicast/emulator/periph/MOGAInput.java +++ b/shell/android/src/com/reicast/emulator/periph/MOGAInput.java @@ -6,15 +6,18 @@ package com.reicast.emulator.periph; import java.util.Arrays; import android.app.Activity; +import android.app.Instrumentation; +import android.content.Context; import android.content.SharedPreferences; import android.os.Build; import android.os.Handler; +import android.os.SystemClock; import android.preference.PreferenceManager; import android.util.Log; +import com.bda.controller.KeyEvent; import com.bda.controller.Controller; import com.bda.controller.ControllerListener; -import com.bda.controller.KeyEvent; import com.bda.controller.MotionEvent; import com.bda.controller.StateEvent; import com.reicast.emulator.R; @@ -131,11 +134,14 @@ public final class MOGAInput public void onKeyEvent(KeyEvent event) { // Handled by the primary controller interface +// act.dispatchKeyEvent(new android.view.KeyEvent(0, 0, event.getAction(), +// event.getKeyCode(), 0)); } public void onMotionEvent(MotionEvent event) { // Handled by the primary controller interface + } private void getCompatibilityMap(int playerNum, String id) {