This example creates a log file (Myfile.txt) with a list of each time the backspace key was pressed during a VT terminal session.

Private Sub Session_AfterTerminalKey(ByVal Key As Long)

 Dim keyPressTime As String 'Time key was pressed


 'Check to see if the backspace key was pressed

 If Key = rcVtBackArrowKey Then

  'Set the time the keystroke is pressed

  keyPressTime = Time


  'Open a file to contain the data

  Open "C:\mypath\myfile.txt" For Append As #1


  'Write the time to the file

  Print #1, keyPressTime


  'Close the file 

  Close #1


 End If


End Sub