diff options
| author | Dana Jansens <danakj@orodu.net> | 2009-12-14 15:40:09 -0500 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2009-12-14 15:40:33 -0500 |
| commit | d55f4b41c6ebf00e36a5e91ddc962a753f6c9ef8 (patch) | |
| tree | 3197682bebb144eb27c1f45c110cfec0e4005903 /openbox/event.c | |
| parent | f3e553446fdcfc04f26ea25396a138965c4a999d (diff) | |
Allow the user to bind more than one keycode to a keysym for Ob Menus/Move/Resize
If the user has escape bound to more than one keycode then they can use any of
them to close a menu. This change applies to the hardcoded keys in openbox,
which are used for the menus and for move/resize, and maybe other places.
Diffstat (limited to 'openbox/event.c')
| -rw-r--r-- | openbox/event.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/openbox/event.c b/openbox/event.c index b4bd8270..881c9f8f 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -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) |
