OBJECT GET SHORTCUT
OBJECT GET SHORTCUT ( {* ;} object ; key ; modifiers )
Parameter | Type | Description | |
---|---|---|---|
* | Operator | → | If specified, object is an object name (string)If omitted, object is a variable |
object | any | → | Object Name (if * is specified) or Variable (if * is omitted) |
key | Text | ← | Key associated with object |
modifiers | Integer | ← | Modifier key mask or combination of masks |
This command is not thread-safe, it cannot be used in preemptive code.
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:
Constant | Type | Value | Comment |
---|---|---|---|
Command key mask | Integer | 256 | Ctrl key under Windows, Command key under OS X |
Control key mask | Integer | 4096 | Ctrl key under OS X, or right click under Windows and OS X |
Option key mask | Integer | 2048 | Alt key (also called Option under OS X) |
Shift key mask | Integer | 512 | Windows 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.