KeyboardEvent ctrlKey Property

Find out whether or not the "CTRL" key was pressed when a keyboard key is pressed

Definition and Usage

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

Note: This property is read-only.

Browser Support

Property
ctrlKey Yes Yes Yes Yes Yes

Syntax

event.ctrlKey

Technical Details

Return Value: A Boolean, indicating whether the "CTRL" key was pressed when the key event occured.

Possible values:

  • true - The ctrl key was pressed
  • false - The ctrl key was not pressed
DOM Version: DOM Level 2 Events

Related Pages

HTML DOM reference: KeyboardEvent altKey Property

HTML DOM reference: KeyboardEvent metaKey Property

HTML DOM reference: KeyboardEvent shiftKey Property