提交 063f4661 编写于 作者: D Dirk Gouders 提交者: Yann E. MORIN

mconf: handle keys in empty dialogs

When entering an empty dialog, using the movement keys resulted in
unexpected characters beeing displayed, other keys like "z" and "h"
did not work as expected.

This patch handles the movement keys as well as other keys, especially
"z", "h" and "/".
Signed-off-by: NDirk Gouders <dirk@gouders.net>
[yann.morin.1998@free.fr: keep lines <80 chars, so reorder test]
Tested-by: N"Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: N"Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: N"Yann E. MORIN" <yann.morin.1998@free.fr>
上级 57a9c760
......@@ -303,10 +303,11 @@ int dialog_menu(const char *title, const char *prompt,
}
}
if (i < max_choice ||
key == KEY_UP || key == KEY_DOWN ||
key == '-' || key == '+' ||
key == KEY_PPAGE || key == KEY_NPAGE) {
if (item_count() != 0 &&
(i < max_choice ||
key == KEY_UP || key == KEY_DOWN ||
key == '-' || key == '+' ||
key == KEY_PPAGE || key == KEY_NPAGE)) {
/* Remove highligt of current item */
print_item(scroll + choice, choice, FALSE);
......
......@@ -670,11 +670,12 @@ static void conf(struct menu *menu, struct menu *active_menu)
active_menu, &s_scroll);
if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL)
break;
if (!item_activate_selected())
continue;
if (!item_tag())
continue;
if (item_count() != 0) {
if (!item_activate_selected())
continue;
if (!item_tag())
continue;
}
submenu = item_data();
active_menu = item_data();
if (submenu)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册