Support for Shift-Tab to loop backward in list of sources.

This commit is contained in:
brunoherbelin
2021-01-13 14:06:54 +01:00
parent 52eb9284f7
commit 6fdb93a020
3 changed files with 22 additions and 2 deletions

View File

@@ -642,6 +642,21 @@ void Mixer::setCurrentNext()
}
}
void Mixer::setCurrentPrevious()
{
if (session_->numSource() > 0) {
SourceList::iterator it = current_source_;
if (it == session_->begin()) {
it = session_->end();
}
it--;
setCurrentSource( it );
}
}
void Mixer::unsetCurrentSource()
{
// discard overlay for previously current source

View File

@@ -59,6 +59,7 @@ public:
void setCurrentSource (Node *node);
void setCurrentSource (uint64_t id);
void setCurrentNext ();
void setCurrentPrevious ();
void unsetCurrentSource ();
void setCurrentIndex (int index);

View File

@@ -382,8 +382,12 @@ void UserInterface::handleKeyboard()
else if (ImGui::IsKeyPressed( GLFW_KEY_INSERT ))
navigator.togglePannelNew();
// button tab to select next
else if (ImGui::IsKeyPressed( GLFW_KEY_TAB ))
Mixer::manager().setCurrentNext();
else if (ImGui::IsKeyPressed( GLFW_KEY_TAB )) {
if (shift_modifier_active)
Mixer::manager().setCurrentPrevious();
else
Mixer::manager().setCurrentNext();
}
}
}