Platforms to show: All Mac Windows Linux Cross-Platform

Back to CarbonEventsIdleTimerMBS class.

CarbonEventsIdleTimerMBS.Constructor(delay as Double, interval as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Carbon Events MBS MacCF Plugin 3.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Installs an idle timer.

Idle timers are only called when there is no user activity occuring in the application. This means that the user is not actively clicking/typing, and is also not in the middle of tracking a control, menu, or window. TrackMouseLocation actually disables all idle timers automatically for you.

Parameters:

delay:
The delay before firing this timer after a user input event has come in. For example, if you want to start your timer 2 seconds after the user stops typing, etc. you would pass 2.0 into this parameter. Each time the user types a key (or whatever), this timer is reset. If we are considered to be idle when an idle timer is installed, the first time it fires will be inDelay seconds from the time it is installed. So if you installed it in the middle of control tracking, say, it wouldn't fire until the user stopped tracking. But if you installed it at app startup and the user hasn't typed/clicked, it would fire in delay seconds.

interval:
The timer interval (pass 0 for a one-shot timer, which executes once but does not repeat). You may also pass kEventDurationForever (-1) to create a one-shot timer.

In older plugins this was called Create, but later changed to Constructor to make usage easier.

The items on this page are in the following plugins: MBS MacCF Plugin.


The biggest plugin in space...