November 1999
Intermediate to advanced
832 pages
19h 28m
English
A modifier indicates that another key or button is being held down at the time of the event. Typical modifiers are the Shift and Control keys. The mouse buttons can also be used as modifiers. If an event does not specify any modifiers, the presence of a modifier key is ignored by the event dispatcher. However, if there are two possible matching events, the more accurate match will be used. For example, consider these three bindings:
bind $w <KeyPress> {puts "key=%A"}
bind $w <Key-c> {puts "just a c"}
bind $w <Control-Key-c> {exit}
The last event is more specific than the others. Its binding will be triggered when the user types c with the Control key held down. If the user types c with the Meta key held down, the second binding will ...
Read now
Unlock full access