X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Ftranslate.c;h=c697679d1291fd03da7f0837f384ac1475f8e11f;hb=58788c781713092c6aa3a4544f8a06cd499ec4fd;hp=e7962ad575561b2f89e3e8d7e72e94b643eb1e9f;hpb=7f5347897754164c9688d7e3d882411283c13a55;p=chaz%2Fopenbox diff --git a/openbox/translate.c b/openbox/translate.c index e7962ad5..c697679d 100644 --- a/openbox/translate.c +++ b/openbox/translate.c @@ -20,6 +20,7 @@ #include "openbox.h" #include "mouse.h" #include "modkeys.h" +#include "translate.h" #include "gettext.h" #include #include @@ -111,6 +112,8 @@ gboolean translate_key(const gchar *str, guint *state, guint *keycode) parsed = g_strsplit(str, "-", -1); + *state = *keycode = 0; + /* first, find the key (last token) */ l = NULL; for (i = 0; parsed[i] != NULL; ++i) @@ -156,7 +159,7 @@ translation_fail: return ret; } -const gchar *translate_keycode(guint keycode) +gchar *translate_keycode(guint keycode) { KeySym sym; const gchar *ret = NULL; @@ -170,7 +173,7 @@ gunichar translate_unichar(guint keycode) { gunichar unikey = 0; - const char *key; + char *key; if ((key = translate_keycode(keycode)) != NULL && /* don't accept keys that aren't a single letter, like "space" */ key[1] == '\0')