This commit is contained in:
Steven Cherry 2016-06-23 07:00:07 -05:00
parent 071d0325a3
commit 4ba93b819a
2 changed files with 6 additions and 4 deletions

View File

@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include <utility>
#include <QTimer>
#include "citra_qt/configure_input.h"
@ -45,6 +46,7 @@ ConfigureInput::ConfigureInput(QWidget* parent) :
}
connect(ui->btnRestoreDefaults, SIGNAL(released()), this, SLOT(restoreDefaults()));
setFocusPolicy(Qt::ClickFocus);
timer = new QTimer(this);
timer->setSingleShot(true);
connect(timer, &QTimer::timeout, this, [&]() { key_pressed = Qt::Key_Escape; setKey(); });
this->setConfiguration();

View File

@ -7,7 +7,6 @@
#include <memory>
#include <QWidget>
#include <QKeyEvent>
#include <QTimer>
#include "citra_qt/config.h"
#include "core/settings.h"
@ -15,6 +14,7 @@
class QPushButton;
class QString;
class QTimer;
namespace Ui {
class ConfigureInput;
@ -35,7 +35,7 @@ private:
int key_pressed;
QPushButton* changing_button = nullptr; /// button currently waiting for key press.
QString previous_mapping;
QTimer* timer = new QTimer(this);
QTimer* timer;
void setConfiguration();
void removeDuplicates(const QString& newValue);
@ -43,7 +43,7 @@ private:
QString getKeyName(int key_code) const;
Qt::Key getKeyValue(const QString& text) const;
void setKey();
private Q_SLOTS:
private Q_SLOTS:
void handleClick();
void restoreDefaults();
};