ControlActive[act,norm]
evaluates to act if a control that affects act is actively being used, and to norm otherwise.
ControlActive
ControlActive[act,norm]
evaluates to act if a control that affects act is actively being used, and to norm otherwise.
Details
- ControlActive can be used to switch between a faster computation to be done while controls like sliders are being moved, and a slower computation to be done once the controls are released.
- ControlActive[act,norm] can also be used to trigger evaluation of norm when controls are released.
- ControlActive[] is equivalent to ControlActive[True,False].
- ControlActive[act,norm] is effectively equivalent to If[$ControlActiveSetting,act,norm].
Examples
open all close allBasic Examples (1)
Scope (2)
The arguments of ControlActive can be any expression:
Manipulate[ControlActive[u, Graphics[Circle[{0, 0}, u], PlotRange -> 2]], {u, 0, 1.5}]Use ControlActive to switch between a low-resolution and a high-resolution version:
Manipulate[ArrayPlot[CellularAutomaton[n, {{1}, 0}, {ControlActive[10, 100], All}]], {n, 1, 64, 1}]Applications (2)
Only emit a sound when the manipulator is not actively used:
Manipulate[ControlActive[w, EmitSound[Play[Sin[1000 w t], {t, 0, .2}]];w], {w, 1, 3}]Use a lower sampling when actively manipulating:
Manipulate[Plot[Sin[1 / (x - a)], {x, 0, 1}, PlotPoints -> ControlActive[5, 50], PlotRange -> 1], {a, 0, 1}]Properties & Relations (2)
By using the second argument of Dynamic, you can get an effect similar to ControlActive:
Manipulate[ControlActive[u, u Range[4]], {u, 0, 1}]{Slider[Dynamic[u, {(u = p = #)&, (u#;p = # Range[4])&}]], Dynamic[p]}Plot functions effectively use ControlActive for the PerformanceGoal setting:
Manipulate[Plot3D[Sin[a x]Sin[b y], {x, 0, 3}, {y, 0, 3}, PerformanceGoal -> ControlActive["Speed", "Quality"], PlotRange -> 1], {a, 1, 3}, {b, 1, 3}]Tech Notes
History
Text
Wolfram Research (2007), ControlActive, Wolfram Language function, https://reference.wolfram.com/language/ref/ControlActive.html.
CMS
Wolfram Language. 2007. "ControlActive." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ControlActive.html.
APA
Wolfram Language. (2007). ControlActive. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ControlActive.html
BibTeX
@misc{reference.wolfram_2026_controlactive, author="Wolfram Research", title="{ControlActive}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/ControlActive.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_controlactive, organization={Wolfram Research}, title={ControlActive}, year={2007}, url={https://reference.wolfram.com/language/ref/ControlActive.html}, note=[Accessed: 13-June-2026]}