Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
Private Const KEY_PRESSED As Integer = &H1000
Private Sub Timer1_Timer()
If GetKeyState(vbKeyDown) And KEY_PRESSED Then
Me.Caption = "the key is pressed"
Else
Me.Caption = "the key is unpressed"
End If
End Sub