Hi, i have a problem with my hotkey using GetAsyncKeyState.
I use ctrl, shift and A for the hotkey but the problem is it still works with only Shift pressed.
Why aren't ctrl and A working?
I use ctrl, shift and A for the hotkey but the problem is it still works with only Shift pressed.
Why aren't ctrl and A working?
Code:
Public Class Form1
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Dim ctrlkey As Boolean
Dim shiftkey As Boolean
Dim a As Boolean
ctrlkey = GetAsyncKeyState(Keys.ControlKey)
shiftkey = GetAsyncKeyState(Keys.ShiftKey)
a = GetAsyncKeyState(Keys.A)
If ctrlkey And shiftkey And a = True Then
Button1.PerformClick()
End If
End Sub