This sample saves all of the text entered into a session by a user to a log file. Only text entered by the user is saved.
If you prefer to run macros in pre-configured sessions instead of creating your own sessions, you can download the VBA Sample Sessions and open the log-user-input.rd3x (IBM) and log-user-input.rdox (Open Systems) files. The download package contains everything you need to run the macros in these files. See Download the VBA Sample Sessions.
These samples use events to capture and save data users enter during a terminal session.
As the user enters text, the BeforeSendKeys (IBM) or KeysSending (Open Systems) event adds the text entered to a buffer before each key is sent.
When the control key is pressed, the BeforeSendControlKey (IBM) or ControlKeysSending (Open Systems) events are handled to append the text in the buffer to a file. The buffer is cleared before the control key is sent.