FileMaker TIP: How To Trap For Modifier Keys

BE CAREFUL trapping for modifier keys – sometimes it can backfire!

There are times when you want to allow some advanced functionality when a combination of modifier keys (shift, alt, ctrl, etc.) are held down. I’ve seen some developers go nuts with this – using one button with 5 or 6 functions based on what keys are held down…


I my opinion, not the best way to go – since the user has to “know” to hold down some combination of keys in order to make some functionality work. Instead, the user interface should be easily discoverable – and familiar to use. But I digress…

In FileMaker, you can tell which modifier keys are held down by using the function:

Get ( ActiveModifierKeys )
Here’s what you’ll get back:
Shift = 1
Caps Lock = 2
Ctrl (Windows) / Control (Mac OS) = 4
Alt (Windows) / Option (Mac OS) = 8
Command (Mac OS) = 16

If all modifier keys are being pressed (on a Mac), the function will return 31 (1+2+4+8+16).

Older post, but still useful.

Liked Liked
Need FileMaker Development Help? Or to purchase FileMaker Software?
Contact FM Pro Gurus for help