Broadcaster + SliderPack
-
This is some code for attaching xtra mouse events to a sliderpack.
const var CCWatch = Engine.createBroadcaster({"component": undefined, "event": undefined}); CCWatch.setEnableQueue(true); CCWatch.attachToComponentMouseEvents(Content.getComponent("CC1SP"), "All Callbacks"); CCWatch.addListener("RefreshFunction", function(component, event) { if (event.clicked && event.shiftDown) { Console.print("working"); } });
Is it possible to make SP not respond on some of the events?
I'm talking of the events .shiftDown, altDown and ctrlDown, if I'm right these are not needed by the sliderpack? -
@ulrik you can use different callback levels like in the scriptpanel in order to filter out frequent events that you don‘t need, but if you don‘t care about a shift click then just check that and return from the function.
-
@Christoph-Hart yes you're right as always :) thank you I didn't think of that.
Btw the broadcaster system seems very powerful! -
@Christoph-Hart wait, I said of course to soon
This is what I have
I use a sliderpack, and it's mouse callbacks, as you see in the picture
but I don't want the sliderpack to change its values when holding down the shiftKey, I want to use the event.shiftDown (set in the broadcaster function), to control other parameters.
So I don't want the sliderpack to react if the shiftKey is down, is it possible?
-
@ulrik No, you can't change the native functionality, you can only attach new logic.
-
@Christoph-Hart Ok, I understand, thank you!