all repos — mgba @ 13de6dfdc74aa12756b22f18ef62b93777a38b69

mGBA Game Boy Advance Emulator

Qt: Merge findFocus from master
Jeffrey Pfau jeffrey@endrift.com
Mon, 05 Jan 2015 04:21:56 -0800
commit

13de6dfdc74aa12756b22f18ef62b93777a38b69

parent

388c94a56930447b575bd1a8776f18357171f194

2 files changed, 15 insertions(+), 0 deletions(-)

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

@@ -179,6 +179,20 @@ m_controller->bindKey(m_type, m_keyR->value(), GBA_KEY_R);

m_controller->saveConfiguration(m_type); } +bool GBAKeyEditor::findFocus() { + if (m_currentKey != m_keyOrder.end() && (*m_currentKey)->hasFocus()) { + return true; + } + + for (auto key = m_keyOrder.begin(); key != m_keyOrder.end(); ++key) { + if ((*key)->hasFocus()) { + m_currentKey = key; + return true; + } + } + return false; +} + #ifdef BUILD_SDL void GBAKeyEditor::testGamepad() { QSet<int> activeKeys = m_controller->activeGamepadButtons();
M src/platform/qt/GBAKeyEditor.hsrc/platform/qt/GBAKeyEditor.h

@@ -31,6 +31,7 @@

private slots: void setNext(); void save(); + bool findFocus(); #ifdef BUILD_SDL void testGamepad(); #endif