README.md

December 4, 2022 ยท View on GitHub

Detect if Shift Key is down

Description

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

More Info

Submitted On
ByKamilche
LevelBeginner
User Rating3.5 (14 globes from 4 users)
CompatibilityVB 4.0 (32-bit), VB 5.0, VB 6.0
CategoryMiscellaneous
WorldVisual Basic
Archive File

API Declarations

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

Source 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