Processing has a delay () function , but unfortunately it is not yet implemented in Processing.js.
JS (JQuery ..) .
1.9.9 Javascript, Processing/DOM, SelectionFlower.
/pde , form js:
void setSelectionText ( String txt )
{
selectedText = txt;
}
js , , :
var mySketchInstance;
window.onload = function () {
getSketchInstance();
}
function getSketchInstance() {
var s = Processing.instances[0];
if ( s == undefined ) {
setTimeout(getSketchInstance, 200);
} else {
mySketchInstance = s;
monitorSelection();
}
}
, , / :
function monitorSelection () {
mySketchInstance.setSelectionText(txt);
}