Software Venture Consulting

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

Free Web Tools
Free FileMaker Tools

Personal Pages
Videos
Adventures
Links

Shopping Cart
Shopping Cart

Search:

Free Newsletter
Signup


Contact


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:  

RatingRatingRatingRatingRating
  Average rating: 4.1  (22 votes)
  Discuss this Custom Function

Eric, SJSU
http://filemaker.sjsu.edu

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

$ShiftOn
$CapsLockOn
$ControlOn
$AltOn
$CommandOn
when all keys pressed


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

Description:

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

Purpose
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.

Parameters
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

Description
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)
http://briandunning.com/filemaker-custom-functions/detail.php?fn_id=980 :
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.

Examples
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 ( "" ) =
$ShiftOn
$CapsLockOn
$ControlOn
$AltOn
$CommandOn
when all keys pressed

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

This is my Custom Function and I want to edit it

Discuss:

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:
City/Location:
Comment:
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 1 + 4 =
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. SortList ( theList )
  (Sat, Jun 23, 8:45am)
2. HexUUIDToNum_cf (_uuid)
  (Sat, Jun 16, 1:55pm)
3. httpResponseCode ( responseHeaders )
  (Tue, Jun 12, 10:40pm)
4. FindDuplicateCharacters ( string )
  (Fri, Jun 08, 5:01pm)
5. FieldRepetitionLast ( field ; maxRepetition )
  (Wed, Jun 06, 6:05pm)
6. CountModifiedRecords ( NameTimestampField ; StartTimestamp ; EndTimestamp )
  (Mon, May 28, 8:23am)
7. JSONArrayLength ( JSONArrayStr )
  (Fri, May 25, 7:46am)
8. interpolation (y1; y2; y3; x1; x2; x3; x1y1; x2y1; x1y2; x2y2; rnd)
  (Sat, May 19, 3:55am)

RSS Feed of Custom Functions