]> Dogcows Code - chaz/openbox/blobdiff - openbox/openbox.c
Merge branch 'backport' into work
[chaz/openbox] / openbox / openbox.c
index 29506c00b74b681b671a65b7502450e3781a6c1a..800e6a210d3141a2fffd4eba1dc7b9816a167a0f 100644 (file)
@@ -101,7 +101,7 @@ static gboolean  reconfigure = FALSE;
 static gboolean  restart = FALSE;
 static gchar    *restart_path = NULL;
 static Cursor    cursors[OB_NUM_CURSORS];
-static KeyCode   keys[OB_NUM_KEYS];
+static KeyCode  *keys[OB_NUM_KEYS];
 static gint      exitcode = 0;
 static guint     remote_control = 0;
 static gboolean  being_replaced = FALSE;
@@ -400,6 +400,16 @@ gint main(gint argc, gchar **argv)
             event_shutdown(reconfigure);
             config_shutdown();
             actions_shutdown(reconfigure);
+
+            /* Free the key codes for built in keys */
+            g_free(keys[OB_KEY_RETURN]);
+            g_free(keys[OB_KEY_ESCAPE]);
+            g_free(keys[OB_KEY_LEFT]);
+            g_free(keys[OB_KEY_RIGHT]);
+            g_free(keys[OB_KEY_UP]);
+            g_free(keys[OB_KEY_DOWN]);
+            g_free(keys[OB_KEY_TAB]);
+            g_free(keys[OB_KEY_SPACE]);
         } while (reconfigure);
     }
 
@@ -716,10 +726,14 @@ Cursor ob_cursor(ObCursor cursor)
     return cursors[cursor];
 }
 
-KeyCode ob_keycode(ObKey key)
+gboolean ob_keycode_match(KeyCode code, ObKey key)
 {
+    KeyCode *k;
+    
     g_assert(key < OB_NUM_KEYS);
-    return keys[key];
+    for (k = keys[key]; *k; ++k)
+        if (*k == code) return TRUE;
+    return FALSE;
 }
 
 ObState ob_state(void)
This page took 0.017088 seconds and 4 git commands to generate.