I’m moving a project of mine from 4.1.0 to 4.2.0, where I have several layers of input going on - a canvas where the scene is being rendered, with a UI built from html on top.
Previously I used the scene’s InputManager attachControl function to hook the mouse movement event to a layer on top of the UI, and called it a second time to hook up the mouse up/down events to the main scene.
manager.detachControl(); manager.attachControl(false,false,true, pointerElement); // only attaches the mouseMove event manager.attachControl(true,true,false); // attaches mouseDown and mouseUp to the main canvas
This meant you could start dragging to move the camera on the 3d parts without starting it when clicking on the UI, but still remain dragging when the mouse moves over the UI.
A change in 4.2.0 made it so that when you call attachControl, it automatically detaches itself if it was called before, preventing this kind of setup.
I can understand having the check there to prevent a particular event being attached several times so that detach can work correctly, but there are three different events here and you can choose which ones get attached - a blanket check like this instead of one for each means that even if you’re not duplicating attachments you can’t mix targets.
How should I deal with this? I’m using a minified distribution so it’s not exactly easy to tweak, and I’d rather not resort to extending things because the InputManager is already created and managed internally by the scene.