Macro duration modifiers - WarmUpTill/SceneSwitcher GitHub Wiki

Most macro conditions can optionally be expanded upon with a duration modifier. To add a duration modifier to an existing condition click the small clock icon next to the condition type.

There are four types of duration modifiers:

  • "For at least X amount of time" will result in the condition to only return true if it was true for at least X amount of time. For example, assuming you just switched to scene "A", the following condition will return false for the first three seconds. Three seconds after the scene switch and as long as the current scene is "A" the condition will return true.

  • "For exactly X amount of time" will result in the condition to only return true at the moment the underlying condition - ignoring the time constraint - was true for the specified amount of time. For example, assuming you just switched to scene "A", the following condition will return false for the first three seconds. Three seconds after switching to scene "A" the condition will return true. Afterwards it will once again return false.

  • "For at most X amount of time" will result in the condition to only return true for at most X amount of time, after which it will return false. If the underlying condition - ignoring the duration modifier - will return false the duration modifier will be reset. For example, assuming you just switched to scene "A", the following condition will return true for the first three seconds the scene is active. After three seconds have passed and the scene is still active the condition will then return false. If you should switch to a different scene and switch back to "A" the condition will once again return true for the first three seconds of "A" being the active scene.

  • "Within the last X amount of time" will result in the condition to return true for X amount of time, even after the underlying condition is false. For example, assuming you just switched to scene "A", the following condition will return true when scene "A" is active, but also return true if you just switched away from scene "A" within the last X seconds.
    Within the last

Events that happen between evaluation ticks

Macro conditions are only evaluated once per evaluation interval, not continuously. Whether a duration modifier "notices" something that happened briefly between two evaluation ticks depends on how the underlying condition tracks its internal state - this differs between condition types.

For example, with an evaluation interval of one second, consider the "Hotkey" condition combined with a "for at least 1 second" duration modifier: if the hotkey is pressed, then released and pressed again before the next evaluation, and this repeats without a gap longer than the evaluation interval, the condition will still report the key as having been continuously pressed. This happens because the Hotkey condition currently only tracks whether the key is pressed at the moment of evaluation, so a brief release in between two evaluations goes unnoticed.

Other condition types may track state differently and could behave differently in similar situations. If precise sub-interval timing matters for your use case, consider lowering the evaluation interval to reduce the size of this blind spot.