Unicode Controls & Classes for VB6 - Version 4

clsCommonWrapper.ShiftState Function

Returns the state of CTRL, ALT and SHIFT keys

-  Syntax
Public Function ShiftState () As Integer
-  Remarks
Hide Sample
Option Explicit

Private Sub Form_Load()
Dim ow As New clsCommonWrapper

Dim st As Integer
st = ow.ShiftState()

Dim bCtrl As Boolean
Dim bShift As Boolean
Dim bAlt As Boolean

bCtrl = (st And vbCtrlMask) <> 0
bShift = (st And vbShiftMask) <> 0
bAlt = (st And vbAltMask) <> 0
End Sub