diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2016-09-21 20:29:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-21 20:29:48 +0200 |
commit | d5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a (patch) | |
tree | 8a22ca73ff838f3f0090b29a548ae81087fc90ed /src/citra_qt/configure_input.cpp | |
parent | README: Specify master branch for Travis CI badge (diff) | |
parent | Fix Travis clang-format check (diff) | |
download | yuzu-d5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a.tar yuzu-d5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a.tar.gz yuzu-d5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a.tar.bz2 yuzu-d5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a.tar.lz yuzu-d5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a.tar.xz yuzu-d5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a.tar.zst yuzu-d5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a.zip |
Diffstat (limited to 'src/citra_qt/configure_input.cpp')
-rw-r--r-- | src/citra_qt/configure_input.cpp | 60 |
1 files changed, 32 insertions, 28 deletions
diff --git a/src/citra_qt/configure_input.cpp b/src/citra_qt/configure_input.cpp index 9c7a67174..d321db71f 100644 --- a/src/citra_qt/configure_input.cpp +++ b/src/citra_qt/configure_input.cpp @@ -5,38 +5,39 @@ #include <memory> #include <utility> #include <QTimer> - #include "citra_qt/configure_input.h" -ConfigureInput::ConfigureInput(QWidget* parent) : QWidget(parent), ui(std::make_unique<Ui::ConfigureInput>()) { +ConfigureInput::ConfigureInput(QWidget* parent) + : QWidget(parent), ui(std::make_unique<Ui::ConfigureInput>()) { + ui->setupUi(this); // Initialize mapping of input enum to UI button. input_mapping = { - { std::make_pair(Settings::NativeInput::Values::A, ui->buttonA) }, - { std::make_pair(Settings::NativeInput::Values::B, ui->buttonB) }, - { std::make_pair(Settings::NativeInput::Values::X, ui->buttonX) }, - { std::make_pair(Settings::NativeInput::Values::Y, ui->buttonY) }, - { std::make_pair(Settings::NativeInput::Values::L, ui->buttonL) }, - { std::make_pair(Settings::NativeInput::Values::R, ui->buttonR) }, - { std::make_pair(Settings::NativeInput::Values::ZL, ui->buttonZL) }, - { std::make_pair(Settings::NativeInput::Values::ZR, ui->buttonZR) }, - { std::make_pair(Settings::NativeInput::Values::START, ui->buttonStart) }, - { std::make_pair(Settings::NativeInput::Values::SELECT, ui->buttonSelect) }, - { std::make_pair(Settings::NativeInput::Values::HOME, ui->buttonHome) }, - { std::make_pair(Settings::NativeInput::Values::DUP, ui->buttonDpadUp) }, - { std::make_pair(Settings::NativeInput::Values::DDOWN, ui->buttonDpadDown) }, - { std::make_pair(Settings::NativeInput::Values::DLEFT, ui->buttonDpadLeft) }, - { std::make_pair(Settings::NativeInput::Values::DRIGHT, ui->buttonDpadRight) }, - { std::make_pair(Settings::NativeInput::Values::CUP, ui->buttonCStickUp) }, - { std::make_pair(Settings::NativeInput::Values::CDOWN, ui->buttonCStickDown) }, - { std::make_pair(Settings::NativeInput::Values::CLEFT, ui->buttonCStickLeft) }, - { std::make_pair(Settings::NativeInput::Values::CRIGHT, ui->buttonCStickRight) }, - { std::make_pair(Settings::NativeInput::Values::CIRCLE_UP, ui->buttonCircleUp) }, - { std::make_pair(Settings::NativeInput::Values::CIRCLE_DOWN, ui->buttonCircleDown) }, - { std::make_pair(Settings::NativeInput::Values::CIRCLE_LEFT, ui->buttonCircleLeft) }, - { std::make_pair(Settings::NativeInput::Values::CIRCLE_RIGHT, ui->buttonCircleRight) }, - { std::make_pair(Settings::NativeInput::Values::CIRCLE_MODIFIER, ui->buttonCircleMod) }, + {Settings::NativeInput::Values::A, ui->buttonA}, + {Settings::NativeInput::Values::B, ui->buttonB}, + {Settings::NativeInput::Values::X, ui->buttonX}, + {Settings::NativeInput::Values::Y, ui->buttonY}, + {Settings::NativeInput::Values::L, ui->buttonL}, + {Settings::NativeInput::Values::R, ui->buttonR}, + {Settings::NativeInput::Values::ZL, ui->buttonZL}, + {Settings::NativeInput::Values::ZR, ui->buttonZR}, + {Settings::NativeInput::Values::START, ui->buttonStart}, + {Settings::NativeInput::Values::SELECT, ui->buttonSelect}, + {Settings::NativeInput::Values::HOME, ui->buttonHome}, + {Settings::NativeInput::Values::DUP, ui->buttonDpadUp}, + {Settings::NativeInput::Values::DDOWN, ui->buttonDpadDown}, + {Settings::NativeInput::Values::DLEFT, ui->buttonDpadLeft}, + {Settings::NativeInput::Values::DRIGHT, ui->buttonDpadRight}, + {Settings::NativeInput::Values::CUP, ui->buttonCStickUp}, + {Settings::NativeInput::Values::CDOWN, ui->buttonCStickDown}, + {Settings::NativeInput::Values::CLEFT, ui->buttonCStickLeft}, + {Settings::NativeInput::Values::CRIGHT, ui->buttonCStickRight}, + {Settings::NativeInput::Values::CIRCLE_UP, ui->buttonCircleUp}, + {Settings::NativeInput::Values::CIRCLE_DOWN, ui->buttonCircleDown}, + {Settings::NativeInput::Values::CIRCLE_LEFT, ui->buttonCircleLeft}, + {Settings::NativeInput::Values::CIRCLE_RIGHT, ui->buttonCircleRight}, + {Settings::NativeInput::Values::CIRCLE_MODIFIER, ui->buttonCircleMod}, }; // Attach handle click method to each button click. @@ -47,7 +48,10 @@ ConfigureInput::ConfigureInput(QWidget* parent) : QWidget(parent), ui(std::make_ setFocusPolicy(Qt::ClickFocus); timer = new QTimer(this); timer->setSingleShot(true); - connect(timer, &QTimer::timeout, this, [&]() { key_pressed = Qt::Key_Escape; setKey(); }); + connect(timer, &QTimer::timeout, this, [&]() { + key_pressed = Qt::Key_Escape; + setKey(); + }); this->setConfiguration(); } @@ -59,7 +63,7 @@ void ConfigureInput::handleClick() { grabKeyboard(); grabMouse(); changing_button = sender; - timer->start(5000); //Cancel after 5 seconds + timer->start(5000); // Cancel after 5 seconds } void ConfigureInput::applyConfiguration() { |