summaryrefslogtreecommitdiff
path: root/openbox/prompt.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2010-02-11 15:05:16 -0500
committerDana Jansens <danakj@orodu.net>2010-02-11 15:07:08 -0500
commit096dad0c6c027100494ede811b33cb8558d32e25 (patch)
tree0e7799172d90d81a03632b186bf80cbeb26496e6 /openbox/prompt.c
parent6c760c5a63a2e49bc2a5a4f39f8b4b9ed285bd7e (diff)
make control keys work in menus/dialogs/etc with the new obt code, using XLookup stuff
Diffstat (limited to 'openbox/prompt.c')
-rw-r--r--openbox/prompt.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/openbox/prompt.c b/openbox/prompt.c
index 9fd56773..b10d8a18 100644
--- a/openbox/prompt.c
+++ b/openbox/prompt.c
@@ -525,6 +525,7 @@ gboolean prompt_key_event(ObPrompt *self, XEvent *e)
{
gboolean shift;
guint shift_mask, mods;
+ KeySym sym;
if (e->type != KeyPress) return FALSE;
@@ -536,23 +537,18 @@ gboolean prompt_key_event(ObPrompt *self, XEvent *e)
if (mods != 0 && mods != shift_mask)
return FALSE;
- if (ob_keycode_match(e->xkey.keycode, OB_KEY_ESCAPE))
+ sym = obt_keyboard_keypress_to_keysym(e);
+
+ if (sym == XK_Escape)
prompt_cancel(self);
- else if (ob_keycode_match(e->xkey.keycode, OB_KEY_RETURN) ||
- ob_keycode_match(e->xkey.keycode, OB_KEY_SPACE))
- {
+ else if (sym == XK_Return || sym == XK_space)
prompt_run_callback(self, self->focus->result);
- }
- 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))
- {
+ else if (sym == XK_Tab || sym == XK_Left || sym == XK_Right) {
gint i;
gboolean left;
ObPromptElement *oldfocus;
- left = ob_keycode_match(e->xkey.keycode, OB_KEY_LEFT) ||
- (ob_keycode_match(e->xkey.keycode, OB_KEY_TAB) && shift);
+ left = (sym == XK_Left) || ((sym == XK_Tab) && shift);
oldfocus = self->focus;
for (i = 0; i < self->n_buttons; ++i)