This commit is contained in:
Dana Jansens 2007-07-21 09:45:56 -04:00
parent b3e333d67a
commit 9713a629d7

View file

@ -1629,30 +1629,31 @@ static gboolean event_handle_menu_keyboard(XEvent *ev)
if (frame == NULL) if (frame == NULL)
g_assert_not_reached(); /* there is no active menu */ g_assert_not_reached(); /* there is no active menu */
else if (ev->type == KeyPress) { /* Allow control while going thru the menu */
if (keycode == ob_keycode(OB_KEY_ESCAPE) && state == 0) { else if (ev->type == KeyPress && (state & ~ControlMask) == 0) {
if (keycode == ob_keycode(OB_KEY_ESCAPE)) {
menu_frame_hide_all(); menu_frame_hide_all();
ret = TRUE; ret = TRUE;
} }
else if (keycode == ob_keycode(OB_KEY_LEFT) && ev->xkey.state == 0) { else if (keycode == ob_keycode(OB_KEY_LEFT)) {
/* Left goes to the parent menu */ /* Left goes to the parent menu */
menu_frame_select(frame, NULL, TRUE); menu_frame_select(frame, NULL, TRUE);
ret = TRUE; ret = TRUE;
} }
else if (keycode == ob_keycode(OB_KEY_RIGHT) && ev->xkey.state == 0) { else if (keycode == ob_keycode(OB_KEY_RIGHT)) {
/* Right goes to the selected submenu */ /* Right goes to the selected submenu */
if (frame->child) menu_frame_select_next(frame->child); if (frame->child) menu_frame_select_next(frame->child);
ret = TRUE; ret = TRUE;
} }
else if (keycode == ob_keycode(OB_KEY_UP) && state == 0) { else if (keycode == ob_keycode(OB_KEY_UP)) {
menu_frame_select_previous(frame); menu_frame_select_previous(frame);
ret = TRUE; ret = TRUE;
} }
else if (keycode == ob_keycode(OB_KEY_DOWN) && state == 0) { else if (keycode == ob_keycode(OB_KEY_DOWN)) {
menu_frame_select_next(frame); menu_frame_select_next(frame);
ret = TRUE; ret = TRUE;
} }
@ -1662,7 +1663,7 @@ static gboolean event_handle_menu_keyboard(XEvent *ev)
get sent to the focused application. get sent to the focused application.
Allow ControlMask only, and don't bother if the menu is empty */ Allow ControlMask only, and don't bother if the menu is empty */
else if ((ev->xkey.state & ~ControlMask) == 0 && frame->entries) { else if ((state & ~ControlMask) == 0 && frame->entries) {
if (keycode == ob_keycode(OB_KEY_RETURN)) { if (keycode == ob_keycode(OB_KEY_RETURN)) {
/* Enter runs the active item or goes into the submenu. /* Enter runs the active item or goes into the submenu.
Control-Enter runs it without closing the menu. */ Control-Enter runs it without closing the menu. */