From 4309585623e67f38e3c6113d6435f128069748d2 Mon Sep 17 00:00:00 2001 From: Adityarup Laha <30696515+adityaruplaha@users.noreply.github.com> Date: Fri, 16 Nov 2018 22:04:00 +0530 Subject: [PATCH] citra-qt: Commented & documented code related to hotkeys as & when required. --- src/citra_qt/configuration/configure_dialog.cpp | 1 + src/citra_qt/configuration/configure_hotkeys.h | 11 +++++++++++ src/citra_qt/configuration/configure_input.h | 6 +++++- src/citra_qt/util/sequence_dialog/sequence_dialog.cpp | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/citra_qt/configuration/configure_dialog.cpp b/src/citra_qt/configuration/configure_dialog.cpp index 08c60ec8a..8d0d89c3b 100644 --- a/src/citra_qt/configuration/configure_dialog.cpp +++ b/src/citra_qt/configuration/configure_dialog.cpp @@ -22,6 +22,7 @@ ConfigureDialog::ConfigureDialog(QWidget* parent, const HotkeyRegistry& registry adjustSize(); ui->selectorList->setCurrentRow(0); + // Set up used key list synchronisation connect(ui->inputTab, &ConfigureInput::InputKeysChanged, ui->hotkeysTab, &ConfigureHotkeys::OnInputKeysChanged); connect(ui->hotkeysTab, &ConfigureHotkeys::HotkeysChanged, ui->inputTab, diff --git a/src/citra_qt/configuration/configure_hotkeys.h b/src/citra_qt/configuration/configure_hotkeys.h index 431d53fb2..960d9d572 100644 --- a/src/citra_qt/configuration/configure_hotkeys.h +++ b/src/citra_qt/configuration/configure_hotkeys.h @@ -28,6 +28,11 @@ public: 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); public slots: @@ -43,6 +48,12 @@ private: std::unique_ptr ui; + /** + * List of keyboard keys currently registered to any of the 3DS inputs. + * These can't be bound to any hotkey. + * Synchronised with ConfigureInput via signal-slot. + */ QList input_keys_list; + QStandardItemModel* model; }; diff --git a/src/citra_qt/configuration/configure_input.h b/src/citra_qt/configuration/configure_input.h index 410415990..a122402aa 100644 --- a/src/citra_qt/configuration/configure_input.h +++ b/src/citra_qt/configuration/configure_input.h @@ -80,7 +80,11 @@ private: std::vector> device_pollers; - /// Keys currently registered as hotkeys + /** + * List of keys currently registered to hotkeys. + * These can't be bound to any input key. + * Synchronised with ConfigureHotkeys via signal-slot. + */ QList hotkey_list; /// A flag to indicate if keyboard keys are okay when configuring an input. If this is false, diff --git a/src/citra_qt/util/sequence_dialog/sequence_dialog.cpp b/src/citra_qt/util/sequence_dialog/sequence_dialog.cpp index 5a4cfb03f..48e7a82a7 100644 --- a/src/citra_qt/util/sequence_dialog/sequence_dialog.cpp +++ b/src/citra_qt/util/sequence_dialog/sequence_dialog.cpp @@ -23,6 +23,7 @@ SequenceDialog::SequenceDialog(QWidget* parent) : QDialog(parent) { SequenceDialog::~SequenceDialog() = default; QKeySequence SequenceDialog::GetSequence() { + // Only the first key is returned. The other 3, if present, are ignored. return QKeySequence(key_sequence->keySequence()[0]); }