Share via


shiftKey Property

Returns a Boolean that represents whether the SHIFT key on the keyboard is pressed. True if the SHIFT key is pressed. False if it is not.

expression.shiftKey

*expression   * Required. An expression that returns an IHTMLEventObj object.

Example

The following example displays a message every time the user clicks on the active document telling whether the user is pressing the SHIFT key. This example must be placed in a class module, and it assumes that you have declared in the General Declarations section of a class module an FPHTMLDocument object variable called "doc" using the WithEvents keyword.

Private Function objDoc_onclick() As Boolean
    Dim objEvent As IHTMLEventObj

    Set objEvent = objWindow.event
    
    Select Case objEvent.shiftKey
        Case False
            MsgBox "You are not pressing your SHIFT key."
        Case True
            MsgBox "You are pressing your SHIFT key."
    End Select
End Function

Applies to | IHTMLEventObj Object