This is an unofficial mirror of Tkinter reference documentation (based on Python 2.7 and Tk 8.5) created by the late John Shipman.
It was last updated in 2013 and is unmaintained. [More info]
The modifier names that you can use in event sequences include:
Alt
| True when the user is holding the alt key down. |
Any
|
This modifier generalizes an event type. For
example, the event pattern '<Any-KeyPress>' applies to the
pressing of any key.
|
Control
| True when the user is holding the control key down. |
Double
|
Specifies two events happening close together in
time. For example, <Double-Button-1> describes two
presses of button 1 in rapid succession.
|
Lock
| True when the user has pressed shift lock. |
Shift
| True when the user is holding down the shift key. |
Triple
|
Like Double , but specifies three
events in rapid succession.
|
You can use shorter forms of the events. Here are some examples:
'<1>'
is the same as '<Button-1>'
.
'x'
is the same as '<KeyPress-x>'
.
Note that you can leave out the enclosing '<…>'
for most single-character
keypresses, but you can't do that for the space character
(whose name is '<space>'
) or the
less-than (<
) character (whose name is
'<less>'
).