Qt: Fix shortcuts being updated improperly when changing input type (fixes #102)

This commit is contained in:
Jeffrey Pfau 2015-09-09 02:00:52 -07:00
parent 31d409c8b1
commit f0c3f6e42a
1 changed files with 4 additions and 0 deletions

View File

@ -22,10 +22,14 @@ ShortcutView::ShortcutView(QWidget* parent)
m_ui.keyEdit->setValueKey(0);
connect(m_ui.gamepadButton, &QAbstractButton::pressed, [this]() {
bool signalsBlocked = m_ui.keyEdit->blockSignals(true);
m_ui.keyEdit->setValueButton(-1);
m_ui.keyEdit->blockSignals(signalsBlocked);
});
connect(m_ui.keyboardButton, &QAbstractButton::pressed, [this]() {
bool signalsBlocked = m_ui.keyEdit->blockSignals(true);
m_ui.keyEdit->setValueKey(0);
m_ui.keyEdit->blockSignals(signalsBlocked);
});
connect(m_ui.keyEdit, SIGNAL(valueChanged(int)), this, SLOT(updateButton(int)));
connect(m_ui.keyEdit, SIGNAL(axisChanged(int, int)), this, SLOT(updateAxis(int, int)));