Subject: | perl-tk doesnt support xim input |
if xim is set, i can input any thing.
the diff file may need to rename to xim.patch.
the patch is from http://forum.ubuntu.org.cn/viewtopic.php?f=63&t=55262 (chinese)
need to modify the line number.
here is another bug report for this question
https://bugs.launchpad.net/ubuntu/+source/perl-tk/+bug/283806
Subject: | xim.diff |
--- pTk/mTk/generic/tkEvent.c 2008-09-05 13:29:48.000000000 +0800
+++ pTk/mTk/generic/tkEvent.c 2008-09-05 13:17:24.000000000 +0800
@@ -945,8 +945,10 @@
#endif
}
}
- if (XFilterEvent(eventPtr, None)) {
- goto done;
+ if(eventPtr->type == KeyPress || eventPtr->type == KeyRelease) {
+ if(XFilterEvent(eventPtr, None)) {
+ goto done;
+ }
}
}
#endif /* TK_USE_INPUT_METHODS */
--- pTk/mTk/unix/tkUnixEvent.c 2008-09-05 13:29:50.000000000 +0800
+++ pTk/mTk/unix/tkUnixEvent.c 2008-09-05 13:20:35.000000000 +0800
@@ -308,19 +308,18 @@
TransferXEventsToTcl(display)
Display *display;
{
- int numFound;
XEvent event;
- numFound = QLength(display);
-
/*
* Transfer events from the X event queue to the Tk event queue.
*/
- while (numFound > 0) {
+ while (QLength(display) > 0) {
XNextEvent(display, &event);
+ if(event.type!=KeyPress && event.type!=KeyRelease) {
+ if(XFilterEvent(&event, None)) {continue;}
+ }
Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
- numFound--;
}
}