MouseEvent.metaKey
doesn't seem to work. On both FireFox and Chrome, it returns false
even if I hold the Win key while clicking:
<!doctype html>
<button onclick=alert(event.metaKey)>click while holding "meta key"</button>
MDN states:
The
MouseEvent.metaKey
read-only property returning aBoolean
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 (⊞).
Browser Compatibility
MDN claims MouseEvent.metaKey
is supported on FireFox and Chrome, but it's not working.
Which key does MouseEvent.metaKey
refer to?
Why is the above code not working?