Broadcaster Mouse Events - remove double click?
-
Very new to broadcasters.... I'm currently using
eqWatcher.attachToComponentMouseEvents("FloatingTile12", "All Callbacks", "Mouse Listener for FloatingTile12");
But I don't want to enable anything for double clicking with the mouse - Is there a way to be selective with mouse events?
-
@DanH In your callback function you can ignore the double click.
-
@d-healey Thanks currently I only have this in the callback:
if(event.drag || event.clicked || event.hover)
Do I want a
if(event.doubleclick) { ///Nothing Here }
as well?
-
Do the opposite and your code will be simpler.
if (!event.drag && !event.clicked && !event.hover) return; // Put all your other stuff here
-
@d-healey Not sure I follow... do you mean like this?
eqWatcher.addListener("RefreshFunction", "sets the table data from FloatingTile12", function(component, event) { if(event.drag || event.clicked || event.hover) { for (k = 0; k < numOfNodes; k++) { //stuff happens } } if (!event.drag && !event.clicked && !event.hover) { return; } });
-
Instead of saying if this do this, say if not this don't do anything. It simplifies the code.
So in your case:
eqWatcher.addListener("RefreshFunction", "sets the table data from FloatingTile12", function(component, event) { if (!event.drag && !event.clicked && !event.hover) return; // This means the function will exit here for (k = 0; k < numOfNodes; k++) { // stuff happens } });
This is a good video about the principle:
https://youtu.be/CFRhGnuXG-4?si=jDgeQCcN_yienHej -
@d-healey Oh I see Thanks!
-
@d-healey Ok so double clicking is still allowed.... Possibly because all those conditions are still actually met when double clicking...
-
@DanH Try adding || event.doubleClick
-
@d-healey said in Broadcaster Mouse Events - remove double click?:
|| event.doubleClick
like this?
if (!event.drag && !event.clicked && !event.hover || event.doubleClick)
If so it doesn't change behaviour
-
@DanH Post a simple snippet
-
@d-healey ok turns out disabling double click with the broadcaster wouldn't ever help but I managed to edit the source code to get the desired effect :)
Thanks for the help! Always learning