THE WORLD'S LARGEST WEB DEVELOPER SITE

TouchEvent shiftKey Property

❮ DOM Events ❮ TouchEvent

Example

Find out whether or not the "SHIFT" key was pressed when you touch the screen:

if (event.shiftKey) {
    alert("The SHIFT key was pressed!");
} else {
    alert("The SHIFT key was NOT pressed!");
}
Try it Yourself »

Definition and Usage

The shiftKey property returns a Boolean value that indicates whether or not the "SHIFT" key was pressed when a touch event was triggered.

Note: On many devices th SHIFT key is represented by the the ("⇧") key.

Note: This property is read-only.


Browser Support

Property
shiftKey 22 yes 52 Not supported Not supported

Syntax

event.shiftKey

Technical Details

Return Value: A Boolean, indicating whether the "SHIFT" key was pressed when the touch event occurred.

Possible values:

  • true - The shift key was pressed
  • false - The shift key was not pressed

Related Pages

HTML DOM reference: MouseEvent shiftKey Property

HTML DOM reference: TouchEvent altKey Property

HTML DOM reference: TouchEvent ctrlKey Property

HTML DOM reference: TouchEvent metaKey Property


❮ DOM Events ❮ TouchEvent