diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2012-04-22 22:07:41 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2012-04-22 22:07:41 (GMT) |
commit | 021238ae28d80332aca5ce297082885bf0e798d5 (patch) | |
tree | af4a5c91d6384103eef0acc48b6817568117b941 | |
parent | fd636b80ebd519e891807305cf5c22f69a03edd6 (diff) | |
parent | bcc1d86678bcd77495a02ca7b58041f6c9ff3d1a (diff) | |
download | tk-021238ae28d80332aca5ce297082885bf0e798d5.zip tk-021238ae28d80332aca5ce297082885bf0e798d5.tar.gz tk-021238ae28d80332aca5ce297082885bf0e798d5.tar.bz2 |
[Bug 3520202]: %K must not work with <MouseWheel> or effects are undefined!
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | generic/tkBind.c | 8 |
2 files changed, 13 insertions, 4 deletions
@@ -1,3 +1,12 @@ +2012-04-22 Donal K. Fellows <dkf@users.sf.net> + + * generic/tkBind.c (ExpandPercents): [Bug 3520202]: Ensure that the + %k, %K and %N substitutions use dummy tokens with <MouseWheel> events + and that the %D subsitution is a dummy with <Key>/<KeyRelease>. 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 Donal K. Fellows <dkf@users.sf.net> * generic/tkWindow.c (commands): Ensure that all descriptions of diff --git a/generic/tkBind.c b/generic/tkBind.c index 6841f1e..10998fe 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -2028,7 +2028,7 @@ ExpandPercents( string = numStorage; goto doString; case 'k': - if (flags & KEY) { + if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) { number = eventPtr->xkey.keycode; goto doNumber; } @@ -2168,7 +2168,7 @@ ExpandPercents( * This is used only by the MouseWheel event. */ - if (flags & KEY) { + if ((flags & KEY) && (eventPtr->type == MouseWheelEvent)) { number = eventPtr->xkey.keycode; goto doNumber; } @@ -2177,7 +2177,7 @@ ExpandPercents( number = (int) eventPtr->xany.send_event; goto doNumber; case 'K': - if (flags & KEY) { + if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) { const char *name = TkKeysymToString(keySym); if (name != NULL) { @@ -2186,7 +2186,7 @@ ExpandPercents( } goto doString; case 'N': - if (flags & KEY) { + if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) { number = (int) keySym; goto doNumber; } |