+
+ /* Use KeyRelease events for running things so that the key release
+ doesn't get sent to the focused application.
+
+ Allow ControlMask only, and don't bother if the menu is empty */
+ else if (ev->type == KeyRelease && (mods & ~ControlMask) == 0 &&
+ frame->entries && frame->got_press)
+ {
+ if (ob_keycode_match(ev->xkey.keycode, OB_KEY_RETURN)) {
+ /* Enter runs the active item or goes into the submenu.
+ Control-Enter runs it without closing the menu. */
+ if (frame->child)
+ menu_frame_select_next(frame->child);
+ else if (frame->selected)
+ menu_entry_frame_execute(frame->selected, ev->xkey.state);
+
+ ret = TRUE;
+ }
+
+ if (frame->press_keycode == ev->xkey.keycode &&
+ frame->press_doexec)
+ {
+ if (frame->selected->entry->type == OB_MENU_ENTRY_TYPE_NORMAL)
+ menu_entry_frame_execute(frame->selected, ev->xkey.state);
+ else
+ menu_frame_select_next(frame->child);
+ }
+ }