I am trying to use the web-render with multi-touch events.
Browser supports them but having issues passing this sort of data into the web render top.
I feel this may be more of a JS question, but wondering if anyone has tried sending touches and not just mouse clicks.
Here is the JS I am trying to send to the browser, would multi-line strings not work for some reason. I don’t think javascript cares if it has a semicolon
Is there any way to see the web-console for any errors or debug messaging chromium returns?
WR = op('webrender')
def makeJSString(type, px, py, id):
returnString = ""
returnString+="var event = document.createEvent('TouchEvent');"
returnString+="event.initTouchEvent('touch"+type+"', true, true);"
returnString+="event.touches = [{"
returnString+="identifier: "+str(id)+","
returnString+="pageX: "+str(px)+","
returnString+="pageY: "+str(py)
returnString+="}];"
returnString+="dispatchEvent(event);"
return returnString
x = int(touch.u * 1280)
y = int(touch.v * 720)
strN = makeJSString('start',x,y,touch.id)
WR.executeJavaScript(strN)