asc-community / MxEngine

C++ open source 3D game engine
BSD 3-Clause "New" or "Revised" License
1.15k stars 60 forks source link

When no button specified at MousePressEvent, it gets called multiple times` #26

Closed WhiteBlackGoose closed 4 years ago

WhiteBlackGoose commented 4 years ago

Reproduction: ~ then click once then observe how many times it got called

WhiteBlackGoose commented 4 years ago

Even without clicking it calls the event

MomoDeve commented 4 years ago

I agree, MousePressEvent should not be triggered if no button is pressed So I decided to split it into the following events: MouseButtonEvent - generic event that is triggered if any mouse button event occured (pressed, released, held) LeftMouseButtonPressedEvent, RightMouseButtonPressedEvent, MiddleMouseButtonPressedEvent - events for convenience, triggered only on left/right/middle button press

MomoDeve commented 4 years ago

fixed with commit https://github.com/asc-community/MxEngine/commit/a373555908ea82fb136dfbb8dc1579c33808db02