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/prompt.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/prompt.c')
| -rw-r--r-- | openbox/prompt.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/openbox/prompt.c b/openbox/prompt.c index 53ed2d7d..bef06a74 100644 --- a/openbox/prompt.c +++ b/openbox/prompt.c @@ -532,23 +532,23 @@ gboolean prompt_key_event(ObPrompt *self, XEvent *e) if (e->xkey.state != 0 && e->xkey.state != shift_mask) return FALSE; - if (e->xkey.keycode == ob_keycode(OB_KEY_ESCAPE)) + if (ob_keycode_match(e->xkey.keycode, OB_KEY_ESCAPE)) prompt_cancel(self); - else if (e->xkey.keycode == ob_keycode(OB_KEY_RETURN) || - e->xkey.keycode == ob_keycode(OB_KEY_SPACE)) + else if (ob_keycode_match(e->xkey.keycode, OB_KEY_RETURN) || + ob_keycode_match(e->xkey.keycode, OB_KEY_SPACE)) { prompt_run_callback(self, self->focus->result); } - else if (e->xkey.keycode == ob_keycode(OB_KEY_TAB) || - e->xkey.keycode == ob_keycode(OB_KEY_LEFT) || - e->xkey.keycode == ob_keycode(OB_KEY_RIGHT)) + else if (ob_keycode_match(e->xkey.keycode, OB_KEY_TAB) || + ob_keycode_match(e->xkey.keycode, OB_KEY_LEFT) || + ob_keycode_match(e->xkey.keycode, OB_KEY_RIGHT)) { gint i; gboolean left; ObPromptElement *oldfocus; - left = e->xkey.keycode == ob_keycode(OB_KEY_LEFT) || - (e->xkey.keycode == ob_keycode(OB_KEY_TAB) && shift); + left = ob_keycode_match(e->xkey.keycode, OB_KEY_LEFT) || + (ob_keycode_match(e->xkey.keycode, OB_KEY_TAB) && shift); oldfocus = self->focus; for (i = 0; i < self->n_buttons; ++i) |
