MCPcopy Create free account
hub / github.com/TodePond/ScreenPond / handleTouchEvent

Function handleTouchEvent

libraries/habitat-embed.js:746–764  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

744 });
745
746 const handleTouchEvent = (event) => {
747 const [touch] = event.changedTouches;
748 const type = touchEventEquivalents[event.type];
749 const { screenX, screenY, clientX, clientY } = touch;
750 const mouseEvent = new MouseEvent(type, {
751 type,
752 bubbles: true,
753 cancelable: true,
754 view: global,
755 detail: 1,
756 screenX,
757 screenY,
758 clientX,
759 clientY,
760 });
761
762 touch.target.dispatchEvent(mouseEvent);
763 event.preventDefault();
764 };
765
766 global.addEventListener("touchstart", handleTouchEvent, true);
767 global.addEventListener("touchmove", handleTouchEvent, true);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected