The Jython function fpmi.system.getInactivitySeconds() has been implemented and will be released in the next build.
In your example, you could use a timer object, which would be set to fire as often as you wanted to check (every second, for example). The short script would inspect inactivity time and if it exceeds some amount would: close the window, log the user off, lock the application, open a “do you need more time” warning window that would do the same, etc.
Another interesting application would be to run it in a Timer Global Event Script. This script will always run and give you flexible control over inactivity throughout the application. For example, your system might lock the screen after 3 minutes for supervisors, log off after 5 minutes for managers, and do nothing for operator inactivity. You could go a step further and store the configuration in the database so each user could change their settings.
getInactivitySeconds also makes an interesting input when dealing with “Alarm/Alert” scripts. For example, you might want to hold the alarm warning until they’ve been inactive for 10 seconds, but if they’ve been inactive for longer than 30 minutes you could send an email instead of changing windows.