AnsweredAssumed Answered

TriggerKeystroke Bug

Question asked by estaylorco on Jun 19, 2012
Latest reply on Jun 19, 2012 by philmodjunk

Summary

TriggerKeystroke Bug

Product

FileMaker Pro

Version

FileMaker Pro Advanced 11.0v3

Operating system version

Windows 7

Description of the issue

Hello Support:

OnObjectKeystroke trigger can lead to an infinite loop under the conditions given below.

Steps to reproduce the problem

1. Create a portal (or any object, really)
2. Give the object an object name
3. Specify an OnObjectKeystroke script (be sure Allow User Abort is set to "On")
4. In the script specified, issue the Go to Object script step and return to the object named in step #2 above (in other words, return to the very object that raised the trigger in the first place)
5. Notice that the script is now in an infinite loop

Expected result

It would seem that the keyboard buffer isn't flushed after the Get(TriggerKeystroke) function is called.  When returning to the object under script control, FileMaker sees a keystroke in the buffer and repeatedly fires the OnObjectKeystroke event.

This is a real problem when trying to implement keyboard-based navigation for portals.  After processing, say, the Home key or the Up key, it is necessary to return to the portal and await the user's next keystroke.  Because of this bug, it is not possible to implement keyboard-based navigation.

Actual result

OnObjectKeystroke can lead to an infinite loop.

FileMaker should immediately flush the keyboard buffer after calling Get(TriggerKeystroke).  If the developer wants to persist the keycode for processing in the rest of the script, he should do the following:

Set Variable[$keycode; Code(Get(TriggerKeystroke))

Exact text of any error message(s) that appear

N/A

Configuration information

N/A

Workaround

None.

Outcomes