# event.ctrlKey property

The `event.ctrlKey` property allows you to find out if the `Ctrl` key was pressed during the event.

## Syntax

`event.ctrlKey;`

## Example

In the following example, when a button is clicked, we will display a message indicating whether one of the `Ctrl`, `Alt` or `Shift` keys was pressed:

`<button id="button">click me</button>` `let button = document.querySelector('#button'); button.addEventListener('click', function(event) { if (event.ctrlKey) { alert('Ctrl pressed'); } if (event.altKey) { alert('Alt pressed'); } if (event.shiftKey) { alert('Shift pressed'); } });`

:

## See also

- the `event.altKey` property
  that catches pressing the Alt key
- the `event.shiftKey` property
  that catches pressing the Shift key
- the `event.metaKey` property
  that catches pressing the Cmd key

← →
↑
en ru