Qt: Implement "Iterative Input"

This commit is contained in:
spycrab
2018-04-01 16:25:34 +02:00
parent 9be505fde2
commit e0ba2a4aeb
7 changed files with 64 additions and 12 deletions

View File

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