KeyboardState (SUI)

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.

Objects:

Boolean, String

Property Listing

Property

Type

Access

Description

altKey

Boolean

readonly

True if the Alt or Option key is pressed.

ctrlKey

Boolean

readonly

True if the Ctrl key is pressed.

keyName

String

readonly

A string containing the name of the currently pressed key, such as "a", or an empty string.

metaKey

Boolean

readonly

True if the Cmd key (in Mac OS) or Windows key (in Windows) is pressed.

shiftKey

Boolean

readonly

True if the Shift key is pressed.

Object of

Environment (SUI).keyboardState