summaryrefslogtreecommitdiffstats
path: root/src/android/app
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2023-10-30 06:09:14 +0100
committerCharles Lombardo <clombardo169@gmail.com>2023-10-30 06:20:27 +0100
commit70be45c992218469f6884516f9f22e373cd0c3b1 (patch)
tree7f0a1ae9a91503bc2c2fdb9b427cfd67e695b961 /src/android/app
parentandroid: Removed unused ControllerMappingHelper (diff)
downloadyuzu-70be45c992218469f6884516f9f22e373cd0c3b1.tar
yuzu-70be45c992218469f6884516f9f22e373cd0c3b1.tar.gz
yuzu-70be45c992218469f6884516f9f22e373cd0c3b1.tar.bz2
yuzu-70be45c992218469f6884516f9f22e373cd0c3b1.tar.lz
yuzu-70be45c992218469f6884516f9f22e373cd0c3b1.tar.xz
yuzu-70be45c992218469f6884516f9f22e373cd0c3b1.tar.zst
yuzu-70be45c992218469f6884516f9f22e373cd0c3b1.zip
Diffstat (limited to 'src/android/app')
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt8
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt2
2 files changed, 4 insertions, 6 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt
index 7464647c4..0eda27f7d 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt
@@ -58,7 +58,6 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener {
var isActivityRecreated = false
private lateinit var nfcReader: NfcReader
- private lateinit var inputHandler: InputHandler
private val gyro = FloatArray(3)
private val accel = FloatArray(3)
@@ -100,8 +99,7 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener {
nfcReader = NfcReader(this)
nfcReader.initialize()
- inputHandler = InputHandler()
- inputHandler.initialize()
+ InputHandler.initialize()
val preferences = PreferenceManager.getDefaultSharedPreferences(YuzuApplication.appContext)
if (!preferences.getBoolean(Settings.PREF_MEMORY_WARNING_SHOWN, false)) {
@@ -190,7 +188,7 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener {
return super.dispatchKeyEvent(event)
}
- return inputHandler.dispatchKeyEvent(event)
+ return InputHandler.dispatchKeyEvent(event)
}
override fun dispatchGenericMotionEvent(event: MotionEvent): Boolean {
@@ -205,7 +203,7 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener {
return true
}
- return inputHandler.dispatchGenericMotionEvent(event)
+ return InputHandler.dispatchGenericMotionEvent(event)
}
override fun onSensorChanged(event: SensorEvent) {
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt
index e963dfbc1..fec40e27d 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt
@@ -8,7 +8,7 @@ import android.view.MotionEvent
import kotlin.math.sqrt
import org.yuzu.yuzu_emu.NativeLibrary
-class InputHandler {
+object InputHandler {
fun initialize() {
// Connect first controller
NativeLibrary.onGamePadConnectEvent(getPlayerNumber(NativeLibrary.Player1Device))