diff --git a/Source/Android/.idea/workspace.xml b/Source/Android/.idea/workspace.xml index 1a8e010c8e..140ae23672 100644 --- a/Source/Android/.idea/workspace.xml +++ b/Source/Android/.idea/workspace.xml @@ -54,6 +54,7 @@ + - @@ -103,7 +103,16 @@ - + + + + + + + + + + @@ -112,25 +121,16 @@ - + - - - - - - - - - - + - + @@ -171,10 +171,10 @@ @@ -182,8 +182,8 @@ - @@ -330,49 +330,38 @@ + + + + + + - - - - - - - - - - - - - - - - - - + - + + + + + + + + + + + + - + - - - - + + + + + - + - - - - + - - - - - - - - - - - - - - + + + - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - + + + + + + @@ -691,9 +691,7 @@ - - - + @@ -726,9 +724,7 @@ - - - + @@ -748,20 +744,6 @@ - - - - - - - - - - - - - - @@ -771,7 +753,21 @@ - + + + + + + + + + + + + + + + diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java b/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java index 1afeff417e..a34e803a45 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java @@ -204,7 +204,7 @@ public class DolphinEmulator extends Activity return false; } InputDevice input = event.getDevice(); - NativeLibrary.onGamePadEvent(input.getDescriptor(), event.getKeyCode(), action); + NativeLibrary.onGamePadEvent(InputConfigActivity.getInputDesc(input), event.getKeyCode(), action); return true; } return false; @@ -222,7 +222,7 @@ public class DolphinEmulator extends Activity { InputDevice.MotionRange range; range = motions.get(a); - NativeLibrary.onGamePadMoveEvent(input.getDescriptor(), range.getAxis(), event.getAxisValue(range.getAxis())); + NativeLibrary.onGamePadMoveEvent(InputConfigActivity.getInputDesc(input), range.getAxis(), event.getAxisValue(range.getAxis())); } return true; diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/InputConfigActivity.java b/Source/Android/src/org/dolphinemu/dolphinemu/InputConfigActivity.java index 6646865f03..607af71766 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/InputConfigActivity.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/InputConfigActivity.java @@ -3,6 +3,7 @@ package org.dolphinemu.dolphinemu; import android.app.Activity; import android.app.ListActivity; import android.content.Intent; +import android.os.Build; import android.os.Bundle; import android.util.Log; import android.view.InputDevice; @@ -26,6 +27,19 @@ public class InputConfigActivity extends ListActivity { boolean Configuring = false; boolean firstEvent = true; + static public String getInputDesc(InputDevice input) + { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) + return input.getDescriptor(); + else + { + List motions = input.getMotionRanges(); + String fakeid = ""; + for (InputDevice.MotionRange range : motions) + fakeid += range.getAxis(); + return fakeid; + } + } @Override public void onCreate(Bundle savedInstanceState) { @@ -124,12 +138,12 @@ public class InputConfigActivity extends ListActivity { range = motions.get(a); if (m_values.get(a) > (event.getAxisValue(range.getAxis()) + 0.5f)) { - AssignBind("Device '" + input.getDescriptor() + "'-Axis " + range.getAxis() + "-"); + AssignBind("Device '" + InputConfigActivity.getInputDesc(input) + "'-Axis " + range.getAxis() + "-"); Configuring = false; } else if (m_values.get(a) < (event.getAxisValue(range.getAxis()) - 0.5f)) { - AssignBind("Device '" + input.getDescriptor() + "'-Axis " + range.getAxis() + "+"); + AssignBind("Device '" + InputConfigActivity.getInputDesc(input) + "'-Axis " + range.getAxis() + "+"); Configuring = false; } } @@ -148,7 +162,7 @@ public class InputConfigActivity extends ListActivity { if (Configuring) { InputDevice input = event.getDevice(); - AssignBind("Device '" + input.getDescriptor() + "'-Button " + event.getKeyCode()); + AssignBind("Device '" + InputConfigActivity.getInputDesc(input) + "'-Button " + event.getKeyCode()); Configuring = false; return true; }