What if your PB app kept track of the "last user interaction" timestamp internally, such as a global datetime variable, but only recorded/updated that timestamp in the database on a slightly more leisurely interval, say, every five minutes?
I think you need to clearly define what "last user interaction" means. IMHO, a mouse move event sent to a DataWindow doesn't signify user interaction, but a keystroke or mouse click handled by any object within the app does. What is your definition of the term and is it a reasonable definition that makes sense?
If your app has been constructed using a framework, then it should not be overly difficult to put code in the ancestor objects to update a global datetime variable on an as-needed basis. If it were me, I'd consider not even updating the global timestamp unless 15 seconds (or more) had passed since it was last recorded, because you have to ask if any finer granularity really makes a difference? If you do not have/use a framework, then yes, you have a non-trivial amount of work ahead of you.
Your app could utilize a timer object to update the database every so often, say, five minutes, for example. I would use an additional, separate transaction object to accomplish this, so as to not adversely affect anything the user may be doing. The timer object could keep an instance copy of the global timestamp it last sent to the database so it could determine if the timestamp has changed since the last timer "pop" and bypass recording the same timestamp in the database if it has not changed.
The problem that I am really having is that if I want to detect the mousemove event it is not enough to do it in the master window, because the window only captures it if it is done on an empty are, if you do it over a dw you have to code it in the datawindow to, if you do it over a picture you have to code it on the picture too....
Resuming if I want to track mouse movements on a screen I have to code the screen and ALL visual objects that could be placed on it.
And I think that is too much. That's why I am trying to find any other options.
Thanks.