mirror of
https://github.com/citra-emu/citra.git
synced 2025-07-05 04:11:04 +00:00
37 lines
787 B
C++
37 lines
787 B
C++
// Copyright 2014 Citra Emulator Project
|
|
// Licensed under GPLv2 or any later version
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include <map>
|
|
|
|
#include <QLineEdit>
|
|
|
|
class QKeyEvent;
|
|
|
|
/// An enum for the buttons on the 3DS
|
|
enum Button {
|
|
A, B, X, Y, L, R, ZL, ZR,
|
|
DUp, DDown, DLeft, DRight,
|
|
SUp, SDown, SLeft, SRight,
|
|
CUp, CDown, CLeft, CRight,
|
|
Start, Select, Home
|
|
};
|
|
|
|
/// Map a button to its name
|
|
extern std::map<Button, std::string> ButtonNameMap;
|
|
|
|
/// The LineEdits used for button configuration
|
|
class QLineEditKeyConfig : public QLineEdit {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
Button button;
|
|
QLineEditKeyConfig(Button button, QWidget* parent = nullptr);
|
|
void keyPressEvent(QKeyEvent* event) override;
|
|
|
|
signals:
|
|
void ValueChanged(Button, int);
|
|
};
|