Yeah, just setup a rotate method.
function processRotateBtnPress(%val,%direction)
{
if(%val)
{
beginRotation(%direction);
}
else
{
endRotation();
}
}
Something like that would let you continue rotations for as long as you hold the button.
Now, if you wanted to toggle rotation, you could use something like this:
$rotationtoggle = 0;
function processRotateBtnPress(%val,%direction)
{
if(%val)
{
if($rotationtoggle)
{
$rotationtoggle = 0;
endRotation();
}
else
{
$rotationtoggle = 1;
beginRotation(%direction);
}
}
}
Now, in both the examples above, %direction would be for counter-clockwise or clockwise. So, for your clockwise button, you could have processRotateBtnPress(1); and for counter-clockwise, you could have processRotateBtnPress(-1);.