helo
how to detect the shift key being released on a global not app specific basis?
system wide hook is overkill, what about hotkey, any other better approaches?
Printable View
helo
how to detect the shift key being released on a global not app specific basis?
system wide hook is overkill, what about hotkey, any other better approaches?
Try using GetAsyncKeyState api.
ok thank RhinoBull... how to detect key released with it?
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
Private Sub Timer1_Timer()
Debug.Print GetKeyState(16)
End Sub
A little different:
Code:Option Explicit
Private Const VK_SHIFT = &H10
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Sub Timer1_Timer()
If (GetAsyncKeyState(VK_SHIFT) And &HF0000000) = &HF0000000 Then
Debug.Print "shift key is down"
Else
Debug.Print "shift key is up"
End If
End Sub