Public Function MyKBHook(ByVal ncode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Dim i
Dim strtemp
If ncode >= 0 Then
If (wParam >= 48 And wParam <= 58) Then
idstr = Trim(idstr) + Trim(Str(wParam - 48))
Open "C:\Keyfile.txt" For Append As #1
Write #1, "=============================================================="
Write #1, wParam - 48, lParam, Date, Time
Close #1
End If
If wParam = 13 Then
For i = 1 To Len(idstr)
strtemp = strtemp + Trim(Mid(idstr, i, 1))
i = i + 3
Next i
Form1.Text2.Text = ""
Form1.Text2.Text = Trim(strtemp)
strtemp = ""
End If