I'm trying, unsuccessfully, to get an action button to respond to left and right mouse button clicks. I've downloaded the SABTest example from chapter 17 as a starting point but I'm unable to get the button to respond to right-clicks. My aim is to get the button to cast "Remove Curse" when left-clicked and "Cure Poison" when right-clicked. I've tried the following:

SABTest:SetAttribute("spell1", "Remove Curse")

SABTest:SetAttribute("spell2", "Cure Poison")

It works fine when I left-click but nothing happens when I right-click the button.

Thanks.

Posted by jnwhiteh on Tue, 22 Jul 2008 20:52:48

Hi,

I'm trying, unsuccessfully, to get an action button to respond to left and right mouse button clicks. I've downloaded the SABTest example from chapter 17 as a starting point but I'm unable to get the button to respond to right-clicks. My aim is to get the button to cast "Remove Curse" when left-clicked and "Cure Poison" when right-clicked. I've tried the following:

SABTest:SetAttribute("spell1", "Remove Curse")

SABTest:SetAttribute("spell2", "Cure Poison")

It works fine when I left-click but nothing happens when I right-click the button.

Thanks.

Did you register the button for right click? i.e.

SABTest:RegisterForClicks("LeftButton", "RightButton")

Posted by Paul on Fri, 25 Jul 2008 19:08:37

Ahh, that explains it. I didn't register the button. It works fine now.