X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=obt%2Fkeyboard.c;h=699fa8baccbd55accf1d32f7680e6b9495936301;hb=163950b23bf796a39870044417ca54d667b6b470;hp=397504fb6b4af493af2425012804b407f19715c2;hpb=759e9f58a8cc02b78bc85b4454f133544e3ac36e;p=chaz%2Fopenbox diff --git a/obt/keyboard.c b/obt/keyboard.c index 397504fb..699fa8ba 100644 --- a/obt/keyboard.c +++ b/obt/keyboard.c @@ -49,7 +49,7 @@ static gboolean hyper_l = FALSE; static gboolean started = FALSE; -void obt_keyboard_reload() +void obt_keyboard_reload(void) { gint i, j, k; @@ -97,7 +97,7 @@ void obt_keyboard_reload() modkeys_keys[OBT_KEYBOARD_MODKEY_CONTROL] = ControlMask; } -void obt_keyboard_shutdown() +void obt_keyboard_shutdown(void) { XFreeModifiermap(modmap); modmap = NULL; @@ -197,21 +197,20 @@ KeyCode obt_keyboard_keysym_to_keycode(KeySym sym) return 0; } -const gchar *obt_keyboard_keycode_to_string(guint keycode) +gchar *obt_keyboard_keycode_to_string(guint keycode) { KeySym sym; - const gchar *ret = NULL; if ((sym = XKeycodeToKeysym(obt_display, keycode, 0)) != NoSymbol) - ret = XKeysymToString(sym); - return g_locale_to_utf8(ret, -1, NULL, NULL, NULL); + return g_locale_to_utf8(XKeysymToString(sym), -1, NULL, NULL, NULL); + return NULL; } gunichar obt_keyboard_keycode_to_unichar(guint keycode) { gunichar unikey = 0; + char *key; - const char *key; if ((key = obt_keyboard_keycode_to_string(keycode)) != NULL && /* don't accept keys that aren't a single letter, like "space" */ key[1] == '\0')