MouseEvent.ctrlKey is a read-only boolean: true if Control was held when the mouse event fired. Learn Ctrl+click patterns, Mac caveats, trackpad pinch-zoom quirks, synthetic events, and five try-it labs.
01
Kind
Instance property
02
Returns
Boolean
03
Status
Baseline Widely available
04
Access
event.ctrlKey
05
Mac label
control key
06
Family
Modifier keys
Fundamentals
Introduction
Ctrl+click is a common power-user pattern: open in a new tab, multi-select, or a secondary action. The browser stores that state on the event as ctrlKey.
JavaScript
element.addEventListener("click", (event) => {
console.log(event.ctrlKey); // true or false
});
💡
Mac tip
On Mac, Control+click often opens a context menu at the OS level, so ctrlKey may not reach your click handler. Command (⌘) is metaKey instead. MDN also notes pinch-zoom can set ctrlKey on simulated wheel events.
Concept
Understanding the Property
MDN: MouseEvent.ctrlKey is a read-only boolean that indicates whether the ctrl key was pressed when a given mouse event occurred.
Instance — read event.ctrlKey inside a handler.
Boolean — true pressed, false not pressed.
Read-only — set via constructor options on synthetic events.
Platform notes — Mac Control+click / trackpad pinch-zoom quirks (see above).
Foundation
📝 Syntax
JavaScript
const isCtrlHeld = mouseEvent.ctrlKey;
Value
A boolean: true if Control was held during the event; otherwise false.
MouseEvent.ctrlKey is Baseline Widely available across modern browsers (MDN: since July 2015). Logos use the shared browser-image-sprite.png sprite from this project.
✓ Baseline · Widely available
MouseEvent.ctrlKey
Reliable Control modifier boolean—mind Mac Control+click and pinch-zoom wheel quirks.
UniversalWidely available
Google ChromeFull support · Desktop & Mobile
Full support
Mozilla FirefoxFull support · Desktop & Mobile
Full support
Apple SafariFull support · macOS & iOS
Full support
Microsoft EdgeFull support · Chromium
Full support
OperaFull support · Modern versions
Full support
Internet ExplorerSupported in modern IE versions
Full support
ctrlKeyExcellent
Bottom line: Read event.ctrlKey in mouse handlers; consider metaKey for Mac Command-click UX.
Wrap Up
Conclusion
event.ctrlKey tells you whether Control was held for that mouse event. Use it for Ctrl+click shortcuts, pair with metaKey for Mac Command-click, and set ctrlKey on synthetic MouseEvent objects when testing.
Consider ctrlKey || metaKey for cross-platform power-clicks
Test with new MouseEvent(..., { ctrlKey: true })
Use mousemove when Mac Control+click is OS-stolen
Offer a non-modifier UI path when possible
❌ Don’t
Assume Control+click always reaches the page on Mac
Treat every wheel + ctrlKey as a physical key press
Confuse Control with Command (metaKey)
Rely only on hidden modifier shortcuts for critical actions
Mutate event.ctrlKey on live user events
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about ctrlKey
Boolean Control state on every mouse event.
5
Core concepts
🖱️01
Instance
on the event
Kind
✅02
Boolean
true / false
Type
🍎03
Mac caveat
Control+click
Platform
🔧04
Synthetic OK
options.ctrlKey
Tests
🛡️05
Baseline
widely available
Status
❓ Frequently Asked Questions
It is a read-only boolean on a mouse event that is true when the Control key was held down at the time of that event, and false otherwise.
No. MDN marks MouseEvent.ctrlKey as Baseline Widely available (since July 2015). It is not Deprecated, Experimental, or Non-standard, so no status warning banner is needed.
On Macintosh, Control+click is often intercepted by the OS to open a context menu, so ctrlKey may not be detectable on click events. Prefer metaKey (Command) for Mac-style modifiers, or use mousemove / other events where Control is visible.
MDN notes that pinch-zooming on a trackpad can send a simulated wheel event with ctrlKey set to true. Do not assume every ctrlKey wheel event means the physical Control key was held.
Pass ctrlKey: true in the options object to new MouseEvent("click", { ctrlKey: true }). The constructed event then reports event.ctrlKey as true.
Mouse events also expose altKey, shiftKey, and metaKey. Together they describe which modifier keys were held. You can also use event.getModifierState("Control").
Did you know?
MDN warns that trackpad pinch-zoom can fire a simulated wheel event with ctrlKey: true. Zoom handlers that check e.ctrlKey must also look at other signals (for example e.deltaY) so they do not confuse pinch with a physical Control key.