[osg-users] GUIEventHandler osgGA::GUIEventAdapter::RELEASE

Robert Osfield robert.osfield at gmail.com
Mon Nov 28 09:35:55 PST 2016


On 28 November 2016 at 17:23, Bruno Oliveira
<bruno.manata.oliveira at gmail.com> wrote:
> Hello,
>
> I created a custom osgGA::GUIEventHandler.
> It handles both mouse click(push) and release.
>
> In both cases (click/push and release) I do
>
> bool Handler::handle(const osgGA::GUIEventAdapter&
> ea,osgGA::GUIActionAdapter& aa) {
>
> unsigned int buttonMask = ea.getButtonMask();
>
> }
>
> If the event is a mouse push event, buttonMask is OK. If it is a release
> event, buttonMask is always zero. Is there any internal reason for this?


If you have released the button the that button won't be pressed so
the mask will be 0 if no other buttons are pressed.

If you want the button that the event is related to then simply use
ea.getButton().

Robert



More information about the osg-users mailing list