Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / ui / events / ozone / layout / xkb / xkb_keyboard_layout_engine_unittest.cc
blobf5195d0ee5442ec7b67cbd08b896059e1150a323
1 // Copyright 2014 The Chromium 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.
5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "ui/events/event_constants.h"
7 #include "ui/events/keycodes/dom3/dom_code.h"
8 #include "ui/events/keycodes/dom3/dom_key.h"
9 #include "ui/events/keycodes/keyboard_code_conversion.h"
10 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h"
11 #include "ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h"
13 namespace ui {
15 namespace {
17 // This XkbKeyCodeConverter simply uses the numeric value of the DomCode.
18 class VkTestXkbKeyCodeConverter : public XkbKeyCodeConverter {
19 public:
20 VkTestXkbKeyCodeConverter() {
21 invalid_xkb_keycode_ = static_cast<xkb_keycode_t>(DomCode::NONE);
23 ~VkTestXkbKeyCodeConverter() override {}
24 xkb_keycode_t DomCodeToXkbKeyCode(DomCode dom_code) const override {
25 return static_cast<xkb_keycode_t>(dom_code);
29 // This mock XkbKeyboardLayoutEngine fakes a layout that succeeds only when the
30 // supplied keycode matches its |Entry|, in which case it supplies DomKey::NONE
31 // and a character that depends on the flags.
32 class VkTestXkbKeyboardLayoutEngine : public XkbKeyboardLayoutEngine {
33 public:
34 struct Entry {
35 base::char16 plain_character;
36 base::char16 shift_character;
37 base::char16 altgr_character;
38 ui::DomCode dom_code;
39 ui::KeyboardCode key_code;
42 struct RuleNames {
43 std::string layout_name;
44 std::string layout;
45 std::string variant;
48 public:
49 VkTestXkbKeyboardLayoutEngine(const XkbKeyCodeConverter& keycode_converter)
50 : XkbKeyboardLayoutEngine(keycode_converter), entry_(nullptr) {
51 // For testing, use the same modifier values as ui::EventFlags.
52 static const int kTestFlags[] = {
53 EF_SHIFT_DOWN, EF_ALTGR_DOWN, EF_MOD3_DOWN};
54 xkb_flag_map_.clear();
55 xkb_flag_map_.resize(arraysize(kTestFlags));
56 for (size_t i = 0; i < arraysize(kTestFlags); ++i) {
57 XkbFlagMapEntry e = {kTestFlags[i], kTestFlags[i]};
58 xkb_flag_map_.push_back(e);
61 ~VkTestXkbKeyboardLayoutEngine() override {}
63 void SetEntry(const Entry* entry) { entry_ = entry; }
65 xkb_keysym_t CharacterToKeySym(base::char16 c) const {
66 return 0x01000000u + c;
69 KeyboardCode GetKeyboardCode(DomCode dom_code,
70 int flags,
71 base::char16 character) const {
72 KeyboardCode key_code = DifficultKeyboardCode(
73 dom_code, flags, key_code_converter_.DomCodeToXkbKeyCode(dom_code),
74 flags, CharacterToKeySym(character), DomKey::CHARACTER, character);
75 if (key_code == VKEY_UNKNOWN) {
76 DomKey dummy_dom_key;
77 base::char16 dummy_character;
78 // If this fails, key_code remains VKEY_UNKNOWN.
79 ignore_result(DomCodeToUsLayoutMeaning(dom_code, EF_NONE, &dummy_dom_key,
80 &dummy_character, &key_code));
82 return key_code;
85 // XkbKeyboardLayoutEngine overrides:
86 bool XkbLookup(xkb_keycode_t xkb_keycode,
87 xkb_mod_mask_t xkb_flags,
88 xkb_keysym_t* xkb_keysym,
89 base::char16* character) const override {
90 if (!entry_ ||
91 (xkb_keycode != static_cast<xkb_keycode_t>(entry_->dom_code)))
92 return false;
93 if (xkb_flags & EF_ALTGR_DOWN)
94 *character = entry_->altgr_character;
95 else if (xkb_flags & EF_SHIFT_DOWN)
96 *character = entry_->shift_character;
97 else
98 *character = entry_->plain_character;
99 *xkb_keysym = CharacterToKeySym(*character);
100 return *character != 0;
103 private:
104 const Entry* entry_;
107 } // anonymous namespace
109 class XkbLayoutEngineVkTest : public testing::Test {
110 public:
111 XkbLayoutEngineVkTest() {}
112 ~XkbLayoutEngineVkTest() override {}
114 void SetUp() override {
115 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(
116 make_scoped_ptr(new VkTestXkbKeyboardLayoutEngine(keycode_converter_)));
117 layout_engine_ = static_cast<VkTestXkbKeyboardLayoutEngine*>(
118 KeyboardLayoutEngineManager::GetKeyboardLayoutEngine());
120 void TearDown() override {}
122 protected:
123 VkTestXkbKeyCodeConverter keycode_converter_;
124 VkTestXkbKeyboardLayoutEngine* layout_engine_;
127 TEST_F(XkbLayoutEngineVkTest, KeyboardCodeForPrintable) {
128 // This table contains U+2460 CIRCLED DIGIT ONE, U+2461 CIRCLED DIGIT TWO,
129 // and DomCode::NONE where the result should not depend on those values.
130 static const VkTestXkbKeyboardLayoutEngine::Entry kVkeyTestCase[] = {
131 // Cases requiring mapping tables.
132 // exclamation mark, *, *
133 /* 0 */ {0x0021, 0x2460, 0x2461, DomCode::DIGIT1, VKEY_1},
134 // exclamation mark, *, *
135 /* 1 */ {0x0021, 0x2460, 0x2461, DomCode::DIGIT8, VKEY_8},
136 // exclamation mark, *, *
137 /* 2 */ {0x0021, 0x2460, 0x2461, DomCode::SLASH, VKEY_OEM_8},
138 // quotation mark, *, *
139 /* 3 */ {0x0022, 0x2460, 0x2461, DomCode::DIGIT2, VKEY_2},
140 // quotation mark, *, *
141 /* 4 */ {0x0022, 0x2460, 0x2461, DomCode::DIGIT3, VKEY_3},
142 // number sign, apostrophe, *
143 /* 5 */ {0x0023, 0x0027, 0x2461, DomCode::BACKSLASH, VKEY_OEM_2},
144 // number sign, tilde, unmapped
145 /* 6 */ {0x0023, 0x007E, 0x0000, DomCode::BACKSLASH, VKEY_OEM_7},
146 // number sign, *, *
147 /* 7 */ {0x0023, 0x2460, 0x2461, DomCode::BACKQUOTE, VKEY_OEM_7},
148 // dollar sign, *, *
149 /* 8 */ {0x0024, 0x2460, 0x2461, DomCode::BACKSLASH, VKEY_OEM_8},
150 // dollar sign, *, *
151 /* 9 */ {0x0024, 0x2460, 0x2461, DomCode::BRACKET_RIGHT, VKEY_OEM_1},
152 // percent sign, *, *
153 /* 10 */ {0x0025, 0x2460, 0x2461, DomCode::NONE, VKEY_5},
154 // ampersand, *, *
155 /* 11 */ {0x0026, 0x2460, 0x2461, DomCode::NONE, VKEY_1},
156 // apostrophe, unmapped, *
157 /* 12 */ {0x0027, 0x0000, 0x2461, DomCode::BACKSLASH, VKEY_OEM_5},
158 // apostrophe, quotation mark, unmapped
159 /* 13 */ {0x0027, 0x0022, 0x0000, DomCode::KEY_Z, VKEY_Z},
160 // apostrophe, quotation mark, R caron
161 /* 14 */ {0x0027, 0x0022, 0x0158, DomCode::KEY_Z, VKEY_OEM_7},
162 // apostrophe, quotation mark, *
163 /* 15 */ {0x0027, 0x0022, 0x2461, DomCode::BACKQUOTE, VKEY_OEM_3},
164 // apostrophe, quotation mark, *
165 /* 16 */ {0x0027, 0x0022, 0x2461, DomCode::QUOTE, VKEY_OEM_7},
166 // apostrophe, asterisk, unmapped
167 /* 17 */ {0x0027, 0x002A, 0x0000, DomCode::BACKSLASH, VKEY_OEM_2},
168 // apostrophe, asterisk, unmapped
169 /* 18 */ {0x0027, 0x002A, 0x0000, DomCode::EQUAL, VKEY_OEM_PLUS},
170 // apostrophe, asterisk, vulgar fraction one half
171 /* 19 */ {0x0027, 0x002A, 0x00BD, DomCode::BACKSLASH, VKEY_OEM_5},
172 // apostrophe, asterisk, L stroke
173 /* 20 */ {0x0027, 0x002A, 0x0141, DomCode::BACKSLASH, VKEY_OEM_2},
174 // apostrophe, question mark, unmapped
175 /* 21 */ {0x0027, 0x003F, 0x0000, DomCode::MINUS, VKEY_OEM_4},
176 // apostrophe, question mark, Y acute
177 /* 22 */ {0x0027, 0x003F, 0x00DD, DomCode::MINUS, VKEY_OEM_4},
178 // apostrophe, commercial at, unmapped
179 /* 23 */ {0x0027, 0x0040, 0x0000, DomCode::QUOTE, VKEY_OEM_3},
180 // apostrophe, middle dot, *
181 /* 24 */ {0x0027, 0x00B7, 0x2461, DomCode::BACKQUOTE, VKEY_OEM_5},
182 // apostrophe, *, *
183 /* 25 */ {0x0027, 0x2460, 0x2461, DomCode::BRACKET_RIGHT, VKEY_OEM_1},
184 // apostrophe, *, *
185 /* 26 */ {0x0027, 0x2460, 0x2461, DomCode::DIGIT4, VKEY_4},
186 // apostrophe, *, *
187 /* 27 */ {0x0027, 0x2460, 0x2461, DomCode::KEY_Q, VKEY_OEM_7},
188 // apostrophe, *, *
189 /* 28 */ {0x0027, 0x2460, 0x2461, DomCode::SLASH, VKEY_OEM_7},
190 // left parenthesis, *, *
191 /* 29 */ {0x0028, 0x2460, 0x2461, DomCode::BACKSLASH, VKEY_OEM_5},
192 // left parenthesis, *, *
193 /* 30 */ {0x0028, 0x2460, 0x2461, DomCode::DIGIT5, VKEY_5},
194 // left parenthesis, *, *
195 /* 31 */ {0x0028, 0x2460, 0x2461, DomCode::DIGIT9, VKEY_9},
196 // right parenthesis, *, *
197 /* 32 */ {0x0029, 0x2460, 0x2461, DomCode::BRACKET_RIGHT, VKEY_OEM_6},
198 // right parenthesis, *, *
199 /* 33 */ {0x0029, 0x2460, 0x2461, DomCode::DIGIT0, VKEY_0},
200 // right parenthesis, *, *
201 /* 34 */ {0x0029, 0x2460, 0x2461, DomCode::MINUS, VKEY_OEM_4},
202 // asterisk, *, *
203 /* 35 */ {0x002A, 0x2460, 0x2461, DomCode::BACKSLASH, VKEY_OEM_5},
204 // asterisk, *, *
205 /* 36 */ {0x002A, 0x2460, 0x2461, DomCode::BRACKET_RIGHT, VKEY_OEM_1},
206 // plus sign, question mark, unmapped
207 /* 37 */ {0x002B, 0x003F, 0x0000, DomCode::MINUS, VKEY_OEM_PLUS},
208 // plus sign, question mark, reverse solidus
209 /* 38 */ {0x002B, 0x003F, 0x005C, DomCode::MINUS, VKEY_OEM_MINUS},
210 // plus sign, question mark, o double acute
211 /* 39 */ {0x002B, 0x003F, 0x0151, DomCode::MINUS, VKEY_OEM_PLUS},
212 // plus sign, *, *
213 /* 40 */ {0x002B, 0x2460, 0x2461, DomCode::BACKSLASH, VKEY_OEM_2},
214 // plus sign, *, *
215 /* 41 */ {0x002B, 0x2460, 0x2461, DomCode::BRACKET_LEFT, VKEY_OEM_PLUS},
216 // plus sign, *, *
217 /* 42 */ {0x002B, 0x2460, 0x2461, DomCode::BRACKET_RIGHT, VKEY_OEM_PLUS},
218 // plus sign, *, *
219 /* 43 */ {0x002B, 0x2460, 0x2461, DomCode::DIGIT1, VKEY_1},
220 // plus sign, *, *
221 /* 44 */ {0x002B, 0x2460, 0x2461, DomCode::EQUAL, VKEY_OEM_PLUS},
222 // plus sign, *, *
223 /* 45 */ {0x002B, 0x2460, 0x2461, DomCode::SEMICOLON, VKEY_OEM_PLUS},
224 // comma, *, *
225 /* 46 */ {0x002C, 0x2460, 0x2461, DomCode::COMMA, VKEY_OEM_COMMA},
226 // comma, *, *
227 /* 47 */ {0x002C, 0x2460, 0x2461, DomCode::DIGIT3, VKEY_3},
228 // comma, *, *
229 /* 48 */ {0x002C, 0x2460, 0x2461, DomCode::DIGIT5, VKEY_5},
230 // comma, *, *
231 /* 49 */ {0x002C, 0x2460, 0x2461, DomCode::DIGIT6, VKEY_6},
232 // comma, *, *
233 /* 50 */ {0x002C, 0x2460, 0x2461, DomCode::DIGIT9, VKEY_9},
234 // comma, *, *
235 /* 51 */ {0x002C, 0x2460, 0x2461, DomCode::KEY_M, VKEY_OEM_COMMA},
236 // comma, *, *
237 /* 52 */ {0x002C, 0x2460, 0x2461, DomCode::KEY_V, VKEY_OEM_COMMA},
238 // comma, *, *
239 /* 53 */ {0x002C, 0x2460, 0x2461, DomCode::KEY_W, VKEY_OEM_COMMA},
240 // hyphen-minus, equals sign, *
241 /* 54 */ {0x002D, 0x003D, 0x2461, DomCode::SLASH, VKEY_OEM_MINUS},
242 // hyphen-minus, low line, unmapped
243 /* 55 */ {0x002D, 0x005F, 0x0000, DomCode::EQUAL, VKEY_OEM_MINUS},
244 // hyphen-minus, low line, unmapped
245 /* 56 */ {0x002D, 0x005F, 0x0000, DomCode::SLASH, VKEY_OEM_MINUS},
246 // hyphen-minus, low line, asterisk
247 /* 57 */ {0x002D, 0x005F, 0x002A, DomCode::SLASH, VKEY_OEM_MINUS},
248 // hyphen-minus, low line, solidus
249 /* 58 */ {0x002D, 0x005F, 0x002F, DomCode::SLASH, VKEY_OEM_2},
250 // hyphen-minus, low line, n
251 /* 59 */ {0x002D, 0x005F, 0x006E, DomCode::SLASH, VKEY_OEM_MINUS},
252 // hyphen-minus, low line, r cedilla
253 /* 60 */ {0x002D, 0x005F, 0x0157, DomCode::EQUAL, VKEY_OEM_4},
254 // hyphen-minus, *, *
255 /* 61 */ {0x002D, 0x2460, 0x2461, DomCode::DIGIT2, VKEY_2},
256 // hyphen-minus, *, *
257 /* 62 */ {0x002D, 0x2460, 0x2461, DomCode::DIGIT6, VKEY_6},
258 // hyphen-minus, *, *
259 /* 63 */ {0x002D, 0x2460, 0x2461, DomCode::KEY_A, VKEY_OEM_MINUS},
260 // hyphen-minus, *, *
261 /* 64 */ {0x002D, 0x2460, 0x2461, DomCode::MINUS, VKEY_OEM_MINUS},
262 // hyphen-minus, *, *
263 /* 65 */ {0x002D, 0x2460, 0x2461, DomCode::QUOTE, VKEY_OEM_MINUS},
264 // full stop, *, *
265 /* 66 */ {0x002E, 0x2460, 0x2461, DomCode::DIGIT7, VKEY_7},
266 // full stop, *, *
267 /* 67 */ {0x002E, 0x2460, 0x2461, DomCode::DIGIT8, VKEY_8},
268 // full stop, *, *
269 /* 68 */ {0x002E, 0x2460, 0x2461, DomCode::KEY_E, VKEY_OEM_PERIOD},
270 // full stop, *, *
271 /* 69 */ {0x002E, 0x2460, 0x2461, DomCode::KEY_O, VKEY_OEM_PERIOD},
272 // full stop, *, *
273 /* 70 */ {0x002E, 0x2460, 0x2461, DomCode::KEY_R, VKEY_OEM_PERIOD},
274 // full stop, *, *
275 /* 71 */ {0x002E, 0x2460, 0x2461, DomCode::PERIOD, VKEY_OEM_PERIOD},
276 // full stop, *, *
277 /* 72 */ {0x002E, 0x2460, 0x2461, DomCode::QUOTE, VKEY_OEM_7},
278 // full stop, *, *
279 /* 73 */ {0x002E, 0x2460, 0x2461, DomCode::SLASH, VKEY_OEM_2},
280 // solidus, digit zero, *
281 /* 74 */ {0x002F, 0x0030, 0x2461, DomCode::DIGIT0, VKEY_0},
282 // solidus, digit three, *
283 /* 75 */ {0x002F, 0x0033, 0x2461, DomCode::DIGIT3, VKEY_3},
284 // solidus, question mark, *
285 /* 76 */ {0x002F, 0x003F, 0x2461, DomCode::DIGIT0, VKEY_OEM_2},
286 // solidus, question mark, *
287 /* 77 */ {0x002F, 0x003F, 0x2461, DomCode::DIGIT3, VKEY_OEM_2},
288 // solidus, *, *
289 /* 78 */ {0x002F, 0x2460, 0x2461, DomCode::BACKQUOTE, VKEY_OEM_7},
290 // solidus, *, *
291 /* 79 */ {0x002F, 0x2460, 0x2461, DomCode::BACKSLASH, VKEY_OEM_5},
292 // solidus, *, *
293 /* 80 */ {0x002F, 0x2460, 0x2461, DomCode::BRACKET_LEFT, VKEY_OEM_2},
294 // solidus, *, *
295 /* 81 */ {0x002F, 0x2460, 0x2461, DomCode::MINUS, VKEY_OEM_4},
296 // solidus, *, *
297 /* 82 */ {0x002F, 0x2460, 0x2461, DomCode::SLASH, VKEY_OEM_2},
298 // colon, *, *
299 /* 83 */ {0x003A, 0x2460, 0x2461, DomCode::DIGIT1, VKEY_1},
300 // colon, *, *
301 /* 84 */ {0x003A, 0x2460, 0x2461, DomCode::DIGIT5, VKEY_5},
302 // colon, *, *
303 /* 85 */ {0x003A, 0x2460, 0x2461, DomCode::DIGIT6, VKEY_6},
304 // colon, *, *
305 /* 86 */ {0x003A, 0x2460, 0x2461, DomCode::PERIOD, VKEY_OEM_2},
306 // semicolon, *, *
307 /* 87 */ {0x003B, 0x2460, 0x2461, DomCode::BACKQUOTE, VKEY_OEM_3},
308 // semicolon, *, *
309 /* 88 */ {0x003B, 0x2460, 0x2461, DomCode::BRACKET_LEFT, VKEY_OEM_1},
310 // semicolon, *, *
311 /* 89 */ {0x003B, 0x2460, 0x2461, DomCode::BRACKET_RIGHT, VKEY_OEM_6},
312 // semicolon, *, *
313 /* 90 */ {0x003B, 0x2460, 0x2461, DomCode::COMMA, VKEY_OEM_PERIOD},
314 // semicolon, *, *
315 /* 91 */ {0x003B, 0x2460, 0x2461, DomCode::DIGIT4, VKEY_4},
316 // semicolon, *, *
317 /* 92 */ {0x003B, 0x2460, 0x2461, DomCode::DIGIT8, VKEY_8},
318 // semicolon, *, *
319 /* 93 */ {0x003B, 0x2460, 0x2461, DomCode::KEY_Q, VKEY_OEM_1},
320 // semicolon, *, *
321 /* 94 */ {0x003B, 0x2460, 0x2461, DomCode::KEY_Z, VKEY_OEM_1},
322 // semicolon, *, *
323 /* 95 */ {0x003B, 0x2460, 0x2461, DomCode::SEMICOLON, VKEY_OEM_1},
324 // semicolon, *, *
325 /* 96 */ {0x003B, 0x2460, 0x2461, DomCode::SLASH, VKEY_OEM_2},
326 // less-than sign, *, *
327 /* 97 */ {0x003C, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_5},
328 // equals sign, percent sign, unmapped
329 /* 98 */ {0x003D, 0x0025, 0x0000, DomCode::MINUS, VKEY_OEM_PLUS},
330 // equals sign, percent sign, hyphen-minus
331 /* 99 */ {0x003D, 0x0025, 0x002D, DomCode::MINUS, VKEY_OEM_MINUS},
332 // equals sign, percent sign, *
333 /* 100 */ {0x003D, 0x0025, 0x2461, DomCode::SLASH, VKEY_OEM_8},
334 // equals sign, plus sign, *
335 /* 101 */ {0x003D, 0x002B, 0x2461, DomCode::SLASH, VKEY_OEM_PLUS},
336 // equals sign, *, *
337 /* 102 */ {0x003D, 0x2460, 0x2461, DomCode::BRACKET_RIGHT, VKEY_OEM_PLUS},
338 // equals sign, *, *
339 /* 103 */ {0x003D, 0x2460, 0x2461, DomCode::DIGIT8, VKEY_8},
340 // equals sign, *, *
341 /* 104 */ {0x003D, 0x2460, 0x2461, DomCode::EQUAL, VKEY_OEM_PLUS},
342 // question mark, *, *
343 /* 105 */ {0x003F, 0x2460, 0x2461, DomCode::DIGIT2, VKEY_2},
344 // question mark, *, *
345 /* 106 */ {0x003F, 0x2460, 0x2461, DomCode::DIGIT7, VKEY_7},
346 // question mark, *, *
347 /* 107 */ {0x003F, 0x2460, 0x2461, DomCode::DIGIT8, VKEY_8},
348 // question mark, *, *
349 /* 108 */ {0x003F, 0x2460, 0x2461, DomCode::MINUS, VKEY_OEM_PLUS},
350 // commercial at, *, *
351 /* 109 */ {0x0040, 0x2460, 0x2461, DomCode::BACKQUOTE, VKEY_OEM_7},
352 // commercial at, *, *
353 /* 110 */ {0x0040, 0x2460, 0x2461, DomCode::BRACKET_RIGHT, VKEY_OEM_6},
354 // left square bracket, *, *
355 /* 111 */ {0x005B, 0x2460, 0x2461, DomCode::BRACKET_LEFT, VKEY_OEM_4},
356 // left square bracket, *, *
357 /* 112 */ {0x005B, 0x2460, 0x2461, DomCode::BRACKET_RIGHT, VKEY_OEM_6},
358 // left square bracket, *, *
359 /* 113 */ {0x005B, 0x2460, 0x2461, DomCode::DIGIT1, VKEY_OEM_4},
360 // left square bracket, *, *
361 /* 114 */ {0x005B, 0x2460, 0x2461, DomCode::MINUS, VKEY_OEM_4},
362 // left square bracket, *, *
363 /* 115 */ {0x005B, 0x2460, 0x2461, DomCode::QUOTE, VKEY_OEM_7},
364 // reverse solidus, solidus, *
365 /* 116 */ {0x005C, 0x002F, 0x2461, DomCode::BACKSLASH, VKEY_OEM_7},
366 // reverse solidus, vertical line, digit one
367 /* 117 */ {0x005C, 0x007C, 0x0031, DomCode::BACKQUOTE, VKEY_OEM_5},
368 // reverse solidus, vertical line, N cedilla
369 /* 118 */ {0x005C, 0x007C, 0x0145, DomCode::BACKQUOTE, VKEY_OEM_3},
370 // reverse solidus, vertical line, *
371 /* 119 */ {0x005C, 0x007C, 0x2461, DomCode::BACKSLASH, VKEY_OEM_5},
372 // reverse solidus, *, *
373 /* 120 */ {0x005C, 0x2460, 0x2461, DomCode::EQUAL, VKEY_OEM_4},
374 // right square bracket, *, *
375 /* 121 */ {0x005D, 0x2460, 0x2461, DomCode::BACKQUOTE, VKEY_OEM_3},
376 // right square bracket, *, *
377 /* 122 */ {0x005D, 0x2460, 0x2461, DomCode::BACKSLASH, VKEY_OEM_5},
378 // right square bracket, *, *
379 /* 123 */ {0x005D, 0x2460, 0x2461, DomCode::BRACKET_RIGHT, VKEY_OEM_6},
380 // right square bracket, *, *
381 /* 124 */ {0x005D, 0x2460, 0x2461, DomCode::DIGIT2, VKEY_OEM_6},
382 // right square bracket, *, *
383 /* 125 */ {0x005D, 0x2460, 0x2461, DomCode::EQUAL, VKEY_OEM_6},
384 // low line, *, *
385 /* 126 */ {0x005F, 0x2460, 0x2461, DomCode::DIGIT8, VKEY_8},
386 // low line, *, *
387 /* 127 */ {0x005F, 0x2460, 0x2461, DomCode::MINUS, VKEY_OEM_MINUS},
388 // grave accent, unmapped, *
389 /* 128 */ {0x0060, 0x0000, 0x2461, DomCode::BACKQUOTE, VKEY_OEM_3},
390 // grave accent, tilde, unmapped
391 /* 129 */ {0x0060, 0x007E, 0x0000, DomCode::BACKQUOTE, VKEY_OEM_3},
392 // grave accent, tilde, digit one
393 /* 130 */ {0x0060, 0x007E, 0x0031, DomCode::BACKQUOTE, VKEY_OEM_3},
394 // grave accent, tilde, semicolon
395 /* 131 */ {0x0060, 0x007E, 0x003B, DomCode::BACKQUOTE, VKEY_OEM_3},
396 // grave accent, tilde, grave accent
397 /* 132 */ {0x0060, 0x007E, 0x0060, DomCode::BACKQUOTE, VKEY_OEM_3},
398 // grave accent, tilde, inverted question mark
399 /* 133 */ {0x0060, 0x007E, 0x00BF, DomCode::BACKQUOTE, VKEY_OEM_3},
400 // grave accent, tilde, o double acute
401 /* 134 */ {0x0060, 0x007E, 0x0151, DomCode::BACKQUOTE, VKEY_OEM_3},
402 // grave accent, not sign, *
403 /* 135 */ {0x0060, 0x00AC, 0x2461, DomCode::BACKQUOTE, VKEY_OEM_8},
404 // left curly bracket, *, *
405 /* 136 */ {0x007B, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_7},
406 // vertical line, *, *
407 /* 137 */ {0x007C, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_5},
408 // right curly bracket, *, *
409 /* 138 */ {0x007D, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_2},
410 // tilde, *, *
411 /* 139 */ {0x007E, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_5},
412 // inverted exclamation mark, *, *
413 /* 140 */ {0x00A1, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_6},
414 // section sign, degree sign, *
415 /* 141 */ {0x00A7, 0x00B0, 0x2461, DomCode::BACKQUOTE, VKEY_OEM_2},
416 // section sign, vulgar fraction one half, *
417 /* 142 */ {0x00A7, 0x00BD, 0x2461, DomCode::BACKQUOTE, VKEY_OEM_5},
418 // section sign, *, *
419 /* 143 */ {0x00A7, 0x2460, 0x2461, DomCode::DIGIT4, VKEY_4},
420 // section sign, *, *
421 /* 144 */ {0x00A7, 0x2460, 0x2461, DomCode::DIGIT6, VKEY_6},
422 // section sign, *, *
423 /* 145 */ {0x00A7, 0x2460, 0x2461, DomCode::QUOTE, VKEY_OEM_7},
424 // left-pointing double angle quotation mark, *, *
425 /* 146 */ {0x00AB, 0x2460, 0x2461, DomCode::DIGIT8, VKEY_8},
426 // left-pointing double angle quotation mark, *, *
427 /* 147 */ {0x00AB, 0x2460, 0x2461, DomCode::EQUAL, VKEY_OEM_6},
428 // soft hyphen, *, *
429 /* 148 */ {0x00AD, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_3},
430 // degree sign, *, *
431 /* 149 */ {0x00B0, 0x2460, 0x2461, DomCode::BACKQUOTE, VKEY_OEM_7},
432 // degree sign, *, *
433 /* 150 */ {0x00B0, 0x2460, 0x2461, DomCode::EQUAL, VKEY_OEM_2},
434 // superscript two, *, *
435 /* 151 */ {0x00B2, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_7},
436 // micro sign, *, *
437 /* 152 */ {0x00B5, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_5},
438 // masculine ordinal indicator, *, *
439 /* 153 */ {0x00BA, 0x2460, 0x2461, DomCode::BACKQUOTE, VKEY_OEM_5},
440 // masculine ordinal indicator, *, *
441 /* 154 */ {0x00BA, 0x2460, 0x2461, DomCode::QUOTE, VKEY_OEM_7},
442 // right-pointing double angle quotation mark, *, *
443 /* 155 */ {0x00BB, 0x2460, 0x2461, DomCode::NONE, VKEY_9},
444 // vulgar fraction one half, *, *
445 /* 156 */ {0x00BD, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_5},
446 // inverted question mark, *, *
447 /* 157 */ {0x00BF, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_6},
448 // sharp s, *, *
449 /* 158 */ {0x00DF, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_4},
450 // a grave, degree sign, *
451 /* 159 */ {0x00E0, 0x00B0, 0x2461, DomCode::QUOTE, VKEY_OEM_7},
452 // a grave, a diaeresis, *
453 /* 160 */ {0x00E0, 0x00E4, 0x2461, DomCode::QUOTE, VKEY_OEM_5},
454 // a grave, *, *
455 /* 161 */ {0x00E0, 0x2460, 0x2461, DomCode::BACKSLASH, VKEY_OEM_5},
456 // a grave, *, *
457 /* 162 */ {0x00E0, 0x2460, 0x2461, DomCode::DIGIT0, VKEY_0},
458 // a acute, *, *
459 /* 163 */ {0x00E1, 0x2460, 0x2461, DomCode::DIGIT8, VKEY_8},
460 // a acute, *, *
461 /* 164 */ {0x00E1, 0x2460, 0x2461, DomCode::QUOTE, VKEY_OEM_7},
462 // a circumflex, *, *
463 /* 165 */ {0x00E2, 0x2460, 0x2461, DomCode::BACKSLASH, VKEY_OEM_5},
464 // a circumflex, *, *
465 /* 166 */ {0x00E2, 0x2460, 0x2461, DomCode::DIGIT2, VKEY_2},
466 // a diaeresis, A diaeresis, unmapped
467 /* 167 */ {0x00E4, 0x00C4, 0x0000, DomCode::QUOTE, VKEY_OEM_7},
468 // a diaeresis, A diaeresis, r caron
469 /* 168 */ {0x00E4, 0x00C4, 0x0159, DomCode::QUOTE, VKEY_OEM_7},
470 // a diaeresis, A diaeresis, S acute
471 /* 169 */ {0x00E4, 0x00C4, 0x015A, DomCode::QUOTE, VKEY_OEM_7},
472 // a diaeresis, a grave, *
473 /* 170 */ {0x00E4, 0x00E0, 0x2461, DomCode::QUOTE, VKEY_OEM_5},
474 // a diaeresis, *, *
475 /* 171 */ {0x00E4, 0x2460, 0x2461, DomCode::BRACKET_RIGHT, VKEY_OEM_6},
476 // a ring above, *, *
477 /* 172 */ {0x00E5, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_6},
478 // ae, *, *
479 /* 173 */ {0x00E6, 0x2460, 0x2461, DomCode::QUOTE, VKEY_OEM_7},
480 // ae, *, *
481 /* 174 */ {0x00E6, 0x2460, 0x2461, DomCode::SEMICOLON, VKEY_OEM_3},
482 // c cedilla, C cedilla, unmapped
483 /* 175 */ {0x00E7, 0x00C7, 0x0000, DomCode::SEMICOLON, VKEY_OEM_1},
484 // c cedilla, C cedilla, Thorn
485 /* 176 */ {0x00E7, 0x00C7, 0x00DE, DomCode::SEMICOLON, VKEY_OEM_3},
486 // c cedilla, *, *
487 /* 177 */ {0x00E7, 0x2460, 0x2461, DomCode::BACKSLASH, VKEY_OEM_2},
488 // c cedilla, *, *
489 /* 178 */ {0x00E7, 0x2460, 0x2461, DomCode::BRACKET_LEFT, VKEY_OEM_4},
490 // c cedilla, *, *
491 /* 179 */ {0x00E7, 0x2460, 0x2461, DomCode::BRACKET_RIGHT, VKEY_OEM_6},
492 // c cedilla, *, *
493 /* 180 */ {0x00E7, 0x2460, 0x2461, DomCode::COMMA, VKEY_OEM_COMMA},
494 // c cedilla, *, *
495 /* 181 */ {0x00E7, 0x2460, 0x2461, DomCode::DIGIT9, VKEY_9},
496 // c cedilla, *, *
497 /* 182 */ {0x00E7, 0x2460, 0x2461, DomCode::QUOTE, VKEY_OEM_7},
498 // e grave, *, *
499 /* 183 */ {0x00E8, 0x2460, 0x2461, DomCode::BRACKET_LEFT, VKEY_OEM_1},
500 // e grave, *, *
501 /* 184 */ {0x00E8, 0x2460, 0x2461, DomCode::DIGIT7, VKEY_7},
502 // e grave, *, *
503 /* 185 */ {0x00E8, 0x2460, 0x2461, DomCode::QUOTE, VKEY_OEM_3},
504 // e acute, E acute, *
505 /* 186 */ {0x00E9, 0x00C9, 0x2461, DomCode::SEMICOLON, VKEY_OEM_1},
506 // e acute, o diaeresis, *
507 /* 187 */ {0x00E9, 0x00F6, 0x2461, DomCode::SEMICOLON, VKEY_OEM_7},
508 // e acute, *, *
509 /* 188 */ {0x00E9, 0x2460, 0x2461, DomCode::DIGIT0, VKEY_0},
510 // e acute, *, *
511 /* 189 */ {0x00E9, 0x2460, 0x2461, DomCode::DIGIT2, VKEY_2},
512 // e acute, *, *
513 /* 190 */ {0x00E9, 0x2460, 0x2461, DomCode::SLASH, VKEY_OEM_2},
514 // e circumflex, *, *
515 /* 191 */ {0x00EA, 0x2460, 0x2461, DomCode::NONE, VKEY_3},
516 // e diaeresis, *, *
517 /* 192 */ {0x00EB, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_1},
518 // i grave, *, *
519 /* 193 */ {0x00EC, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_6},
520 // i acute, *, *
521 /* 194 */ {0x00ED, 0x2460, 0x2461, DomCode::BACKQUOTE, VKEY_0},
522 // i acute, *, *
523 /* 195 */ {0x00ED, 0x2460, 0x2461, DomCode::DIGIT9, VKEY_9},
524 // i circumflex, *, *
525 /* 196 */ {0x00EE, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_6},
526 // eth, *, *
527 /* 197 */ {0x00F0, 0x2460, 0x2461, DomCode::BRACKET_LEFT, VKEY_OEM_6},
528 // eth, *, *
529 /* 198 */ {0x00F0, 0x2460, 0x2461, DomCode::BRACKET_RIGHT, VKEY_OEM_1},
530 // n tilde, *, *
531 /* 199 */ {0x00F1, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_3},
532 // o grave, *, *
533 /* 200 */ {0x00F2, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_3},
534 // o acute, *, *
535 /* 201 */ {0x00F3, 0x2460, 0x2461, DomCode::BACKSLASH, VKEY_OEM_5},
536 // o acute, *, *
537 /* 202 */ {0x00F3, 0x2460, 0x2461, DomCode::EQUAL, VKEY_OEM_PLUS},
538 // o circumflex, *, *
539 /* 203 */ {0x00F4, 0x2460, 0x2461, DomCode::DIGIT4, VKEY_4},
540 // o circumflex, *, *
541 /* 204 */ {0x00F4, 0x2460, 0x2461, DomCode::SEMICOLON, VKEY_OEM_1},
542 // o tilde, *, *
543 /* 205 */ {0x00F5, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_4},
544 // o diaeresis, O diaeresis, unmapped
545 /* 206 */ {0x00F6, 0x00D6, 0x0000, DomCode::SEMICOLON, VKEY_OEM_3},
546 // o diaeresis, O diaeresis, T cedilla
547 /* 207 */ {0x00F6, 0x00D6, 0x0162, DomCode::SEMICOLON, VKEY_OEM_3},
548 // o diaeresis, e acute, *
549 /* 208 */ {0x00F6, 0x00E9, 0x2461, DomCode::SEMICOLON, VKEY_OEM_7},
550 // o diaeresis, *, *
551 /* 209 */ {0x00F6, 0x2460, 0x2461, DomCode::BRACKET_LEFT, VKEY_OEM_4},
552 // o diaeresis, *, *
553 /* 210 */ {0x00F6, 0x2460, 0x2461, DomCode::DIGIT0, VKEY_OEM_3},
554 // o diaeresis, *, *
555 /* 211 */ {0x00F6, 0x2460, 0x2461, DomCode::MINUS, VKEY_OEM_PLUS},
556 // division sign, *, *
557 /* 212 */ {0x00F7, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_6},
558 // o stroke, *, *
559 /* 213 */ {0x00F8, 0x2460, 0x2461, DomCode::QUOTE, VKEY_OEM_7},
560 // o stroke, *, *
561 /* 214 */ {0x00F8, 0x2460, 0x2461, DomCode::SEMICOLON, VKEY_OEM_3},
562 // u grave, *, *
563 /* 215 */ {0x00F9, 0x2460, 0x2461, DomCode::BACKSLASH, VKEY_OEM_2},
564 // u grave, *, *
565 /* 216 */ {0x00F9, 0x2460, 0x2461, DomCode::QUOTE, VKEY_OEM_3},
566 // u acute, *, *
567 /* 217 */ {0x00FA, 0x2460, 0x2461, DomCode::BRACKET_LEFT, VKEY_OEM_4},
568 // u acute, *, *
569 /* 218 */ {0x00FA, 0x2460, 0x2461, DomCode::BRACKET_RIGHT, VKEY_OEM_6},
570 // u diaeresis, U diaeresis, unmapped
571 /* 219 */ {0x00FC, 0x00DC, 0x0000, DomCode::BRACKET_LEFT, VKEY_OEM_1},
572 // u diaeresis, U diaeresis, unmapped
573 /* 220 */ {0x00FC, 0x00DC, 0x0000, DomCode::MINUS, VKEY_OEM_2},
574 // u diaeresis, U diaeresis, L stroke
575 /* 221 */ {0x00FC, 0x00DC, 0x0141, DomCode::BRACKET_LEFT, VKEY_OEM_3},
576 // u diaeresis, e grave, *
577 /* 222 */ {0x00FC, 0x00E8, 0x2461, DomCode::BRACKET_LEFT, VKEY_OEM_1},
578 // u diaeresis, *, *
579 /* 223 */ {0x00FC, 0x2460, 0x2461, DomCode::KEY_W, VKEY_W},
580 // y acute, *, *
581 /* 224 */ {0x00FD, 0x2460, 0x2461, DomCode::NONE, VKEY_7},
582 // thorn, *, *
583 /* 225 */ {0x00FE, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_MINUS},
584 // a macron, *, *
585 /* 226 */ {0x0101, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_8},
586 // a breve, *, *
587 /* 227 */ {0x0103, 0x2460, 0x2461, DomCode::BRACKET_LEFT, VKEY_OEM_4},
588 // a breve, *, *
589 /* 228 */ {0x0103, 0x2460, 0x2461, DomCode::DIGIT1, VKEY_1},
590 // a ogonek, *, *
591 /* 229 */ {0x0105, 0x2460, 0x2461, DomCode::DIGIT1, VKEY_1},
592 // a ogonek, *, *
593 /* 230 */ {0x0105, 0x2460, 0x2461, DomCode::KEY_Q, VKEY_Q},
594 // a ogonek, *, *
595 /* 231 */ {0x0105, 0x2460, 0x2461, DomCode::QUOTE, VKEY_OEM_7},
596 // c acute, *, *
597 /* 232 */ {0x0107, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_7},
598 // c dot above, *, *
599 /* 233 */ {0x010B, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_3},
600 // c caron, *, *
601 /* 234 */ {0x010D, 0x2460, 0x2461, DomCode::COMMA, VKEY_OEM_COMMA},
602 // c caron, *, *
603 /* 235 */ {0x010D, 0x2460, 0x2461, DomCode::DIGIT2, VKEY_2},
604 // c caron, *, *
605 /* 236 */ {0x010D, 0x2460, 0x2461, DomCode::DIGIT4, VKEY_4},
606 // c caron, *, *
607 /* 237 */ {0x010D, 0x2460, 0x2461, DomCode::KEY_P, VKEY_X},
608 // c caron, *, *
609 /* 238 */ {0x010D, 0x2460, 0x2461, DomCode::SEMICOLON, VKEY_OEM_1},
610 // d stroke, *, *
611 /* 239 */ {0x0111, 0x2460, 0x2461, DomCode::BRACKET_RIGHT, VKEY_OEM_6},
612 // d stroke, *, *
613 /* 240 */ {0x0111, 0x2460, 0x2461, DomCode::DIGIT0, VKEY_0},
614 // e macron, *, *
615 /* 241 */ {0x0113, 0x2460, 0x2461, DomCode::NONE, VKEY_W},
616 // e dot above, *, *
617 /* 242 */ {0x0117, 0x2460, 0x2461, DomCode::DIGIT4, VKEY_4},
618 // e dot above, *, *
619 /* 243 */ {0x0117, 0x2460, 0x2461, DomCode::QUOTE, VKEY_OEM_7},
620 // e ogonek, E ogonek, unmapped
621 /* 244 */ {0x0119, 0x0118, 0x0000, DomCode::SLASH, VKEY_OEM_MINUS},
622 // e ogonek, E ogonek, n
623 /* 245 */ {0x0119, 0x0118, 0x006E, DomCode::SLASH, VKEY_OEM_2},
624 // e ogonek, *, *
625 /* 246 */ {0x0119, 0x2460, 0x2461, DomCode::DIGIT3, VKEY_3},
626 // e caron, *, *
627 /* 247 */ {0x011B, 0x2460, 0x2461, DomCode::NONE, VKEY_2},
628 // g breve, *, *
629 /* 248 */ {0x011F, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_6},
630 // g dot above, *, *
631 /* 249 */ {0x0121, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_4},
632 // h stroke, *, *
633 /* 250 */ {0x0127, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_6},
634 // i macron, *, *
635 /* 251 */ {0x012B, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_6},
636 // i ogonek, I ogonek, unmapped
637 /* 252 */ {0x012F, 0x012E, 0x0000, DomCode::BRACKET_LEFT, VKEY_OEM_4},
638 // i ogonek, *, *
639 /* 253 */ {0x012F, 0x2460, 0x2461, DomCode::DIGIT5, VKEY_5},
640 // dotless i, *, *
641 /* 254 */ {0x0131, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_1},
642 // k cedilla, *, *
643 /* 255 */ {0x0137, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_5},
644 // l cedilla, *, *
645 /* 256 */ {0x013C, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_2},
646 // l caron, *, *
647 /* 257 */ {0x013E, 0x2460, 0x2461, DomCode::NONE, VKEY_2},
648 // l stroke, *, *
649 /* 258 */ {0x0142, 0x2460, 0x2461, DomCode::BACKSLASH, VKEY_OEM_2},
650 // l stroke, *, *
651 /* 259 */ {0x0142, 0x2460, 0x2461, DomCode::SEMICOLON, VKEY_OEM_1},
652 // n cedilla, *, *
653 /* 260 */ {0x0146, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_4},
654 // n caron, *, *
655 /* 261 */ {0x0148, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_5},
656 // o double acute, *, *
657 /* 262 */ {0x0151, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_4},
658 // r caron, *, *
659 /* 263 */ {0x0159, 0x2460, 0x2461, DomCode::NONE, VKEY_5},
660 // s cedilla, *, *
661 /* 264 */ {0x015F, 0x2460, 0x2461, DomCode::PERIOD, VKEY_OEM_PERIOD},
662 // s cedilla, *, *
663 /* 265 */ {0x015F, 0x2460, 0x2461, DomCode::SEMICOLON, VKEY_OEM_1},
664 // s caron, *, *
665 /* 266 */ {0x0161, 0x2460, 0x2461, DomCode::BRACKET_LEFT, VKEY_OEM_4},
666 // s caron, *, *
667 /* 267 */ {0x0161, 0x2460, 0x2461, DomCode::DIGIT3, VKEY_3},
668 // s caron, *, *
669 /* 268 */ {0x0161, 0x2460, 0x2461, DomCode::DIGIT6, VKEY_6},
670 // s caron, *, *
671 /* 269 */ {0x0161, 0x2460, 0x2461, DomCode::KEY_A, VKEY_OEM_1},
672 // s caron, *, *
673 /* 270 */ {0x0161, 0x2460, 0x2461, DomCode::KEY_F, VKEY_F},
674 // s caron, *, *
675 /* 271 */ {0x0161, 0x2460, 0x2461, DomCode::PERIOD, VKEY_OEM_PERIOD},
676 // t cedilla, *, *
677 /* 272 */ {0x0163, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_7},
678 // t caron, *, *
679 /* 273 */ {0x0165, 0x2460, 0x2461, DomCode::NONE, VKEY_5},
680 // u macron, *, *
681 /* 274 */ {0x016B, 0x2460, 0x2461, DomCode::DIGIT8, VKEY_8},
682 // u macron, *, *
683 /* 275 */ {0x016B, 0x2460, 0x2461, DomCode::KEY_Q, VKEY_Q},
684 // u macron, *, *
685 /* 276 */ {0x016B, 0x2460, 0x2461, DomCode::KEY_X, VKEY_X},
686 // u ring above, *, *
687 /* 277 */ {0x016F, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_1},
688 // u double acute, *, *
689 /* 278 */ {0x0171, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_5},
690 // u ogonek, U ogonek, unmapped
691 /* 279 */ {0x0173, 0x0172, 0x0000, DomCode::SEMICOLON, VKEY_OEM_3},
692 // u ogonek, U ogonek, T cedilla
693 /* 280 */ {0x0173, 0x0172, 0x0162, DomCode::SEMICOLON, VKEY_OEM_1},
694 // u ogonek, *, *
695 /* 281 */ {0x0173, 0x2460, 0x2461, DomCode::DIGIT7, VKEY_7},
696 // z dot above, *, *
697 /* 282 */ {0x017C, 0x2460, 0x2461, DomCode::BACKSLASH, VKEY_OEM_5},
698 // z dot above, *, *
699 /* 283 */ {0x017C, 0x2460, 0x2461, DomCode::BRACKET_LEFT, VKEY_OEM_4},
700 // z caron, *, *
701 /* 284 */ {0x017E, 0x2460, 0x2461, DomCode::BACKSLASH, VKEY_OEM_5},
702 // z caron, *, *
703 /* 285 */ {0x017E, 0x2460, 0x2461, DomCode::BRACKET_LEFT, VKEY_Y},
704 // z caron, *, *
705 /* 286 */ {0x017E, 0x2460, 0x2461, DomCode::DIGIT6, VKEY_6},
706 // z caron, *, *
707 /* 287 */ {0x017E, 0x2460, 0x2461, DomCode::EQUAL, VKEY_OEM_PLUS},
708 // z caron, *, *
709 /* 288 */ {0x017E, 0x2460, 0x2461, DomCode::KEY_W, VKEY_W},
710 // o horn, *, *
711 /* 289 */ {0x01A1, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_6},
712 // u horn, *, *
713 /* 290 */ {0x01B0, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_4},
714 // z stroke, *, *
715 /* 291 */ {0x01B6, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_6},
716 // schwa, *, *
717 /* 292 */ {0x0259, 0x2460, 0x2461, DomCode::NONE, VKEY_OEM_3},
719 // Simple alphanumeric cases.
720 /* 293 */ {'a', 'A', '?', DomCode::NONE, VKEY_A},
721 /* 294 */ {'z', 'Z', '!', DomCode::NONE, VKEY_Z},
722 /* 295 */ {'9', '(', '+', DomCode::NONE, VKEY_9},
723 /* 296 */ {'0', ')', '-', DomCode::NONE, VKEY_0},
726 for (size_t i = 0; i < arraysize(kVkeyTestCase); ++i) {
727 SCOPED_TRACE(i);
728 const VkTestXkbKeyboardLayoutEngine::Entry* e = &kVkeyTestCase[i];
729 layout_engine_->SetEntry(e);
731 // Test with predetermined plain character.
732 KeyboardCode key_code = layout_engine_->GetKeyboardCode(
733 e->dom_code, EF_NONE, e->plain_character);
734 EXPECT_EQ(e->key_code, key_code);
736 if (e->shift_character) {
737 // Test with predetermined shifted character.
738 key_code = layout_engine_->GetKeyboardCode(e->dom_code, EF_SHIFT_DOWN,
739 e->shift_character);
740 EXPECT_EQ(e->key_code, key_code);
743 if (e->altgr_character) {
744 // Test with predetermined AltGr character.
745 key_code = layout_engine_->GetKeyboardCode(e->dom_code, EF_ALTGR_DOWN,
746 e->altgr_character);
747 EXPECT_EQ(e->key_code, key_code);
750 // Test with unrelated predetermined character.
751 key_code =
752 layout_engine_->GetKeyboardCode(e->dom_code, EF_MOD3_DOWN, 0xFFFFu);
753 EXPECT_EQ(e->key_code, key_code);
757 TEST_F(XkbLayoutEngineVkTest, XkbRuleNamesForLayoutName) {
758 static const VkTestXkbKeyboardLayoutEngine::RuleNames kVkeyTestCase[] = {
759 /* 0 */ {"us", "us", ""},
760 /* 1 */ {"jp", "jp", ""},
761 /* 2 */ {"us(intl)", "us", "intl"},
762 /* 3 */ {"us(altgr-intl)", "us", "altgr-intl"},
763 /* 4 */ {"us(dvorak)", "us", "dvorak"},
764 /* 5 */ {"us(colemak)", "us", "colemak"},
765 /* 6 */ {"be", "be", ""},
766 /* 7 */ {"fr", "fr", ""},
767 /* 8 */ {"ca", "ca", ""},
768 /* 9 */ {"ch(fr)", "ch", "fr"},
769 /* 10 */ {"ca(multix)", "ca", "multix"},
770 /* 11 */ {"de", "de", ""},
771 /* 12 */ {"de(neo)", "de", "neo"},
772 /* 13 */ {"ch", "ch", ""},
773 /* 14 */ {"ru", "ru", ""},
774 /* 15 */ {"ru(phonetic)", "ru", "phonetic"},
775 /* 16 */ {"br", "br", ""},
776 /* 17 */ {"bg", "bg", ""},
777 /* 18 */ {"bg(phonetic)", "bg", "phonetic"},
778 /* 19 */ {"ca(eng)", "ca", "eng"},
779 /* 20 */ {"cz", "cz", ""},
780 /* 21 */ {"cz(qwerty)", "cz", "qwerty"},
781 /* 22 */ {"ee", "ee", ""},
782 /* 23 */ {"es", "es", ""},
783 /* 24 */ {"es(cat)", "es", "cat"},
784 /* 25 */ {"dk", "dk", ""},
785 /* 26 */ {"gr", "gr", ""},
786 /* 27 */ {"il", "il", ""},
787 /* 28 */ {"latam", "latam", ""},
788 /* 29 */ {"lt", "lt", ""},
789 /* 30 */ {"lv(apostrophe)", "lv", "apostrophe"},
790 /* 31 */ {"hr", "hr", ""},
791 /* 32 */ {"gb(extd)", "gb", "extd"},
792 /* 33 */ {"gb(dvorak)", "gb", "dvorak"},
793 /* 34 */ {"fi", "fi", ""},
794 /* 35 */ {"hu", "hu", ""},
795 /* 36 */ {"it", "it", ""},
796 /* 37 */ {"is", "is", ""},
797 /* 38 */ {"no", "no", ""},
798 /* 39 */ {"pl", "pl", ""},
799 /* 40 */ {"pt", "pt", ""},
800 /* 41 */ {"ro", "ro", ""},
801 /* 42 */ {"se", "se", ""},
802 /* 43 */ {"sk", "sk", ""},
803 /* 44 */ {"si", "si", ""},
804 /* 45 */ {"rs", "rs", ""},
805 /* 46 */ {"tr", "tr", ""},
806 /* 47 */ {"ua", "ua", ""},
807 /* 48 */ {"by", "by", ""},
808 /* 49 */ {"am", "am", ""},
809 /* 50 */ {"ge", "ge", ""},
810 /* 51 */ {"mn", "mn", ""},
811 /* 52 */ {"ie", "ie", ""}};
812 for (size_t i = 0; i < arraysize(kVkeyTestCase); ++i) {
813 SCOPED_TRACE(i);
814 const VkTestXkbKeyboardLayoutEngine::RuleNames* e = &kVkeyTestCase[i];
815 std::string layout_id;
816 std::string layout_variant;
817 XkbKeyboardLayoutEngine::ParseLayoutName(e->layout_name, &layout_id,
818 &layout_variant);
819 EXPECT_EQ(layout_id, e->layout);
820 EXPECT_EQ(layout_variant, e->variant);
824 } // namespace ui