Some context:
I am using 2022.1.23f1
I am building game UI not editor UI.
I’ve got an in-game drag and drop implementation which captures the mouse on MouseDown and releases it on MouseUp.
Sometimes when running my game in the editor, I get the following warning:
Should not be capturing when there is a hotcontrol
when this happens, I stop getting mouse events and, in particular, never get the mouse up event. I am really counting on getting that mouse up–that’s why I capture the mouse in the first place. Because I don’t get the mouse up I never get a chance to clean up the drag operation and my UI ends up in a pretty broken state.
Note that so far in my testing I don’t see the same failure in a build. However it is super annoying because I have to restart any test I am running under the editor when it happens.
Some questions:
- What is a hot control? How do I know when there is one?
- Is there a way for CaptureMouse() to return an error so I know this happened and can clean up?
- I really need a contract where after I get a mouse down I always get the corresponding mouse up, or at least some termination for the gesture. What is the right way to do this?