You are on page 1of 1

Declare PtrSafe Function GetKeyState Lib �user32�

_
(ByVal nVirtKey As Long) As Integer
Sub Button_Click()
Const VK_SHIFT As Integer = &H10
If GetKeyState(VK_SHIFT) < 0 Then
MsgBox �Shift is pressed�
Else
MsgBox �Shift is not pressed�
End If
End Sub

You might also like