1 Reply Latest reply on Nov 14, 2012 9:44 AM by philmodjunk

    Capturing Keystrokes and Triggering Scripts



      Capturing Keystrokes and Triggering Scripts


           I have an application I created in Access that captures a keystroke when it is entered and allows me to move to the next field without the user having to enter another keystoke like tab, enter or return. The field should only contain a single number from 1 to 9 so it allows me to move to the next field once any of those numbers is entered. I haven't found in Filemaker Pro 12 a good explanation of when the script is activated when using the KeyModified Trigger for an object or the KeyModified Trigger for a layout.

           Can someone point me in the right direction?

           I want to be able to enter a series of one digit numbers in a group of fields that will automatically move me to the next entry field without any other keystrok like an arrow, tab, return or enter key.

           Thanks in advance for your help.

        • 1. Re: Capturing Keystrokes and Triggering Scripts

               There is no trigger named "keymodified". There IS a trigger named OnObjectKeystroke.

               The instant you depress a key when the focus is in the field where you set this object, the trigger is "tripped" this is a "before the event" trigger so you can end your script with Exit Script [False] to keep the key pressed from entering a character into the field when you don't want it to be entered. This also allows you to use go to field or go to next field to put the focus into another field without the keystroke event then popping you back into the field to enter that character.

               Get ( TriggerKeystroke ) and Get ( TriggerModifyKeys ) will return their respective values from within any script that is performed by this script trigger.

               For more on script triggers and which can be affected by Exit Script [False], see the table found in Setting up script triggers in FileMaker Help.