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;
keys[OB_KEY_DOWN] = modkeys_sym_to_code(XK_Down);
keys[OB_KEY_TAB] = modkeys_sym_to_code(XK_Tab);
keys[OB_KEY_SPACE] = modkeys_sym_to_code(XK_space);
+ keys[OB_KEY_HOME] = modkeys_sym_to_code(XK_Home);
+ keys[OB_KEY_END] = modkeys_sym_to_code(XK_End);
{
ObParseInst *i;
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]);
+ g_free(keys[OB_KEY_HOME]);
+ g_free(keys[OB_KEY_END]);
+
modkeys_shutdown(reconfigure);
} while (reconfigure);
}
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()