X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Ftranslate.c;h=97066519f4b9f0cf73e53826e77a59e398cf5777;hb=c8983c42a7c27321d18825f2a130c15e29046f7b;hp=a26017e512065fe2b5926dcea603760e578a40b6;hpb=2442cdfd85e5229c7ee4ac49ca66a7d55ffcb919;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); +}