From 606efd3fa0263aa5eeb8df60bc6639310b3c4238 Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 7 Jan 2013 14:44:22 +0000 Subject: The proposed fix from Bug 3599312, which should make key map handling interact better with input methods. Note that this does not work on OSX (in X11 mode) because that handles the Alt key in its own special way. --- unix/tkUnixKey.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c index b7fc97f..eaa33ae 100644 --- a/unix/tkUnixKey.c +++ b/unix/tkUnixKey.c @@ -280,6 +280,14 @@ TkpGetKeySym( int index; TkKeyEvent* kePtr = (TkKeyEvent*) eventPtr; + /* + * Refresh the mapping information if it's stale + */ + + if (dispPtr->bindInfoStale) { + TkpInitKeymapInfo(dispPtr); + } + #ifdef TK_USE_INPUT_METHODS /* * If input methods are active, we may already have determined a keysym. @@ -292,6 +300,7 @@ TkpGetKeySym( Tcl_DString ds; TkWindow *winPtr = (TkWindow *) Tk_IdToWindow(eventPtr->xany.display, eventPtr->xany.window); + Tcl_DStringInit(&ds); (void) TkpGetString(winPtr, eventPtr, &ds); Tcl_DStringFree(&ds); @@ -303,14 +312,6 @@ TkpGetKeySym( #endif /* - * Refresh the mapping information if it's stale - */ - - if (dispPtr->bindInfoStale) { - TkpInitKeymapInfo(dispPtr); - } - - /* * Figure out which of the four slots in the keymap vector to use for this * key. Refer to Xlib documentation for more info on how this computation * works. -- cgit v0.12