From 57a4a2ae0fc35906723ffc9f788f3cf7dd9c4ba5 Mon Sep 17 00:00:00 2001 From: Adityarup Laha <30696515+adityaruplaha@users.noreply.github.com> Date: Sat, 16 Feb 2019 16:19:29 +0100 Subject: yuzu: Make hotkeys configurable via the GUI * Adds a new Hotkeys tab in the Controls group. * Double-click a Hotkey to rebind it. --- src/yuzu/configuration/configure_hotkeys.h | 48 ++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/yuzu/configuration/configure_hotkeys.h (limited to 'src/yuzu/configuration/configure_hotkeys.h') diff --git a/src/yuzu/configuration/configure_hotkeys.h b/src/yuzu/configuration/configure_hotkeys.h new file mode 100644 index 000000000..cd203aad6 --- /dev/null +++ b/src/yuzu/configuration/configure_hotkeys.h @@ -0,0 +1,48 @@ +// Copyright 2017 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include +#include +#include "core/settings.h" + +namespace Ui { +class ConfigureHotkeys; +} + +class HotkeyRegistry; +class QStandardItemModel; + +class ConfigureHotkeys : public QWidget { + Q_OBJECT + +public: + explicit ConfigureHotkeys(QWidget* parent = nullptr); + ~ConfigureHotkeys() override; + + void applyConfiguration(HotkeyRegistry& registry); + void retranslateUi(); + + void EmitHotkeysChanged(); + + /** + * Populates the hotkey list widget using data from the provided registry. + * Called everytime the Configure dialog is opened. + * @param registry The HotkeyRegistry whose data is used to populate the list. + */ + void Populate(const HotkeyRegistry& registry); + +signals: + void HotkeysChanged(QList new_key_list); + +private: + void Configure(QModelIndex index); + bool IsUsedKey(QKeySequence key_sequence); + QList GetUsedKeyList() const; + + std::unique_ptr ui; + + QStandardItemModel* model; +}; -- cgit v1.2.3