summaryrefslogtreecommitdiffstats
path: root/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/input/model/ButtonName.kt
blob: b8846ecad99a9ceaa35de81247d9c2b78d7adc85 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// SPDX-FileCopyrightText: 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

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

// Loosely matches the enum in common/input.h
enum class ButtonName(val int: Int) {
    Invalid(1),

    // This will display the engine name instead of the button name
    Engine(2),

    // This will display the button by value instead of the button name
    Value(3);

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