These ones will toggle the right or left mouse button with a single interactor. By default Iris includes separate mouse down and up macros. With these you only need 1 interactor to toggle right click and 1 to toggle left.
Code: Select all
<MACRO id="ToggleRightClick">
<MAIN>
<CONDITION>
<VARIABLECONDITION id="right_button_down" condition="NOT_EQUAL" value="1"/>
<MOUSEBUTTONINPUT button="RIGHT" behaviour="PRESS"/>
<VARIABLE id="right_button_down" function="SET" value="1"/>
<REFERENCE behaviour="STOP" idref="ToggleRightClick"/>
</CONDITION>
<MOUSEBUTTONINPUT button="RIGHT" behaviour="RELEASE"/>
<VARIABLE id="right_button_down" function="SET" value="0"/>
</MAIN>
</MACRO>
<MACRO id="ToggleLeftClick">
<MAIN>
<CONDITION>
<VARIABLECONDITION id="left_button_down" condition="NOT_EQUAL" value="1"/>
<MOUSEBUTTONINPUT button="LEFT" behaviour="PRESS"/>
<VARIABLE id="left_button_down" function="SET" value="1"/>
<REFERENCE behaviour="STOP" idref="ToggleLeftClick"/>
</CONDITION>
<MOUSEBUTTONINPUT button="LEFT" behaviour="RELEASE"/>
<VARIABLE id="left_button_down" function="SET" value="0"/>
</MAIN>
</MACRO>
Code: Select all
<MACRO id="HoldRightClick">
<START>
<!--in case the right button is down from the RightClickOn we need to release it first -->
<CONDITION>
<VARIABLECONDITION id="right_button_down" condition="EQUAL" value="1"/>
<MOUSEBUTTONINPUT button="RIGHT" behaviour="RELEASE"/>
<VARIABLE id="right_button_down" function="SET" value="0"/>
</CONDITION>
<MOUSEBUTTONINPUT button="RIGHT" behaviour="PRESS"/>
</START>
<MAIN repeat="x">
<WAIT time="1000"/>
</MAIN>
<END>
<MOUSEBUTTONINPUT button="RIGHT" behaviour="RELEASE"/>
</END>
</MACRO>
<MACRO id="HoldLeftClick">
<START>
<!--in case the left button is down from the LeftClickOn we need to release it first -->
<CONDITION>
<VARIABLECONDITION id="left_button_down" condition="EQUAL" value="1"/>
<MOUSEBUTTONINPUT button="LEFT" behaviour="RELEASE"/>
<VARIABLE id="left_button_down" function="SET" value="0"/>
</CONDITION>
<MOUSEBUTTONINPUT button="LEFT" behaviour="PRESS"/>
</START>
<MAIN repeat="x">
<WAIT time="1000"/>
</MAIN>
<END>
<MOUSEBUTTONINPUT button="LEFT" behaviour="RELEASE"/>
</END>
</MACRO>