Search...
altKey
Indicates if the Option key on a Mac or Alt key on a PC was pressed.
Type:
booleanRead Only
Was this helpful?
Gets the keyboard event's
altKey
property when the altKey
is pressedCopy Code
1$w("#myElement").onKeyPress( (event) => {2 let alt = event.altKey; // 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