diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-09-27 14:42:35 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-09-27 14:42:35 (GMT) |
commit | 5ae24215a70e8cd5bdbd14ad619bd4230bd22f9a (patch) | |
tree | 7ff181eae8103bda9d78cb8cf94363146511a5ed /win/tkWinX.c | |
parent | 94ca8fddecf8a8e3b0e446e9d71eaf77bda8f1e6 (diff) | |
parent | 506ee2fc81bb27e237860565c11a1494ab8c7b38 (diff) | |
download | tk-5ae24215a70e8cd5bdbd14ad619bd4230bd22f9a.zip tk-5ae24215a70e8cd5bdbd14ad619bd4230bd22f9a.tar.gz tk-5ae24215a70e8cd5bdbd14ad619bd4230bd22f9a.tar.bz2 |
merge core-8-6-branch
Diffstat (limited to 'win/tkWinX.c')
-rw-r--r-- | win/tkWinX.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/win/tkWinX.c b/win/tkWinX.c index cbb84cf..7451806 100644 --- a/win/tkWinX.c +++ b/win/tkWinX.c @@ -1573,18 +1573,18 @@ HandleIMEComposition( n = ImmGetCompositionString(hIMC, GCS_RESULTSTR, NULL, 0); if (n > 0) { - char *buff = ckalloc(n); + WCHAR *buff = (WCHAR *) ckalloc(n); TkWindow *winPtr; XEvent event; int i; - n = ImmGetCompositionString(hIMC, GCS_RESULTSTR, buff, (unsigned) n); + n = ImmGetCompositionString(hIMC, GCS_RESULTSTR, buff, (unsigned) n) / 2; /* * Set up the fields pertinent to key event. * - * We set send_event to the special value of -2, so that TkpGetString - * in tkWinKey.c knows that trans_chars[] already contains a UNICODE + * We set send_event to the special value of -3, so that TkpGetString + * in tkWinKey.c knows that keycode already contains a UNICODE * char and there's no need to do encoding conversion. * * Note that the event *must* be zeroed out first; Tk plays cunning @@ -1595,7 +1595,7 @@ HandleIMEComposition( memset(&event, 0, sizeof(XEvent)); event.xkey.serial = winPtr->display->request++; - event.xkey.send_event = -2; + event.xkey.send_event = -3; event.xkey.display = winPtr->display; event.xkey.window = winPtr->window; event.xkey.root = RootWindow(winPtr->display, winPtr->screenNum); @@ -1603,8 +1603,6 @@ HandleIMEComposition( event.xkey.state = TkWinGetModifierState(); event.xkey.time = TkpGetMS(); event.xkey.same_screen = True; - event.xkey.keycode = 0; - event.xkey.nbytes = 2; for (i=0; i<n; ) { /* @@ -1612,8 +1610,7 @@ HandleIMEComposition( * UNICODE character in the composition. */ - event.xkey.trans_chars[0] = (char) buff[i++]; - event.xkey.trans_chars[1] = (char) buff[i++]; + event.xkey.keycode = buff[i++]; event.type = KeyPress; Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL); |