package require twoKeyrec
?1.0?
two_keyrec
command ?options?
keyrec
is a key event recorder.
It has proven usefull when building or configuring new dialog widgets
at runtime, which might take some time (or even calls to process the event
loop). Key events will only be directed to the new dialog after it has
been mapped. In the meantime, those events generally are directed to the
widget which had the focus prevously. Using keyboard shortcuts for opening
new dialogs and blindly typing afterwards will frequently result in typing
at the wrong location. This recorder might be used to catch and record key events and playing them back as if they had been entered at another widget. This is done by using a hidden widget which will get the focus meanwhile.
two_keyrec
init ?widget?- Initialize the recorder. Mainly creates the interception widget widget (defaults to .__two_keyrec). This widget is placed at negative coordinates so it should never be visible.
two_keyrec
start- Start recording. This will set the focus to the hidden interceptor widget.
two_keyrec
stop- Stop recording. This will return the focus to the widget which had the focus before recording (or to any widget which recieved the focus in the meantime, e.g. by mouse button presses).
two_keyrec
replay ?widget?- Replay the previously recorded key events as if the had happend within the widget (defaults to the widget currently having the focus).
keyrec
recorder installs a hidden interceptor
frame (class TwoKeyrec). There are several places in the code which assume
the toplevel . widget does exists.