function appendMessage(message) {
document.getElementById("events").appendChild(makeParagraph(message));
}
/**
* Escape |key| if it's in a surrogate-half character range.
*
* Example: given "\ud83d" return "U+d83d".
*
* Otherwise JSON.stringify will convert it to U+FFFD (REPLACEMENT CHARACTER)
* when returning a value from executeScript, for example.
*/
function escapeSurrogateHalf(key) {
if (typeof key !== "undefined" && key.length === 1) { var charCode = key.charCodeAt(0); var highSurrogate = charCode >= 0xD800 && charCode <= 0xDBFF; var surrogate = highSurrogate || (charCode >= 0xDC00 && charCode <= 0xDFFF);
if (surrogate) {
key = "U+" + charCode.toString(16);
}
}
return key;
}
let mouseReporter = document.getElementById("pointers");
mouseReporter.addEventListener("click", recordPointerEvent);
mouseReporter.addEventListener("dblclick", recordPointerEvent);
mouseReporter.addEventListener("mousedown", recordPointerEvent);
mouseReporter.addEventListener("mouseup", recordPointerEvent);
mouseReporter.addEventListener("contextmenu", recordPointerEvent);
});
</script>
</head>
<body>
<div id="trackPointer" class="block"></div>
<div>
<h2>KeyReporter</h2> <!-- Dummy Button is used to ensure pressing Shift+Tab on <input> will make the new focus
- remains in the same document, rather than the Chrome UI. -->
<button>Dummy Button</button>
<input type="text" id="keys" size="80">
</div>
<div>
<h2>ClickReporter</h2>
<div id="pointers" class="area">
</div>
</div>
<div id="resultContainer">
<h2>Events</h2>
<div id="events"></div>
</div>
</body>
</html>
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.