Allow the user to bind more than one keycode to a keysym for Ob Menus/Move/Resize
[mikachu/openbox.git] / openbox / event.c
index b4bd827..881c9f8 100644 (file)
@@ -1693,30 +1693,30 @@ static gboolean event_handle_menu_keyboard(XEvent *ev)
     else if (ev->type == KeyPress && (state & ~ControlMask) == 0) {
         frame->got_press = TRUE;
 
-        if (keycode == ob_keycode(OB_KEY_ESCAPE)) {
+        if (ob_keycode_match(keycode, OB_KEY_ESCAPE)) {
             menu_frame_hide_all();
             ret = TRUE;
         }
 
-        else if (keycode == ob_keycode(OB_KEY_LEFT)) {
+        else if (ob_keycode_match(keycode, OB_KEY_LEFT)) {
             /* Left goes to the parent menu */
             if (frame->parent)
                 menu_frame_select(frame, NULL, TRUE);
             ret = TRUE;
         }
 
-        else if (keycode == ob_keycode(OB_KEY_RIGHT)) {
+        else if (ob_keycode_match(keycode, OB_KEY_RIGHT)) {
             /* Right goes to the selected submenu */
             if (frame->child) menu_frame_select_next(frame->child);
             ret = TRUE;
         }
 
-        else if (keycode == ob_keycode(OB_KEY_UP)) {
+        else if (ob_keycode_match(keycode, OB_KEY_UP)) {
             menu_frame_select_previous(frame);
             ret = TRUE;
         }
 
-        else if (keycode == ob_keycode(OB_KEY_DOWN)) {
+        else if (ob_keycode_match(keycode, OB_KEY_DOWN)) {
             menu_frame_select_next(frame);
             ret = TRUE;
         }
@@ -1729,7 +1729,7 @@ static gboolean event_handle_menu_keyboard(XEvent *ev)
     else if (ev->type == KeyRelease && (state & ~ControlMask) == 0 &&
              frame->entries && frame->got_press)
     {
-        if (keycode == ob_keycode(OB_KEY_RETURN)) {
+        if (ob_keycode_match(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)