citra-qt: Commented & documented code related to hotkeys as & when required.

This commit is contained in:
Adityarup Laha 2018-11-16 22:04:00 +05:30
parent 9615acb550
commit 4309585623
No known key found for this signature in database
GPG Key ID: 1B24048A1F78845F
4 changed files with 18 additions and 1 deletions

View File

@ -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,

View File

@ -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::ConfigureHotkeys> 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<QKeySequence> input_keys_list;
QStandardItemModel* model;
};

View File

@ -80,7 +80,11 @@ private:
std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> 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<QKeySequence> hotkey_list;
/// A flag to indicate if keyboard keys are okay when configuring an input. If this is false,

View File

@ -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]);
}