diff options
| author | JosJuice <josjuice@gmail.com> | 2021-08-14 15:03:54 +0200 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2023-03-03 22:28:23 +0100 |
| commit | 0150f521f740fc3b1a00d49b432edd0ed32e31d1 (patch) | |
| tree | 3137ffb582d8df58dd5b50bfe41d6f231db0a15d /Source/Android/app/src/main/java/org | |
| parent | 95ce41ac56f2774a1b18a1a1dafd2dadee248616 (diff) | |
ControllerInterface/Android: Rip out ButtonManager
ButtonManager is very different from how a normal input backend works,
and is making it hard for us to improve controller support on Android.
The following commits will add a new input backend in its place.
Diffstat (limited to 'Source/Android/app/src/main/java/org')
| -rw-r--r-- | Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/NativeLibrary.java | 2 | ||||
| -rw-r--r-- | Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java | 49 |
2 files changed, 5 insertions, 46 deletions
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/NativeLibrary.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/NativeLibrary.java index d6fc236771..abd5e8cc2c 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/NativeLibrary.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/NativeLibrary.java @@ -44,7 +44,7 @@ public final class NativeLibrary } /** - * Button type for use in onTouchEvent + * Button type, for legacy use only */ public static final class ButtonType { diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java index 808adbff26..fb839ed41a 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java @@ -894,21 +894,8 @@ public final class EmulationActivity extends AppCompatActivity implements ThemeP return super.dispatchKeyEvent(event); } - int action; - - switch (event.getAction()) - { - case KeyEvent.ACTION_DOWN: - action = NativeLibrary.ButtonState.PRESSED; - break; - case KeyEvent.ACTION_UP: - action = NativeLibrary.ButtonState.RELEASED; - break; - default: - return false; - } - InputDevice input = event.getDevice(); - return NativeLibrary.onGamePadEvent(input.getDescriptor(), event.getKeyCode(), action); + // TODO + return false; } private void toggleControls() @@ -1271,36 +1258,8 @@ public final class EmulationActivity extends AppCompatActivity implements ThemeP return false; } - if (((event.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) == 0)) - { - return super.dispatchGenericMotionEvent(event); - } - - // Don't attempt to do anything if we are disconnecting a device. - if (event.getActionMasked() == MotionEvent.ACTION_CANCEL) - return true; - - InputDevice input = event.getDevice(); - List<InputDevice.MotionRange> motions = input.getMotionRanges(); - - for (InputDevice.MotionRange range : motions) - { - int axis = range.getAxis(); - float origValue = event.getAxisValue(axis); - float value = ControllerMappingHelper.scaleAxis(input, axis, origValue); - // If the input is still in the "flat" area, that means it's really zero. - // This is used to compensate for imprecision in joysticks. - if (Math.abs(value) > range.getFlat()) - { - NativeLibrary.onGamePadMoveEvent(input.getDescriptor(), axis, value); - } - else - { - NativeLibrary.onGamePadMoveEvent(input.getDescriptor(), axis, 0.0f); - } - } - - return true; + // TODO + return false; } private void showSubMenu(SaveLoadStateFragment.SaveOrLoad saveOrLoad) |
