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