Flutter Engine
The Flutter Engine
KeyCodeMap.g.mm
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#import <Cocoa/Cocoa.h>
6#import <Foundation/Foundation.h>
8
9// DO NOT EDIT -- DO NOT EDIT -- DO NOT EDIT
10// This file is generated by
11// flutter/flutter:dev/tools/gen_keycodes/bin/gen_keycodes.dart and should not
12// be edited directly.
13//
14// Edit the template
15// flutter/flutter:dev/tools/gen_keycodes/data/keyboard_map_macos_cc.tmpl
16// instead.
17//
18// See flutter/flutter:dev/tools/gen_keycodes/README.md for more information.
19
20namespace flutter {
21
22const uint64_t kValueMask = 0x000ffffffff;
23const uint64_t kUnicodePlane = 0x00000000000;
24const uint64_t kMacosPlane = 0x01400000000;
25
26const NSDictionary* keyCodeToPhysicalKey = @{
27 @0x00000000 : @0x00070004, // keyA
28 @0x00000001 : @0x00070016, // keyS
29 @0x00000002 : @0x00070007, // keyD
30 @0x00000003 : @0x00070009, // keyF
31 @0x00000004 : @0x0007000b, // keyH
32 @0x00000005 : @0x0007000a, // keyG
33 @0x00000006 : @0x0007001d, // keyZ
34 @0x00000007 : @0x0007001b, // keyX
35 @0x00000008 : @0x00070006, // keyC
36 @0x00000009 : @0x00070019, // keyV
37 @0x0000000a : @0x00070064, // intlBackslash
38 @0x0000000b : @0x00070005, // keyB
39 @0x0000000c : @0x00070014, // keyQ
40 @0x0000000d : @0x0007001a, // keyW
41 @0x0000000e : @0x00070008, // keyE
42 @0x0000000f : @0x00070015, // keyR
43 @0x00000010 : @0x0007001c, // keyY
44 @0x00000011 : @0x00070017, // keyT
45 @0x00000012 : @0x0007001e, // digit1
46 @0x00000013 : @0x0007001f, // digit2
47 @0x00000014 : @0x00070020, // digit3
48 @0x00000015 : @0x00070021, // digit4
49 @0x00000016 : @0x00070023, // digit6
50 @0x00000017 : @0x00070022, // digit5
51 @0x00000018 : @0x0007002e, // equal
52 @0x00000019 : @0x00070026, // digit9
53 @0x0000001a : @0x00070024, // digit7
54 @0x0000001b : @0x0007002d, // minus
55 @0x0000001c : @0x00070025, // digit8
56 @0x0000001d : @0x00070027, // digit0
57 @0x0000001e : @0x00070030, // bracketRight
58 @0x0000001f : @0x00070012, // keyO
59 @0x00000020 : @0x00070018, // keyU
60 @0x00000021 : @0x0007002f, // bracketLeft
61 @0x00000022 : @0x0007000c, // keyI
62 @0x00000023 : @0x00070013, // keyP
63 @0x00000024 : @0x00070028, // enter
64 @0x00000025 : @0x0007000f, // keyL
65 @0x00000026 : @0x0007000d, // keyJ
66 @0x00000027 : @0x00070034, // quote
67 @0x00000028 : @0x0007000e, // keyK
68 @0x00000029 : @0x00070033, // semicolon
69 @0x0000002a : @0x00070031, // backslash
70 @0x0000002b : @0x00070036, // comma
71 @0x0000002c : @0x00070038, // slash
72 @0x0000002d : @0x00070011, // keyN
73 @0x0000002e : @0x00070010, // keyM
74 @0x0000002f : @0x00070037, // period
75 @0x00000030 : @0x0007002b, // tab
76 @0x00000031 : @0x0007002c, // space
77 @0x00000032 : @0x00070035, // backquote
78 @0x00000033 : @0x0007002a, // backspace
79 @0x00000035 : @0x00070029, // escape
80 @0x00000036 : @0x000700e7, // metaRight
81 @0x00000037 : @0x000700e3, // metaLeft
82 @0x00000038 : @0x000700e1, // shiftLeft
83 @0x00000039 : @0x00070039, // capsLock
84 @0x0000003a : @0x000700e2, // altLeft
85 @0x0000003b : @0x000700e0, // controlLeft
86 @0x0000003c : @0x000700e5, // shiftRight
87 @0x0000003d : @0x000700e6, // altRight
88 @0x0000003e : @0x000700e4, // controlRight
89 @0x0000003f : @0x00000012, // fn
90 @0x00000040 : @0x0007006c, // f17
91 @0x00000041 : @0x00070063, // numpadDecimal
92 @0x00000043 : @0x00070055, // numpadMultiply
93 @0x00000045 : @0x00070057, // numpadAdd
94 @0x00000047 : @0x00070053, // numLock
95 @0x00000048 : @0x00070080, // audioVolumeUp
96 @0x00000049 : @0x00070081, // audioVolumeDown
97 @0x0000004a : @0x0007007f, // audioVolumeMute
98 @0x0000004b : @0x00070054, // numpadDivide
99 @0x0000004c : @0x00070058, // numpadEnter
100 @0x0000004e : @0x00070056, // numpadSubtract
101 @0x0000004f : @0x0007006d, // f18
102 @0x00000050 : @0x0007006e, // f19
103 @0x00000051 : @0x00070067, // numpadEqual
104 @0x00000052 : @0x00070062, // numpad0
105 @0x00000053 : @0x00070059, // numpad1
106 @0x00000054 : @0x0007005a, // numpad2
107 @0x00000055 : @0x0007005b, // numpad3
108 @0x00000056 : @0x0007005c, // numpad4
109 @0x00000057 : @0x0007005d, // numpad5
110 @0x00000058 : @0x0007005e, // numpad6
111 @0x00000059 : @0x0007005f, // numpad7
112 @0x0000005a : @0x0007006f, // f20
113 @0x0000005b : @0x00070060, // numpad8
114 @0x0000005c : @0x00070061, // numpad9
115 @0x0000005d : @0x00070089, // intlYen
116 @0x0000005e : @0x00070087, // intlRo
117 @0x0000005f : @0x00070085, // numpadComma
118 @0x00000060 : @0x0007003e, // f5
119 @0x00000061 : @0x0007003f, // f6
120 @0x00000062 : @0x00070040, // f7
121 @0x00000063 : @0x0007003c, // f3
122 @0x00000064 : @0x00070041, // f8
123 @0x00000065 : @0x00070042, // f9
124 @0x00000066 : @0x00070091, // lang2
125 @0x00000067 : @0x00070044, // f11
126 @0x00000068 : @0x00070090, // lang1
127 @0x00000069 : @0x00070068, // f13
128 @0x0000006a : @0x0007006b, // f16
129 @0x0000006b : @0x00070069, // f14
130 @0x0000006d : @0x00070043, // f10
131 @0x0000006e : @0x00070065, // contextMenu
132 @0x0000006f : @0x00070045, // f12
133 @0x00000071 : @0x0007006a, // f15
134 @0x00000072 : @0x00070049, // insert
135 @0x00000073 : @0x0007004a, // home
136 @0x00000074 : @0x0007004b, // pageUp
137 @0x00000075 : @0x0007004c, // delete
138 @0x00000076 : @0x0007003d, // f4
139 @0x00000077 : @0x0007004d, // end
140 @0x00000078 : @0x0007003b, // f2
141 @0x00000079 : @0x0007004e, // pageDown
142 @0x0000007a : @0x0007003a, // f1
143 @0x0000007b : @0x00070050, // arrowLeft
144 @0x0000007c : @0x0007004f, // arrowRight
145 @0x0000007d : @0x00070051, // arrowDown
146 @0x0000007e : @0x00070052, // arrowUp
147};
148
149const NSDictionary* keyCodeToLogicalKey = @{
150 @0x00000024 : @0x0010000000d, // Enter -> enter
151 @0x00000030 : @0x00100000009, // Tab -> tab
152 @0x00000033 : @0x00100000008, // Backspace -> backspace
153 @0x00000035 : @0x0010000001b, // Escape -> escape
154 @0x00000036 : @0x00200000107, // MetaRight -> metaRight
155 @0x00000037 : @0x00200000106, // MetaLeft -> metaLeft
156 @0x00000038 : @0x00200000102, // ShiftLeft -> shiftLeft
157 @0x00000039 : @0x00100000104, // CapsLock -> capsLock
158 @0x0000003a : @0x00200000104, // AltLeft -> altLeft
159 @0x0000003b : @0x00200000100, // ControlLeft -> controlLeft
160 @0x0000003c : @0x00200000103, // ShiftRight -> shiftRight
161 @0x0000003d : @0x00200000105, // AltRight -> altRight
162 @0x0000003e : @0x00200000101, // ControlRight -> controlRight
163 @0x0000003f : @0x00100000106, // Fn -> fn
164 @0x00000040 : @0x00100000811, // F17 -> f17
165 @0x00000041 : @0x0020000022e, // NumpadDecimal -> numpadDecimal
166 @0x00000043 : @0x0020000022a, // NumpadMultiply -> numpadMultiply
167 @0x00000045 : @0x0020000022b, // NumpadAdd -> numpadAdd
168 @0x00000047 : @0x0010000010a, // NumLock -> numLock
169 @0x00000048 : @0x00100000a10, // AudioVolumeUp -> audioVolumeUp
170 @0x00000049 : @0x00100000a0f, // AudioVolumeDown -> audioVolumeDown
171 @0x0000004a : @0x00100000a11, // AudioVolumeMute -> audioVolumeMute
172 @0x0000004b : @0x0020000022f, // NumpadDivide -> numpadDivide
173 @0x0000004c : @0x0020000020d, // NumpadEnter -> numpadEnter
174 @0x0000004e : @0x0020000022d, // NumpadSubtract -> numpadSubtract
175 @0x0000004f : @0x00100000812, // F18 -> f18
176 @0x00000050 : @0x00100000813, // F19 -> f19
177 @0x00000051 : @0x0020000023d, // NumpadEqual -> numpadEqual
178 @0x00000052 : @0x00200000230, // Numpad0 -> numpad0
179 @0x00000053 : @0x00200000231, // Numpad1 -> numpad1
180 @0x00000054 : @0x00200000232, // Numpad2 -> numpad2
181 @0x00000055 : @0x00200000233, // Numpad3 -> numpad3
182 @0x00000056 : @0x00200000234, // Numpad4 -> numpad4
183 @0x00000057 : @0x00200000235, // Numpad5 -> numpad5
184 @0x00000058 : @0x00200000236, // Numpad6 -> numpad6
185 @0x00000059 : @0x00200000237, // Numpad7 -> numpad7
186 @0x0000005a : @0x00100000814, // F20 -> f20
187 @0x0000005b : @0x00200000238, // Numpad8 -> numpad8
188 @0x0000005c : @0x00200000239, // Numpad9 -> numpad9
189 @0x0000005d : @0x00200000022, // IntlYen -> intlYen
190 @0x0000005e : @0x00200000021, // IntlRo -> intlRo
191 @0x0000005f : @0x0020000022c, // NumpadComma -> numpadComma
192 @0x00000060 : @0x00100000805, // F5 -> f5
193 @0x00000061 : @0x00100000806, // F6 -> f6
194 @0x00000062 : @0x00100000807, // F7 -> f7
195 @0x00000063 : @0x00100000803, // F3 -> f3
196 @0x00000064 : @0x00100000808, // F8 -> f8
197 @0x00000065 : @0x00100000809, // F9 -> f9
198 @0x00000066 : @0x00200000011, // Lang2 -> lang2
199 @0x00000067 : @0x0010000080b, // F11 -> f11
200 @0x00000068 : @0x00200000010, // Lang1 -> lang1
201 @0x00000069 : @0x0010000080d, // F13 -> f13
202 @0x0000006a : @0x00100000810, // F16 -> f16
203 @0x0000006b : @0x0010000080e, // F14 -> f14
204 @0x0000006d : @0x0010000080a, // F10 -> f10
205 @0x0000006e : @0x00100000505, // ContextMenu -> contextMenu
206 @0x0000006f : @0x0010000080c, // F12 -> f12
207 @0x00000071 : @0x0010000080f, // F15 -> f15
208 @0x00000072 : @0x00100000407, // Insert -> insert
209 @0x00000073 : @0x00100000306, // Home -> home
210 @0x00000074 : @0x00100000308, // PageUp -> pageUp
211 @0x00000075 : @0x0010000007f, // Delete -> delete
212 @0x00000076 : @0x00100000804, // F4 -> f4
213 @0x00000077 : @0x00100000305, // End -> end
214 @0x00000078 : @0x00100000802, // F2 -> f2
215 @0x00000079 : @0x00100000307, // PageDown -> pageDown
216 @0x0000007a : @0x00100000801, // F1 -> f1
217 @0x0000007b : @0x00100000302, // ArrowLeft -> arrowLeft
218 @0x0000007c : @0x00100000303, // ArrowRight -> arrowRight
219 @0x0000007d : @0x00100000301, // ArrowDown -> arrowDown
220 @0x0000007e : @0x00100000304, // ArrowUp -> arrowUp
221};
222
223const NSDictionary* keyCodeToModifierFlag = @{
224 @0x00000038 : @(kModifierFlagShiftLeft),
225 @0x0000003c : @(kModifierFlagShiftRight),
226 @0x0000003b : @(kModifierFlagControlLeft),
227 @0x0000003e : @(kModifierFlagControlRight),
228 @0x0000003a : @(kModifierFlagAltLeft),
229 @0x0000003d : @(kModifierFlagAltRight),
230 @0x00000037 : @(kModifierFlagMetaLeft),
231 @0x00000036 : @(kModifierFlagMetaRight),
232};
233
234const NSDictionary* modifierFlagToKeyCode = @{
235 @(kModifierFlagShiftLeft) : @0x00000038,
236 @(kModifierFlagShiftRight) : @0x0000003c,
237 @(kModifierFlagControlLeft) : @0x0000003b,
238 @(kModifierFlagControlRight) : @0x0000003e,
239 @(kModifierFlagAltLeft) : @0x0000003a,
240 @(kModifierFlagAltRight) : @0x0000003d,
241 @(kModifierFlagMetaLeft) : @0x00000037,
242 @(kModifierFlagMetaRight) : @0x00000036,
243};
244
245const uint64_t kCapsLockPhysicalKey = 0x00070039;
246const uint64_t kCapsLockLogicalKey = 0x100000104;
247
248const std::vector<LayoutGoal> kLayoutGoals = {
249 LayoutGoal{0x31, 0x20, false}, // Space
250 LayoutGoal{0x27, 0x22, false}, // Quote
251 LayoutGoal{0x2b, 0x2c, false}, // Comma
252 LayoutGoal{0x1b, 0x2d, false}, // Minus
253 LayoutGoal{0x2f, 0x2e, false}, // Period
254 LayoutGoal{0x2c, 0x2f, false}, // Slash
255 LayoutGoal{0x1d, 0x30, true}, // Digit0
256 LayoutGoal{0x12, 0x31, true}, // Digit1
257 LayoutGoal{0x13, 0x32, true}, // Digit2
258 LayoutGoal{0x14, 0x33, true}, // Digit3
259 LayoutGoal{0x15, 0x34, true}, // Digit4
260 LayoutGoal{0x17, 0x35, true}, // Digit5
261 LayoutGoal{0x16, 0x36, true}, // Digit6
262 LayoutGoal{0x1a, 0x37, true}, // Digit7
263 LayoutGoal{0x1c, 0x38, true}, // Digit8
264 LayoutGoal{0x19, 0x39, true}, // Digit9
265 LayoutGoal{0x29, 0x3b, false}, // Semicolon
266 LayoutGoal{0x18, 0x3d, false}, // Equal
267 LayoutGoal{0x21, 0x5b, false}, // BracketLeft
268 LayoutGoal{0x2a, 0x5c, false}, // Backslash
269 LayoutGoal{0x1e, 0x5d, false}, // BracketRight
270 LayoutGoal{0x32, 0x60, false}, // Backquote
271 LayoutGoal{0x00, 0x61, true}, // KeyA
272 LayoutGoal{0x0b, 0x62, true}, // KeyB
273 LayoutGoal{0x08, 0x63, true}, // KeyC
274 LayoutGoal{0x02, 0x64, true}, // KeyD
275 LayoutGoal{0x0e, 0x65, true}, // KeyE
276 LayoutGoal{0x03, 0x66, true}, // KeyF
277 LayoutGoal{0x05, 0x67, true}, // KeyG
278 LayoutGoal{0x04, 0x68, true}, // KeyH
279 LayoutGoal{0x22, 0x69, true}, // KeyI
280 LayoutGoal{0x26, 0x6a, true}, // KeyJ
281 LayoutGoal{0x28, 0x6b, true}, // KeyK
282 LayoutGoal{0x25, 0x6c, true}, // KeyL
283 LayoutGoal{0x2e, 0x6d, true}, // KeyM
284 LayoutGoal{0x2d, 0x6e, true}, // KeyN
285 LayoutGoal{0x1f, 0x6f, true}, // KeyO
286 LayoutGoal{0x23, 0x70, true}, // KeyP
287 LayoutGoal{0x0c, 0x71, true}, // KeyQ
288 LayoutGoal{0x0f, 0x72, true}, // KeyR
289 LayoutGoal{0x01, 0x73, true}, // KeyS
290 LayoutGoal{0x11, 0x74, true}, // KeyT
291 LayoutGoal{0x20, 0x75, true}, // KeyU
292 LayoutGoal{0x09, 0x76, true}, // KeyV
293 LayoutGoal{0x0d, 0x77, true}, // KeyW
294 LayoutGoal{0x07, 0x78, true}, // KeyX
295 LayoutGoal{0x10, 0x79, true}, // KeyY
296 LayoutGoal{0x06, 0x7a, true}, // KeyZ
297 LayoutGoal{0x0a, 0x200000020, false}, // IntlBackslash
298};
299
300} // namespace flutter
const NSDictionary * keyCodeToLogicalKey
const uint64_t kUnicodePlane
Definition: KeyCodeMap.g.mm:23
const std::vector< LayoutGoal > kLayoutGoals
const NSDictionary * keyCodeToPhysicalKey
Definition: KeyCodeMap.g.mm:26
const NSDictionary * keyCodeToModifierFlag
const uint64_t kValueMask
Definition: KeyCodeMap.g.mm:22
const uint64_t kCapsLockLogicalKey
const NSDictionary * modifierFlagToKeyCode
const uint64_t kMacosPlane
Definition: KeyCodeMap.g.mm:24
const uint64_t kCapsLockPhysicalKey
@ kModifierFlagControlLeft
@ kModifierFlagControlRight