yuzu: Add controller hotkeys
This commit is contained in:
parent
b94e947793
commit
72c8a94a6c
14 changed files with 580 additions and 79 deletions
|
@ -7,6 +7,16 @@
|
|||
#include <memory>
|
||||
#include <QWidget>
|
||||
|
||||
namespace Common {
|
||||
class ParamPackage;
|
||||
}
|
||||
|
||||
namespace Core::HID {
|
||||
class HIDCore;
|
||||
class EmulatedController;
|
||||
enum class NpadButton : u64;
|
||||
} // namespace Core::HID
|
||||
|
||||
namespace Ui {
|
||||
class ConfigureHotkeys;
|
||||
}
|
||||
|
@ -18,7 +28,7 @@ class ConfigureHotkeys : public QWidget {
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConfigureHotkeys(QWidget* parent = nullptr);
|
||||
explicit ConfigureHotkeys(Core::HID::HIDCore& hid_core_, QWidget* parent = nullptr);
|
||||
~ConfigureHotkeys() override;
|
||||
|
||||
void ApplyConfiguration(HotkeyRegistry& registry);
|
||||
|
@ -35,13 +45,24 @@ private:
|
|||
void RetranslateUI();
|
||||
|
||||
void Configure(QModelIndex index);
|
||||
void ConfigureController(QModelIndex index);
|
||||
std::pair<bool, QString> IsUsedKey(QKeySequence key_sequence) const;
|
||||
std::pair<bool, QString> IsUsedControllerKey(const QString& key_sequence) const;
|
||||
|
||||
void RestoreDefaults();
|
||||
void ClearAll();
|
||||
void PopupContextMenu(const QPoint& menu_location);
|
||||
void RestoreControllerHotkey(QModelIndex index);
|
||||
void RestoreHotkey(QModelIndex index);
|
||||
|
||||
std::unique_ptr<Ui::ConfigureHotkeys> ui;
|
||||
|
||||
QStandardItemModel* model;
|
||||
|
||||
void SetPollingResult(Core::HID::NpadButton button, bool cancel);
|
||||
QString GetButtonName(Core::HID::NpadButton button) const;
|
||||
Core::HID::EmulatedController* controller;
|
||||
std::unique_ptr<QTimer> timeout_timer;
|
||||
std::unique_ptr<QTimer> poll_timer;
|
||||
std::optional<std::function<void(Core::HID::NpadButton, bool)>> input_setter;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue