Apps Script公式リファレンス: Apps Script Reference |障害・課題追跡: IssueTracker |Google Workspace: Status Dashboard - Summary

2019年11月19日火曜日

keyCodeを取得して表示したい


キーボードのキーを押すと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>


Latest post

Google Apps Scriptの障害時はIssueTrackerを見てみる - Incidents for Apps Script are reported on Issue Tracker

IssueTracker > Apps Script issues https://issuetracker.google.com/savedsearches/566234 Google Apps Scriptの障害時は IssueTracker に課題が上がっていることが...