Binding mouseDragged to function

I’m binding mouse events to functions and they all work fine apart from:

cnv.mouseDragged(mDragged);

Anyone have any idea why?

1 Like
2 Likes

@BSiemens what do you mean by “Binding”? Do you have any sample code to demonstrate the issue?

1 Like

The sketch below emulates p5::mouseDragged() inside a p5.Element::mouseDragged() callback by checking p5::mouseIsPressed: :bulb:

2 Likes

Literally this:

cnv=createCanvas(windowWidth, windowHeight);

//  Bind events to functions

*Changed:
     cnv.mouseDragged(mouseDragged);

*To:
     cnv.mouseDragged(dragged);

cnv.mouseMoved(moved);
cnv.mousePressed(pressed);
cnv.mouseClicked(clicked);
cnv.doubleClicked(dClicked);
cnv.mouseReleased(released);
cnv.mouseOut(out);
cnv.mouseOver(over);

They all work except for mouseDrag. I suspect the answer is below but I’ll investigate.

*Does the editor have strikeThrough capability?

Thanks. I actually know Peter.

If you mean the forum post editor:

No it doesn’t… Yes it does! It is Markdown, which passes through some HTML, meaning you can type <strike> and </strike> tags around any text you wish to strike.

1 Like

[s]text[/s] is a much easier & faster typing shortcut for strike. :wink:
And [u]text[/u] for underline. :innocent:

1 Like

Cool Thank you very much.