summaryrefslogtreecommitdiff
path: root/openbox/openbox.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2009-12-16 15:39:25 -0500
committerDana Jansens <danakj@orodu.net>2009-12-16 15:39:25 -0500
commit50d662681160c309ea86268c0d05794b87b75593 (patch)
treef8ee31f3becc85527581072f9ab1ee6486f62465 /openbox/openbox.c
parenta93b00a5e93281c7c2c31112f0b6b827d605a19d (diff)
parent8ada991d829671ab5e6dd4c5526b6a0238ba6a16 (diff)
Merge branch 'backport' into work
Conflicts: obt/keyboard.c obt/keyboard.h openbox/event.c openbox/menuframe.c openbox/moveresize.c openbox/openbox.c openbox/screen.c
Diffstat (limited to 'openbox/openbox.c')
-rw-r--r--openbox/openbox.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/openbox/openbox.c b/openbox/openbox.c
index 29506c00..800e6a21 100644
--- a/openbox/openbox.c
+++ b/openbox/openbox.c
@@ -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)