Author: yamakenz
Date: Mon Aug 27 05:44:19 2007
New Revision: 4891
Modified:
trunk/gtk/key-util-gtk.c
Log:
* This commit add a hack to distinguish Japanese kana_RO key from yen
sign key (both keys normally generates backslash on ASCII input) by
Yusuke. I just apply his patch without any changes on this
commit. See [uim-en 11] and follow messages for the discussion
* gtk/key-util-gtk.c
- (g_prolongedsound_keycode): New static variable
- (im_uim_convert_keyevent): Add the Japanese kana_RO key hack
- (im_uim_init_modifier_keys): Add initialization for
g_prolongedsound_keycode
Modified: trunk/gtk/key-util-gtk.c
==============================================================================
--- trunk/gtk/key-util-gtk.c (original)
+++ trunk/gtk/key-util-gtk.c Mon Aug 27 05:44:19 2007
@@ -54,6 +54,7 @@
static guint g_mod1_mask, g_mod2_mask, g_mod3_mask, g_mod4_mask, g_mod5_mask;
static gint g_numlock_mask;
static guint g_modifier_state, g_pre_modifier_state;
+static KeyCode g_prolongedsound_keycode;
#endif
void
@@ -228,6 +229,13 @@
break;
}
}
+#ifdef GDK_WINDOWING_X11
+ /* 1'. replace keysym for Japanese keyboard */
+ if (*ukey == '\\' &&
+ event->hardware_keycode == g_prolongedsound_keycode) {
+ *ukey = UKey_Yen;
+ }
+#endif
/* 2. check modifier */
if (mod & GDK_SHIFT_MASK)
@@ -375,5 +383,7 @@
g_slist_free(mod5_list);
XFreeModifiermap(map);
XFree(sym);
+ /* setup keycode hack */
+ g_prolongedsound_keycode = XKeysymToKeycode(display, XK_prolongedsound);
#endif
}