Hi Martin.
There are 2 fairly easy ways of getting here:
1. Attach handlers for onmousedown and onmouseup to your button through blocks instead of using the tasks directly inside of the buttons:
<ogscript handles="onmousedown" targetid="my-button">ogscript.debug('down script goes here');</ogscript>
<ogscript handles="onmouseup" targetid="my-button">ogscript.debug('up script goes here');</ogscript>
<button buttontype="push" height="92" id="my-button" left="40" top="56" width="122"/>
2.Use a toggle button parameter with the w.immediate=true property will cause the toggle button to immediately pop back up when the user releases the mouse:
<abs contexttype="opengear" style="">
<meta>
<params>
<param access="1" constrainttype="INT_CHOICE" name="Toggle" oid="Toggle" precision="0" type="INT32" value="0" widget="toggle">
<config key="w.instantoff">true</config>
<constraint key="0">Off</constraint>
<constraint key="1">On</constraint>
</param>
</params>
</meta>
<param expand="true" height="64" left="21" oid="Toggle" style="style:toggleButton;" top="20" width="122">
<task tasktype="ogscript">ogscript.debug("MY VALUE IS: " + this.getValue());</task>
</param>
</abs>
#DashBoard