Index: ChangeLog ================================================================== --- ChangeLog +++ ChangeLog @@ -1,5 +1,14 @@ +2012-04-22 Donal K. Fellows + + * generic/tkBind.c (ExpandPercents): [Bug 3520202]: Ensure that the + %k, %K and %N substitutions use dummy tokens with events + and that the %D subsitution is a dummy with /. This + was causing significant indigestion (and a read of goodness knows what + memory) to Tkinter/Python because of the way they map events between + languages. + 2012-04-20 Jan Nijtmans * generic/tk.tcl: Use vroot size in stead of screen size for clipping window coordinates in ::tk::PlaceWindow. * generic/dialog.tcl: Use ::tk::PlaceWindow in dialog.tcl, in Index: generic/tkBind.c ================================================================== --- generic/tkBind.c +++ generic/tkBind.c @@ -2381,11 +2381,11 @@ TkpPrintWindowId(numStorage, eventPtr->xany.window); } string = numStorage; goto doString; case 'k': - if (flags & KEY) { + if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) { number = eventPtr->xkey.keycode; goto doNumber; } goto doString; case 'm': @@ -2521,29 +2521,29 @@ case 'D': /* * This is used only by the MouseWheel event. */ - if (flags & KEY) { + if ((flags & KEY) && (eventPtr->type == MouseWheelEvent)) { number = eventPtr->xkey.keycode; goto doNumber; } goto doString; case 'E': number = (int) eventPtr->xany.send_event; goto doNumber; case 'K': - if (flags & KEY) { + if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) { char *name = TkKeysymToString(keySym); if (name != NULL) { string = name; } } goto doString; case 'N': - if (flags & KEY) { + if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) { number = (int) keySym; goto doNumber; } goto doString; case 'P':