The event stream is captured by wrapping all of the bindings for each widget to record the event and then invoke the usual binding. There are a number of special cases that must be handled. Along the way, all percent fields are captured so that events can be replayed exactly. Widget creation has to be monitored. Canvases and text widgets also have internal bindings that need to be monitored.
Some event handlers call tkwait, waiting for another event to occur.
This program is not a regression testing facility. It only addresses replay. I need to fix up bindings for new widgets. The example shows an ISDN telephone mock-up with a handset, a pushbutton keypad and some extra control buttons. The handset can be taken off hook, and a number can be keyed in to initiate a call.