The MouseEvent.metaKey read-only property returning a Boolean that indicates if the Meta key was pressed (true) or not (false) when the event occured.

Note: On Macintosh keyboards, this is the command key (). On Windows keyboards, this is the windows key ().


var metaKeyPressed = instanceOfMouseEvent.metaKey

Return value

A boolean


 function goInput(e) {
 // checks metaKey and
   if (e.metaKey) {
        // passes event along
   } else {


Specification Status Comment
Document Object Model (DOM) Level 3 Events Specification
The definition of 'MouseEvent.metaKey' in that specification.
Obsolete No change from Document Object Model (DOM) Level 2 Events Specification.
Document Object Model (DOM) Level 2 Events Specification
The definition of 'MouseEvent.metaKey' in that specification.
Obsolete Initial definition.

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android ? Chrome Android ? Edge Mobile Full support YesFirefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ?


Full support  
Full support
Compatibility unknown  
Compatibility unknown

See also

Document Tags and Contributors

Contributors to this page: fscholz, libbymc, fredj, teoli, amycb, Jeremie
Last updated by: fscholz,