Add android support

This commit is contained in:
Andy Klimczak 2025-09-21 00:35:15 -04:00 committed by OpenSauce
parent 4d31469062
commit 21a20b4bd6
5 changed files with 13 additions and 5 deletions

View File

@ -805,7 +805,6 @@ object NativeLibrary {
const val BUTTON_GPIO14 = 782
const val BUTTON_TURBO = 783
const val BUTTON_SWAP = 800
const val BUTTON_TURBO = 801
}
/**

View File

@ -20,6 +20,11 @@ class HotkeyUtility(
var HotkeyIsPressed = false
fun handleHotkey(bindedButton: Int): Boolean {
if (bindedButton == NativeLibrary.ButtonType.BUTTON_TURBO) {
TurboHelper.toggleTurbo(true)
HotkeyIsPressed = true
return true
}
if(hotkeyButtons.contains(bindedButton)) {
when (bindedButton) {
Hotkey.SWAP_SCREEN.button -> screenAdjustmentUtil.swapScreen()

View File

@ -121,6 +121,7 @@ class Settings {
const val KEY_BUTTON_SELECT = "button_select"
const val KEY_BUTTON_START = "button_start"
const val KEY_BUTTON_HOME = "button_home"
const val KEY_BUTTON_TURBO = "button_turbo"
const val KEY_BUTTON_UP = "button_up"
const val KEY_BUTTON_DOWN = "button_down"
const val KEY_BUTTON_LEFT = "button_left"
@ -150,7 +151,8 @@ class Settings {
KEY_BUTTON_Y,
KEY_BUTTON_SELECT,
KEY_BUTTON_START,
KEY_BUTTON_HOME
KEY_BUTTON_HOME,
KEY_BUTTON_TURBO
)
val buttonTitles = listOf(
R.string.button_a,
@ -159,7 +161,8 @@ class Settings {
R.string.button_y,
R.string.button_select,
R.string.button_start,
R.string.button_home
R.string.button_home,
R.string.button_turbo
)
val circlePadKeys = listOf(
KEY_CIRCLEPAD_AXIS_VERTICAL,
@ -245,4 +248,4 @@ class Settings {
)
}
}
}
}

View File

@ -123,6 +123,7 @@ class InputBindingSetting(
Settings.KEY_BUTTON_SELECT -> NativeLibrary.ButtonType.BUTTON_SELECT
Settings.KEY_BUTTON_START -> NativeLibrary.ButtonType.BUTTON_START
Settings.KEY_BUTTON_HOME -> NativeLibrary.ButtonType.BUTTON_HOME
Settings.KEY_BUTTON_TURBO -> NativeLibrary.ButtonType.BUTTON_TURBO
Settings.KEY_BUTTON_UP -> NativeLibrary.ButtonType.DPAD_UP
Settings.KEY_BUTTON_DOWN -> NativeLibrary.ButtonType.DPAD_DOWN
Settings.KEY_BUTTON_LEFT -> NativeLibrary.ButtonType.DPAD_LEFT

View File

@ -39,7 +39,7 @@ enum ButtonType {
N3DS_TRIGGER_L = 773,
N3DS_TRIGGER_R = 774,
N3DS_BUTTON_DEBUG = 781,
N3DS_BUTTON_GPIO14 = 782
N3DS_BUTTON_GPIO14 = 782,
N3DS_BUTTON_TURBO = 783
};