From d55f4b41c6ebf00e36a5e91ddc962a753f6c9ef8 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 14 Dec 2009 15:40:09 -0500 Subject: 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. --- openbox/actions/cyclewindows.c | 4 ++-- openbox/actions/directionalwindows.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'openbox/actions') diff --git a/openbox/actions/cyclewindows.c b/openbox/actions/cyclewindows.c index 6fba17ff..32d6a453 100644 --- a/openbox/actions/cyclewindows.c +++ b/openbox/actions/cyclewindows.c @@ -146,13 +146,13 @@ static gboolean i_input_func(guint initial_state, { if (e->type == KeyPress) { /* Escape cancels no matter what */ - if (e->xkey.keycode == ob_keycode(OB_KEY_ESCAPE)) { + if (ob_keycode_match(e->xkey.keycode, OB_KEY_ESCAPE)) { end_cycle(TRUE, e->xkey.state, options); return FALSE; } /* There were no modifiers and they pressed enter */ - else if (e->xkey.keycode == ob_keycode(OB_KEY_RETURN) && + else if (ob_keycode_match(e->xkey.keycode, OB_KEY_RETURN) && !initial_state) { end_cycle(FALSE, e->xkey.state, options); diff --git a/openbox/actions/directionalwindows.c b/openbox/actions/directionalwindows.c index d9f24d61..6559e44c 100644 --- a/openbox/actions/directionalwindows.c +++ b/openbox/actions/directionalwindows.c @@ -169,13 +169,13 @@ static gboolean i_input_func(guint initial_state, { if (e->type == KeyPress) { /* Escape cancels no matter what */ - if (e->xkey.keycode == ob_keycode(OB_KEY_ESCAPE)) { + if (ob_keycode_match(e->xkey.keycode, OB_KEY_ESCAPE)) { end_cycle(TRUE, e->xkey.state, options); return FALSE; } /* There were no modifiers and they pressed enter */ - else if (e->xkey.keycode == ob_keycode(OB_KEY_RETURN) && + else if (ob_keycode_match(e->xkey.keycode, OB_KEY_RETURN) && !initial_state) { end_cycle(FALSE, e->xkey.state, options); -- cgit v1.2.3