[haiku-3rdparty-dev] MouseUp() and GetMouse()

  • From: Carlo Lanzotti - DynaDream <clanzotti@xxxxxxxxxxxxx>
  • To: haiku-3rdparty-dev@xxxxxxxxxxxxx
  • Date: Tue, 8 Jan 2019 15:03:47 +0100

Hi all,

I'm new here, my name is Carlo Lanzotti, from Italy.

I've been ported my graphics system to Haiku but I'm having problem with the mouse buttons handling.

I've a BGLView derived class where I've reimplemented MouseDown() and MouseUp() hooks. In the MouseDown() and MouseUp() I use this code to check which button was pressed/released:

uint32 buttons;

GetMouse(&point, &buttons);

In the MouseDown() hook is all ok, I get the correct buttons flags while in the MouseUp() hook I get always 0 from the buttons variable.

I also tried by looking at the looper:

if (BMessage* message = Window()->CurrentMessage()) {
        if (message->FindInt32("buttons", (int32*)&buttons) != B_OK) ...

Even in this case I always get 0.

To be sure the problem was not some conflicts with my system I wrote a simple App/BView application and the problem still persist.

Is there something I can do? I do remember that there was an implementation issue in the original BeOS R4 but I think it was fixed at some point. In the meantime I used a sort of custom mouse tracking but it would be better to rely on the messages loop from the system.

My big congratulations to all the Haiku team, I'm using it everyday and it is a pleasure to work with.

Best Regards

Carlo Lanzotti

DynaDream - Dynamic Laboratory


Other related posts: