Is there a way to detect if the windows key has been pressed, I cant find any keyconstants for it anywhere??? And would I be right in ausumming that XP comes with all the API's the 95 systems and upwards had???
Thanks.
Printable View
Is there a way to detect if the windows key has been pressed, I cant find any keyconstants for it anywhere??? And would I be right in ausumming that XP comes with all the API's the 95 systems and upwards had???
Thanks.
VB Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 91 Then Debug.Print "Left Windows Key" ElseIf KeyCode = 92 Then Debug.Print "Right Windows Key" End If End Sub
Thanks a lot, but in would a form_keypress event catch the button, because the form would be deselected???
Ah, you never mentioned that you wanted to capture key stokes
when not in your application, try:VB Code:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer Private Sub Form_Load() Timer1.Interval = 100 End Sub Private Sub Timer1_Timer() If GetAsyncKeyState(91) <> 0 Then Debug.Print "Left Windows Key" ElseIf GetAsyncKeyState(92) <> 0 Then Debug.Print "Right Windows Key" End If End Sub
Thanks, just what I need.
You've almost given me what I need. I can get the keycode for the ctrl keys and the enter keys but how do I read WHICH ctrl key has been pressed and WHICH enter key has been pressed as they will perform different functions in my program.
Thanks,