VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Detect if Shift Key is down

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 Declarations
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal uAction As Long) As Long

Rate Detect if Shift Key is down

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

Download this snippet    Add to My Saved Code

Detect if Shift Key is down Comments

No comments have been posted about Detect if Shift Key is down. Why not be the first to post a comment about Detect if Shift Key is down.

Post your comment

Subject:
Message:
0/1000 characters