diff options
| author | spycrab <spycrab@users.noreply.github.com> | 2018-04-01 16:25:34 +0200 |
|---|---|---|
| committer | spycrab <spycrab@users.noreply.github.com> | 2018-04-04 21:51:51 +0200 |
| commit | e0ba2a4aebc47e00ccc78c630ea89d2172ed51e7 (patch) | |
| tree | 24161ad880a1fff204309126b50568122bea75ec /Source/Core/DolphinQt2/Config/Mapping/MappingWidget.cpp | |
| parent | 9be505fde2c695c90314b07a0ad90f537301f034 (diff) | |
Qt: Implement "Iterative Input"
Diffstat (limited to 'Source/Core/DolphinQt2/Config/Mapping/MappingWidget.cpp')
| -rw-r--r-- | Source/Core/DolphinQt2/Config/Mapping/MappingWidget.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Source/Core/DolphinQt2/Config/Mapping/MappingWidget.cpp b/Source/Core/DolphinQt2/Config/Mapping/MappingWidget.cpp index efe64ac2ce..01913ca8c7 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/MappingWidget.cpp +++ b/Source/Core/DolphinQt2/Config/Mapping/MappingWidget.cpp @@ -31,6 +31,29 @@ MappingWindow* MappingWidget::GetParent() const return m_parent; } +bool MappingWidget::IsIterativeInput() const +{ + return m_parent->IsIterativeInput(); +} + +void MappingWidget::NextButton(MappingButton* button) +{ + auto iterator = std::find(m_buttons.begin(), m_buttons.end(), button); + + if (iterator == m_buttons.end()) + return; + + if (++iterator == m_buttons.end()) + return; + + MappingButton* next = *iterator; + + if (next->IsInput() && next->isVisible()) + next->Detect(); + else + NextButton(next); +} + std::shared_ptr<ciface::Core::Device> MappingWidget::GetDevice() const { return m_parent->GetDevice(); |
