Commit 6646821d authored by Adam Barth's avatar Adam Barth

Add support for touch events to sky_viewer

This CL adds conversion routines for touch events to sky_viewer so that Mojo
touch events actually show up in the platform.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/847873003
parent fcec0237
<sky>
<div id="log">Ready</div>
<script>
function logTouchEvent(evt) {
var message = "type=" + event.type;
if (evt.touches && evt.touches.length > 0)
message += " x=" + evt.touches[0].clientX + " y=" + evt.touches[0].clientY;
document.getElementById("log").textContent = message;
}
document.documentElement.addEventListener("touchstart", logTouchEvent);
document.documentElement.addEventListener("touchmove", logTouchEvent);
document.documentElement.addEventListener("touchend", logTouchEvent);
document.documentElement.addEventListener("touchcancel", logTouchEvent);
</script>
</sky>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment