generalized left/right/up/down handling. it actually seems to work well!

This commit is contained in:
Casey Langen 2016-07-13 00:52:08 -07:00
parent 05e35be074
commit f4c484b751
2 changed files with 9 additions and 8 deletions

View File

@ -230,14 +230,6 @@ bool LibraryLayout::KeyPress(const std::string& key) {
this->ShowTrackSearch();
return true;
}
else if (key == "KEY_LEFT") {
this->FocusPrev();
return true;
}
else if (key == "KEY_RIGHT") {
this->FocusNext();
return true;
}
/* forward to the visible layout */
else if (this->visibleLayout && this->visibleLayout->KeyPress(key)) {
return true;

View File

@ -263,6 +263,15 @@ IWindowPtr LayoutBase::GetFocus() {
}
bool LayoutBase::KeyPress(const std::string& key) {
if (key == "KEY_LEFT" || key == "KEY_UP") {
this->FocusPrev();
return true;
}
else if (key == "KEY_RIGHT" || key == "KEY_DOWN") {
this->FocusNext();
return true;
}
return false;
}