Search...
metaKey
Indicates if the ⌘ Command key on a Mac or ⊞ Windows key on a PC was pressed.
Type:
booleanRead Only
Was this helpful?
Gets the keyboard event's
metaKey
property when the metaKey
is pressedCopy Code
1$w("#myElement").onKeyPress( (event) => {2 let meta = event.metaKey; // true3} );
Gets all of the keyboard event's properties
This example gets the properties of a keyboard event fired when the
Shift
and a
keys are pressed.
Copy Code
1$w("#myElement").onKeyPress( (event) => {2 let key = event.key; // "A"3 let shift = event.shiftKey; // true4 let meta = event.metaKey; // false5 let alt = event.altKey; // false6 let ctrl = event.ctrlKey; // false7 let value = event.target.value; // string value of text inside "#myElement" before the last KeyPress event8} );9