kMacOsToLogicalKey top-level constant Null safety

Map<int, LogicalKeyboardKey> const kMacOsToLogicalKey

A map of macOS key codes presenting LogicalKeyboardKey.

Logical key codes are not available in macOS key events. Most of the logical keys are derived from its characterIgnoringModifiers, but those keys that don't have a character representation will be derived from their key codes using this map.

Implementation

const Map<int, LogicalKeyboardKey> kMacOsToLogicalKey = <int, LogicalKeyboardKey>{
  36: LogicalKeyboardKey.enter,
  48: LogicalKeyboardKey.tab,
  51: LogicalKeyboardKey.backspace,
  53: LogicalKeyboardKey.escape,
  54: LogicalKeyboardKey.metaRight,
  55: LogicalKeyboardKey.metaLeft,
  56: LogicalKeyboardKey.shiftLeft,
  57: LogicalKeyboardKey.capsLock,
  58: LogicalKeyboardKey.altLeft,
  59: LogicalKeyboardKey.controlLeft,
  60: LogicalKeyboardKey.shiftRight,
  61: LogicalKeyboardKey.altRight,
  62: LogicalKeyboardKey.controlRight,
  63: LogicalKeyboardKey.fn,
  64: LogicalKeyboardKey.f17,
  65: LogicalKeyboardKey.numpadDecimal,
  67: LogicalKeyboardKey.numpadMultiply,
  69: LogicalKeyboardKey.numpadAdd,
  71: LogicalKeyboardKey.numLock,
  72: LogicalKeyboardKey.audioVolumeUp,
  73: LogicalKeyboardKey.audioVolumeDown,
  74: LogicalKeyboardKey.audioVolumeMute,
  75: LogicalKeyboardKey.numpadDivide,
  76: LogicalKeyboardKey.numpadEnter,
  78: LogicalKeyboardKey.numpadSubtract,
  79: LogicalKeyboardKey.f18,
  80: LogicalKeyboardKey.f19,
  81: LogicalKeyboardKey.numpadEqual,
  82: LogicalKeyboardKey.numpad0,
  83: LogicalKeyboardKey.numpad1,
  84: LogicalKeyboardKey.numpad2,
  85: LogicalKeyboardKey.numpad3,
  86: LogicalKeyboardKey.numpad4,
  87: LogicalKeyboardKey.numpad5,
  88: LogicalKeyboardKey.numpad6,
  89: LogicalKeyboardKey.numpad7,
  90: LogicalKeyboardKey.f20,
  91: LogicalKeyboardKey.numpad8,
  92: LogicalKeyboardKey.numpad9,
  93: LogicalKeyboardKey.intlYen,
  94: LogicalKeyboardKey.intlRo,
  95: LogicalKeyboardKey.numpadComma,
  96: LogicalKeyboardKey.f5,
  97: LogicalKeyboardKey.f6,
  98: LogicalKeyboardKey.f7,
  99: LogicalKeyboardKey.f3,
  100: LogicalKeyboardKey.f8,
  101: LogicalKeyboardKey.f9,
  102: LogicalKeyboardKey.lang2,
  103: LogicalKeyboardKey.f11,
  104: LogicalKeyboardKey.lang1,
  105: LogicalKeyboardKey.f13,
  106: LogicalKeyboardKey.f16,
  107: LogicalKeyboardKey.f14,
  109: LogicalKeyboardKey.f10,
  110: LogicalKeyboardKey.contextMenu,
  111: LogicalKeyboardKey.f12,
  113: LogicalKeyboardKey.f15,
  114: LogicalKeyboardKey.insert,
  115: LogicalKeyboardKey.home,
  116: LogicalKeyboardKey.pageUp,
  117: LogicalKeyboardKey.delete,
  118: LogicalKeyboardKey.f4,
  119: LogicalKeyboardKey.end,
  120: LogicalKeyboardKey.f2,
  121: LogicalKeyboardKey.pageDown,
  122: LogicalKeyboardKey.f1,
  123: LogicalKeyboardKey.arrowLeft,
  124: LogicalKeyboardKey.arrowRight,
  125: LogicalKeyboardKey.arrowDown,
  126: LogicalKeyboardKey.arrowUp,
};