summaryrefslogtreecommitdiff
path: root/Source/Android/app/src/main/java
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2023-06-10 05:15:49 -0400
committerCharles Lombardo <clombardo169@gmail.com>2023-08-25 14:20:32 -0400
commit2590382871c0e4000577434fcfa79d7d7393200f (patch)
tree26d56ce75613743a7a0b403930b202101d5a0acf /Source/Android/app/src/main/java
parentf8ab65bcaca3d830ecb66ae21b327f4031484f7a (diff)
Android: Convert MappingCommon to Kotlin
Diffstat (limited to 'Source/Android/app/src/main/java')
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/MappingCommon.java34
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/MappingCommon.kt29
2 files changed, 29 insertions, 34 deletions
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/MappingCommon.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/MappingCommon.java
deleted file mode 100644
index 5e4c0076ea..0000000000
--- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/MappingCommon.java
+++ /dev/null
@@ -1,34 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-
-package org.dolphinemu.dolphinemu.features.input.model;
-
-import androidx.annotation.NonNull;
-
-import org.dolphinemu.dolphinemu.features.input.model.controlleremu.EmulatedController;
-
-public final class MappingCommon
-{
- private MappingCommon()
- {
- }
-
- /**
- * Waits until the user presses one or more inputs or until a timeout,
- * then returns the pressed inputs.
- *
- * When this is being called, a separate thread must be calling ControllerInterface's
- * dispatchKeyEvent and dispatchGenericMotionEvent, otherwise no inputs will be registered.
- *
- * @param controller The device to detect inputs from.
- * @param allDevices Whether to also detect inputs from devices other than the specified one.
- * @return The input(s) pressed by the user in the form of an InputCommon expression,
- * or an empty string if there were no inputs.
- */
- public static native String detectInput(@NonNull EmulatedController controller,
- boolean allDevices);
-
- public static native String getExpressionForControl(String control, String device,
- String defaultDevice);
-
- public static native void save();
-}
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/MappingCommon.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/MappingCommon.kt
new file mode 100644
index 0000000000..32775a7ebc
--- /dev/null
+++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/MappingCommon.kt
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+package org.dolphinemu.dolphinemu.features.input.model
+
+import org.dolphinemu.dolphinemu.features.input.model.controlleremu.EmulatedController
+
+object MappingCommon {
+ /**
+ * Waits until the user presses one or more inputs or until a timeout,
+ * then returns the pressed inputs.
+ *
+ * When this is being called, a separate thread must be calling ControllerInterface's
+ * dispatchKeyEvent and dispatchGenericMotionEvent, otherwise no inputs will be registered.
+ *
+ * @param controller The device to detect inputs from.
+ * @param allDevices Whether to also detect inputs from devices other than the specified one.
+ * @return The input(s) pressed by the user in the form of an InputCommon expression,
+ * or an empty string if there were no inputs.
+ */
+ external fun detectInput(controller: EmulatedController, allDevices: Boolean): String
+
+ external fun getExpressionForControl(
+ control: String,
+ device: String,
+ defaultDevice: String
+ ): String
+
+ external fun save()
+}