X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=obt%2Fkeyboard.c;h=710a94c23b33ccad97af9421f514214a71b474e8;hb=def8fc707d1146a4edccbca85afc93d6bdbff440;hp=a93c07d080d5a37f9f5d48d0a326cb47b9c4efca;hpb=ea481338b5f16fd81a7b33e036ead39b918a51af;p=chaz%2Fopenbox diff --git a/obt/keyboard.c b/obt/keyboard.c index a93c07d0..710a94c2 100644 --- a/obt/keyboard.c +++ b/obt/keyboard.c @@ -200,18 +200,17 @@ KeyCode obt_keyboard_keysym_to_keycode(KeySym sym) 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; + if ((key = obt_keyboard_keycode_to_string(keycode)) != NULL && /* don't accept keys that aren't a single letter, like "space" */ key[1] == '\0')