I'm using the OnKeyDown event in hopes of capturing a key being held
down during the initial startup of my application. Does anyone know,
at what point the OnKeyDown event fires?
I checked to see if the key would be captured in the OnOpen and OnLoad
or Initial OnCurrent event, but this does not seem to be the case.
Can I capture a key in these events?
Public CkOnOpenKey As Boolean
CkOnOpenKey = True 'Placed in the OnOpen event
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
'Key interpreter. Restricts keys.
If CkOnOpenKey Then
If KeyCode = 88 Then
MsgBox "The X key was pressed"
End If
End If
End Sub
Private Sub Form_Load()
'Check if he X key is pressed and held during the app startup
Call Pauser(2) 'Pause for 2 seconds
'The message "The X Key was pressed" should appear, but doesn't
CkOnOpenKey = False ' The app is running. Shut off the check
End Sub