Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages

Shopping Cart
Shopping Cart


Free Newsletter


Privacy Policy

FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.


 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

ModifiersOn ( keys )

Rate this function:  

  Average rating: 4.4  (20 votes)
  Discuss this Custom Function

Eric, SJSU

Returns whether modifier key-combination pressed.

Sample Input:
ModifiersOn ( "Shift" )

ModifiersOn ( 9 )

ModifiersOn ( "Ctrl-Alt" )

ModifiersOn ( 0 )

ModifiersOn ( "" )
Sample Output:
1 when shift pressed

1 when shift-option pressed

1 when ctrl-alt pressed

0 when any modifier pressed

when all keys pressed

 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Click here to copy To Clip Manager if you have myFMbutler's Clip Manager installed


ModifiersOn ( keys ) ©2015 Eric Matthews, San Jose, CA :-)
Returns whether modifier key-combination pressed.

Returns 0 (False) if the modifier key or key-combination specified is not pressed
and 1 (True) if the key or key-combination specified is pressed,
or returns a list of variables flagged corresponding to keys pressed.

keys - number representing one or more modifier keys and/or a key name, or a combination of key names

Data type returned
number or text

Use this function to test whether a modifier key or specifiec combination of keys are pressed.
Specifying one key will test for that key only.
Valid values to specifiy key:
SHIft, 1;
CAPslock, 2
CONtrol, CTRl, 4
ALT, OPTion, 8
COMmand, 16
A single number can be specified to represent multiple keys. E.g. 31 = All keys pressed.
Or "Shift-Control-Alt" will test whether all three of those keys were pressed in combination.
A number can be specified in combination with names:
"3CtrlAlt" is the same as "Shift-CapsLock-Control-Option"
Also ModifiersOn(0) is True when no modifier keys are pressed, False when any modifier key is pressed.

Adaptions from custom functions ModifierVariables (©2009 Jeffanna Design) :
If keys is empty (e.g. ""), this function "...sets a series of local variables based on which modifier keys are being pressed, e.g.
If the shift key is being pressed, $ShiftOn = 1.
If the command key is not being pressed, $CommandOn = 0."

This function will then also return a list of those variables turned on.
Note: The output of this function with no key specified can be used to specify a key or key-combination for this same function.

ModifiersOn ( "Shift" ) = 1 when shift pressed
ModifiersOn ( 9 ) = 1 when shift-option pressed
ModifiersOn ( "Ctrl-Alt" ) = 1 when ctrl-alt pressed
ModifiersOn ( 0 ) = 0 when any modifier pressed
ModifiersOn ( "" ) =
when all keys pressed

Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it


Modified 5/31/2015. I changed the alias "CTL" for "control" to "CTRL"

Eric, San Jose, CA
May 31, 2015 2:37pm

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 3 + 1 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. ProperAllWords ( text )
  (Thu, Dec 14, 5:19pm)
2. MatchExist ( SourceTable.Field ; DestTable.Field ; ReturnField )
  (Thu, Dec 14, 1:07pm)
3. BVR_Format ( bvr )
  (Wed, Dec 13, 5:32pm)
4. NumberToHexadecimal(NumberValue)
  (Fri, Dec 08, 8:54am)
5. Get_BaseTable
  (Thu, Dec 07, 4:27pm)
6. JSONCreateVarsFromKeys ( json ; namespace )
  (Wed, Dec 06, 8:21pm)
7. GetTableNzme ( field )
  (Tue, Dec 05, 9:16pm)
8. TimeFormatAsText ( theTime )
  (Mon, Nov 13, 1:59pm)

RSS Feed of Custom Functions