How to detect IDEA is idle for more than 10-15minutes?

Hello all,

Does anyone know how to detect IDEA is idle for more than 10-15 minutes? Is there any listener in OpenAPI which I can subscribe to receive this kind of event?

Thanks in advance!

Regards
Boon Ping.

5 comments

One possible way would be subscribing to VirtualFileListener, LocalFileOperationListener, CommandListener etc, assuming IDEA is idle if none of these listeners have received any event.

Make sense?

0

One (simpler?) possibility could be to add an AWTEventListener with Toolkit.getDefaultToolkit().addAWTEventListener(). Then you get notified on every AWT event which should be a good sign of any activity.

0

Hi Martin,

Thanks for the reply. I afraid this may not help, because IDEA may have some threads running in background to do some kind of works periodically. it is likely that it will fire some AwtEvents. Well, i think it is worth to check this out..

Thanks.

Regards
Boon Ping.

0

You can filter for the desired event type(s). If you look only for mouse and keyboard events you should get a good sign of user activity.

0

Make sense! Thanks for the hint!

Regards
Boon Ping.

0

Please sign in to leave a comment.