metaKey event attribute
Event Object
Definition and Usage
The metaKey event attribute returns a boolean value indicating whether the "meta" key was pressed and held down when the event occurred.
Syntax
event.metaKey
Example
Example
The following example alerts whether the "meta" key is held down when a mouse button is clicked:
Click somewhere in the document. An alert box will tell you whether you pressed the meta key.
Try it »
Event Object