Capture user keyboard input in modal window?
I was wondering if anyone had an idea about how to capture user keyboard key presses while in a modal window (FM 12)?
I have a pop-up window that has a bunch of checkbox sets in it to act as a found set filter. There are OK and Cancel buttons on the window, but it would be nice if I could also trap for ENTER or RETURN key to activate the OK button, and also perhaps the ESC key to close/cancel the window.
To further complicate things, there is a script that runs to open the window in the first place. I did find a way to work part of this by using the Pause/Resume script step in this original script that opens the window. Part of the Pause setting will cause the script to Continue when the Enter key is pressed.
I have done such things inside a field, but how to monitor the window as a whole? Could put a timer script to move the focus to a field, and then monitor that field. But that would have to run very frequently to be sure to try and capture the input and not fail in some instances.