Button to trigger only on Left-Click


#1

Hello,

Is there an easy way to make a button trigger only on left click?


#2

Hey Brad!

The following worked for me: I Implemented my own TextButton class and overrode the mouseDown (const MouseEvent& e) method.

class MyTextButton  : public TextButton
{
    void mouseDown (const MouseEvent& e) override
    {
        if (! e.mods.isRightButtonDown())
            TextButton::mouseDown (e);
    }
};

Hope this helps!


#3

Great! Thanks!!