X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Ftranslate.c;h=97066519f4b9f0cf73e53826e77a59e398cf5777;hb=5d5be2ba2a6e0b3886e0076475ed9d7a2d4ac9ab;hp=a26017e512065fe2b5926dcea603760e578a40b6;hpb=138d3e38d88dbcb1426bd1eb0cd8c43dd01777ad;p=chaz%2Fopenbox diff --git a/openbox/translate.c b/openbox/translate.c index a26017e5..97066519 100644 --- a/openbox/translate.c +++ b/openbox/translate.c @@ -139,3 +139,13 @@ translation_fail: g_strfreev(parsed); return ret; } + +const gchar *translate_keycode(guint keycode) +{ + KeySym sym; + const gchar *ret = NULL; + + if ((sym = XKeycodeToKeysym(ob_display, keycode, 0)) != NoSymbol) + ret = XKeysymToString(sym); + return g_locale_to_utf8(ret, -1, NULL, NULL, NULL); +}