Panel popupMenu with first click callback?
-
I'm trying to have my panel popup menu spawn with left click and also get a callback from that first click before anything has been selected from the popupMenuItems.
It seems like I can only get callbacks from the action the doesn't spawn the popupMenu with .clicked
Or the second click that selects an item from the popupMenu with .result
Is there an additional one I'm missing that will give me that first click for the action I've chosen to use for the popupMenu?
-
@whoopsydoodle Try a mouse callback
-
Yep already am.
The issue seems to be that .rightClick only triggers on right click. And .click only triggers on whatever doesn't spawn the popupMenu.
So if you have the properties option popupOnRightClick turned off, there is nothing that triggers on left click.
Maybe it can be done with some dirty mess of things like !even.mouseUp && !event.hover && something else?
-
@whoopsydoodle said in Panel popupMenu with first click callback?:
Maybe it can be done with some dirty mess of things like !even.mouseUp && !event.hover && something else?
Try it and see, I have no idea.
-
Haha dirty indeed. But it works!
I don't know why but the mouseDownX and mouseDownY values I get when clicking on the panel are always huge. So I'm using an X that's higher than my object width to trigger that? Idk man... haha
if (event.mouseDownX > 26) { //click on panel //first click shows menu, second hides menu } if (!event.hover && !event.mouseDownX) { //click off of panel that also hides menu }