Base: Add a browser test page that dumps out all mouse events

This commit is contained in:
Andreas Kling 2022-02-07 13:26:46 +01:00
parent 438c5bce6c
commit 6c31f6c073
Notes: sideshowbarker 2024-07-17 19:40:25 +09:00
2 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1,22 @@
<style>
#rect {
width: 300px;
height: 300px;
border: 5px solid black;
}
</style>
<div id=rect></div>
<pre id=out></pre>
<script>
function handle(e) {
var out = document.getElementById('out');
out.innerHTML = e.type + ' @ ' + e.offsetX + ',' + e.y + '\n' + out.innerHTML;
}
var rect = document.getElementById('rect');
rect.onmousedown = handle;
rect.onmousemove = handle;
rect.onmouseup = handle;
rect.onclick = handle;
rect.ondblclick = handle;
</script>

View file

@ -135,6 +135,7 @@
<h2>JavaScript/Wasm</h2>
<ul>
<li><a href="mouse-events.html">mouse events</a></li>
<li><a href="message-channel.html">MessageChannel</a></li>
<li><a href="websocket.html">WebSocket API Test</a></li>
<li><a href="cookie.html">document.cookie</a></li>