KeysDown ( theModifierKeys ; ignoreCapsLock )
User friendly version of Get ( ActiveModifierKeys )
Average rating: 4.1 (37 votes) Log in to vote
Peter Wagemans - Show more from this author
Lesterius https://www.lesterius.com |
KeysDown ( "ctrl-shift-alt" ; False )
KeysDown ( "ctrl-capslock" ; False )
True if ctrl option/alt and shift are down, caps-lock should be off
True if ctrl key is down, AND caps-lock is on
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
The Get(ActiveModifierKeys) function returns a number that represents the keyboard modifier keys. When converted to binary, it becomes clear how this number is constructed.
0 0 1 0 1
| | | | |
| | | | Shift
| | | Caps Lock
| | Ctrl
| Alt/Option
Apple Command Key
The custom function tests for each bit, each time comparing it with the presence of the modifier key in "theModifierKeys" (using XOR). All tests are put together using AND, so if one fails, all fail.
The Caps Lock test is only performed when ignoreCapsLock is False.
This custom function is much clearer to read than e.g.:
Get ( ActiveModifierKeys ) = 27
I preferr KeysDown ( "alt-shift-command-capslock" ; True )
Comments
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.