diff options
| author | Dana Jansens <danakj@orodu.net> | 2008-01-20 03:33:51 -0500 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2008-01-31 12:25:30 -0500 |
| commit | 46cf95d36b29cd6bda18ba2d511be10b8e9471cc (patch) | |
| tree | 3244c6aa408f5e5c1d5d6602a97cfc10f2b86edf /obt/keyboard.c | |
| parent | 770032fdb5112adde46125bdcdc65b1607c05dd5 (diff) | |
make menu event handling work more like how other events are handled, less special-casey
Diffstat (limited to 'obt/keyboard.c')
| -rw-r--r-- | obt/keyboard.c | 7 |
1 files changed, 3 insertions, 4 deletions
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') |
