From 92e73dc072f318a1b5a2d2ffe65962dd93b0908d Mon Sep 17 00:00:00 2001 From: "donal.k.fellows@manchester.ac.uk" Date: Sun, 22 Apr 2012 22:03:10 +0000 Subject: [Bug 3520202]: %K must not work with or effects are undefined! --- ChangeLog | 9 +++++++++ generic/tkBind.c | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) mode change 100755 => 100644 generic/tkBind.c diff --git a/ChangeLog b/ChangeLog index 37db952..561a56c 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +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 diff --git a/generic/tkBind.c b/generic/tkBind.c old mode 100755 new mode 100644 index 3f05ccc..7e8d823 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -2428,7 +2428,7 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr) string = numStorage; goto doString; case 'k': - if (flags & KEY) { + if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) { number = eventPtr->xkey.keycode; goto doNumber; } @@ -2567,7 +2567,7 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr) /* * This is used only by the MouseWheel event. */ - if (flags & KEY) { + if ((flags & KEY) && (eventPtr->type == MouseWheelEvent)) { number = eventPtr->xkey.keycode; goto doNumber; } @@ -2576,7 +2576,7 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr) number = (int) eventPtr->xany.send_event; goto doNumber; case 'K': - if (flags & KEY) { + if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) { char *name; name = TkKeysymToString(keySym); @@ -2586,7 +2586,7 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr) } goto doString; case 'N': - if (flags & KEY) { + if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) { number = (int) keySym; goto doNumber; } -- cgit v0.12