9 Replies Latest reply on May 28, 2015 11:57 AM by danshockley

    Modifier Keys Not Working with either "Get" statement

    DavidLake

      Title

      Modifier Keys Not Working with either "Get" statement

      Post

      Im running Windows XP 2002 sp 3 and FMP Adv 11.0v3 and neither get (activemodifierkeys) or get (triggermodiferkeys) seems to be trapping my modified input.  Where do I look next?

      I even picked up in one post to try using the

      Code (Get (Triggerkeystroke)) = xx in leu of just the Get (Triggerkeystroke) = "x" for the modified character.  Both work okay when looking for the single character, but it didn't affect my modifier issue.

       

      David

        • 1. Re: Modifier Keys Not Working with either "Get" statement
          philmodjunk

          My system uses get ( TriggerModifierkeys ) successfully 100's of times every day to detect that both the caps lock and shift keys are or are not down to control the function of a magnetic strip reader.

          Why doesn't this work for you? (How does it fail?)

          • 2. Re: Modifier Keys Not Working with either "Get" statement
            DavidLake

            Let me do some testing.  I'll include my "Get" statement with each result.

            • 3. Re: Modifier Keys Not Working with either "Get" statement
              DavidLake

              No Modifier+"~"

              Get (TriggerKeystroke) = "~"

              Worked.

               

              Shift+Caps Lock+"~"

              Get (TriggerModifierKeys)=3 and
              Get (TriggerKeystroke) = "~"

              Worked.

               

              CTRL+"~"

              Get (TriggerModifierKeys)=4 and
              Get (TriggerKeystroke) = "~"

              Didn't Work, no beep, no error.  Nothing.

               

              CTRL+"~"

              Get (ActiveModifierKeys)=4 and
              Get (TriggerKeystroke) = "~"

              Didn't Work, no beep, no error.  Nothing.

               

              SHIFT+"~"

              Get (ActiveModifierKeys)=1 and
              Get (TriggerKeystroke) = "~"

              Worked.

               

              SHIFT+"~"

              Get (TriggerModifierKeys)=1 and
              Get (TriggerKeystroke) = "~"

              Worked.

               

              Now what?

              • 4. Re: Modifier Keys Not Working with either "Get" statement
                philmodjunk

                From what I can tell, Ctrl keeps the OnLayoutKeystroke trigger from "firing"...

                • 5. Re: Modifier Keys Not Working with either "Get" statement
                  DavidLake

                  One more test:

                  ALT+"~"

                  Get (TriggerModifierKeys)=8 and
                  Get (TriggerKeystroke) = "~"

                  also tried ActiveModifierKeys

                  Neither version worked, but I did get a "Dink" bell.....

                  • 6. Re: Modifier Keys Not Working with either "Get" statement
                    DavidLake

                    I had 2 3rd party plug-ins installed and enabled.  I have unchecked them and restarted FMP.  (The autoupdate plugin was still on, it looked safe).

                     

                    Still does not work and no feedback with the CTRL trap and only the Dink bell with the ALT trap and SHIFT works fine.  No change with the plug-ins turned off.

                     

                    I'm trying to implement a preamble CTRL sequence on my barcode scanner to trigger my script.  The Shift & Caps Lock keys don't map to an ascii code, and I need to program the barcode in ascii.  I'm caught in an unresolvable loop here.

                    • 7. Re: Modifier Keys Not Working with either "Get" statement
                      philmodjunk

                      Do you really need the shift and caps lock keys as part of your trigger? There's no hard and fast rule that you need that. It's just a combination that worked for me that also was unlikely to be pressed by accident by a user.

                      I'm not really suprised that ctrl doesn't trip the trigger as so many ctrl key sequences have predefined functions such as copy, paste and exit application (ctrl-Q).

                      Here's a more complete explanation on what you have encountered:

                      Keystrokes are processed in the following order:

                      1. The operating system processes certain keys.

                      2. FileMaker Pro processes keyboard shortcut keys.

                      3. An active object with an OnObjectKeystroke script trigger can process a character.

                      4. An OnLayoutKeystroke script trigger can process a character.

                      5. Navigational keys are used for navigation, while non-navigational keys are processed by an active object with an OnObjectKeystroke script trigger.

                      6. If there is no active object, an alert displays for non-navigational keys.

                      The first of these steps to use the key stops the process. A script executed by the OnObjectKeystroke or OnLayoutKeystroke script trigger can stop further processing of the keystroke by returning False.

                      • 8. Re: Modifier Keys Not Working with either "Get" statement
                        DavidLake

                        No, I don't really need the Shift-Caps Lock...in fact, I didn't want that combination.  A previous thread on this site for bar codes recommended setting a modified and unusual key combination so the scan trigger didn't easily launch through the keyboard. 

                         

                        When I couldn't make the CTRL trap work, I found another thread that specified the trigger statement and used Shift-Caps as the example. 

                        We did some further testing and found the CTRL and ALT traps failed on several Windows computers.  The Mac's worked fine.

                         

                        Thanks for your help!

                        • 9. Re: Modifier Keys Not Working with either "Get" statement
                          danshockley

                          Restarting FileMaker didn't help me. But, after restarting my Mac, it was working.