all repos — mgba @ f0c3f6e42a783b607e3acbe77e0ff82c4f2b7187

mGBA Game Boy Advance Emulator

Qt: Fix shortcuts being updated improperly when changing input type (fixes #102)
Jeffrey Pfau jeffrey@endrift.com
Wed, 09 Sep 2015 02:00:52 -0700
commit

f0c3f6e42a783b607e3acbe77e0ff82c4f2b7187

parent

31d409c8b16d9676dd78681db43dc851c4e54000

1 files changed, 4 insertions(+), 0 deletions(-)

jump to
M src/platform/qt/ShortcutView.cppsrc/platform/qt/ShortcutView.cpp

@@ -22,10 +22,14 @@ m_ui.setupUi(this);

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)));