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

2019年12月29日日曜日

keyCodeとcharCodeを知りたい


keyCodeとcharCodeを全部知りたくて手元のMacbookで取得した



keyCode.gs
function returnKeyCodeObj() {
  var keyCodeObj = {
    "esc": 27,
    "F1": 112,
    "F2": 113,
    "F3": 114,
    "F4": 115,
    "F5": 116,
    "F6": 117,
    "F7": 118,
    "F8": 119,
    "F9": 120,
    "F10": 121,
    "F11": 122,
    "F12": 123,
    "1": 49,
    "2": 50,
    "3": 51,
    "4": 52,
    "5": 53,
    "6": 54,
    "7": 55,
    "8": 56,
    "9": 57,
    "0": 48,
    "-": 189,
    "^": 187,
    "¥": 0,
    "delete": 8,
    "tb": 84,
    "q": 81,
    "w": 87,
    "e": 69,
    "r": 82,
    "y": 89,
    "u": 85,
    "i": 73,
    "o": 79,
    "p": 80,
    "@": 219,
    "[": 219,
    "enter": 13,
    "control": 17,
    "a": 65,
    "s": 83,
    "d": 68,
    "f": 70,
    "g": 71,
    "h": 72,
    "j": 74,
    "k": 75,
    "l": 76,
    ";": 186,
    ":": 186,
    "]": 221,
    "shift": 16,
    "z": 90,
    "x": 88,
    "c": 67,
    "v": 86,
    "b": 66,
    "n": 78,
    "m": 77,
    ",": 188,
    ".": 190,
    "/": 191,
    "_": 189,
    "caps": 20,
    "option": 18,
    "command": 93,
    "英数": "",
    "スペース": 32,
    "かな": "",
    "fn": "",
    "◀": 37,
    "▲": 38,
    "▼": 40,
    "▶": 39
  }
  return keyCodeObj;
}



charCode.gs
function returnCharCodeObj() {
  var charCodeObj = {
    "1": 49,
    "2": 50,
    "3": 51,
    "4": 52,
    "5": 53,
    "6": 54,
    "7": 55,
    "8": 56,
    "9": 57,
    "0": 48,
    "-": 45,
    "^": 94,
    "¥": 165,
    "q": 113,
    "w": 119,
    "e": 101,
    "r": 114,
    "t": 116,
    "y": 121,
    "u": 117,
    "i": 105,
    "o": 111,
    "p": 112,
    "@": 64,
    "[": 91,
    "a": 97,
    "s": 115,
    "d": 100,
    "f": 102,
    "g": 103,
    "h": 104,
    "j": 106,
    "k": 107,
    "l": 108,
    ";": 59,
    ":": 58,
    "]": 93,
    "z": 122,
    "x": 120,
    "c": 99,
    "v": 118,
    "b": 98,
    "n": 110,
    "m": 109,
    ",": 44,
    ".": 46,
    "/": 47,
    "_": 95,
    "!": 33,
    '"': 34,
    "#": 35,
    "$": 36,
    "%": 37,
    "&": 38,
    "'": 39,
    "(": 40,
    ")": 41,
    "0": 48,
    "=": 61,
    "~": 126,
    "|": 124,
    "Q": 81,
    "W": 87,
    "E": 69,
    "R": 82,
    "T": 84,
    "Y": 89,
    "U": 85,
    "I": 73,
    "O": 79,
    "P": 80,
    "`": 96,
    "{": 123,
    "A": 65,
    "S": 83,
    "D": 68,
    "F": 70,
    "G": 71,
    "H": 72,
    "J": 74,
    "K": 75,
    "L": 76,
    "+": 43,
    "*": 42,
    "}": 125,
    "Z": 90,
    "X": 88,
    "C": 67,
    "V": 86,
    "B": 66,
    "N": 78,
    "M": 77,
    "<": 60,
    ">": 62,
    "?": 63,
    "_": 95,
    " ": 32
  }
  return charCodeObj;
}


Latest post

Googleドキュメントに見出しを追加したい

今回の例では、ドキュメントの末尾に「見出しD」 を追加します。 見出しA, B, C, Dのスタイルは、見出し3 ( HEADING3 ) に設定しています。  下記Code.gsの  GOOGLE_DOCUMENT_URL を設定して  addHeadingToEnd()  を...