Reference > Functions reference > Get functions > Get(TriggerModifierKeys)
 

Get(TriggerModifierKeys)

Returns the state of the keyboard modifier keys when an OnObjectKeystroke or OnLayoutKeystroke script trigger was activated.

Format 

Get ( TriggerModifierKeys )

Parameters 

None

Data type returned 

number

Originated in 

FileMaker Pro 10.0

Description 

Returns a value only when called from a script activated by a script trigger or from a sub-script called from the triggered script; otherwise, returns an empty string.

See Get(ActiveModifierKeys) for a description of the values assigned to the keyboard modifier keys.

See the Code function for a list of navigational keys and the codes returned to a script activated by this trigger.

Time might elapse between when the keys that activated a script trigger are pressed and the script asks for information on the modifier keys. Use Get(TriggerKeystroke) and Get(TriggerModifierKeys) to capture the keys that were active when the script trigger was activated. Use Get(ActiveModifierKeys) to capture any current keys being pressed.

Notes 

Windows: Alt and Ctrl key combinations do not activate script triggers.

macOS: Command key combinations do not activate script triggers.

In FileMaker WebDirect, this function is not supported and returns an empty string.

In FileMaker Go, this function is not supported and returns 0.

Example 1 

The following example will only display a custom dialog box when lowercase "a" is entered:

If [ Get ( TriggerKeystroke ) = "a" and Get ( TriggerModifierKeys ) = 0 ]
Show Custom Dialog ["You entered \"a\"."]
End If

Example 2 

The value 9 is returned when Shift-Option is pressed on a computer running macOS. If the Option and Shift keys are pressed on a Mac when a script is triggered, Get(TriggerModifierKeys) returns 9, regardless of which modifier keys have been pressed between when the trigger was activated and when the script runs.

Related topics 

Functions reference (category list)

Functions reference (alphabetical list)

About formulas

About functions

Defining calculation fields

Using operators in formulas