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