A Boolean property: true if the META key was pressed when the event fired, otherwise false. Added in jQuery 1.0.4. It is a property — not a method — so do not call it with ().
Syntax
Start with these common calls. Keep them short and readable.
jQuery
event.metaKey // Boolean property — no parentheses
// Official idea
$("#checkMetaKey").on("click", function (event) {
$("#display").text(event.metaKey); // true or false
});
// Mac: Command (⌘) · Windows: Windows key
// Cross-platform "primary" shortcut: metaKey || ctrlKey
Call
What it does
event.metaKey
Learn jQuery event.metaKey: detect the Meta modifier (Command on Mac, Windows key on PC) on click and keyboard events, official true/false demo, Cmd+click patterns, modifier comparison, examples, and FAQs.
Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.
Parameters
Parameter
Description
Step 1
Bind a handler with .on("click", …) or .on("keydown", …).
Step 2
Accept the event argument in the handler.
Step 3
Read event.metaKey (no call — it is a property).
Return Value
Return Value
Description
Boolean
Often true or false depending on the match or state.
jQuery Examples
Example 1 — Official: Display metaKey on Click
Show true or false when the target is clicked.
jQuery
$("#checkMetaKey").on("click", function (event) {
$("#display").text(event.metaKey);
});
Platform. Windows Ctrl often sets ctrlKey, not metaKey.
Frequently Asked Questions
event.metaKey is a Boolean property on the jQuery event object. It is true when the META modifier key was pressed when the event fired, and false otherwise. Available since jQuery 1.0.4.
On Macintosh keyboards, metaKey maps to the Command key (⌘). On Windows keyboards, metaKey maps to the Windows key. The property name is always metaKey.
They report different modifiers. On Mac, Command-click often sets metaKey; Ctrl-click sets ctrlKey. On Windows, Ctrl+click sets ctrlKey; the Windows key may set metaKey. Do not assume metaKey is the primary shortcut key on every OS.
Mouse events such as click, mousedown, and mouseup expose metaKey when Meta/Command/Windows is held. Keyboard events such as keydown and keyup also expose it alongside key and other modifiers.
No. metaKey is read-only — it reflects keyboard state when the browser dispatched the event. You cannot flip it to simulate a modifier.
Many apps use (event.metaKey || event.ctrlKey) for “primary modifier + click/key” so Mac Command and Windows Ctrl behave similarly. Use metaKey alone when you specifically need the Meta/Command/Windows key.