haiku_loader: add J, K keys support for up/down keys

Arrow keys are not available on some platforms.

Change-Id: Ia38797eb12202668a0b0976b31f21f564d140901
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4087
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
This commit is contained in:
X512 2021-06-13 02:11:22 +09:00 committed by Fredrik Holmqvist
parent b7a6ab94c3
commit 7766b5a136

View File

@ -412,7 +412,8 @@ run_menu(Menu* menu)
item = menu->ItemAt(selected);
if (TEXT_CONSOLE_IS_CURSOR_KEY(key)) {
if (TEXT_CONSOLE_IS_CURSOR_KEY(key) || key == 'j' || key == 'J'
|| key == 'k' || key == 'K') {
if (item == NULL)
continue;
@ -420,9 +421,13 @@ run_menu(Menu* menu)
switch (key) {
case TEXT_CONSOLE_KEY_UP:
case 'k':
case 'K':
selected = select_previous_valid_item(menu, selected - 1);
break;
case TEXT_CONSOLE_KEY_DOWN:
case 'j':
case 'J':
selected = select_next_valid_item(menu, selected + 1);
break;
case TEXT_CONSOLE_KEY_PAGE_UP: