diff options
author | Joe Mistachkin <joe@mistachkin.com> | 2012-11-16 22:09:07 (GMT) |
---|---|---|
committer | Joe Mistachkin <joe@mistachkin.com> | 2012-11-16 22:09:07 (GMT) |
commit | 4dcfbd660f0135c73d8b76670653ecb091856863 (patch) | |
tree | a9e8a510b38ec1176f7be14a88696a82c8a7d32a | |
parent | 7df4b167c0bfa1ff3ab6b8374f287299ec2228df (diff) | |
download | tk-4dcfbd660f0135c73d8b76670653ecb091856863.zip tk-4dcfbd660f0135c73d8b76670653ecb091856863.tar.gz tk-4dcfbd660f0135c73d8b76670653ecb091856863.tar.bz2 |
Add docs and tests.
-rw-r--r-- | doc/bind.n | 3 | ||||
-rw-r--r-- | tests/bind.test | 26 |
2 files changed, 29 insertions, 0 deletions
@@ -548,6 +548,9 @@ event generated by \fBSendEvent\fR. .IP \fB%K\fR 5 The keysym corresponding to the event, substituted as a textual string. Valid only for \fBKeyPress\fR and \fBKeyRelease\fR events. +.IP \fB%M\fR 5 +The number of script-based binding patterns matched so far for the +event. Valid for all event types. .IP \fB%N\fR 5 The keysym corresponding to the event, substituted as a decimal number. Valid only for \fBKeyPress\fR and \fBKeyRelease\fR events. diff --git a/tests/bind.test b/tests/bind.test index 85372f8..de9da70 100644 --- a/tests/bind.test +++ b/tests/bind.test @@ -25,6 +25,14 @@ proc setup {} { foreach p [event info] {event delete $p} update } +proc setup2 {} { + catch {destroy .b.e} + entry .b.e + pack .b.e + focus -force .b.e + foreach p [event info] {event delete $p} + update +} setup foreach i [bind Test] { @@ -1565,6 +1573,24 @@ test bind-16.44 {ExpandPercents procedure} { event gen .b.f <Gravity> set x } {?? ??} +test bind-16.45 {ExpandPercents procedure} { + setup2 + bind .b.e <Key> {set x "%M"} + bind Entry <Key> {set y "%M"} + bind all <Key> {set z "%M"} + set x none; set y none; set z none + event gen .b.e <Key-a> + list $x $y $z +} {0 1 2} +test bind-16.46 {ExpandPercents procedure} { + setup2 + bind all <Key> {set z "%M"} + bind Entry <Key> {set y "%M"} + bind .b.e <Key> {set x "%M"} + set x none; set y none; set z none + event gen .b.e <Key-a> + list $x $y $z +} {0 1 2} test bind-17.1 {event command} { |