by Kamilche (35 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (4 Votes)
A function that returns whether or not the shift key is currently down.
API DeclarationsPrivate Declare Function GetAsyncKeyState Lib "user32" (ByVal uAction As Long) As Long
Private Function ShiftDown()
Dim RetVal As Long
RetVal = GetAsyncKeyState(16) 'SHIFT key
If (RetVal And 32768) <> 0 Then
ShiftDown = True
Else
ShiftDown = False
End If
End Function