]> Dogcows Code - chaz/openbox/blobdiff - openbox/prompt.c
Allow the user to bind more than one keycode to a keysym for Ob Menus/Move/Resize
[chaz/openbox] / openbox / prompt.c
index 53ed2d7daa1dc38553d5512cf43921890b4b5c03..bef06a74f217ce0569952e8bde00215bd7705c2d 100644 (file)
@@ -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)
This page took 0.020785 seconds and 4 git commands to generate.