2 Replies Latest reply on Aug 26, 2009 7:18 AM by donjuancarlos_1

    Interrupt keystroke with script



      Interrupt keystroke with script


      When a user is tabbing through a line he is entering data into into a portal,  I want to interrupt the tab, perform a script and then perhaps go somewhere else besides the next field. 

       Currently I can go to another location, but the Filemaker immediately takes me to the next field.  Is there some way to prevent Filemaker from completing theTab keystroke?

        • 1. Re: Interrupt keystroke with script

          Use the OnObjectKeyStroke trigger and trap for any keystrokes that exit the field:


          If [Code(Get ( TriggerKeystroke )) = 13 or Code(Get ( TriggerKeystroke )) = 9 or Code(Get ( TriggerKeystroke )) = 10]

            Commit Record

            #put your script steps here to do stuff when the user exits the field


            #keep the triggering keystroke from taking the user to the next field

            Exit Script [Result: False]

          End If


          This example is set up for a field where its behavior is enabled for keys 9: Tab, 10: Enter (keypad) or 13: Return (Qwerty) to take the user to the next field in the tab order.


          I don't use OnExitObject for this because then using the mouse to exit the field will also trigger the script and this almost always causes problems for the user when the focus suddenly jumps to a field other than where they clicked.

          • 2. Re: Interrupt keystroke with script
               Perfect, thanks