Search Tools Links Login

Detect if Shift Key is down


A function that returns whether or not the shift key is currently down.

Original Author: Kamilche

API Declarations

Private Declare Function GetAsyncKeyState Lib "user32" (ByVal uAction As Long) As Long

Code

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

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 93 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.