Right, Zhang, this _should_ handle the issue. No luck yet with getting fcitx
to work on my machine, so please test the change.
src/ChangeLog addition:
2005-12-03 Aidan Kehoe <kehoea(a)parhasard.net>
* console-x.c (x_perhaps_init_unseen_key_defaults):
* event-Xt.c (x_to_emacs_keysym):
Add code to handle keys with NoSymbol as the associated keycode,
but a single-character non-ASCII name encoded in ISO 2022; only
output printable ASCII in the keysym names with %c format, using
octal for others.
XEmacs Trunk source patch:
Diff command: cvs -q diff -u
Files affected: src/event-Xt.c src/console-x.c
Index: src/console-x.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/console-x.c,v
retrieving revision 1.15
diff -u -u -r1.15 console-x.c
--- src/console-x.c 2005/06/29 09:47:35 1.15
+++ src/console-x.c 2005/12/03 20:02:54
@@ -349,6 +349,26 @@
xkeysym = XStringToKeysym(keysym_ext);
if (NoSymbol == xkeysym)
{
+ /* Keysym is NoSymbol; this may mean the key event passed to us came
+ from an input method, which stored the actual character intended to
+ be inserted in the ISO 2022-encoded key name, and didn't trouble
+ itself to set the keycode to anything useful. Thus, if the key name
+ is a single character, and the keysym is NoSymbol, give it a
+ default binding, if that is possible. */
+ Lisp_Object keychar;
+
+ if (1 != itext_ichar_len(XSTRING_DATA(key_name)))
+ {
+ /* Don't let them pass us more than one character. */
+ return Qnil;
+ }
+ keychar = make_char(itext_ichar(XSTRING_DATA(key_name)));
+ if (NILP (Flookup_key (Vcurrent_global_map, keychar, Qnil)))
+ {
+ Fdefine_key (Vcurrent_global_map, keychar, Qself_insert_command);
+ Fputhash (keychar, Qt, DEVICE_X_KEYSYM_MAP_HASH_TABLE (d));
+ return Qt;
+ }
return Qnil;
}
Index: src/event-Xt.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/event-Xt.c,v
retrieving revision 1.89
diff -u -u -r1.89 event-Xt.c
--- src/event-Xt.c 2005/11/26 11:46:07 1.89
+++ src/event-Xt.c 2005/12/03 20:02:55
@@ -898,7 +898,16 @@
int j;
stderr_out (" chars=\"");
for (j=0; j<len; j++)
- stderr_out ("%c", bufptr[j]);
+ {
+ if (32 <= bufptr[j] && bufptr[j] >= 127)
+ {
+ stderr_out ("%c", bufptr[j]);
+ }
+ else
+ {
+ stderr_out ("\\o%o", bufptr[j]);
+ }
+ }
stderr_out ("\"");
}
else if (bufptr[0] <= 32 || bufptr[0] >= 127)
--
I AM IN JAIL AND ALLOWED SEND ONLY ONE CABLE SINCE WAS ARRESTED WHILE
MEASURING FIFTEEN FOOT WALL OUTSIDE PALACE AND HAVE JUST FINISHED COUNTING
THIRTY EIGHT THOUSAND FIVE HUNDERED TWENTY TWO NAMES WHOS WHO IN MIDEAST.