KeyboardState

Description

Reports the active state of the keyboard.

Access through the?ScriptUI.environment.keyboardState?property. Query the properties of this object at any time to determine the current key that is down and any modifiers that are pressed.

Properties

altKey readonly True if the Alt or Option key is pressed.
ctrlKey readonly True if the Ctrl key is pressed.
keyName readonly A string containing the name of the currently pressed key, such as “a”, or an empty string.
metaKey readonly True if the Cmd key (in Mac OS) or Windows key (in Windows) is pressed.
shiftKey readonly True if the Shift key is pressed.