What happens if you put Get( ActiveModifierKeys ) in a variable $key and then show the dialog:
Show Custom Dialog [ "mod key value: " & $key ]
Thanks for the suggestion Tom. I first noticed the problem trying to write the value into a variable, it comes up 0 in the variable as well regardless which keys are down. Tested FM9 on this machine yesterday, still 0.
Weird, I think we may have to chalk this one up to gremlins.
Get(activemodifierKeys) is a calculation that gets the value at the time it has to evaluate. It does not necessarily mean that it evaluates at the same time it refreshes, or it may need refreshing to show the correct value.
Create an unstored calculation field of get(activemodifierkeys) and go to browse mode.
The value is changed even though the calculation doesn't refresh in the displayed field. Click inside the field while still holding the modifier key. The field display is refreshed so it now shows the proper value.
You may want to store the value in some manner such as variables or global fields during script execution before displaying the value.
set variable [ $var ; get (activemodifierkeys) ]
Show custom dialog [$var]
hold the option key at the same time while running the script.
Yeah, I understand about the refresh. That's why I captured the mod keys in a variable up front in my original script. I know if you run in debug mode that the mod keys are evaluated when it gets to that script step. I don't think it's a timing issue.
It doesn't appear to be a hardware thing because it's the same on external keyboards and the option/command/ctrl keys do work for other functions system-wide; I can close a FileMaker window by pressing command-w. But any calc to sense mod keys being held down returns 0.
Deleted prefs again with client last night on the phone to make sure he was getting the right file and that FM was not running at the time. I think next step is to reformat the HD but I hate to put them through that.
Thanks for the note.
Try creating a new user account on the Mac OS and run FileMaker from there as a test if you think it's a preference issue. A new account will have fresh preferences.
My suggestion would be to create a new account on the OS, remove all plugins from FileMaker temporarily (there are 2 directories to check for plugins : one in the extensions folder of FileMaker Pro Folder and the other is in
Macintosh HD/Users/user_name/Library/Application Support/FileMaker/Extensions ) , and then use a new file with the evaluation script.
I am also having this problem. Never had it or noticed it before. Get(ActiveModifierKeys) always returns 0 in all versions of Filemaker Pro.
What could possibly be causing this? Is there a hardware related way that Filemaker uses to capture this that is distinct from the keyboard? ie, is it possibly related to some other issue with the motherboard of the machine?
Has anybody else seen this?
How are you using this function?
In a script?
In a calculation field?
One of my clients is seeing this, too. It happens on his Mac in the office and on his laptop at home, but not on any of the other Macs in the office when he tries it on them. It happens when he clicks a button that runs a script. The first step in the script sets a variable to the active modifier key, and if that variable is >0, it puts up a dialog. I've instructed him to keep holding the key until the dialog appears, but on his machines the script behaves as if get(activemodifierkeys) = 0.
But ... he swears ... only before noon! After noon, it works as it should.