Shadowphile Your example has the line print("PRESSED OUTSIDE OF BUTTON") but there is no circumstance where I would replace this print statement with some action
Wasn't your original intent, as deduced from your first post this:
- click the button to enter the drag state
- click again anywhere to end the drag state
But you couldn't do it because your button click triggered your end drag state code.
My code does precisely that. When the button is clicked the signal handler is called. The event is here consumed so _unhandled_input() won't be called. Conversely, when the click is not on the button, the _unhandled_input() is called instead. The end result is that button click executes one piece of code and off-button click executes another.
It doesn't matter where those pieces of script are situated. The only important thing is that one is the button's signal callback and the other is _unhandled_input() callback.