Hacker Newsnew | past | comments | ask | show | jobs | submit | nirei's commentslogin

Very good involuntary defense of the thing it's trying to disprove.


function createEvent(type, x, y) { const event = new PointerEvent(type, {pointerId: 1, bubbles: true, cancelable: true, pointerType: "touch", width: 100, height: 100, isPrimary: true, clientX: x, clientY: y }); const element = document.getElementById('canvas'); element.dispatchEvent(event); }

createEvent("pointerdown", 0, 300); for(x = 0; x < 100; x+=10) { createEvent("pointermove", x, 300) } createEvent("pointerup", 100, 300);

what am I doing wrong?


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: