diff options
author | german77 <juangerman-13@hotmail.com> | 2023-11-26 01:22:03 +0100 |
---|---|---|
committer | german77 <juangerman-13@hotmail.com> | 2023-11-26 01:22:03 +0100 |
commit | de58618421fea6d8926bb4e8e4d66ddff0a6db9c (patch) | |
tree | 44bb507de2215c498de115967d598c8d4a0a7673 /src/android/app | |
parent | android: input: Flip abxy on redmagic controllers (diff) | |
download | yuzu-de58618421fea6d8926bb4e8e4d66ddff0a6db9c.tar yuzu-de58618421fea6d8926bb4e8e4d66ddff0a6db9c.tar.gz yuzu-de58618421fea6d8926bb4e8e4d66ddff0a6db9c.tar.bz2 yuzu-de58618421fea6d8926bb4e8e4d66ddff0a6db9c.tar.lz yuzu-de58618421fea6d8926bb4e8e4d66ddff0a6db9c.tar.xz yuzu-de58618421fea6d8926bb4e8e4d66ddff0a6db9c.tar.zst yuzu-de58618421fea6d8926bb4e8e4d66ddff0a6db9c.zip |
Diffstat (limited to 'src/android/app')
-rw-r--r-- | src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/InputHandler.kt | 19 |
1 files changed, 19 insertions, 0 deletions
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 a38822c94..e63382e1d 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 @@ -28,6 +28,7 @@ object InputHandler { 0x057E -> getInputJoyconButtonKey(event.keyCode) 0x1532 -> getInputRazerButtonKey(event.keyCode) 0x3537 -> getInputRedmagicButtonKey(event.keyCode) + 0x358A -> getInputBackboneLabsButtonKey(event.keyCode) else -> getInputGenericButtonKey(event.keyCode) } @@ -246,6 +247,24 @@ object InputHandler { } } + private fun getInputBackboneLabsButtonKey(key: Int): Int { + return when (key) { + KeyEvent.KEYCODE_BUTTON_A -> NativeLibrary.ButtonType.BUTTON_B + KeyEvent.KEYCODE_BUTTON_B -> NativeLibrary.ButtonType.BUTTON_A + KeyEvent.KEYCODE_BUTTON_X -> NativeLibrary.ButtonType.BUTTON_Y + KeyEvent.KEYCODE_BUTTON_Y -> NativeLibrary.ButtonType.BUTTON_X + KeyEvent.KEYCODE_BUTTON_L1 -> NativeLibrary.ButtonType.TRIGGER_L + KeyEvent.KEYCODE_BUTTON_R1 -> NativeLibrary.ButtonType.TRIGGER_R + KeyEvent.KEYCODE_BUTTON_L2 -> NativeLibrary.ButtonType.TRIGGER_ZL + KeyEvent.KEYCODE_BUTTON_R2 -> NativeLibrary.ButtonType.TRIGGER_ZR + KeyEvent.KEYCODE_BUTTON_THUMBL -> NativeLibrary.ButtonType.STICK_L + KeyEvent.KEYCODE_BUTTON_THUMBR -> NativeLibrary.ButtonType.STICK_R + KeyEvent.KEYCODE_BUTTON_START -> NativeLibrary.ButtonType.BUTTON_PLUS + KeyEvent.KEYCODE_BUTTON_SELECT -> NativeLibrary.ButtonType.BUTTON_MINUS + else -> -1 + } + } + private fun getInputGenericButtonKey(key: Int): Int { return when (key) { KeyEvent.KEYCODE_BUTTON_A -> NativeLibrary.ButtonType.BUTTON_A |