キーボードのキーを押すとkeyCodeが表示されます。
コード.gs
function doGet() {
return HtmlService.createHtmlOutputFromFile("index");
}
|
意訳この機能がやること 指定したHTMLファイルを表示する |
index.html
<!DOCTYPE html>
<html>
<body>
<label id="key_code" style="font-size: 30px;"></label>
<script>
document.body.onkeyup = bodyKeyup;
function bodyKeyup(e) {
document.getElementById("key_code").innerHTML = e.keyCode;
}
</script>
</body>
</html>
|