Docs / Making content / HTML textures
Touch and mouse
The app passes presses, releases and movements of the pointer on the texture to the page. They turn into events on the element under the pointer and bubble up through its parents:
pointerdown,pointerup,mousedown,mouseup,click,mousemove
You can listen in three ways:
<button onclick="doSomething()">Press</button>el.onclick = function (event) { ...
};
el.addEventListener('click', function (event) { ...
});The event object has type, x, y (in texture pixels), target, stopPropagation() and
preventDefault(). A click needs both the press and the release on the page.
There is no keyboard input, no hover and no drag and drop. Build keypads and lists from
buttons or boxes and react to click.
Something wrong or missing? Fix it on GitHub or open an issue.