Product: Mingcedar Studio DESIGNER
Press/Release Script | Mingcedar Studio
Configure separate press and release scripts on one object for momentary controls, hold-to-run actions, and other interactions that must distinguish button phases.
<div class="manual-doc-article manual-doc-article-section"><h2 id="press-release-script">Interactions: Press/Release Script</h2>
Configure separate press and release scripts on one object for momentary controls, hold-to-run actions, and other interactions that must distinguish button phases.
<div class="doc-card-list">
<article class="doc-card">
<h3 id="press-release-script-item-1">Overview</h3>
<p>Press/Release Script has a fixed Pointer Button trigger. The runtime accepts a real primary left-pointer interaction: pointerdown runs Pointer Press, while pointerup, pointercancel, or lost pointer capture enters Pointer Release. Unlike Click Script, it distinguishes the held and released phases.</p>
</article>
<article class="doc-card">
<h3 id="press-release-script-item-2">How to use it: design the scripts as a pair</h3>
<p>The editor provides two full script boxes, Pointer Press and Pointer Release, with no separate Condition field. The press script enters a temporary state; the release script exits or resets it. Both scripts can use object, objects, event, tag, page, presentation, shape, hqVisuDesigner, and globals.</p>
<ul>
<li>Pointer Press: runs on the primary pointer press, for example write a momentary command true, show a pressed state, or begin a temporary action.</li>
<li>Pointer Release: runs on release, cancellation, or lost capture, for example write false, restore styling, or end the action.</li>
<li>Each script is syntax-validated separately. An empty phase script does not run.</li>
<li>Tag writes still depend on host permission, confirmation, reason, and audit processing; a script call is not proof that the device completed the action.</li>
</ul>
<div class="manual-code" data-code-language="text"><div class="manual-code-toolbar"><span>Text</span><span class="manual-code-tools"><small>Text</small><button type="button" data-copy-code data-copied="Copied" data-failed="Select and copy the code" aria-label="Copy code: Text">Copy code</button><span class="manual-code-status" role="status"></span></span></div><pre tabindex="0" class="docs-code-block shiki github-light" style="background-color:#fff;color:#24292e" tabindex="0"><code><span class="line"><span>// Pointer Press</span></span>
<span class="line"><span>WriteTagBoolean("<CommandTag>", true);</span></span>
<span class="line"><span></span></span>
<span class="line"><span>// Pointer Release</span></span>
<span class="line"><span>WriteTagBoolean("<CommandTag>", false);</span></span></code></pre></div>
</article>
<article class="doc-card">
<h3 id="press-release-script-item-3">When to use it</h3>
<p>Use it for actions that remain active until the operator releases the pointer: motor jog, manual valve movement, a temporary acknowledgement, a hold-to-preview state, or pressed-state feedback. Keep one-shot submissions, navigation, and fixed writes in Click Script, Open Link, or Write Tag.</p>
</article>
<article class="doc-card doc-card-warn">
<h3 id="press-release-script-item-4">Safety boundaries and common mistakes</h3>
<p>Keep the release script short, idempotent, and safe to repeat. Never configure only the press side and omit the reset path, and never treat this UI behavior as a replacement for PLC interlocks, emergency stops, or a safety circuit. If a host write outcome is uncertain, the runtime may block a later release write; the PLC/control system must enforce the final safe state for critical equipment.</p>
</article>
</div>
<div class="docs-note-grid manual-doc-image-grid">
<figure class="docs-note-card manual-doc-image-card" id="press-release-script-image-1">
<img src="/WEB_img/HQPPT/MouseBehaviorEditorForm.png" alt="Shared mouse behavior editor structure used by Press/Release Script" loading="lazy" decoding="async" />
<figcaption>
<strong>Figure 1: Press/Release Script editor structure</strong>
<p>This behavior shares the Click/Hover editor shell; its actual mode shows Pointer Button, Pointer Press, and Pointer Release.</p>
</figcaption>
</figure>
</div>
</div>