mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix crash when mapping gamepad if no key is selected
This commit is contained in:
parent
fa1b74a89b
commit
fcac245b98
|
@ -217,11 +217,11 @@ void GBAKeyEditor::bindKey(const KeyEditor* keyEditor, GBAKey key) {
|
||||||
|
|
||||||
#ifdef BUILD_SDL
|
#ifdef BUILD_SDL
|
||||||
void GBAKeyEditor::testGamepad() {
|
void GBAKeyEditor::testGamepad() {
|
||||||
KeyEditor* focused = *m_currentKey;
|
if (m_currentKey == m_keyOrder.end() || !*m_currentKey) {
|
||||||
if (!focused) {
|
|
||||||
QTimer::singleShot(50, this, SLOT(testGamepad()));
|
QTimer::singleShot(50, this, SLOT(testGamepad()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
KeyEditor* focused = *m_currentKey;
|
||||||
|
|
||||||
QSet<QPair<int, int32_t>> activeAxes = m_controller->activeGamepadAxes();
|
QSet<QPair<int, int32_t>> activeAxes = m_controller->activeGamepadAxes();
|
||||||
if (!activeAxes.empty()) {
|
if (!activeAxes.empty()) {
|
||||||
|
|
Loading…
Reference in New Issue