8 Replies Latest reply on Dec 6, 2009 11:11 AM by comment_1

    Can this be done in FMP?

    mattb

      Title

      Can this be done in FMP?

      Post

      Is it possible to associate a script trigger or otherwise run a script from an assigned key on the keyboard?  I'm thinking of something along

      the lines of pressing the F1 key in a Windows app will trigger the appearance of a help window.  The closest I see is that On Object Keystroke

      will run a script and the first line of the script can check to see what key was pressed.  But that's not quite what I'm aiming for here.  I

      would like to be able to press a key (any of the "F" function keys, for example) and run a script, without ever having clicked on any

      object in the layout with the mouse.  Also this would necessarily be independent of any shortcut key assigned in a pulldown menu. 

       

      Is this possible?  

       

       

       

      Matt Bloomfield

        • 1. Re: Can this be done in FMP?
          scubed_1
            

          I think that you can do this by setting a trigger on the layout (not on an object) using the "OnLayoutKeystroke" option. You would have to interpret what key was hit inside the trigger script, but once that's done, you could then execute the script associated with the key. You can also return 'true' from the trigger script to assure that keys without associated script execution would be passed on to the layout. If you do interpret the key, the trigger should return 'false'.

           

          I don't think that you can do this with F keys, though. I seem to remember having difficulties with this. I believe that the F keys are processed by Filemaker (e.g. F1 is 'help'). This might not be true if you are using a mimimal menu system, but I don't know. I think that you can use the 'code' function and use control characters, though.

           

          Is this what you were looking for?

          • 2. Re: Can this be done in FMP?
            comment_1
               I am not sure about Windows - on a Mac, you can use F5 - F8 and F13.
            • 3. Re: Can this be done in FMP?
              mattb
                

              I am not sure about Windows - on a Mac, you can use F5 - F8 and F13.

               

              On my MacBook the only function key that FMP could interpret was F8.  All the rest of them seem to be assigned to OS functions which

              FMP can't override.  So F5 is increase volume, F6 is Num Lock toggle, F7 is something that FMP won't interpret, and F8 is available.

              I don't even have an F13 key on my keyboard.  

              • 4. Re: Can this be done in FMP?
                mattb
                  

                I don't think that you can do this with F keys, though. I seem to remember having difficulties with this. I believe that the F keys are processed by Filemaker (e.g. F1 is 'help'). This might not be true if you are using a mimimal menu system, but I don't know. I think that you can use the 'code' function and use control characters, though.

                 

                Is this what you were looking for?

                 

                Yes, except on my Mac (I'm doing an FMP Mac rewrite of a Windows app) only the F8 key seems available.  Otherwise, that's sound advice - thanks.

                • 5. Re: Can this be done in FMP?
                  comment_1
                     It could be OS version differences - I am still on 10.5. In any case, OS-level commands (e.g. F1 or Command-C) are intercepted by the OS and do not count as "keystroke".
                  • 6. Re: Can this be done in FMP?
                    Steve Wright
                      

                    You can make F1 run your own script by using custom menu's

                     

                    Set a new option using a filemaker command, being F1 help

                    Then make it run your script

                     

                    screenshot

                     

                     

                    Other keys which are mapped such as F3 for zoom, can also be used in this way, however if you then call a zoom window script step, your script runs instead, so be careful

                     

                    As for other keys, ive not tried any since I only needed to remap the help to open my own help files in a context sensitive nature

                    • 7. Re: Can this be done in FMP?
                      mattb
                        

                      It could be OS version differences - I am still on 10.5.

                       

                      I'm using 10.5.6.  The lack of availability of the F-keys for reassignment might be more due to how the keyboard usage on MacBook

                      laptops were designed.  These keys might not have the same OS functions on desktops.  

                      • 8. Re: Can this be done in FMP?
                        comment_1
                           That's probably the answer: you get a different default configuration when the OS is installed on a laptop. I tried de-assigning F9 in my System Preferences, and sure enough it became a "keystroke" recognized by Filemaker's script trigger.