I'm hoping to use the Access key events but need to better understand how the code works. In the below code I don't understand how "(Shift And acShiftMask) > 0 " is working. I Would appreciate it if someone could help me understand bit masks and how the below code works?
Private Sub KeyHandler_KeyDown(KeyCode As Integer, _
Shift As Integer)
Dim intShiftDown As Integer, intAltDown As Integer
Dim intCtrlDown As Integer
' Use bit masks to determine which key was pressed.
intShiftDown = (Shift And acShiftMask) > 0
intAltDown = (Shift And acAltMask) > 0
intCtrlDown = (Shift And acCtrlMask) > 0
' Display message telling user which key was pressed.
If intShiftDown Then MsgBox "You pressed the SHIFT key."
If intAltDown Then MsgBox "You pressed the ALT key."
If intCtrlDown Then MsgBox "You pressed the CTRL key."
End Sub