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 ().
Remember
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
Read it on the event object inside any mouse or keyboard handler.
Bind a handler with .on("click", …) or .on("keydown", …).
Accept the event argument in the handler.
Read event.metaKey (no call — it is a property).
Branch: if true, Meta/Command/Windows was held.
For cross-platform shortcuts, also check event.ctrlKey when needed.
Piece
Required?
Role
event
Yes
jQuery event object in the handler
metaKey
—
Boolean: Meta held or not
Arguments
N/A
Property — not a function
ctrlKey etc.
Optional
Other modifiers on the same event
Pseudocode
Pseudocode
target.on("click", handler)
when click fires:
browser sets event.metaKey from keyboard state
if event.metaKey is true:
Meta / Command / Windows was held
else:
Meta was not held
// Common cross-platform pattern:
if event.metaKey OR event.ctrlKey:
treat as "primary modifier" shortcut
Reference
Cheat Sheet
Keep these facts handy while reading modifier keys.
Platform. Windows Ctrl often sets ctrlKey, not metaKey.
Debug. Print all four when shortcuts feel “wrong.”
Example 4 — Multi-Select with Meta/Ctrl
Plain click selects one item; Meta/Ctrl click toggles without clearing others.
jQuery
var selected = [];
$("#list").on("click", "button", function (event) {
var name = $(this).text();
if (!event.metaKey && !event.ctrlKey) {
selected = [name];
} else {
var i = selected.indexOf(name);
if (i === -1) selected.push(name);
else selected.splice(i, 1);
}
$("#out").text("Selected: " + selected.join(", "));
});
Prevent default. Stop the browser Save dialog when you handle it.
Note. On Windows, many apps use Ctrl+S — add || event.ctrlKey if needed.
Edge Cases & Pitfalls
Watch for these when using event.metaKey.
property
Not a method
Write event.metaKey, not event.metaKey().
OS
Meta ≠ Ctrl on Windows
Ctrl+click sets ctrlKey. Use metaKey || ctrlKey for shared shortcuts.
read-only
Cannot assign it
Setting event.metaKey = true does not simulate holding Meta for the browser.
touch
Touch devices
Phones and tablets usually have no Meta key — metaKey stays false.
Compatibility
Browser Support
event.metaKey is a jQuery event-object property available since 1.0.4. Browsers map Meta to Command (Mac) or the Windows key (PC). Works wherever your loaded jQuery version runs.
✓ Stable · jQuery 1.0.4+
event.metaKey
Supported in jQuery 1.0.4–3.x. Prefer jQuery 3.x with .on() handlers. Read the Boolean on click, mousedown, keydown, and related events.
100%With jQuery 1.0.4+
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
metaKeyjQuery 1.0.4+
Bottom line: Safe for production. Remember platform mapping: Command on Mac, Windows key on PC; use metaKey || ctrlKey for shared shortcuts.
Analysis
Performance Notes
Approach
Cost
Best for
Read event.metaKey
Free
One Boolean check in a handler
metaKey || ctrlKey
Free
Cross-platform shortcut branches
Document keydown
Cheap
Global chords; keep the handler tiny
Modifier reads are free. Cost comes from what you do when the flag is true — keep shortcut handlers short.
Remember
Key Takeaways
Role: Boolean — was Meta held when the event fired?
Platform: Command on Mac, Windows key on PC.
Official:$("#display").text(event.metaKey).
Cross-OS: often metaKey || ctrlKey for shared shortcuts.
One line:event.metaKey answers “was Command / Windows held for this event?”
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.