Minor keyboard menu control adjustment

This commit is contained in:
K. Lange 2018-07-20 22:24:05 +09:00
parent 43829e163a
commit 95ad690212
1 changed files with 13 additions and 4 deletions

View File

@ -601,11 +601,22 @@ void menu_key_action(struct MenuList * menu, struct yutani_msg_key_event * me) {
hilighted->hilight = 1;
_menu_redraw(window,yctx,menu);
} else if (me->event.keycode == KEY_ARROW_RIGHT) {
if (hilighted && hilighted->_type == MenuEntry_Submenu) {
hilighted->activate(hilighted, 0);
if (!hilighted) {
hilighted = menu->entries->head->value;
}
if (hilighted) {
hilighted->hilight = 1;
if (hilighted->_type == MenuEntry_Submenu) {
hilighted->activate(hilighted, 0);
}
_menu_redraw(window,yctx,menu);
}
} else if (me->event.key == '\n') {
if (!hilighted) {
hilighted = menu->entries->head->value;
}
if (hilighted) {
hilighted->hilight = 1;
hilighted->activate(hilighted, 0);
}
} else if (me->event.keycode == KEY_ARROW_LEFT) {
@ -614,8 +625,6 @@ void menu_key_action(struct MenuList * menu, struct yutani_msg_key_event * me) {
}
menu_definitely_close(menu);
}
}
void menu_mouse_action(struct MenuList * menu, struct yutani_msg_window_mouse_event * me) {