kMacOsToPhysicalKey top-level constant

const kMacOsToPhysicalKey = <int, PhysicalKeyboardKey>{0 : PhysicalKeyboardKey.keyA, 11 : PhysicalKeyboardKey.keyB, 8 : PhysicalKeyboardKey.keyC, 2 : PhysicalKeyboardKey.keyD, 14 : PhysicalKeyboardKey.keyE, 3 : PhysicalKeyboardKey.keyF, 5 : PhysicalKeyboardKey.keyG, 4 : PhysicalKeyboardKey.keyH, 34 : PhysicalKeyboardKey.keyI, 38 : PhysicalKeyboardKey.keyJ, 40 : PhysicalKeyboardKey.keyK, 37 : PhysicalKeyboardKey.keyL, 46 : PhysicalKeyboardKey.keyM, 45 : PhysicalKeyboardKey.keyN, 31 : PhysicalKeyboardKey.keyO, 35 : PhysicalKeyboardKey.keyP, 12 : PhysicalKeyboardKey.keyQ, 15 : PhysicalKeyboardKey.keyR, 1 : PhysicalKeyboardKey.keyS, 17 : PhysicalKeyboardKey.keyT, 32 : PhysicalKeyboardKey.keyU, 9 : PhysicalKeyboardKey.keyV, 13 : PhysicalKeyboardKey.keyW, 7 : PhysicalKeyboardKey.keyX, 16 : PhysicalKeyboardKey.keyY, 6 : PhysicalKeyboardKey.keyZ, 18 : PhysicalKeyboardKey.digit1, 19 : PhysicalKeyboardKey.digit2, 20 : PhysicalKeyboardKey.digit3, 21 : PhysicalKeyboardKey.digit4, 23 : PhysicalKeyboardKey.digit5, 22 : PhysicalKeyboardKey.digit6, 26 : PhysicalKeyboardKey.digit7, 28 : PhysicalKeyboardKey.digit8, 25 : PhysicalKeyboardKey.digit9, 29 : PhysicalKeyboardKey.digit0, 36 : PhysicalKeyboardKey.enter, 53 : PhysicalKeyboardKey.escape, 51 : PhysicalKeyboardKey.backspace, 48 : PhysicalKeyboardKey.tab, 49 : PhysicalKeyboardKey.space, 27 : PhysicalKeyboardKey.minus, 24 : PhysicalKeyboardKey.equal, 33 : PhysicalKeyboardKey.bracketLeft, 30 : PhysicalKeyboardKey.bracketRight, 42 : PhysicalKeyboardKey.backslash, 41 : PhysicalKeyboardKey.semicolon, 39 : PhysicalKeyboardKey.quote, 50 : PhysicalKeyboardKey.backquote, 43 : PhysicalKeyboardKey.comma, 47 : PhysicalKeyboardKey.period, 44 : PhysicalKeyboardKey.slash, 57 : PhysicalKeyboardKey.capsLock, 122 : PhysicalKeyboardKey.f1, 120 : PhysicalKeyboardKey.f2, 99 : PhysicalKeyboardKey.f3, 118 : PhysicalKeyboardKey.f4, 96 : PhysicalKeyboardKey.f5, 97 : PhysicalKeyboardKey.f6, 98 : PhysicalKeyboardKey.f7, 100 : PhysicalKeyboardKey.f8, 101 : PhysicalKeyboardKey.f9, 109 : PhysicalKeyboardKey.f10, 103 : PhysicalKeyboardKey.f11, 111 : PhysicalKeyboardKey.f12, 114 : PhysicalKeyboardKey.insert, 115 : PhysicalKeyboardKey.home, 116 : PhysicalKeyboardKey.pageUp, 117 : PhysicalKeyboardKey.delete, 119 : PhysicalKeyboardKey.end, 121 : PhysicalKeyboardKey.pageDown, 124 : PhysicalKeyboardKey.arrowRight, 123 : PhysicalKeyboardKey.arrowLeft, 125 : PhysicalKeyboardKey.arrowDown, 126 : PhysicalKeyboardKey.arrowUp, 71 : PhysicalKeyboardKey.numLock, 75 : PhysicalKeyboardKey.numpadDivide, 67 : PhysicalKeyboardKey.numpadMultiply, 78 : PhysicalKeyboardKey.numpadSubtract, 69 : PhysicalKeyboardKey.numpadAdd, 76 : PhysicalKeyboardKey.numpadEnter, 83 : PhysicalKeyboardKey.numpad1, 84 : PhysicalKeyboardKey.numpad2, 85 : PhysicalKeyboardKey.numpad3, 86 : PhysicalKeyboardKey.numpad4, 87 : PhysicalKeyboardKey.numpad5, 88 : PhysicalKeyboardKey.numpad6, 89 : PhysicalKeyboardKey.numpad7, 91 : PhysicalKeyboardKey.numpad8, 92 : PhysicalKeyboardKey.numpad9, 82 : PhysicalKeyboardKey.numpad0, 65 : PhysicalKeyboardKey.numpadDecimal, 10 : PhysicalKeyboardKey.intlBackslash, 110 : PhysicalKeyboardKey.contextMenu, 81 : PhysicalKeyboardKey.numpadEqual, 105 : PhysicalKeyboardKey.f13, 107 : PhysicalKeyboardKey.f14, 113 : PhysicalKeyboardKey.f15, 106 : PhysicalKeyboardKey.f16, 64 : PhysicalKeyboardKey.f17, 79 : PhysicalKeyboardKey.f18, 80 : PhysicalKeyboardKey.f19, 90 : PhysicalKeyboardKey.f20, 74 : PhysicalKeyboardKey.audioVolumeMute, 72 : PhysicalKeyboardKey.audioVolumeUp, 73 : PhysicalKeyboardKey.audioVolumeDown, 95 : PhysicalKeyboardKey.numpadComma, 94 : PhysicalKeyboardKey.intlRo, 104 : PhysicalKeyboardKey.kanaMode, 93 : PhysicalKeyboardKey.intlYen, 59 : PhysicalKeyboardKey.controlLeft, 56 : PhysicalKeyboardKey.shiftLeft, 58 : PhysicalKeyboardKey.altLeft, 55 : PhysicalKeyboardKey.metaLeft, 62 : PhysicalKeyboardKey.controlRight, 60 : PhysicalKeyboardKey.shiftRight, 61 : PhysicalKeyboardKey.altRight, 54 : PhysicalKeyboardKey.metaRight, 63 : PhysicalKeyboardKey.fn}

Maps macOS-specific key code values representing PhysicalKeyboardKey.

MacOS doesn't provide a scan code, but a virtual keycode to represent a physical key.

Implementation

const Map<int, PhysicalKeyboardKey> kMacOsToPhysicalKey = <int, PhysicalKeyboardKey>{
  0x00000000: PhysicalKeyboardKey.keyA,
  0x0000000b: PhysicalKeyboardKey.keyB,
  0x00000008: PhysicalKeyboardKey.keyC,
  0x00000002: PhysicalKeyboardKey.keyD,
  0x0000000e: PhysicalKeyboardKey.keyE,
  0x00000003: PhysicalKeyboardKey.keyF,
  0x00000005: PhysicalKeyboardKey.keyG,
  0x00000004: PhysicalKeyboardKey.keyH,
  0x00000022: PhysicalKeyboardKey.keyI,
  0x00000026: PhysicalKeyboardKey.keyJ,
  0x00000028: PhysicalKeyboardKey.keyK,
  0x00000025: PhysicalKeyboardKey.keyL,
  0x0000002e: PhysicalKeyboardKey.keyM,
  0x0000002d: PhysicalKeyboardKey.keyN,
  0x0000001f: PhysicalKeyboardKey.keyO,
  0x00000023: PhysicalKeyboardKey.keyP,
  0x0000000c: PhysicalKeyboardKey.keyQ,
  0x0000000f: PhysicalKeyboardKey.keyR,
  0x00000001: PhysicalKeyboardKey.keyS,
  0x00000011: PhysicalKeyboardKey.keyT,
  0x00000020: PhysicalKeyboardKey.keyU,
  0x00000009: PhysicalKeyboardKey.keyV,
  0x0000000d: PhysicalKeyboardKey.keyW,
  0x00000007: PhysicalKeyboardKey.keyX,
  0x00000010: PhysicalKeyboardKey.keyY,
  0x00000006: PhysicalKeyboardKey.keyZ,
  0x00000012: PhysicalKeyboardKey.digit1,
  0x00000013: PhysicalKeyboardKey.digit2,
  0x00000014: PhysicalKeyboardKey.digit3,
  0x00000015: PhysicalKeyboardKey.digit4,
  0x00000017: PhysicalKeyboardKey.digit5,
  0x00000016: PhysicalKeyboardKey.digit6,
  0x0000001a: PhysicalKeyboardKey.digit7,
  0x0000001c: PhysicalKeyboardKey.digit8,
  0x00000019: PhysicalKeyboardKey.digit9,
  0x0000001d: PhysicalKeyboardKey.digit0,
  0x00000024: PhysicalKeyboardKey.enter,
  0x00000035: PhysicalKeyboardKey.escape,
  0x00000033: PhysicalKeyboardKey.backspace,
  0x00000030: PhysicalKeyboardKey.tab,
  0x00000031: PhysicalKeyboardKey.space,
  0x0000001b: PhysicalKeyboardKey.minus,
  0x00000018: PhysicalKeyboardKey.equal,
  0x00000021: PhysicalKeyboardKey.bracketLeft,
  0x0000001e: PhysicalKeyboardKey.bracketRight,
  0x0000002a: PhysicalKeyboardKey.backslash,
  0x00000029: PhysicalKeyboardKey.semicolon,
  0x00000027: PhysicalKeyboardKey.quote,
  0x00000032: PhysicalKeyboardKey.backquote,
  0x0000002b: PhysicalKeyboardKey.comma,
  0x0000002f: PhysicalKeyboardKey.period,
  0x0000002c: PhysicalKeyboardKey.slash,
  0x00000039: PhysicalKeyboardKey.capsLock,
  0x0000007a: PhysicalKeyboardKey.f1,
  0x00000078: PhysicalKeyboardKey.f2,
  0x00000063: PhysicalKeyboardKey.f3,
  0x00000076: PhysicalKeyboardKey.f4,
  0x00000060: PhysicalKeyboardKey.f5,
  0x00000061: PhysicalKeyboardKey.f6,
  0x00000062: PhysicalKeyboardKey.f7,
  0x00000064: PhysicalKeyboardKey.f8,
  0x00000065: PhysicalKeyboardKey.f9,
  0x0000006d: PhysicalKeyboardKey.f10,
  0x00000067: PhysicalKeyboardKey.f11,
  0x0000006f: PhysicalKeyboardKey.f12,
  0x00000072: PhysicalKeyboardKey.insert,
  0x00000073: PhysicalKeyboardKey.home,
  0x00000074: PhysicalKeyboardKey.pageUp,
  0x00000075: PhysicalKeyboardKey.delete,
  0x00000077: PhysicalKeyboardKey.end,
  0x00000079: PhysicalKeyboardKey.pageDown,
  0x0000007c: PhysicalKeyboardKey.arrowRight,
  0x0000007b: PhysicalKeyboardKey.arrowLeft,
  0x0000007d: PhysicalKeyboardKey.arrowDown,
  0x0000007e: PhysicalKeyboardKey.arrowUp,
  0x00000047: PhysicalKeyboardKey.numLock,
  0x0000004b: PhysicalKeyboardKey.numpadDivide,
  0x00000043: PhysicalKeyboardKey.numpadMultiply,
  0x0000004e: PhysicalKeyboardKey.numpadSubtract,
  0x00000045: PhysicalKeyboardKey.numpadAdd,
  0x0000004c: PhysicalKeyboardKey.numpadEnter,
  0x00000053: PhysicalKeyboardKey.numpad1,
  0x00000054: PhysicalKeyboardKey.numpad2,
  0x00000055: PhysicalKeyboardKey.numpad3,
  0x00000056: PhysicalKeyboardKey.numpad4,
  0x00000057: PhysicalKeyboardKey.numpad5,
  0x00000058: PhysicalKeyboardKey.numpad6,
  0x00000059: PhysicalKeyboardKey.numpad7,
  0x0000005b: PhysicalKeyboardKey.numpad8,
  0x0000005c: PhysicalKeyboardKey.numpad9,
  0x00000052: PhysicalKeyboardKey.numpad0,
  0x00000041: PhysicalKeyboardKey.numpadDecimal,
  0x0000000a: PhysicalKeyboardKey.intlBackslash,
  0x0000006e: PhysicalKeyboardKey.contextMenu,
  0x00000051: PhysicalKeyboardKey.numpadEqual,
  0x00000069: PhysicalKeyboardKey.f13,
  0x0000006b: PhysicalKeyboardKey.f14,
  0x00000071: PhysicalKeyboardKey.f15,
  0x0000006a: PhysicalKeyboardKey.f16,
  0x00000040: PhysicalKeyboardKey.f17,
  0x0000004f: PhysicalKeyboardKey.f18,
  0x00000050: PhysicalKeyboardKey.f19,
  0x0000005a: PhysicalKeyboardKey.f20,
  0x0000004a: PhysicalKeyboardKey.audioVolumeMute,
  0x00000048: PhysicalKeyboardKey.audioVolumeUp,
  0x00000049: PhysicalKeyboardKey.audioVolumeDown,
  0x0000005f: PhysicalKeyboardKey.numpadComma,
  0x0000005e: PhysicalKeyboardKey.intlRo,
  0x00000068: PhysicalKeyboardKey.kanaMode,
  0x0000005d: PhysicalKeyboardKey.intlYen,
  0x0000003b: PhysicalKeyboardKey.controlLeft,
  0x00000038: PhysicalKeyboardKey.shiftLeft,
  0x0000003a: PhysicalKeyboardKey.altLeft,
  0x00000037: PhysicalKeyboardKey.metaLeft,
  0x0000003e: PhysicalKeyboardKey.controlRight,
  0x0000003c: PhysicalKeyboardKey.shiftRight,
  0x0000003d: PhysicalKeyboardKey.altRight,
  0x00000036: PhysicalKeyboardKey.metaRight,
  0x0000003f: PhysicalKeyboardKey.fn,
}