Hi,
This code will output (to a text file) the ascii value of the key on the keyboard which was pressed. This code was written in Visual Basic 6.0.
vb Code:
Private Sub Command1_Click()
Unload Me
'End
End Sub
Private Sub Text1_Change()
Open App.Path & "\keyboard.txt" For Append As #1
Print #1, Label2.Caption & " " & Text1.Text
Close #1
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
Label2.Caption = Chr(KeyCode)
Text1.Text = KeyCode
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
Label2.Caption = Chr(KeyAscii)
MsgBox "Asciikey: " & KeyAscii
End Sub
Edit:
The commented out parts were apart of the original code but are not needed to preform the task suggested in the thread title.
Nightwalker