This is how it is done in VB6
Code:
Private Sub Form_Load()
main.x1 = GetSavedVar("x1")
End Sub
Private Sub Timer1_Timer()
If GetAsyncKeyState(main.x1) Then Label1_Click
End Sub
Private Sub Timer2_Timer()
WriteSavedVar "x1", x1.Text
End Sub
Private Sub x1_KeyDown(keycode As Integer, shift As Integer)
x1.Text = keycode
End Sub
Public Function GetSavedVar(strKey As String)
Dim nSize, ret As Long
Dim strBuffer As String
strBuffer = Space$(255)
nSize = 255
ret = GetPrivateProfileString("Hotkeys", strKey, "0", strBuffer, nSize, App.Path & "\keys.ini")
GetSavedVar = strBuffer
End Function
Public Sub WriteSavedVar(strKey As String, strBuffer As String)
Dim ret As Long
ret = WritePrivateProfileString("Hotkeys", strKey, strBuffer, App.Path & "\keys.ini")
End Sub
Private Sub Label1_Click()
THE CODE TO EXECUTE
End Sub