- if (ev->xkey.keycode == ob_keycode(OB_KEY_ESCAPE))
- if ((f = find_active_or_last_menu()) && f->parent)
- menu_frame_select(f, NULL, TRUE);
- else
- menu_frame_hide_all();
- else if (ev->xkey.keycode == ob_keycode(OB_KEY_RETURN)) {
- ObMenuFrame *f;
- if ((f = find_active_menu())) {
- if (f->child)
- menu_frame_select_next(f->child);
- else
- menu_entry_frame_execute(f->selected, ev->xkey.state,
- ev->xkey.time);
- }
- } else if (ev->xkey.keycode == ob_keycode(OB_KEY_LEFT)) {
- ObMenuFrame *f;
- if ((f = find_active_or_last_menu()))
- menu_frame_select(f, NULL, TRUE);
- } else if (ev->xkey.keycode == ob_keycode(OB_KEY_RIGHT)) {
- ObMenuFrame *f;
- if ((f = find_active_menu()) && f->child)
- menu_frame_select_next(f->child);
- } else if (ev->xkey.keycode == ob_keycode(OB_KEY_UP)) {
- ObMenuFrame *f;
- if ((f = find_active_or_last_menu()))
- menu_frame_select_previous(f);
- } else if (ev->xkey.keycode == ob_keycode(OB_KEY_DOWN)) {
- ObMenuFrame *f;
- if ((f = find_active_or_last_menu()))
- menu_frame_select_next(f);
- } else
- event_handle_menu_shortcut(ev);