To create an event with event_generate(), we need to pass in an event sequence string, in the format <EventModifier-EventType-EventDetail>.
Event type specifies the kind of event we're sending, such as a keystroke, mouse click, windowing event, and so on.
Tkinter has around 30 event types, but you will typically only need to work with the following:
Event types
|
Description
|
ButtonPress | Also Button, represents a mouse button click |
ButtonRelease | Represents lifting off a mouse button |
KeyPress | Also Key, represents pressing a keyboard key |
KeyRelease | Represents lifting off a keyboard key |
FocusIn | Represents giving focus to a widget |
FocusOut | Represents exiting a widget |
Enter | Represents the mouse cursor ... |