mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 20:13:36 +00:00
generalized left/right/up/down handling. it actually seems to work well!
This commit is contained in:
parent
05e35be074
commit
f4c484b751
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user