I'm not sure what value of %slot corresponds to the right mouse button, but the function is called with a %val of 1 when you press it, and 0 when you release it
So something like
function Armor::onTrigger(%this,%player,%slot,%val)
{
if(%slot == )
{
if(%val)
//do stuff when button is pressed
else
//do stuff when button is let go off
}
}