diff options
| author | 2016-07-29 07:45:49 -0500 | |
|---|---|---|
| committer | 2016-07-29 08:45:49 -0400 | |
| commit | e91327c86a863b9419fd3695b2400a52336ec3b5 (patch) | |
| tree | ec914c0dbd050f8063fa5dac0204f3ff0d5b035b /src/citra_qt | |
| parent | Merge pull request #1950 from JamePeng/fix-apt-0x0055004-and-0x00560000 (diff) | |
| download | yuzu-e91327c86a863b9419fd3695b2400a52336ec3b5.tar.gz yuzu-e91327c86a863b9419fd3695b2400a52336ec3b5.tar.xz yuzu-e91327c86a863b9419fd3695b2400a52336ec3b5.zip | |
Input GUI: Add tab to remap controls (#1900)
Diffstat (limited to 'src/citra_qt')
| -rw-r--r-- | src/citra_qt/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | src/citra_qt/config.cpp | 9 | ||||
| -rw-r--r-- | src/citra_qt/config.h | 6 | ||||
| -rw-r--r-- | src/citra_qt/configure.ui | 8 | ||||
| -rw-r--r-- | src/citra_qt/configure_dialog.cpp | 1 | ||||
| -rw-r--r-- | src/citra_qt/configure_input.cpp | 149 | ||||
| -rw-r--r-- | src/citra_qt/configure_input.h | 63 | ||||
| -rw-r--r-- | src/citra_qt/configure_input.ui | 593 | ||||
| -rw-r--r-- | src/citra_qt/main.cpp | 1 |
9 files changed, 825 insertions, 8 deletions
diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt index 017b43871..4402ad995 100644 --- a/src/citra_qt/CMakeLists.txt +++ b/src/citra_qt/CMakeLists.txt | |||
| @@ -23,6 +23,7 @@ set(SRCS | |||
| 23 | configure_dialog.cpp | 23 | configure_dialog.cpp |
| 24 | configure_general.cpp | 24 | configure_general.cpp |
| 25 | configure_system.cpp | 25 | configure_system.cpp |
| 26 | configure_input.cpp | ||
| 26 | game_list.cpp | 27 | game_list.cpp |
| 27 | hotkeys.cpp | 28 | hotkeys.cpp |
| 28 | main.cpp | 29 | main.cpp |
| @@ -54,6 +55,7 @@ set(HEADERS | |||
| 54 | configure_dialog.h | 55 | configure_dialog.h |
| 55 | configure_general.h | 56 | configure_general.h |
| 56 | configure_system.h | 57 | configure_system.h |
| 58 | configure_input.h | ||
| 57 | game_list.h | 59 | game_list.h |
| 58 | game_list_p.h | 60 | game_list_p.h |
| 59 | hotkeys.h | 61 | hotkeys.h |
| @@ -72,6 +74,7 @@ set(UIS | |||
| 72 | configure_debug.ui | 74 | configure_debug.ui |
| 73 | configure_general.ui | 75 | configure_general.ui |
| 74 | configure_system.ui | 76 | configure_system.ui |
| 77 | configure_input.ui | ||
| 75 | hotkeys.ui | 78 | hotkeys.ui |
| 76 | main.ui | 79 | main.ui |
| 77 | ) | 80 | ) |
diff --git a/src/citra_qt/config.cpp b/src/citra_qt/config.cpp index ba7edaff9..0e5f285c0 100644 --- a/src/citra_qt/config.cpp +++ b/src/citra_qt/config.cpp | |||
| @@ -3,14 +3,11 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <QSettings> | 5 | #include <QSettings> |
| 6 | #include <QString> | ||
| 7 | #include <QStringList> | ||
| 8 | 6 | ||
| 9 | #include "citra_qt/config.h" | 7 | #include "citra_qt/config.h" |
| 10 | #include "citra_qt/ui_settings.h" | 8 | #include "citra_qt/ui_settings.h" |
| 11 | 9 | ||
| 12 | #include "common/file_util.h" | 10 | #include "common/file_util.h" |
| 13 | #include "core/settings.h" | ||
| 14 | 11 | ||
| 15 | Config::Config() { | 12 | Config::Config() { |
| 16 | // TODO: Don't hardcode the path; let the frontend decide where to put the config files. | 13 | // TODO: Don't hardcode the path; let the frontend decide where to put the config files. |
| @@ -21,7 +18,7 @@ Config::Config() { | |||
| 21 | Reload(); | 18 | Reload(); |
| 22 | } | 19 | } |
| 23 | 20 | ||
| 24 | static const std::array<QVariant, Settings::NativeInput::NUM_INPUTS> defaults = { | 21 | const std::array<QVariant, Settings::NativeInput::NUM_INPUTS> Config::defaults = { |
| 25 | // directly mapped keys | 22 | // directly mapped keys |
| 26 | Qt::Key_A, Qt::Key_S, Qt::Key_Z, Qt::Key_X, | 23 | Qt::Key_A, Qt::Key_S, Qt::Key_Z, Qt::Key_X, |
| 27 | Qt::Key_Q, Qt::Key_W, Qt::Key_1, Qt::Key_2, | 24 | Qt::Key_Q, Qt::Key_W, Qt::Key_1, Qt::Key_2, |
| @@ -109,7 +106,7 @@ void Config::ReadValues() { | |||
| 109 | UISettings::values.shortcuts.emplace_back( | 106 | UISettings::values.shortcuts.emplace_back( |
| 110 | UISettings::Shortcut(group + "/" + hotkey, | 107 | UISettings::Shortcut(group + "/" + hotkey, |
| 111 | UISettings::ContextualShortcut(qt_config->value("KeySeq").toString(), | 108 | UISettings::ContextualShortcut(qt_config->value("KeySeq").toString(), |
| 112 | qt_config->value("Context").toInt()))); | 109 | qt_config->value("Context").toInt()))); |
| 113 | qt_config->endGroup(); | 110 | qt_config->endGroup(); |
| 114 | } | 111 | } |
| 115 | 112 | ||
| @@ -191,7 +188,7 @@ void Config::SaveValues() { | |||
| 191 | qt_config->endGroup(); | 188 | qt_config->endGroup(); |
| 192 | 189 | ||
| 193 | qt_config->beginGroup("Shortcuts"); | 190 | qt_config->beginGroup("Shortcuts"); |
| 194 | for (auto shortcut : UISettings::values.shortcuts ) { | 191 | for (auto shortcut : UISettings::values.shortcuts) { |
| 195 | qt_config->setValue(shortcut.first + "/KeySeq", shortcut.second.first); | 192 | qt_config->setValue(shortcut.first + "/KeySeq", shortcut.second.first); |
| 196 | qt_config->setValue(shortcut.first + "/Context", shortcut.second.second); | 193 | qt_config->setValue(shortcut.first + "/Context", shortcut.second.second); |
| 197 | } | 194 | } |
diff --git a/src/citra_qt/config.h b/src/citra_qt/config.h index dd0b2ef0b..0cbdb707f 100644 --- a/src/citra_qt/config.h +++ b/src/citra_qt/config.h | |||
| @@ -1,10 +1,13 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // Copyright 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <string> | 7 | #include <string> |
| 8 | #include <QVariant> | ||
| 9 | |||
| 10 | #include "core/settings.h" | ||
| 8 | 11 | ||
| 9 | class QSettings; | 12 | class QSettings; |
| 10 | 13 | ||
| @@ -20,4 +23,5 @@ public: | |||
| 20 | 23 | ||
| 21 | void Reload(); | 24 | void Reload(); |
| 22 | void Save(); | 25 | void Save(); |
| 26 | static const std::array<QVariant, Settings::NativeInput::NUM_INPUTS> defaults; | ||
| 23 | }; | 27 | }; |
diff --git a/src/citra_qt/configure.ui b/src/citra_qt/configure.ui index 4a9c52650..15fe17323 100644 --- a/src/citra_qt/configure.ui +++ b/src/citra_qt/configure.ui | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | <string>System</string> | 29 | <string>System</string> |
| 30 | </attribute> | 30 | </attribute> |
| 31 | </widget> | 31 | </widget> |
| 32 | <widget class="QWidget" name="inputTab"> | 32 | <widget class="ConfigureInput" name="inputTab"> |
| 33 | <attribute name="title"> | 33 | <attribute name="title"> |
| 34 | <string>Input</string> | 34 | <string>Input</string> |
| 35 | </attribute> | 35 | </attribute> |
| @@ -80,6 +80,12 @@ | |||
| 80 | <header>configure_debug.h</header> | 80 | <header>configure_debug.h</header> |
| 81 | <container>1</container> | 81 | <container>1</container> |
| 82 | </customwidget> | 82 | </customwidget> |
| 83 | <customwidget> | ||
| 84 | <class>ConfigureInput</class> | ||
| 85 | <extends>QWidget</extends> | ||
| 86 | <header>configure_input.h</header> | ||
| 87 | <container>1</container> | ||
| 88 | </customwidget> | ||
| 83 | </customwidgets> | 89 | </customwidgets> |
| 84 | <resources/> | 90 | <resources/> |
| 85 | <connections> | 91 | <connections> |
diff --git a/src/citra_qt/configure_dialog.cpp b/src/citra_qt/configure_dialog.cpp index 77c266d01..459fac4bb 100644 --- a/src/citra_qt/configure_dialog.cpp +++ b/src/citra_qt/configure_dialog.cpp | |||
| @@ -30,6 +30,7 @@ void ConfigureDialog::setConfiguration() { | |||
| 30 | void ConfigureDialog::applyConfiguration() { | 30 | void ConfigureDialog::applyConfiguration() { |
| 31 | ui->generalTab->applyConfiguration(); | 31 | ui->generalTab->applyConfiguration(); |
| 32 | ui->systemTab->applyConfiguration(); | 32 | ui->systemTab->applyConfiguration(); |
| 33 | ui->inputTab->applyConfiguration(); | ||
| 33 | ui->audioTab->applyConfiguration(); | 34 | ui->audioTab->applyConfiguration(); |
| 34 | ui->debugTab->applyConfiguration(); | 35 | ui->debugTab->applyConfiguration(); |
| 35 | } | 36 | } |
diff --git a/src/citra_qt/configure_input.cpp b/src/citra_qt/configure_input.cpp new file mode 100644 index 000000000..9c7a67174 --- /dev/null +++ b/src/citra_qt/configure_input.cpp | |||
| @@ -0,0 +1,149 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <memory> | ||
| 6 | #include <utility> | ||
| 7 | #include <QTimer> | ||
| 8 | |||
| 9 | #include "citra_qt/configure_input.h" | ||
| 10 | |||
| 11 | ConfigureInput::ConfigureInput(QWidget* parent) : QWidget(parent), ui(std::make_unique<Ui::ConfigureInput>()) { | ||
| 12 | ui->setupUi(this); | ||
| 13 | |||
| 14 | // Initialize mapping of input enum to UI button. | ||
| 15 | input_mapping = { | ||
| 16 | { std::make_pair(Settings::NativeInput::Values::A, ui->buttonA) }, | ||
| 17 | { std::make_pair(Settings::NativeInput::Values::B, ui->buttonB) }, | ||
| 18 | { std::make_pair(Settings::NativeInput::Values::X, ui->buttonX) }, | ||
| 19 | { std::make_pair(Settings::NativeInput::Values::Y, ui->buttonY) }, | ||
| 20 | { std::make_pair(Settings::NativeInput::Values::L, ui->buttonL) }, | ||
| 21 | { std::make_pair(Settings::NativeInput::Values::R, ui->buttonR) }, | ||
| 22 | { std::make_pair(Settings::NativeInput::Values::ZL, ui->buttonZL) }, | ||
| 23 | { std::make_pair(Settings::NativeInput::Values::ZR, ui->buttonZR) }, | ||
| 24 | { std::make_pair(Settings::NativeInput::Values::START, ui->buttonStart) }, | ||
| 25 | { std::make_pair(Settings::NativeInput::Values::SELECT, ui->buttonSelect) }, | ||
| 26 | { std::make_pair(Settings::NativeInput::Values::HOME, ui->buttonHome) }, | ||
| 27 | { std::make_pair(Settings::NativeInput::Values::DUP, ui->buttonDpadUp) }, | ||
| 28 | { std::make_pair(Settings::NativeInput::Values::DDOWN, ui->buttonDpadDown) }, | ||
| 29 | { std::make_pair(Settings::NativeInput::Values::DLEFT, ui->buttonDpadLeft) }, | ||
| 30 | { std::make_pair(Settings::NativeInput::Values::DRIGHT, ui->buttonDpadRight) }, | ||
| 31 | { std::make_pair(Settings::NativeInput::Values::CUP, ui->buttonCStickUp) }, | ||
| 32 | { std::make_pair(Settings::NativeInput::Values::CDOWN, ui->buttonCStickDown) }, | ||
| 33 | { std::make_pair(Settings::NativeInput::Values::CLEFT, ui->buttonCStickLeft) }, | ||
| 34 | { std::make_pair(Settings::NativeInput::Values::CRIGHT, ui->buttonCStickRight) }, | ||
| 35 | { std::make_pair(Settings::NativeInput::Values::CIRCLE_UP, ui->buttonCircleUp) }, | ||
| 36 | { std::make_pair(Settings::NativeInput::Values::CIRCLE_DOWN, ui->buttonCircleDown) }, | ||
| 37 | { std::make_pair(Settings::NativeInput::Values::CIRCLE_LEFT, ui->buttonCircleLeft) }, | ||
| 38 | { std::make_pair(Settings::NativeInput::Values::CIRCLE_RIGHT, ui->buttonCircleRight) }, | ||
| 39 | { std::make_pair(Settings::NativeInput::Values::CIRCLE_MODIFIER, ui->buttonCircleMod) }, | ||
| 40 | }; | ||
| 41 | |||
| 42 | // Attach handle click method to each button click. | ||
| 43 | for (const auto& entry : input_mapping) { | ||
| 44 | connect(entry.second, SIGNAL(released()), this, SLOT(handleClick())); | ||
| 45 | } | ||
| 46 | connect(ui->buttonRestoreDefaults, SIGNAL(released()), this, SLOT(restoreDefaults())); | ||
| 47 | setFocusPolicy(Qt::ClickFocus); | ||
| 48 | timer = new QTimer(this); | ||
| 49 | timer->setSingleShot(true); | ||
| 50 | connect(timer, &QTimer::timeout, this, [&]() { key_pressed = Qt::Key_Escape; setKey(); }); | ||
| 51 | this->setConfiguration(); | ||
| 52 | } | ||
| 53 | |||
| 54 | void ConfigureInput::handleClick() { | ||
| 55 | QPushButton* sender = qobject_cast<QPushButton*>(QObject::sender()); | ||
| 56 | previous_mapping = sender->text(); | ||
| 57 | sender->setText(tr("[waiting]")); | ||
| 58 | sender->setFocus(); | ||
| 59 | grabKeyboard(); | ||
| 60 | grabMouse(); | ||
| 61 | changing_button = sender; | ||
| 62 | timer->start(5000); //Cancel after 5 seconds | ||
| 63 | } | ||
| 64 | |||
| 65 | void ConfigureInput::applyConfiguration() { | ||
| 66 | for (int i = 0; i < Settings::NativeInput::NUM_INPUTS; ++i) { | ||
| 67 | int value = getKeyValue(input_mapping[Settings::NativeInput::Values(i)]->text()); | ||
| 68 | Settings::values.input_mappings[Settings::NativeInput::All[i]] = value; | ||
| 69 | } | ||
| 70 | Settings::Apply(); | ||
| 71 | } | ||
| 72 | |||
| 73 | void ConfigureInput::setConfiguration() { | ||
| 74 | for (int i = 0; i < Settings::NativeInput::NUM_INPUTS; ++i) { | ||
| 75 | QString keyValue = getKeyName(Settings::values.input_mappings[i]); | ||
| 76 | input_mapping[Settings::NativeInput::Values(i)]->setText(keyValue); | ||
| 77 | } | ||
| 78 | } | ||
| 79 | |||
| 80 | void ConfigureInput::keyPressEvent(QKeyEvent* event) { | ||
| 81 | if (!changing_button) | ||
| 82 | return; | ||
| 83 | if (!event || event->key() == Qt::Key_unknown) | ||
| 84 | return; | ||
| 85 | key_pressed = event->key(); | ||
| 86 | timer->stop(); | ||
| 87 | setKey(); | ||
| 88 | } | ||
| 89 | |||
| 90 | void ConfigureInput::setKey() { | ||
| 91 | const QString key_value = getKeyName(key_pressed); | ||
| 92 | if (key_pressed == Qt::Key_Escape) | ||
| 93 | changing_button->setText(previous_mapping); | ||
| 94 | else | ||
| 95 | changing_button->setText(key_value); | ||
| 96 | removeDuplicates(key_value); | ||
| 97 | key_pressed = Qt::Key_unknown; | ||
| 98 | releaseKeyboard(); | ||
| 99 | releaseMouse(); | ||
| 100 | changing_button = nullptr; | ||
| 101 | previous_mapping = nullptr; | ||
| 102 | } | ||
| 103 | |||
| 104 | QString ConfigureInput::getKeyName(int key_code) const { | ||
| 105 | if (key_code == Qt::Key_Shift) | ||
| 106 | return tr("Shift"); | ||
| 107 | if (key_code == Qt::Key_Control) | ||
| 108 | return tr("Ctrl"); | ||
| 109 | if (key_code == Qt::Key_Alt) | ||
| 110 | return tr("Alt"); | ||
| 111 | if (key_code == Qt::Key_Meta) | ||
| 112 | return ""; | ||
| 113 | if (key_code == -1) | ||
| 114 | return ""; | ||
| 115 | |||
| 116 | return QKeySequence(key_code).toString(); | ||
| 117 | } | ||
| 118 | |||
| 119 | Qt::Key ConfigureInput::getKeyValue(const QString& text) const { | ||
| 120 | if (text == "Shift") | ||
| 121 | return Qt::Key_Shift; | ||
| 122 | if (text == "Ctrl") | ||
| 123 | return Qt::Key_Control; | ||
| 124 | if (text == "Alt") | ||
| 125 | return Qt::Key_Alt; | ||
| 126 | if (text == "Meta") | ||
| 127 | return Qt::Key_unknown; | ||
| 128 | if (text == "") | ||
| 129 | return Qt::Key_unknown; | ||
| 130 | |||
| 131 | return Qt::Key(QKeySequence(text)[0]); | ||
| 132 | } | ||
| 133 | |||
| 134 | void ConfigureInput::removeDuplicates(const QString& newValue) { | ||
| 135 | for (int i = 0; i < Settings::NativeInput::NUM_INPUTS; ++i) { | ||
| 136 | if (changing_button != input_mapping[Settings::NativeInput::Values(i)]) { | ||
| 137 | const QString oldValue = input_mapping[Settings::NativeInput::Values(i)]->text(); | ||
| 138 | if (newValue == oldValue) | ||
| 139 | input_mapping[Settings::NativeInput::Values(i)]->setText(""); | ||
| 140 | } | ||
| 141 | } | ||
| 142 | } | ||
| 143 | |||
| 144 | void ConfigureInput::restoreDefaults() { | ||
| 145 | for (int i = 0; i < Settings::NativeInput::NUM_INPUTS; ++i) { | ||
| 146 | const QString keyValue = getKeyName(Config::defaults[i].toInt()); | ||
| 147 | input_mapping[Settings::NativeInput::Values(i)]->setText(keyValue); | ||
| 148 | } | ||
| 149 | } | ||
diff --git a/src/citra_qt/configure_input.h b/src/citra_qt/configure_input.h new file mode 100644 index 000000000..fe8ea5580 --- /dev/null +++ b/src/citra_qt/configure_input.h | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <QWidget> | ||
| 8 | #include <QKeyEvent> | ||
| 9 | |||
| 10 | #include "citra_qt/config.h" | ||
| 11 | #include "core/settings.h" | ||
| 12 | #include "ui_configure_input.h" | ||
| 13 | |||
| 14 | class QPushButton; | ||
| 15 | class QString; | ||
| 16 | class QTimer; | ||
| 17 | |||
| 18 | namespace Ui { | ||
| 19 | class ConfigureInput; | ||
| 20 | } | ||
| 21 | |||
| 22 | class ConfigureInput : public QWidget { | ||
| 23 | Q_OBJECT | ||
| 24 | |||
| 25 | public: | ||
| 26 | explicit ConfigureInput(QWidget* parent = nullptr); | ||
| 27 | |||
| 28 | /// Save all button configurations to settings file | ||
| 29 | void applyConfiguration(); | ||
| 30 | |||
| 31 | private: | ||
| 32 | std::unique_ptr<Ui::ConfigureInput> ui; | ||
| 33 | std::map<Settings::NativeInput::Values, QPushButton*> input_mapping; | ||
| 34 | int key_pressed; | ||
| 35 | QPushButton* changing_button = nullptr; ///< button currently waiting for key press. | ||
| 36 | QString previous_mapping; | ||
| 37 | QTimer* timer; | ||
| 38 | |||
| 39 | /// Load configuration settings into button text | ||
| 40 | void setConfiguration(); | ||
| 41 | |||
| 42 | /// Check all inputs for duplicate keys. Clears out any other button with the same value as this button's new value. | ||
| 43 | void removeDuplicates(const QString& newValue); | ||
| 44 | |||
| 45 | /// Handle key press event for input tab when a button is 'waiting'. | ||
| 46 | void keyPressEvent(QKeyEvent* event) override; | ||
| 47 | |||
| 48 | /// Convert key ASCII value to its' letter/name | ||
| 49 | QString getKeyName(int key_code) const; | ||
| 50 | |||
| 51 | /// Convert letter/name of key to its ASCII value. | ||
| 52 | Qt::Key getKeyValue(const QString& text) const; | ||
| 53 | |||
| 54 | /// Set button text to name of key pressed. | ||
| 55 | void setKey(); | ||
| 56 | |||
| 57 | private slots: | ||
| 58 | /// Event handler for all button released() event. | ||
| 59 | void handleClick(); | ||
| 60 | |||
| 61 | /// Restore all buttons to their default values. | ||
| 62 | void restoreDefaults(); | ||
| 63 | }; | ||
diff --git a/src/citra_qt/configure_input.ui b/src/citra_qt/configure_input.ui new file mode 100644 index 000000000..a040d4df4 --- /dev/null +++ b/src/citra_qt/configure_input.ui | |||
| @@ -0,0 +1,593 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <ui version="4.0"> | ||
| 3 | <class>ConfigureInput</class> | ||
| 4 | <widget class="QWidget" name="ConfigureInput"> | ||
| 5 | <property name="geometry"> | ||
| 6 | <rect> | ||
| 7 | <x>0</x> | ||
| 8 | <y>0</y> | ||
| 9 | <width>370</width> | ||
| 10 | <height>534</height> | ||
| 11 | </rect> | ||
| 12 | </property> | ||
| 13 | <property name="windowTitle"> | ||
| 14 | <string>ConfigureInput</string> | ||
| 15 | </property> | ||
| 16 | <layout class="QVBoxLayout" name="verticalLayout_5"> | ||
| 17 | <item> | ||
| 18 | <layout class="QGridLayout" name="gridLayout_7"> | ||
| 19 | <item row="0" column="0"> | ||
| 20 | <widget class="QGroupBox" name="faceButtons"> | ||
| 21 | <property name="title"> | ||
| 22 | <string>Face Buttons</string> | ||
| 23 | </property> | ||
| 24 | <property name="flat"> | ||
| 25 | <bool>false</bool> | ||
| 26 | </property> | ||
| 27 | <property name="checkable"> | ||
| 28 | <bool>false</bool> | ||
| 29 | </property> | ||
| 30 | <layout class="QGridLayout" name="gridLayout"> | ||
| 31 | <item row="0" column="0"> | ||
| 32 | <layout class="QVBoxLayout" name="verticalLayout"> | ||
| 33 | <item> | ||
| 34 | <widget class="QLabel" name="label"> | ||
| 35 | <property name="text"> | ||
| 36 | <string>A:</string> | ||
| 37 | </property> | ||
| 38 | </widget> | ||
| 39 | </item> | ||
| 40 | <item> | ||
| 41 | <widget class="QPushButton" name="buttonA"> | ||
| 42 | <property name="text"> | ||
| 43 | <string/> | ||
| 44 | </property> | ||
| 45 | </widget> | ||
| 46 | </item> | ||
| 47 | </layout> | ||
| 48 | </item> | ||
| 49 | <item row="0" column="1"> | ||
| 50 | <layout class="QVBoxLayout" name="verticalLayout_2"> | ||
| 51 | <item> | ||
| 52 | <widget class="QLabel" name="label_2"> | ||
| 53 | <property name="text"> | ||
| 54 | <string>B:</string> | ||
| 55 | </property> | ||
| 56 | </widget> | ||
| 57 | </item> | ||
| 58 | <item> | ||
| 59 | <widget class="QPushButton" name="buttonB"> | ||
| 60 | <property name="text"> | ||
| 61 | <string/> | ||
| 62 | </property> | ||
| 63 | </widget> | ||
| 64 | </item> | ||
| 65 | </layout> | ||
| 66 | </item> | ||
| 67 | <item row="1" column="0"> | ||
| 68 | <layout class="QVBoxLayout" name="verticalLayout_3"> | ||
| 69 | <item> | ||
| 70 | <widget class="QLabel" name="label_3"> | ||
| 71 | <property name="text"> | ||
| 72 | <string>X:</string> | ||
| 73 | </property> | ||
| 74 | </widget> | ||
| 75 | </item> | ||
| 76 | <item> | ||
| 77 | <widget class="QPushButton" name="buttonX"> | ||
| 78 | <property name="text"> | ||
| 79 | <string/> | ||
| 80 | </property> | ||
| 81 | </widget> | ||
| 82 | </item> | ||
| 83 | </layout> | ||
| 84 | </item> | ||
| 85 | <item row="1" column="1"> | ||
| 86 | <layout class="QVBoxLayout" name="verticalLayout_4"> | ||
| 87 | <item> | ||
| 88 | <widget class="QLabel" name="label_4"> | ||
| 89 | <property name="text"> | ||
| 90 | <string>Y:</string> | ||
| 91 | </property> | ||
| 92 | </widget> | ||
| 93 | </item> | ||
| 94 | <item> | ||
| 95 | <widget class="QPushButton" name="buttonY"> | ||
| 96 | <property name="text"> | ||
| 97 | <string/> | ||
| 98 | </property> | ||
| 99 | </widget> | ||
| 100 | </item> | ||
| 101 | </layout> | ||
| 102 | </item> | ||
| 103 | </layout> | ||
| 104 | </widget> | ||
| 105 | </item> | ||
| 106 | <item row="0" column="1"> | ||
| 107 | <widget class="QGroupBox" name="faceButtons_2"> | ||
| 108 | <property name="title"> | ||
| 109 | <string>Directional Pad</string> | ||
| 110 | </property> | ||
| 111 | <property name="flat"> | ||
| 112 | <bool>false</bool> | ||
| 113 | </property> | ||
| 114 | <property name="checkable"> | ||
| 115 | <bool>false</bool> | ||
| 116 | </property> | ||
| 117 | <layout class="QGridLayout" name="gridLayout_2"> | ||
| 118 | <item row="1" column="0"> | ||
| 119 | <layout class="QVBoxLayout" name="verticalLayout_12"> | ||
| 120 | <item> | ||
| 121 | <widget class="QLabel" name="label_34"> | ||
| 122 | <property name="text"> | ||
| 123 | <string>Up:</string> | ||
| 124 | </property> | ||
| 125 | </widget> | ||
| 126 | </item> | ||
| 127 | <item> | ||
| 128 | <widget class="QPushButton" name="buttonDpadUp"> | ||
| 129 | <property name="text"> | ||
| 130 | <string/> | ||
| 131 | </property> | ||
| 132 | </widget> | ||
| 133 | </item> | ||
| 134 | </layout> | ||
| 135 | </item> | ||
| 136 | <item row="1" column="1"> | ||
| 137 | <layout class="QVBoxLayout" name="verticalLayout_9"> | ||
| 138 | <item> | ||
| 139 | <widget class="QLabel" name="label_35"> | ||
| 140 | <property name="text"> | ||
| 141 | <string>Down:</string> | ||
| 142 | </property> | ||
| 143 | </widget> | ||
| 144 | </item> | ||
| 145 | <item> | ||
| 146 | <widget class="QPushButton" name="buttonDpadDown"> | ||
| 147 | <property name="text"> | ||
| 148 | <string/> | ||
| 149 | </property> | ||
| 150 | </widget> | ||
| 151 | </item> | ||
| 152 | </layout> | ||
| 153 | </item> | ||
| 154 | <item row="0" column="0"> | ||
| 155 | <layout class="QVBoxLayout" name="verticalLayout_10"> | ||
| 156 | <item> | ||
| 157 | <widget class="QLabel" name="label_32"> | ||
| 158 | <property name="text"> | ||
| 159 | <string>Left:</string> | ||
| 160 | </property> | ||
| 161 | </widget> | ||
| 162 | </item> | ||
| 163 | <item> | ||
| 164 | <widget class="QPushButton" name="buttonDpadLeft"> | ||
| 165 | <property name="text"> | ||
| 166 | <string/> | ||
| 167 | </property> | ||
| 168 | </widget> | ||
| 169 | </item> | ||
| 170 | </layout> | ||
| 171 | </item> | ||
| 172 | <item row="0" column="1"> | ||
| 173 | <layout class="QVBoxLayout" name="verticalLayout_11"> | ||
| 174 | <item> | ||
| 175 | <widget class="QLabel" name="label_33"> | ||
| 176 | <property name="text"> | ||
| 177 | <string>Right:</string> | ||
| 178 | </property> | ||
| 179 | </widget> | ||
| 180 | </item> | ||
| 181 | <item> | ||
| 182 | <widget class="QPushButton" name="buttonDpadRight"> | ||
| 183 | <property name="text"> | ||
| 184 | <string/> | ||
| 185 | </property> | ||
| 186 | </widget> | ||
| 187 | </item> | ||
| 188 | </layout> | ||
| 189 | </item> | ||
| 190 | </layout> | ||
| 191 | </widget> | ||
| 192 | </item> | ||
| 193 | <item row="1" column="0"> | ||
| 194 | <widget class="QGroupBox" name="faceButtons_3"> | ||
| 195 | <property name="title"> | ||
| 196 | <string>Shoulder Buttons</string> | ||
| 197 | </property> | ||
| 198 | <property name="flat"> | ||
| 199 | <bool>false</bool> | ||
| 200 | </property> | ||
| 201 | <property name="checkable"> | ||
| 202 | <bool>false</bool> | ||
| 203 | </property> | ||
| 204 | <layout class="QGridLayout" name="gridLayout_3"> | ||
| 205 | <item row="0" column="0"> | ||
| 206 | <layout class="QVBoxLayout" name="verticalLayout_13"> | ||
| 207 | <item> | ||
| 208 | <widget class="QLabel" name="label_17"> | ||
| 209 | <property name="text"> | ||
| 210 | <string>L:</string> | ||
| 211 | </property> | ||
| 212 | </widget> | ||
| 213 | </item> | ||
| 214 | <item> | ||
| 215 | <widget class="QPushButton" name="buttonL"> | ||
| 216 | <property name="text"> | ||
| 217 | <string/> | ||
| 218 | </property> | ||
| 219 | </widget> | ||
| 220 | </item> | ||
| 221 | </layout> | ||
| 222 | </item> | ||
| 223 | <item row="0" column="1"> | ||
| 224 | <layout class="QVBoxLayout" name="verticalLayout_14"> | ||
| 225 | <item> | ||
| 226 | <widget class="QLabel" name="label_19"> | ||
| 227 | <property name="text"> | ||
| 228 | <string>R:</string> | ||
| 229 | </property> | ||
| 230 | </widget> | ||
| 231 | </item> | ||
| 232 | <item> | ||
| 233 | <widget class="QPushButton" name="buttonR"> | ||
| 234 | <property name="text"> | ||
| 235 | <string/> | ||
| 236 | </property> | ||
| 237 | </widget> | ||
| 238 | </item> | ||
| 239 | </layout> | ||
| 240 | </item> | ||
| 241 | <item row="1" column="0"> | ||
| 242 | <layout class="QVBoxLayout" name="verticalLayout_15"> | ||
| 243 | <item> | ||
| 244 | <widget class="QLabel" name="label_20"> | ||
| 245 | <property name="text"> | ||
| 246 | <string>ZL:</string> | ||
| 247 | </property> | ||
| 248 | </widget> | ||
| 249 | </item> | ||
| 250 | <item> | ||
| 251 | <widget class="QPushButton" name="buttonZL"> | ||
| 252 | <property name="text"> | ||
| 253 | <string/> | ||
| 254 | </property> | ||
| 255 | </widget> | ||
| 256 | </item> | ||
| 257 | </layout> | ||
| 258 | </item> | ||
| 259 | <item row="1" column="1"> | ||
| 260 | <layout class="QVBoxLayout" name="verticalLayout_16"> | ||
| 261 | <item> | ||
| 262 | <widget class="QLabel" name="label_18"> | ||
| 263 | <property name="text"> | ||
| 264 | <string>ZR:</string> | ||
| 265 | </property> | ||
| 266 | </widget> | ||
| 267 | </item> | ||
| 268 | <item> | ||
| 269 | <widget class="QPushButton" name="buttonZR"> | ||
| 270 | <property name="text"> | ||
| 271 | <string/> | ||
| 272 | </property> | ||
| 273 | </widget> | ||
| 274 | </item> | ||
| 275 | </layout> | ||
| 276 | </item> | ||
| 277 | </layout> | ||
| 278 | <zorder></zorder> | ||
| 279 | </widget> | ||
| 280 | </item> | ||
| 281 | <item row="1" column="1"> | ||
| 282 | <widget class="QGroupBox" name="faceButtons_4"> | ||
| 283 | <property name="title"> | ||
| 284 | <string>Circle Pad</string> | ||
| 285 | </property> | ||
| 286 | <property name="flat"> | ||
| 287 | <bool>false</bool> | ||
| 288 | </property> | ||
| 289 | <property name="checkable"> | ||
| 290 | <bool>false</bool> | ||
| 291 | </property> | ||
| 292 | <layout class="QGridLayout" name="gridLayout_4"> | ||
| 293 | <item row="0" column="0"> | ||
| 294 | <layout class="QVBoxLayout" name="verticalLayout_17"> | ||
| 295 | <item> | ||
| 296 | <widget class="QLabel" name="label_21"> | ||
| 297 | <property name="text"> | ||
| 298 | <string>Left:</string> | ||
| 299 | </property> | ||
| 300 | </widget> | ||
| 301 | </item> | ||
| 302 | <item> | ||
| 303 | <widget class="QPushButton" name="buttonCircleLeft"> | ||
| 304 | <property name="text"> | ||
| 305 | <string/> | ||
| 306 | </property> | ||
| 307 | </widget> | ||
| 308 | </item> | ||
| 309 | </layout> | ||
| 310 | </item> | ||
| 311 | <item row="0" column="1"> | ||
| 312 | <layout class="QVBoxLayout" name="verticalLayout_18"> | ||
| 313 | <item> | ||
| 314 | <widget class="QLabel" name="label_23"> | ||
| 315 | <property name="text"> | ||
| 316 | <string>Right:</string> | ||
| 317 | </property> | ||
| 318 | </widget> | ||
| 319 | </item> | ||
| 320 | <item> | ||
| 321 | <widget class="QPushButton" name="buttonCircleRight"> | ||
| 322 | <property name="text"> | ||
| 323 | <string/> | ||
| 324 | </property> | ||
| 325 | </widget> | ||
| 326 | </item> | ||
| 327 | </layout> | ||
| 328 | </item> | ||
| 329 | <item row="1" column="0"> | ||
| 330 | <layout class="QVBoxLayout" name="verticalLayout_19"> | ||
| 331 | <item> | ||
| 332 | <widget class="QLabel" name="label_24"> | ||
| 333 | <property name="text"> | ||
| 334 | <string>Up:</string> | ||
| 335 | </property> | ||
| 336 | </widget> | ||
| 337 | </item> | ||
| 338 | <item> | ||
| 339 | <widget class="QPushButton" name="buttonCircleUp"> | ||
| 340 | <property name="text"> | ||
| 341 | <string/> | ||
| 342 | </property> | ||
| 343 | </widget> | ||
| 344 | </item> | ||
| 345 | </layout> | ||
| 346 | </item> | ||
| 347 | <item row="1" column="1"> | ||
| 348 | <layout class="QVBoxLayout" name="verticalLayout_20"> | ||
| 349 | <item> | ||
| 350 | <widget class="QLabel" name="label_22"> | ||
| 351 | <property name="text"> | ||
| 352 | <string>Down:</string> | ||
| 353 | </property> | ||
| 354 | </widget> | ||
| 355 | </item> | ||
| 356 | <item> | ||
| 357 | <widget class="QPushButton" name="buttonCircleDown"> | ||
| 358 | <property name="text"> | ||
| 359 | <string/> | ||
| 360 | </property> | ||
| 361 | </widget> | ||
| 362 | </item> | ||
| 363 | </layout> | ||
| 364 | </item> | ||
| 365 | </layout> | ||
| 366 | </widget> | ||
| 367 | </item> | ||
| 368 | <item row="2" column="0"> | ||
| 369 | <widget class="QGroupBox" name="faceButtons_5"> | ||
| 370 | <property name="title"> | ||
| 371 | <string>C-Stick</string> | ||
| 372 | </property> | ||
| 373 | <property name="flat"> | ||
| 374 | <bool>false</bool> | ||
| 375 | </property> | ||
| 376 | <property name="checkable"> | ||
| 377 | <bool>false</bool> | ||
| 378 | </property> | ||
| 379 | <layout class="QGridLayout" name="gridLayout_5"> | ||
| 380 | <item row="0" column="0"> | ||
| 381 | <layout class="QVBoxLayout" name="verticalLayout_21"> | ||
| 382 | <item> | ||
| 383 | <widget class="QLabel" name="label_25"> | ||
| 384 | <property name="text"> | ||
| 385 | <string>Left:</string> | ||
| 386 | </property> | ||
| 387 | </widget> | ||
| 388 | </item> | ||
| 389 | <item> | ||
| 390 | <widget class="QPushButton" name="buttonCStickLeft"> | ||
| 391 | <property name="text"> | ||
| 392 | <string/> | ||
| 393 | </property> | ||
| 394 | </widget> | ||
| 395 | </item> | ||
| 396 | </layout> | ||
| 397 | </item> | ||
| 398 | <item row="0" column="1"> | ||
| 399 | <layout class="QVBoxLayout" name="verticalLayout_22"> | ||
| 400 | <item> | ||
| 401 | <widget class="QLabel" name="label_27"> | ||
| 402 | <property name="text"> | ||
| 403 | <string>Right:</string> | ||
| 404 | </property> | ||
| 405 | </widget> | ||
| 406 | </item> | ||
| 407 | <item> | ||
| 408 | <widget class="QPushButton" name="buttonCStickRight"> | ||
| 409 | <property name="text"> | ||
| 410 | <string/> | ||
| 411 | </property> | ||
| 412 | </widget> | ||
| 413 | </item> | ||
| 414 | </layout> | ||
| 415 | </item> | ||
| 416 | <item row="1" column="0"> | ||
| 417 | <layout class="QVBoxLayout" name="verticalLayout_23"> | ||
| 418 | <item> | ||
| 419 | <widget class="QLabel" name="label_28"> | ||
| 420 | <property name="text"> | ||
| 421 | <string>Up:</string> | ||
| 422 | </property> | ||
| 423 | </widget> | ||
| 424 | </item> | ||
| 425 | <item> | ||
| 426 | <widget class="QPushButton" name="buttonCStickUp"> | ||
| 427 | <property name="text"> | ||
| 428 | <string/> | ||
| 429 | </property> | ||
| 430 | </widget> | ||
| 431 | </item> | ||
| 432 | </layout> | ||
| 433 | </item> | ||
| 434 | <item row="1" column="1"> | ||
| 435 | <layout class="QVBoxLayout" name="verticalLayout_24"> | ||
| 436 | <item> | ||
| 437 | <widget class="QLabel" name="label_26"> | ||
| 438 | <property name="text"> | ||
| 439 | <string>Down:</string> | ||
| 440 | </property> | ||
| 441 | </widget> | ||
| 442 | </item> | ||
| 443 | <item> | ||
| 444 | <widget class="QPushButton" name="buttonCStickDown"> | ||
| 445 | <property name="text"> | ||
| 446 | <string/> | ||
| 447 | </property> | ||
| 448 | </widget> | ||
| 449 | </item> | ||
| 450 | </layout> | ||
| 451 | </item> | ||
| 452 | </layout> | ||
| 453 | </widget> | ||
| 454 | </item> | ||
| 455 | <item row="2" column="1"> | ||
| 456 | <widget class="QGroupBox" name="faceButtons_6"> | ||
| 457 | <property name="title"> | ||
| 458 | <string>Misc.</string> | ||
| 459 | </property> | ||
| 460 | <property name="flat"> | ||
| 461 | <bool>false</bool> | ||
| 462 | </property> | ||
| 463 | <property name="checkable"> | ||
| 464 | <bool>false</bool> | ||
| 465 | </property> | ||
| 466 | <layout class="QGridLayout" name="gridLayout_6"> | ||
| 467 | <item row="0" column="0"> | ||
| 468 | <layout class="QVBoxLayout" name="verticalLayout_25"> | ||
| 469 | <item> | ||
| 470 | <widget class="QLabel" name="label_29"> | ||
| 471 | <property name="text"> | ||
| 472 | <string>Start:</string> | ||
| 473 | </property> | ||
| 474 | </widget> | ||
| 475 | </item> | ||
| 476 | <item> | ||
| 477 | <widget class="QPushButton" name="buttonStart"> | ||
| 478 | <property name="text"> | ||
| 479 | <string/> | ||
| 480 | </property> | ||
| 481 | </widget> | ||
| 482 | </item> | ||
| 483 | </layout> | ||
| 484 | </item> | ||
| 485 | <item row="0" column="1"> | ||
| 486 | <layout class="QVBoxLayout" name="verticalLayout_26"> | ||
| 487 | <item> | ||
| 488 | <widget class="QLabel" name="label_30"> | ||
| 489 | <property name="text"> | ||
| 490 | <string>Select:</string> | ||
| 491 | </property> | ||
| 492 | </widget> | ||
| 493 | </item> | ||
| 494 | <item> | ||
| 495 | <widget class="QPushButton" name="buttonSelect"> | ||
| 496 | <property name="text"> | ||
| 497 | <string/> | ||
| 498 | </property> | ||
| 499 | </widget> | ||
| 500 | </item> | ||
| 501 | </layout> | ||
| 502 | </item> | ||
| 503 | <item row="1" column="0"> | ||
| 504 | <layout class="QVBoxLayout" name="verticalLayout_27"> | ||
| 505 | <item> | ||
| 506 | <widget class="QLabel" name="label_31"> | ||
| 507 | <property name="text"> | ||
| 508 | <string>Home:</string> | ||
| 509 | </property> | ||
| 510 | </widget> | ||
| 511 | </item> | ||
| 512 | <item> | ||
| 513 | <widget class="QPushButton" name="buttonHome"> | ||
| 514 | <property name="text"> | ||
| 515 | <string/> | ||
| 516 | </property> | ||
| 517 | </widget> | ||
| 518 | </item> | ||
| 519 | </layout> | ||
| 520 | </item> | ||
| 521 | <item row="1" column="1"> | ||
| 522 | <layout class="QVBoxLayout" name="verticalLayout_28"> | ||
| 523 | <item> | ||
| 524 | <widget class="QLabel" name="label_34"> | ||
| 525 | <property name="text"> | ||
| 526 | <string>Circle Mod:</string> | ||
| 527 | </property> | ||
| 528 | </widget> | ||
| 529 | </item> | ||
| 530 | <item> | ||
| 531 | <widget class="QPushButton" name="buttonCircleMod"> | ||
| 532 | <property name="text"> | ||
| 533 | <string/> | ||
| 534 | </property> | ||
| 535 | </widget> | ||
| 536 | </item> | ||
| 537 | </layout> | ||
| 538 | </item> | ||
| 539 | </layout> | ||
| 540 | </widget> | ||
| 541 | </item> | ||
| 542 | </layout> | ||
| 543 | </item> | ||
| 544 | <item> | ||
| 545 | <layout class="QHBoxLayout" name="horizontalLayout"> | ||
| 546 | <item> | ||
| 547 | <spacer name="horizontalSpacer"> | ||
| 548 | <property name="orientation"> | ||
| 549 | <enum>Qt::Horizontal</enum> | ||
| 550 | </property> | ||
| 551 | <property name="sizeHint" stdset="0"> | ||
| 552 | <size> | ||
| 553 | <width>40</width> | ||
| 554 | <height>20</height> | ||
| 555 | </size> | ||
| 556 | </property> | ||
| 557 | </spacer> | ||
| 558 | </item> | ||
| 559 | <item> | ||
| 560 | <widget class="QPushButton" name="buttonRestoreDefaults"> | ||
| 561 | <property name="sizePolicy"> | ||
| 562 | <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> | ||
| 563 | <horstretch>0</horstretch> | ||
| 564 | <verstretch>0</verstretch> | ||
| 565 | </sizepolicy> | ||
| 566 | </property> | ||
| 567 | <property name="sizeIncrement"> | ||
| 568 | <size> | ||
| 569 | <width>0</width> | ||
| 570 | <height>0</height> | ||
| 571 | </size> | ||
| 572 | </property> | ||
| 573 | <property name="baseSize"> | ||
| 574 | <size> | ||
| 575 | <width>0</width> | ||
| 576 | <height>0</height> | ||
| 577 | </size> | ||
| 578 | </property> | ||
| 579 | <property name="layoutDirection"> | ||
| 580 | <enum>Qt::LeftToRight</enum> | ||
| 581 | </property> | ||
| 582 | <property name="text"> | ||
| 583 | <string>Restore Defaults</string> | ||
| 584 | </property> | ||
| 585 | </widget> | ||
| 586 | </item> | ||
| 587 | </layout> | ||
| 588 | </item> | ||
| 589 | </layout> | ||
| 590 | </widget> | ||
| 591 | <resources/> | ||
| 592 | <connections/> | ||
| 593 | </ui> | ||
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 6fe5d7a3f..68a936087 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp | |||
| @@ -513,6 +513,7 @@ void GMainWindow::OnConfigure() { | |||
| 513 | if (result == QDialog::Accepted) | 513 | if (result == QDialog::Accepted) |
| 514 | { | 514 | { |
| 515 | configureDialog.applyConfiguration(); | 515 | configureDialog.applyConfiguration(); |
| 516 | render_window->ReloadSetKeymaps(); | ||
| 516 | config->Save(); | 517 | config->Save(); |
| 517 | } | 518 | } |
| 518 | } | 519 | } |