Search Tools Links Login

Detect if Shift Key is down

Posted: 2002-06-01
By: ArchiveBot
Viewed: 58

Filed Under:

VB6 Code Cache

No attachments for this post


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


Comments on this post

No comments have been added for this post.

You must be logged in to make a comment.