summaryrefslogtreecommitdiffstats
path: root/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/input/model/NativeButton.kt
blob: c5ccd7115b0b34dfd1229b7ec28f9aca8004db4d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// SPDX-FileCopyrightText: 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

package org.yuzu.yuzu_emu.features.input.model

// Must match enum in src/common/settings_input.h
enum class NativeButton(val int: Int) {
    A(0),
    B(1),
    X(2),
    Y(3),
    LStick(4),
    RStick(5),
    L(6),
    R(7),
    ZL(8),
    ZR(9),
    Plus(10),
    Minus(11),

    DLeft(12),
    DUp(13),
    DRight(14),
    DDown(15),

    SLLeft(16),
    SRLeft(17),

    Home(18),
    Capture(19),

    SLRight(20),
    SRRight(21);

    companion object {
        fun from(int: Int): NativeButton = entries.firstOrNull { it.int == int } ?: A
    }
}