Making MouseLook and MouseLookHandler use buttons

I've been creating my own MouseLook and MouseLookHandler so they only tilt the camera when a button has been pressed, and came to think, that this could be useful as a standard feature.



A method could be used to set this button, and if it's not set, it works just like it does now (always use mouse look), while when it's set, the button has to be pressed. Essentially, you need a boolean variable and implement MouseInputListener in MouseLook, but the listener is only used if a button has been set.



What do you think?

You can simply achieve this by switching the handler on and off upon mouse press and release :slight_smile:

irrisor said:

You can simply achieve this by switching the handler on and off upon mouse press and release :)

I know, but I'm not sure which option means more overhead, and it might be nice to have a ready option for everyone.

What overhead do you mean?



What I proposed costs you 2 lines of code so a "ready option for everyone" does not seem to be needed.