diff options
-rw-r--r-- | src/yuzu/configuration/configure_input.cpp | 406 | ||||
-rw-r--r-- | src/yuzu/configuration/configure_input.h | 53 | ||||
-rw-r--r-- | src/yuzu/configuration/configure_input.ui | 1064 |
3 files changed, 525 insertions, 998 deletions
diff --git a/src/yuzu/configuration/configure_input.cpp b/src/yuzu/configuration/configure_input.cpp index 42a7beac6..9ae9827fe 100644 --- a/src/yuzu/configuration/configure_input.cpp +++ b/src/yuzu/configuration/configure_input.cpp @@ -9,334 +9,164 @@ #include <QMessageBox> #include <QTimer> #include "common/param_package.h" +#include "configuration/configure_touchscreen_advanced.h" +#include "core/core.h" #include "input_common/main.h" +#include "ui_configure_input.h" +#include "ui_configure_input_player.h" +#include "ui_configure_mouse_advanced.h" +#include "ui_configure_touchscreen_advanced.h" #include "yuzu/configuration/config.h" #include "yuzu/configuration/configure_input.h" - -const std::array<std::string, ConfigureInput::ANALOG_SUB_BUTTONS_NUM> - ConfigureInput::analog_sub_buttons{{ - "up", - "down", - "left", - "right", - "modifier", - }}; - -static QString getKeyName(int key_code) { - switch (key_code) { - case Qt::Key_Shift: - return QObject::tr("Shift"); - case Qt::Key_Control: - return QObject::tr("Ctrl"); - case Qt::Key_Alt: - return QObject::tr("Alt"); - case Qt::Key_Meta: - return ""; - default: - return QKeySequence(key_code).toString(); - } -} - -static void SetAnalogButton(const Common::ParamPackage& input_param, - Common::ParamPackage& analog_param, const std::string& button_name) { - if (analog_param.Get("engine", "") != "analog_from_button") { - analog_param = { - {"engine", "analog_from_button"}, - {"modifier_scale", "0.5"}, - }; - } - analog_param.Set(button_name, input_param.Serialize()); -} - -static QString ButtonToText(const Common::ParamPackage& param) { - if (!param.Has("engine")) { - return QObject::tr("[not set]"); - } else if (param.Get("engine", "") == "keyboard") { - return getKeyName(param.Get("code", 0)); - } else if (param.Get("engine", "") == "sdl") { - if (param.Has("hat")) { - return QString(QObject::tr("Hat %1 %2")) - .arg(param.Get("hat", "").c_str(), param.Get("direction", "").c_str()); - } - if (param.Has("axis")) { - return QString(QObject::tr("Axis %1%2")) - .arg(param.Get("axis", "").c_str(), param.Get("direction", "").c_str()); - } - if (param.Has("button")) { - return QString(QObject::tr("Button %1")).arg(param.Get("button", "").c_str()); - } - return QString(); - } else { - return QObject::tr("[unknown]"); - } -}; - -static QString AnalogToText(const Common::ParamPackage& param, const std::string& dir) { - if (!param.Has("engine")) { - return QObject::tr("[not set]"); - } else if (param.Get("engine", "") == "analog_from_button") { - return ButtonToText(Common::ParamPackage{param.Get(dir, "")}); - } else if (param.Get("engine", "") == "sdl") { - if (dir == "modifier") { - return QString(QObject::tr("[unused]")); - } - - if (dir == "left" || dir == "right") { - return QString(QObject::tr("Axis %1")).arg(param.Get("axis_x", "").c_str()); - } else if (dir == "up" || dir == "down") { - return QString(QObject::tr("Axis %1")).arg(param.Get("axis_y", "").c_str()); - } - return QString(); - } else { - return QObject::tr("[unknown]"); - } -}; +#include "yuzu/configuration/configure_input_player.h" +#include "yuzu/configuration/configure_mouse_advanced.h" ConfigureInput::ConfigureInput(QWidget* parent) - : QWidget(parent), ui(std::make_unique<Ui::ConfigureInput>()), - timeout_timer(std::make_unique<QTimer>()), poll_timer(std::make_unique<QTimer>()) { - + : QWidget(parent), ui(std::make_unique<Ui::ConfigureInput>()) { ui->setupUi(this); - setFocusPolicy(Qt::ClickFocus); - button_map = { - ui->buttonA, ui->buttonB, ui->buttonX, ui->buttonY, - ui->buttonLStick, ui->buttonRStick, ui->buttonL, ui->buttonR, - ui->buttonZL, ui->buttonZR, ui->buttonPlus, ui->buttonMinus, - ui->buttonDpadLeft, ui->buttonDpadUp, ui->buttonDpadRight, ui->buttonDpadDown, - ui->buttonLStickLeft, ui->buttonLStickUp, ui->buttonLStickRight, ui->buttonLStickDown, - ui->buttonRStickLeft, ui->buttonRStickUp, ui->buttonRStickRight, ui->buttonRStickDown, - ui->buttonSL, ui->buttonSR, ui->buttonHome, ui->buttonScreenshot, + players_enabled = { + ui->player1_checkbox, ui->player2_checkbox, ui->player3_checkbox, ui->player4_checkbox, + ui->player5_checkbox, ui->player6_checkbox, ui->player7_checkbox, ui->player8_checkbox, }; - analog_map_buttons = {{ - { - ui->buttonLStickUp, - ui->buttonLStickDown, - ui->buttonLStickLeft, - ui->buttonLStickRight, - ui->buttonLStickMod, - }, - { - ui->buttonRStickUp, - ui->buttonRStickDown, - ui->buttonRStickLeft, - ui->buttonRStickRight, - ui->buttonRStickMod, - }, - }}; + player_controller = { + ui->player1_combobox, ui->player2_combobox, ui->player3_combobox, ui->player4_combobox, + ui->player5_combobox, ui->player6_combobox, ui->player7_combobox, ui->player8_combobox, + }; - analog_map_stick = {ui->buttonLStickAnalog, ui->buttonRStickAnalog}; + player_configure = { + ui->player1_configure, ui->player2_configure, ui->player3_configure, ui->player4_configure, + ui->player5_configure, ui->player6_configure, ui->player7_configure, ui->player8_configure, + }; - for (int button_id = 0; button_id < Settings::NativeButton::NumButtons; button_id++) { - if (!button_map[button_id]) - continue; - button_map[button_id]->setContextMenuPolicy(Qt::CustomContextMenu); - connect(button_map[button_id], &QPushButton::released, [=]() { - handleClick( - button_map[button_id], - [=](const Common::ParamPackage& params) { buttons_param[button_id] = params; }, - InputCommon::Polling::DeviceType::Button); - }); - connect(button_map[button_id], &QPushButton::customContextMenuRequested, - [=](const QPoint& menu_location) { - QMenu context_menu; - context_menu.addAction(tr("Clear"), [&] { - buttons_param[button_id].Clear(); - button_map[button_id]->setText(tr("[not set]")); - }); - context_menu.addAction(tr("Restore Default"), [&] { - buttons_param[button_id] = Common::ParamPackage{ - InputCommon::GenerateKeyboardParam(Config::default_buttons[button_id])}; - button_map[button_id]->setText(ButtonToText(buttons_param[button_id])); - }); - context_menu.exec(button_map[button_id]->mapToGlobal(menu_location)); - }); + for (auto* controller_box : player_controller) { + controller_box->addItems( + {"Pro Controller", "Dual Joycons", "Single Right Joycon", "Single Left Joycon"}); } - for (int analog_id = 0; analog_id < Settings::NativeAnalog::NumAnalogs; analog_id++) { - for (int sub_button_id = 0; sub_button_id < ANALOG_SUB_BUTTONS_NUM; sub_button_id++) { - if (!analog_map_buttons[analog_id][sub_button_id]) - continue; - analog_map_buttons[analog_id][sub_button_id]->setContextMenuPolicy( - Qt::CustomContextMenu); - connect(analog_map_buttons[analog_id][sub_button_id], &QPushButton::released, [=]() { - handleClick(analog_map_buttons[analog_id][sub_button_id], - [=](const Common::ParamPackage& params) { - SetAnalogButton(params, analogs_param[analog_id], - analog_sub_buttons[sub_button_id]); - }, - InputCommon::Polling::DeviceType::Button); - }); - connect(analog_map_buttons[analog_id][sub_button_id], - &QPushButton::customContextMenuRequested, [=](const QPoint& menu_location) { - QMenu context_menu; - context_menu.addAction(tr("Clear"), [&] { - analogs_param[analog_id].Erase(analog_sub_buttons[sub_button_id]); - analog_map_buttons[analog_id][sub_button_id]->setText(tr("[not set]")); - }); - context_menu.addAction(tr("Restore Default"), [&] { - Common::ParamPackage params{InputCommon::GenerateKeyboardParam( - Config::default_analogs[analog_id][sub_button_id])}; - SetAnalogButton(params, analogs_param[analog_id], - analog_sub_buttons[sub_button_id]); - analog_map_buttons[analog_id][sub_button_id]->setText(AnalogToText( - analogs_param[analog_id], analog_sub_buttons[sub_button_id])); - }); - context_menu.exec(analog_map_buttons[analog_id][sub_button_id]->mapToGlobal( - menu_location)); - }); - } - connect(analog_map_stick[analog_id], &QPushButton::released, [=]() { - QMessageBox::information(this, tr("Information"), - tr("After pressing OK, first move your joystick horizontally, " - "and then vertically.")); - handleClick( - analog_map_stick[analog_id], - [=](const Common::ParamPackage& params) { analogs_param[analog_id] = params; }, - InputCommon::Polling::DeviceType::Analog); - }); - } + this->loadConfiguration(); + updateUIEnabled(); - connect(ui->buttonClearAll, &QPushButton::released, [this] { ClearAll(); }); - connect(ui->buttonRestoreDefaults, &QPushButton::released, [this]() { restoreDefaults(); }); + connect(ui->restore_defaults_button, &QPushButton::pressed, this, + &ConfigureInput::restoreDefaults); - timeout_timer->setSingleShot(true); - connect(timeout_timer.get(), &QTimer::timeout, [this]() { setPollingResult({}, true); }); + for (auto* enabled : players_enabled) + connect(enabled, &QCheckBox::stateChanged, this, &ConfigureInput::updateUIEnabled); + connect(ui->use_docked_mode, &QCheckBox::stateChanged, this, &ConfigureInput::updateUIEnabled); + connect(ui->handheld_connected, &QCheckBox::stateChanged, this, + &ConfigureInput::updateUIEnabled); + connect(ui->mouse_enabled, &QCheckBox::stateChanged, this, &ConfigureInput::updateUIEnabled); + connect(ui->keyboard_enabled, &QCheckBox::stateChanged, this, &ConfigureInput::updateUIEnabled); + connect(ui->debug_enabled, &QCheckBox::stateChanged, this, &ConfigureInput::updateUIEnabled); + connect(ui->touchscreen_enabled, &QCheckBox::stateChanged, this, + &ConfigureInput::updateUIEnabled); - connect(poll_timer.get(), &QTimer::timeout, [this]() { - Common::ParamPackage params; - for (auto& poller : device_pollers) { - params = poller->GetNextInput(); - if (params.Has("engine")) { - setPollingResult(params, false); - return; - } - } - }); + for (std::size_t i = 0; i < player_configure.size(); ++i) { + connect(player_configure[i], &QPushButton::pressed, this, + [this, i]() { CallConfigureDialog<ConfigureInputPlayer>(i, false); }); + } - this->loadConfiguration(); + connect(ui->handheld_configure, &QPushButton::pressed, this, + [this]() { CallConfigureDialog<ConfigureInputPlayer>(8, false); }); - // TODO(wwylele): enable this when we actually emulate it - ui->buttonHome->setEnabled(false); -} + connect(ui->debug_configure, &QPushButton::pressed, this, + [this]() { CallConfigureDialog<ConfigureInputPlayer>(9, true); }); -void ConfigureInput::applyConfiguration() { - std::transform(buttons_param.begin(), buttons_param.end(), Settings::values.buttons.begin(), - [](const Common::ParamPackage& param) { return param.Serialize(); }); - std::transform(analogs_param.begin(), analogs_param.end(), Settings::values.analogs.begin(), - [](const Common::ParamPackage& param) { return param.Serialize(); }); -} + connect(ui->mouse_advanced, &QPushButton::pressed, this, + [this]() { CallConfigureDialog<ConfigureMouseAdvanced>(); }); -void ConfigureInput::loadConfiguration() { - std::transform(Settings::values.buttons.begin(), Settings::values.buttons.end(), - buttons_param.begin(), - [](const std::string& str) { return Common::ParamPackage(str); }); - std::transform(Settings::values.analogs.begin(), Settings::values.analogs.end(), - analogs_param.begin(), - [](const std::string& str) { return Common::ParamPackage(str); }); - updateButtonLabels(); + connect(ui->touchscreen_advanced, &QPushButton::pressed, this, + [this]() { CallConfigureDialog<ConfigureTouchscreenAdvanced>(); }); + + ui->use_docked_mode->setEnabled(!Core::System::GetInstance().IsPoweredOn()); } -void ConfigureInput::restoreDefaults() { - for (int button_id = 0; button_id < Settings::NativeButton::NumButtons; button_id++) { - buttons_param[button_id] = Common::ParamPackage{ - InputCommon::GenerateKeyboardParam(Config::default_buttons[button_id])}; - } +template <typename Dialog, typename... Args> +void ConfigureInput::CallConfigureDialog(Args... args) { + this->applyConfiguration(); + Dialog dialog(this, args...); - for (int analog_id = 0; analog_id < Settings::NativeAnalog::NumAnalogs; analog_id++) { - for (int sub_button_id = 0; sub_button_id < ANALOG_SUB_BUTTONS_NUM; sub_button_id++) { - Common::ParamPackage params{InputCommon::GenerateKeyboardParam( - Config::default_analogs[analog_id][sub_button_id])}; - SetAnalogButton(params, analogs_param[analog_id], analog_sub_buttons[sub_button_id]); - } + const auto res = dialog.exec(); + if (res == QDialog::Accepted) { + dialog.applyConfiguration(); } - updateButtonLabels(); } -void ConfigureInput::ClearAll() { - for (int button_id = 0; button_id < Settings::NativeButton::NumButtons; button_id++) { - if (button_map[button_id] && button_map[button_id]->isEnabled()) - buttons_param[button_id].Clear(); - } - for (int analog_id = 0; analog_id < Settings::NativeAnalog::NumAnalogs; analog_id++) { - for (int sub_button_id = 0; sub_button_id < ANALOG_SUB_BUTTONS_NUM; sub_button_id++) { - if (analog_map_buttons[analog_id][sub_button_id] && - analog_map_buttons[analog_id][sub_button_id]->isEnabled()) - analogs_param[analog_id].Erase(analog_sub_buttons[sub_button_id]); - } - } - updateButtonLabels(); +void ConfigureInput::applyConfiguration() { + for (std::size_t i = 0; i < 8; ++i) { + Settings::values.players[i].connected = players_enabled[i]->isChecked(); + Settings::values.players[i].type = + static_cast<Settings::ControllerType>(player_controller[i]->currentIndex()); + } + + Settings::values.use_docked_mode = ui->use_docked_mode->isChecked(); + Settings::values.players[8].connected = ui->handheld_connected->isChecked(); + Settings::values.debug_pad_enabled = ui->debug_enabled->isChecked(); + Settings::values.mouse_enabled = ui->mouse_enabled->isChecked(); + Settings::values.keyboard_enabled = ui->keyboard_enabled->isChecked(); + Settings::values.touchscreen.enabled = ui->touchscreen_enabled->isChecked(); } -void ConfigureInput::updateButtonLabels() { - for (int button = 0; button < Settings::NativeButton::NumButtons; button++) { - button_map[button]->setText(ButtonToText(buttons_param[button])); - } +void ConfigureInput::updateUIEnabled() { + for (std::size_t i = 0; i < 8; ++i) { + const auto enabled = players_enabled[i]->checkState() == Qt::Checked; - for (int analog_id = 0; analog_id < Settings::NativeAnalog::NumAnalogs; analog_id++) { - for (int sub_button_id = 0; sub_button_id < ANALOG_SUB_BUTTONS_NUM; sub_button_id++) { - if (analog_map_buttons[analog_id][sub_button_id]) { - analog_map_buttons[analog_id][sub_button_id]->setText( - AnalogToText(analogs_param[analog_id], analog_sub_buttons[sub_button_id])); - } - } - analog_map_stick[analog_id]->setText(tr("Set Analog Stick")); + player_controller[i]->setEnabled(enabled); + player_configure[i]->setEnabled(enabled); } -} - -void ConfigureInput::handleClick(QPushButton* button, - std::function<void(const Common::ParamPackage&)> new_input_setter, - InputCommon::Polling::DeviceType type) { - button->setText(tr("[press key]")); - button->setFocus(); - - input_setter = new_input_setter; - - device_pollers = InputCommon::Polling::GetPollers(type); - - // Keyboard keys can only be used as button devices - want_keyboard_keys = type == InputCommon::Polling::DeviceType::Button; - for (auto& poller : device_pollers) { - poller->Start(); + bool hit_disabled = false; + for (auto* player : players_enabled) { + if (hit_disabled) + player->setDisabled(true); + else + player->setEnabled(true); + if (!player->isChecked()) + hit_disabled = true; } - grabKeyboard(); - grabMouse(); - timeout_timer->start(5000); // Cancel after 5 seconds - poll_timer->start(200); // Check for new inputs every 200ms + ui->handheld_connected->setEnabled(!ui->use_docked_mode->isChecked()); + ui->handheld_configure->setEnabled(ui->handheld_connected->isChecked() && + !ui->use_docked_mode->isChecked()); + ui->mouse_advanced->setEnabled(ui->mouse_enabled->isChecked()); + ui->debug_configure->setEnabled(ui->debug_enabled->isChecked()); + ui->touchscreen_advanced->setEnabled(ui->touchscreen_enabled->isChecked()); } -void ConfigureInput::setPollingResult(const Common::ParamPackage& params, bool abort) { - releaseKeyboard(); - releaseMouse(); - timeout_timer->stop(); - poll_timer->stop(); - for (auto& poller : device_pollers) { - poller->Stop(); - } +void ConfigureInput::loadConfiguration() { + std::stable_partition(Settings::values.players.begin(), Settings::values.players.end(), + [](const auto& player) { return player.connected; }); - if (!abort) { - (*input_setter)(params); + for (std::size_t i = 0; i < 8; ++i) { + players_enabled[i]->setChecked(Settings::values.players[i].connected); + player_controller[i]->setCurrentIndex(static_cast<u8>(Settings::values.players[i].type)); } - updateButtonLabels(); - input_setter = {}; + ui->use_docked_mode->setChecked(Settings::values.use_docked_mode); + ui->handheld_connected->setChecked(Settings::values.players[8].connected); + ui->debug_enabled->setChecked(Settings::values.debug_pad_enabled); + ui->mouse_enabled->setChecked(Settings::values.mouse_enabled); + ui->keyboard_enabled->setChecked(Settings::values.keyboard_enabled); + ui->touchscreen_enabled->setChecked(Settings::values.touchscreen.enabled); + + updateUIEnabled(); } -void ConfigureInput::keyPressEvent(QKeyEvent* event) { - if (!input_setter || !event) - return; +void ConfigureInput::restoreDefaults() { + players_enabled[0]->setCheckState(Qt::Checked); + player_controller[0]->setCurrentIndex(1); - if (event->key() != Qt::Key_Escape) { - if (want_keyboard_keys) { - setPollingResult(Common::ParamPackage{InputCommon::GenerateKeyboardParam(event->key())}, - false); - } else { - // Escape key wasn't pressed and we don't want any keyboard keys, so don't stop polling - return; - } + for (std::size_t i = 1; i < 8; ++i) { + players_enabled[i]->setCheckState(Qt::Unchecked); + player_controller[i]->setCurrentIndex(0); } - setPollingResult({}, true); + + ui->use_docked_mode->setCheckState(Qt::Unchecked); + ui->handheld_connected->setCheckState(Qt::Unchecked); + ui->mouse_enabled->setCheckState(Qt::Unchecked); + ui->keyboard_enabled->setCheckState(Qt::Unchecked); + ui->debug_enabled->setCheckState(Qt::Unchecked); + ui->touchscreen_enabled->setCheckState(Qt::Checked); + updateUIEnabled(); } diff --git a/src/yuzu/configuration/configure_input.h b/src/yuzu/configuration/configure_input.h index 32c7183f9..0ba77c5ef 100644 --- a/src/yuzu/configuration/configure_input.h +++ b/src/yuzu/configuration/configure_input.h @@ -18,6 +18,7 @@ #include "core/settings.h" #include "input_common/main.h" #include "ui_configure_input.h" +#include "yuzu/configuration/config.h" class QPushButton; class QString; @@ -37,57 +38,19 @@ public: void applyConfiguration(); private: - std::unique_ptr<Ui::ConfigureInput> ui; - - std::unique_ptr<QTimer> timeout_timer; - std::unique_ptr<QTimer> poll_timer; - - /// This will be the the setting function when an input is awaiting configuration. - std::optional<std::function<void(const Common::ParamPackage&)>> input_setter; - - std::array<Common::ParamPackage, Settings::NativeButton::NumButtons> buttons_param; - std::array<Common::ParamPackage, Settings::NativeAnalog::NumAnalogs> analogs_param; - - static constexpr int ANALOG_SUB_BUTTONS_NUM = 5; - - /// Each button input is represented by a QPushButton. - std::array<QPushButton*, Settings::NativeButton::NumButtons> button_map; - - /// A group of five QPushButtons represent one analog input. The buttons each represent up, - /// down, left, right, and modifier, respectively. - std::array<std::array<QPushButton*, ANALOG_SUB_BUTTONS_NUM>, Settings::NativeAnalog::NumAnalogs> - analog_map_buttons; + void updateUIEnabled(); - /// Analog inputs are also represented each with a single button, used to configure with an - /// actual analog stick - std::array<QPushButton*, Settings::NativeAnalog::NumAnalogs> analog_map_stick; - - static const std::array<std::string, ANALOG_SUB_BUTTONS_NUM> analog_sub_buttons; - - std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> device_pollers; - - /// A flag to indicate if keyboard keys are okay when configuring an input. If this is false, - /// keyboard events are ignored. - bool want_keyboard_keys = false; + template <typename Dialog, typename... Args> + void CallConfigureDialog(Args... args); /// Load configuration settings. void loadConfiguration(); /// Restore all buttons to their default values. void restoreDefaults(); - /// Clear all input configuration - void ClearAll(); - /// Update UI to reflect current configuration. - void updateButtonLabels(); - - /// Called when the button was pressed. - void handleClick(QPushButton* button, - std::function<void(const Common::ParamPackage&)> new_input_setter, - InputCommon::Polling::DeviceType type); - - /// Finish polling and configure input using the input_setter - void setPollingResult(const Common::ParamPackage& params, bool abort); + std::unique_ptr<Ui::ConfigureInput> ui; - /// Handle key press events. - void keyPressEvent(QKeyEvent* event) override; + std::array<QCheckBox*, 8> players_enabled; + std::array<QComboBox*, 8> player_controller; + std::array<QPushButton*, 8> player_configure; }; diff --git a/src/yuzu/configuration/configure_input.ui b/src/yuzu/configuration/configure_input.ui index 8a019a693..f12896b47 100644 --- a/src/yuzu/configuration/configure_input.ui +++ b/src/yuzu/configuration/configure_input.ui @@ -6,7 +6,7 @@ <rect> <x>0</x> <y>0</y> - <width>343</width> + <width>473</width> <height>677</height> </rect> </property> @@ -15,740 +15,474 @@ </property> <layout class="QVBoxLayout" name="verticalLayout_5"> <item> - <layout class="QGridLayout" name="buttons"> - <item row="3" column="1"> - <widget class="QGroupBox" name="misc"> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QGroupBox" name="gridGroupBox"> <property name="title"> - <string>Misc.</string> - </property> - <property name="flat"> - <bool>false</bool> - </property> - <property name="checkable"> - <bool>false</bool> + <string>Players</string> </property> - <layout class="QGridLayout" name="gridLayout_6"> - <item row="0" column="0"> - <layout class="QVBoxLayout" name="buttonMiscMinusVerticalLayout"> - <item> - <widget class="QLabel" name="labelMinus"> - <property name="text"> - <string>Minus:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonMinus"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <layout class="QGridLayout" name="gridLayout"> + <item row="1" column="2"> + <widget class="QComboBox" name="player1_combobox"> + <property name="minimumSize"> + <size> + <width>110</width> + <height>0</height> + </size> + </property> + </widget> </item> - <item row="0" column="1"> - <layout class="QVBoxLayout" name="buttonMiscPlusVerticalLayout"> - <item> - <widget class="QLabel" name="labelPlus"> - <property name="text"> - <string>Plus:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonPlus"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <item row="1" column="3"> + <widget class="QPushButton" name="player1_configure"> + <property name="text"> + <string>Configure</string> + </property> + </widget> </item> - <item row="1" column="0"> - <layout class="QVBoxLayout" name="buttonMiscHomeVerticalLayout"> - <item> - <widget class="QLabel" name="labelHome"> - <property name="text"> - <string>Home:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonHome"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <item row="0" column="2"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Controller Type</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> </item> <item row="1" column="1"> - <layout class="QVBoxLayout" name="buttonMiscScrCapVerticalLayout"> - <item> - <widget class="QLabel" name="labelScrCap"> - <property name="text"> - <string>Screen -Capture:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonScreenshot"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <widget class="QCheckBox" name="player1_checkbox"> + <property name="text"> + <string>Player 1</string> + </property> + </widget> + </item> + <item row="7" column="1"> + <widget class="QCheckBox" name="player7_checkbox"> + <property name="text"> + <string>Player 7</string> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QCheckBox" name="player4_checkbox"> + <property name="text"> + <string>Player 4</string> + </property> + </widget> + </item> + <item row="5" column="1"> + <widget class="QCheckBox" name="player5_checkbox"> + <property name="text"> + <string>Player 5</string> + </property> + </widget> + </item> + <item row="6" column="1"> + <widget class="QCheckBox" name="player6_checkbox"> + <property name="text"> + <string>Player 6</string> + </property> + </widget> + </item> + <item row="8" column="1"> + <widget class="QCheckBox" name="player8_checkbox"> + <property name="text"> + <string>Player 8</string> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QCheckBox" name="player3_checkbox"> + <property name="text"> + <string>Player 3</string> + </property> + </widget> </item> <item row="2" column="1"> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> + <widget class="QCheckBox" name="player2_checkbox"> + <property name="text"> + <string>Player 2</string> </property> - <property name="sizeHint" stdset="0"> + </widget> + </item> + <item row="2" column="2"> + <widget class="QComboBox" name="player2_combobox"> + <property name="minimumSize"> <size> - <width>20</width> - <height>40</height> + <width>110</width> + <height>0</height> </size> </property> - </spacer> + </widget> </item> - </layout> - </widget> - </item> - <item row="0" column="0"> - <widget class="QGroupBox" name="faceButtons"> - <property name="title"> - <string>Face Buttons</string> - </property> - <property name="flat"> - <bool>false</bool> - </property> - <property name="checkable"> - <bool>false</bool> - </property> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0"> - <layout class="QVBoxLayout" name="buttonFaceButtonsAVerticalLayout"> - <item> - <widget class="QLabel" name="labelA"> - <property name="text"> - <string>A:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonA"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <item row="3" column="2"> + <widget class="QComboBox" name="player3_combobox"> + <property name="minimumSize"> + <size> + <width>110</width> + <height>0</height> + </size> + </property> + </widget> </item> - <item row="0" column="1"> - <layout class="QVBoxLayout" name="buttonFaceButtonsBVerticalLayout"> - <item> - <widget class="QLabel" name="labelB"> - <property name="text"> - <string>B:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonB"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <item row="4" column="2"> + <widget class="QComboBox" name="player4_combobox"> + <property name="minimumSize"> + <size> + <width>110</width> + <height>0</height> + </size> + </property> + </widget> </item> - <item row="1" column="0"> - <layout class="QVBoxLayout" name="buttonFaceButtonsXVerticalLayout"> - <item> - <widget class="QLabel" name="labelX"> - <property name="text"> - <string>X:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonX"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <item row="5" column="2"> + <widget class="QComboBox" name="player5_combobox"> + <property name="minimumSize"> + <size> + <width>110</width> + <height>0</height> + </size> + </property> + </widget> </item> - <item row="1" column="1"> - <layout class="QVBoxLayout" name="buttonFaceButtonsYVerticalLayout"> - <item> - <widget class="QLabel" name="labelY"> - <property name="text"> - <string>Y:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonY"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <item row="6" column="2"> + <widget class="QComboBox" name="player6_combobox"> + <property name="minimumSize"> + <size> + <width>110</width> + <height>0</height> + </size> + </property> + </widget> </item> - </layout> - </widget> - </item> - <item row="0" column="1"> - <widget class="QGroupBox" name="Dpad"> - <property name="title"> - <string>Directional Pad</string> - </property> - <property name="flat"> - <bool>false</bool> - </property> - <property name="checkable"> - <bool>false</bool> - </property> - <layout class="QGridLayout" name="gridLayout_2"> - <item row="1" column="0"> - <layout class="QVBoxLayout" name="buttonDpadUpVerticalLayout"> - <item> - <widget class="QLabel" name="labelDpadUp"> - <property name="text"> - <string>Up:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonDpadUp"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <item row="7" column="2"> + <widget class="QComboBox" name="player7_combobox"> + <property name="minimumSize"> + <size> + <width>110</width> + <height>0</height> + </size> + </property> + </widget> </item> - <item row="1" column="1"> - <layout class="QVBoxLayout" name="buttonDpadDownVerticalLayout"> - <item> - <widget class="QLabel" name="labelDpadDown"> - <property name="text"> - <string>Down:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonDpadDown"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <item row="8" column="2"> + <widget class="QComboBox" name="player8_combobox"> + <property name="minimumSize"> + <size> + <width>110</width> + <height>0</height> + </size> + </property> + </widget> + </item> + <item row="2" column="3"> + <widget class="QPushButton" name="player2_configure"> + <property name="text"> + <string>Configure</string> + </property> + </widget> + </item> + <item row="3" column="3"> + <widget class="QPushButton" name="player3_configure"> + <property name="text"> + <string>Configure</string> + </property> + </widget> + </item> + <item row="4" column="3"> + <widget class="QPushButton" name="player4_configure"> + <property name="text"> + <string>Configure</string> + </property> + </widget> + </item> + <item row="5" column="3"> + <widget class="QPushButton" name="player5_configure"> + <property name="text"> + <string>Configure</string> + </property> + </widget> + </item> + <item row="6" column="3"> + <widget class="QPushButton" name="player6_configure"> + <property name="text"> + <string>Configure</string> + </property> + </widget> + </item> + <item row="7" column="3"> + <widget class="QPushButton" name="player7_configure"> + <property name="text"> + <string>Configure</string> + </property> + </widget> + </item> + <item row="8" column="3"> + <widget class="QPushButton" name="player8_configure"> + <property name="text"> + <string>Configure</string> + </property> + </widget> </item> <item row="0" column="0"> - <layout class="QVBoxLayout" name="buttonDpadLeftVerticalLayout"> - <item> - <widget class="QLabel" name="labelDpadLeft"> - <property name="text"> - <string>Left:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonDpadLeft"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="0" column="4"> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> </item> <item row="0" column="1"> - <layout class="QVBoxLayout" name="buttonDpadRightVerticalLayout"> - <item> - <widget class="QLabel" name="labelDpadRight"> - <property name="text"> - <string>Right:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonDpadRight"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>Enabled</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> </item> </layout> </widget> </item> - <item row="3" column="0"> - <widget class="QGroupBox" name="shoulderButtons"> + <item> + <widget class="QGroupBox" name="gridGroupBox"> <property name="title"> - <string>Shoulder Buttons</string> - </property> - <property name="flat"> - <bool>false</bool> - </property> - <property name="checkable"> - <bool>false</bool> + <string>Handheld</string> </property> - <layout class="QGridLayout" name="gridLayout_3"> - <item row="0" column="0"> - <layout class="QVBoxLayout" name="buttonShoulderButtonsLVerticalLayout"> - <item> - <widget class="QLabel" name="labelL"> - <property name="text"> - <string>L:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonL"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="1" column="2"> + <spacer name="horizontalSpacer_5"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>72</width> + <height>20</height> + </size> + </property> + </spacer> </item> - <item row="0" column="1"> - <layout class="QVBoxLayout" name="buttonShoulderButtonsRVerticalLayout"> - <item> - <widget class="QLabel" name="labelR"> - <property name="text"> - <string>R:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonR"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <item row="1" column="4"> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="1" column="3"> + <widget class="QPushButton" name="handheld_configure"> + <property name="text"> + <string>Configure</string> + </property> + </widget> </item> <item row="1" column="0"> - <layout class="QVBoxLayout" name="buttonShoulderButtonsZLVerticalLayout"> - <item> - <widget class="QLabel" name="labelZL"> - <property name="text"> - <string>ZL:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonZL"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> </item> <item row="1" column="1"> - <layout class="QVBoxLayout" name="buttonShoulderButtonsZRVerticalLayout"> - <item> - <widget class="QLabel" name="labelZR"> - <property name="text"> - <string>ZR:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonZR"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </item> - <item row="2" column="0"> - <layout class="QVBoxLayout" name="buttonShoulderButtonsSLVerticalLayout"> - <item> - <widget class="QLabel" name="labelSL"> - <property name="text"> - <string>SL:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonSL"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <widget class="QCheckBox" name="handheld_connected"> + <property name="text"> + <string>Connected</string> + </property> + </widget> </item> - <item row="2" column="1"> - <layout class="QVBoxLayout" name="buttonShoulderButtonsSRVerticalLayout"> - <item> - <widget class="QLabel" name="labelSR"> - <property name="text"> - <string>SR:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonSR"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <item row="0" column="1"> + <widget class="QCheckBox" name="use_docked_mode"> + <property name="text"> + <string>Use Docked Mode</string> + </property> + </widget> </item> </layout> </widget> </item> - <item row="1" column="1"> - <widget class="QGroupBox" name="RStick"> + <item> + <widget class="QGroupBox" name="gridGroupBox"> <property name="title"> - <string>Right Stick</string> - </property> - <property name="alignment"> - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + <string>Other</string> </property> - <property name="flat"> - <bool>false</bool> - </property> - <property name="checkable"> - <bool>false</bool> - </property> - <layout class="QGridLayout" name="gridLayout_5"> + <layout class="QGridLayout" name="gridLayout_3"> <item row="1" column="1"> - <layout class="QVBoxLayout" name="buttonRStickDownVerticalLayout"> - <item> - <widget class="QLabel" name="labelRStickDown"> - <property name="text"> - <string>Down:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonRStickDown"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </item> - <item row="0" column="1"> - <layout class="QVBoxLayout" name="buttonRStickRightVerticalLayout"> - <item> - <widget class="QLabel" name="labelRStickRight"> - <property name="text"> - <string>Right:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonRStickRight"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </item> - <item row="3" column="0" colspan="2"> - <widget class="QPushButton" name="buttonRStickAnalog"> + <widget class="QCheckBox" name="keyboard_enabled"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>23</height> + </size> + </property> <property name="text"> - <string>Set Analog Stick</string> + <string>Keyboard</string> </property> </widget> </item> - <item row="0" column="0"> - <layout class="QVBoxLayout" name="buttonRStickLeftVerticalLayout"> - <item> - <widget class="QLabel" name="labelRStickLeft"> - <property name="text"> - <string>Left:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonRStickLeft"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </item> - <item row="1" column="0"> - <layout class="QVBoxLayout" name="buttonRStickUpVerticalLayout"> - <item> - <widget class="QLabel" name="labelRStickUp"> - <property name="text"> - <string>Up:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonRStickUp"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </item> - <item row="2" column="0"> - <layout class="QVBoxLayout" name="buttonRStickPressedVerticalLayout"> - <item> - <widget class="QLabel" name="labelRStickPressed"> - <property name="text"> - <string>Pressed:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonRStick"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </item> <item row="2" column="1"> - <layout class="QVBoxLayout" name="buttonRStickModVerticalLayout"> - <item> - <widget class="QLabel" name="labelRStickMod"> - <property name="text"> - <string>Modifier:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonRStickMod"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <widget class="QCheckBox" name="debug_enabled"> + <property name="text"> + <string>Debug Controller</string> + </property> + </widget> </item> - </layout> - </widget> - </item> - <item row="1" column="0"> - <widget class="QGroupBox" name="LStick"> - <property name="title"> - <string>Left Stick</string> - </property> - <property name="flat"> - <bool>false</bool> - </property> - <property name="checkable"> - <bool>false</bool> - </property> - <layout class="QGridLayout" name="gridLayout_4"> - <item row="1" column="1"> - <layout class="QVBoxLayout" name="buttonLStickDownVerticalLayout"> - <item> - <widget class="QLabel" name="labelLStickDown"> - <property name="text"> - <string>Down:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonLStickDown"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </item> - <item row="4" column="0" colspan="2"> - <widget class="QPushButton" name="buttonLStickAnalog"> + <item row="3" column="1"> + <widget class="QCheckBox" name="touchscreen_enabled"> <property name="text"> - <string>Set Analog Stick</string> + <string>Touchscreen</string> </property> </widget> </item> <item row="0" column="1"> - <layout class="QVBoxLayout" name="buttonLStickRightVerticalLayout"> - <item> - <widget class="QLabel" name="labelLStickRight"> - <property name="text"> - <string>Right:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonLStickRight"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <widget class="QCheckBox" name="mouse_enabled"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>23</height> + </size> + </property> + <property name="text"> + <string>Mouse</string> + </property> + </widget> + </item> + <item row="0" column="4"> + <spacer name="horizontalSpacer_7"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="0" column="2"> + <spacer name="horizontalSpacer_8"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>76</width> + <height>20</height> + </size> + </property> + </spacer> </item> <item row="0" column="0"> - <layout class="QVBoxLayout" name="buttonLStickLeftVerticalLayout"> - <item> - <widget class="QLabel" name="labelLStickLeft"> - <property name="text"> - <string>Left:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonLStickLeft"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <spacer name="horizontalSpacer_6"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> </item> - <item row="1" column="0"> - <layout class="QVBoxLayout" name="buttonLStickUpVerticalLayout"> - <item> - <widget class="QLabel" name="labelLStickUp"> - <property name="text"> - <string>Up:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonLStickUp"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </item> - <item row="3" column="0"> - <layout class="QVBoxLayout" name="buttonLStickModVerticalLayout"> - <item> - <widget class="QLabel" name="labelLStickMod"> - <property name="text"> - <string>Modifier:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonLStickMod"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <item row="3" column="3"> + <widget class="QPushButton" name="touchscreen_advanced"> + <property name="text"> + <string>Advanced</string> + </property> + </widget> </item> - <item row="3" column="1"> - <layout class="QVBoxLayout" name="buttonLStickPressedVerticalLayout" stretch="0,0"> - <item> - <widget class="QLabel" name="labelLStickPressed"> - <property name="text"> - <string>Pressed:</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonLStick"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <item row="2" column="3"> + <widget class="QPushButton" name="debug_configure"> + <property name="text"> + <string>Configure</string> + </property> + </widget> + </item> + <item row="0" column="3"> + <widget class="QPushButton" name="mouse_advanced"> + <property name="text"> + <string>Advanced</string> + </property> + </widget> </item> </layout> </widget> </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> <item> - <spacer name="horizontalSpacer"> + <spacer name="verticalSpacer"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Vertical</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> - <height>20</height> + <width>20</width> + <height>40</height> </size> </property> </spacer> </item> <item> - <widget class="QPushButton" name="buttonClearAll"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="sizeIncrement"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="baseSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="layoutDirection"> - <enum>Qt::LeftToRight</enum> - </property> - <property name="text"> - <string>Clear All</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonRestoreDefaults"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="sizeIncrement"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="baseSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="layoutDirection"> - <enum>Qt::LeftToRight</enum> - </property> - <property name="text"> - <string>Restore Defaults</string> - </property> - </widget> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QPushButton" name="restore_defaults_button"> + <property name="text"> + <string>Restore Defaults</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_9"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> </item> </layout> </item> |