5 Replies Latest reply on Oct 20, 2013 6:14 PM by deathrobot

    ActiveModifierKeys and onObjectEnter

    deathrobot

      Title

      ActiveModifierKeys and onObjectEnter

      Post

           I am trying to capture whether or not the command-key (on Mac) is pressed when I ENTER a field. I am using an onObjectEnter script trigger and have tried both "get ( ActiveModifierKeys )" and "get ( TriggerModifierKeys )" but neither recognizes the modifier key. I assume this is something to do with onObjectEnter, but is there a way to solve this?

           Thanks,

           Michael

        • 1. Re: ActiveModifierKeys and onObjectEnter
          schamblee

               Use If Get(ActiveModiferKeys)=16 with onObjectEnter script  trigger.  As long as you are pressing the command key when you enter the field it will be detected.

          • 2. Re: ActiveModifierKeys and onObjectEnter
            deathrobot

                 Thanks S Chamblee. That's what I've been trying, but with no luck. As a test, I created a simple script that is:

                 Show Custom Dialog [ get (ActiveModifierKeys) ]
                 Exit Script []

                 and trigger it from onObjectEnter. No matter what keys I press (and hold) the dialog always shows "0". UPDATE: Actually, just tried it on another field and triggered the script from a button to see if that difference would solve anything. Same (non) results. My keyboard is working, but Filemaker is not seeing these keys. Bug? FM setting? ???

                 Michael

            • 3. Re: ActiveModifierKeys and onObjectEnter
              schamblee

                   I have tested and it works.   Try this script

                   If (Get(ActiveModifierKeys)=16)
                      show custom dialog box["Command"]
                   Endif

                    

                   If the Command key is press when you click into the filed the dialog box will display, if the command key is not press then the box will not show.

                    

                    

              • 4. Re: ActiveModifierKeys and onObjectEnter
                schamblee

                     Here is a sample app https://www.sugarsync.com/pf/D9559058_78149901_187895

                     It will only detect the command button if it is pressed and held down when you enter the field. The script trigger will not trip if you press the command button while you are already in the field.

                • 5. Re: ActiveModifierKeys and onObjectEnter
                  deathrobot

                       Thank you, S Chamblee. I downloaded your file, and…it did not work! I tried restarting FM, and still no luck. Shutdown and restarted the computer, and everything worked again. So, there was something going on with the Mac that was preventing the modifier keys from be detected by FM. I have no idea what that could be, but I thank you for your file. When that didn't work either, it showed there was something bigger going on.

                       Michael