Allow home / end to jump to top / bottom of preset list.

This commit is contained in:
milkdropper.com
2020-08-11 20:33:00 +04:00
parent d47d0392ed
commit 0937f3959c
2 changed files with 14 additions and 2 deletions

View File

@ -119,7 +119,16 @@ void projectM::default_key_handler( projectMEvent event, projectMKeycode keycode
switch (keycode)
{
case PROJECTM_K_HOME:
if (renderer->showmenu) { // pageup only does something when the preset menu is active.
selectPreset(0); // jump to top of presets.
}
break;
case PROJECTM_K_END:
if (renderer->showmenu) { // pageup only does something when the preset menu is active.
selectPreset(m_presetLoader->size() - 1); // jump to bottom of presets.
}
break;
case PROJECTM_K_PAGEUP:
if (renderer->showmenu) { // pageup only does something when the preset menu is active.
int upPreset = m_presetPos->lastIndex() - (renderer->textMenuPageSize / 2.0f); // jump up by page size / 2