Skip to main content
Version: 20 R7 BETA

OBJECT GET SHORTCUT

OBJECT GET SHORTCUT ( {* ;} object ; key ; modifiers )

ParameterTypeDescription
*OperatorIf specified, object is an object name (string)If omitted, object is a variable
objectanyObject Name (if * is specified) or Variable (if * is omitted)
keyTextKey associated with object
modifiersIntegerModifier key mask or combination of masks

Description

The OBJECT GET SHORTCUT command returns the keyboard shortcut associated with the object(s) designated by the object and * parameters for the current process.

If you pass the optional * parameter, this indicates that the object parameter is an object name (a string). If you do not pass this parameter, this indicates that the object is a variable. In this case, you pass a variable reference instead of a string.

The key parameter returns the character associated with the key (in the case of a standard key) or a string enclosed in brackets designating the key (in the case of a function key). You can compare this value with the constants of the Shortcut and Associated Keys theme (see the OBJECT SET SHORTCUT command).

The modifiers parameter returns a value indicating the modifier key(s) associated with the shortcut. If there are several modifier keys combined, the command returns the sum of their values. You can compare the value returned with the following constants of the Events (Modifiers) theme:

ConstantTypeValueComment
Command key maskInteger256Ctrl key under Windows, Command key under OS X
Control key maskInteger4096Ctrl key under OS X, or right click under Windows and OS X
Option key maskInteger2048Alt key (also called Option under OS X)
Shift key maskInteger512Windows and OS X

If there are no modifier keys for the shortcut, modifiers returns 0.

Note: If the object parameter designates several objects in the form that have different settings, the command returns "" in key and 0 in modifiers.

See also

OBJECT SET SHORTCUT

Properties

Command number1186
Thread safe