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"
17 // This XkbKeyCodeConverter simply uses the numeric value of the DomCode.
18 class VkTestXkbKeyCodeConverter
: public XkbKeyCodeConverter
{
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
{
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
;
47 std::string layout_name
;
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
,
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
,
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
) {
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
));
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
:
107 case EntryType::PRINTABLE
:
108 if (!printable_entry_
||
110 static_cast<xkb_keycode_t
>(printable_entry_
->dom_code
))) {
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
;
118 *character
= printable_entry_
->plain_character
;
119 *xkb_keysym
= CharacterToKeySym(*character
);
120 return *character
!= 0;
121 case EntryType::KEYSYM
:
122 if (!keysym_entry_
||
124 static_cast<xkb_keycode_t
>(keysym_entry_
->dom_code
))) {
127 *xkb_keysym
= keysym_entry_
->keysym
;
135 EntryType entry_type_
;
136 const PrintableEntry
* printable_entry_
;
137 const KeysymEntry
* keysym_entry_
;
140 } // anonymous namespace
142 class XkbLayoutEngineVkTest
: public testing::Test
{
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
{}
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
},
183 /* 7 */ {{0x0023, 0x2460, 0x2461, DomCode::BACKQUOTE
}, VKEY_OEM_7
},
185 /* 8 */ {{0x0024, 0x2460, 0x2461, DomCode::BACKSLASH
}, VKEY_OEM_8
},
187 /* 9 */ {{0x0024, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
}, VKEY_OEM_1
},
188 // percent sign, *, *
189 /* 10 */ {{0x0025, 0x2460, 0x2461, DomCode::NONE
}, VKEY_5
},
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
},
219 /* 25 */ {{0x0027, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
}, VKEY_OEM_1
},
221 /* 26 */ {{0x0027, 0x2460, 0x2461, DomCode::DIGIT4
}, VKEY_4
},
223 /* 27 */ {{0x0027, 0x2460, 0x2461, DomCode::KEY_Q
}, VKEY_OEM_7
},
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
},
239 /* 35 */ {{0x002A, 0x2460, 0x2461, DomCode::BACKSLASH
}, VKEY_OEM_5
},
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
},
249 /* 40 */ {{0x002B, 0x2460, 0x2461, DomCode::BACKSLASH
}, VKEY_OEM_2
},
251 /* 41 */ {{0x002B, 0x2460, 0x2461, DomCode::BRACKET_LEFT
}, VKEY_OEM_PLUS
},
253 /* 42 */ {{0x002B, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
},
256 /* 43 */ {{0x002B, 0x2460, 0x2461, DomCode::DIGIT1
}, VKEY_1
},
258 /* 44 */ {{0x002B, 0x2460, 0x2461, DomCode::EQUAL
}, VKEY_OEM_PLUS
},
260 /* 45 */ {{0x002B, 0x2460, 0x2461, DomCode::SEMICOLON
}, VKEY_OEM_PLUS
},
262 /* 46 */ {{0x002C, 0x2460, 0x2461, DomCode::COMMA
}, VKEY_OEM_COMMA
},
264 /* 47 */ {{0x002C, 0x2460, 0x2461, DomCode::DIGIT3
}, VKEY_3
},
266 /* 48 */ {{0x002C, 0x2460, 0x2461, DomCode::DIGIT5
}, VKEY_5
},
268 /* 49 */ {{0x002C, 0x2460, 0x2461, DomCode::DIGIT6
}, VKEY_6
},
270 /* 50 */ {{0x002C, 0x2460, 0x2461, DomCode::DIGIT9
}, VKEY_9
},
272 /* 51 */ {{0x002C, 0x2460, 0x2461, DomCode::KEY_M
}, VKEY_OEM_COMMA
},
274 /* 52 */ {{0x002C, 0x2460, 0x2461, DomCode::KEY_V
}, VKEY_OEM_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
},
302 /* 66 */ {{0x002E, 0x2460, 0x2461, DomCode::DIGIT7
}, VKEY_7
},
304 /* 67 */ {{0x002E, 0x2460, 0x2461, DomCode::DIGIT8
}, VKEY_8
},
306 /* 68 */ {{0x002E, 0x2460, 0x2461, DomCode::KEY_E
}, VKEY_OEM_PERIOD
},
308 /* 69 */ {{0x002E, 0x2460, 0x2461, DomCode::KEY_O
}, VKEY_OEM_PERIOD
},
310 /* 70 */ {{0x002E, 0x2460, 0x2461, DomCode::KEY_R
}, VKEY_OEM_PERIOD
},
312 /* 71 */ {{0x002E, 0x2460, 0x2461, DomCode::PERIOD
}, VKEY_OEM_PERIOD
},
314 /* 72 */ {{0x002E, 0x2460, 0x2461, DomCode::QUOTE
}, VKEY_OEM_7
},
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
},
326 /* 78 */ {{0x002F, 0x2460, 0x2461, DomCode::BACKQUOTE
}, VKEY_OEM_7
},
328 /* 79 */ {{0x002F, 0x2460, 0x2461, DomCode::BACKSLASH
}, VKEY_OEM_5
},
330 /* 80 */ {{0x002F, 0x2460, 0x2461, DomCode::BRACKET_LEFT
}, VKEY_OEM_2
},
332 /* 81 */ {{0x002F, 0x2460, 0x2461, DomCode::MINUS
}, VKEY_OEM_4
},
334 /* 82 */ {{0x002F, 0x2460, 0x2461, DomCode::SLASH
}, VKEY_OEM_2
},
336 /* 83 */ {{0x003A, 0x2460, 0x2461, DomCode::DIGIT1
}, VKEY_1
},
338 /* 84 */ {{0x003A, 0x2460, 0x2461, DomCode::DIGIT5
}, VKEY_5
},
340 /* 85 */ {{0x003A, 0x2460, 0x2461, DomCode::DIGIT6
}, VKEY_6
},
342 /* 86 */ {{0x003A, 0x2460, 0x2461, DomCode::PERIOD
}, VKEY_OEM_2
},
344 /* 87 */ {{0x003B, 0x2460, 0x2461, DomCode::BACKQUOTE
}, VKEY_OEM_3
},
346 /* 88 */ {{0x003B, 0x2460, 0x2461, DomCode::BRACKET_LEFT
}, VKEY_OEM_1
},
348 /* 89 */ {{0x003B, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
}, VKEY_OEM_6
},
350 /* 90 */ {{0x003B, 0x2460, 0x2461, DomCode::COMMA
}, VKEY_OEM_PERIOD
},
352 /* 91 */ {{0x003B, 0x2460, 0x2461, DomCode::DIGIT4
}, VKEY_4
},
354 /* 92 */ {{0x003B, 0x2460, 0x2461, DomCode::DIGIT8
}, VKEY_8
},
356 /* 93 */ {{0x003B, 0x2460, 0x2461, DomCode::KEY_Q
}, VKEY_OEM_1
},
358 /* 94 */ {{0x003B, 0x2460, 0x2461, DomCode::KEY_Z
}, VKEY_OEM_1
},
360 /* 95 */ {{0x003B, 0x2460, 0x2461, DomCode::SEMICOLON
}, VKEY_OEM_1
},
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
},
374 /* 102 */ {{0x003D, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
},
377 /* 103 */ {{0x003D, 0x2460, 0x2461, DomCode::DIGIT8
}, VKEY_8
},
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
},
423 /* 126 */ {{0x005F, 0x2460, 0x2461, DomCode::DIGIT8
}, VKEY_8
},
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
},
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
},
467 /* 148 */ {{0x00AD, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_3
},
469 /* 149 */ {{0x00B0, 0x2460, 0x2461, DomCode::BACKQUOTE
}, VKEY_OEM_7
},
471 /* 150 */ {{0x00B0, 0x2460, 0x2461, DomCode::EQUAL
}, VKEY_OEM_2
},
472 // superscript two, *, *
473 /* 151 */ {{0x00B2, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_7
},
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
},
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
},
493 /* 161 */ {{0x00E0, 0x2460, 0x2461, DomCode::BACKSLASH
}, VKEY_OEM_5
},
495 /* 162 */ {{0x00E0, 0x2460, 0x2461, DomCode::DIGIT0
}, VKEY_0
},
497 /* 163 */ {{0x00E1, 0x2460, 0x2461, DomCode::DIGIT8
}, VKEY_8
},
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
},
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
},
517 /* 173 */ {{0x00E6, 0x2460, 0x2461, DomCode::QUOTE
}, VKEY_OEM_7
},
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
},
525 /* 177 */ {{0x00E7, 0x2460, 0x2461, DomCode::BACKSLASH
}, VKEY_OEM_2
},
527 /* 178 */ {{0x00E7, 0x2460, 0x2461, DomCode::BRACKET_LEFT
}, VKEY_OEM_4
},
529 /* 179 */ {{0x00E7, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
}, VKEY_OEM_6
},
531 /* 180 */ {{0x00E7, 0x2460, 0x2461, DomCode::COMMA
}, VKEY_OEM_COMMA
},
533 /* 181 */ {{0x00E7, 0x2460, 0x2461, DomCode::DIGIT9
}, VKEY_9
},
535 /* 182 */ {{0x00E7, 0x2460, 0x2461, DomCode::QUOTE
}, VKEY_OEM_7
},
537 /* 183 */ {{0x00E8, 0x2460, 0x2461, DomCode::BRACKET_LEFT
}, VKEY_OEM_1
},
539 /* 184 */ {{0x00E8, 0x2460, 0x2461, DomCode::DIGIT7
}, VKEY_7
},
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
},
547 /* 188 */ {{0x00E9, 0x2460, 0x2461, DomCode::DIGIT0
}, VKEY_0
},
549 /* 189 */ {{0x00E9, 0x2460, 0x2461, DomCode::DIGIT2
}, VKEY_2
},
551 /* 190 */ {{0x00E9, 0x2460, 0x2461, DomCode::SLASH
}, VKEY_OEM_2
},
552 // e circumflex, *, *
553 /* 191 */ {{0x00EA, 0x2460, 0x2461, DomCode::NONE
}, VKEY_3
},
555 /* 192 */ {{0x00EB, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_1
},
557 /* 193 */ {{0x00EC, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_6
},
559 /* 194 */ {{0x00ED, 0x2460, 0x2461, DomCode::BACKQUOTE
}, VKEY_0
},
561 /* 195 */ {{0x00ED, 0x2460, 0x2461, DomCode::DIGIT9
}, VKEY_9
},
562 // i circumflex, *, *
563 /* 196 */ {{0x00EE, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_6
},
565 /* 197 */ {{0x00F0, 0x2460, 0x2461, DomCode::BRACKET_LEFT
}, VKEY_OEM_6
},
567 /* 198 */ {{0x00F0, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
}, VKEY_OEM_1
},
569 /* 199 */ {{0x00F1, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_3
},
571 /* 200 */ {{0x00F2, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_3
},
573 /* 201 */ {{0x00F3, 0x2460, 0x2461, DomCode::BACKSLASH
}, VKEY_OEM_5
},
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
},
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
},
589 /* 209 */ {{0x00F6, 0x2460, 0x2461, DomCode::BRACKET_LEFT
}, VKEY_OEM_4
},
591 /* 210 */ {{0x00F6, 0x2460, 0x2461, DomCode::DIGIT0
}, VKEY_OEM_3
},
593 /* 211 */ {{0x00F6, 0x2460, 0x2461, DomCode::MINUS
}, VKEY_OEM_PLUS
},
594 // division sign, *, *
595 /* 212 */ {{0x00F7, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_6
},
597 /* 213 */ {{0x00F8, 0x2460, 0x2461, DomCode::QUOTE
}, VKEY_OEM_7
},
599 /* 214 */ {{0x00F8, 0x2460, 0x2461, DomCode::SEMICOLON
}, VKEY_OEM_3
},
601 /* 215 */ {{0x00F9, 0x2460, 0x2461, DomCode::BACKSLASH
}, VKEY_OEM_2
},
603 /* 216 */ {{0x00F9, 0x2460, 0x2461, DomCode::QUOTE
}, VKEY_OEM_3
},
605 /* 217 */ {{0x00FA, 0x2460, 0x2461, DomCode::BRACKET_LEFT
}, VKEY_OEM_4
},
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
},
617 /* 223 */ {{0x00FC, 0x2460, 0x2461, DomCode::KEY_W
}, VKEY_W
},
619 /* 224 */ {{0x00FD, 0x2460, 0x2461, DomCode::NONE
}, VKEY_7
},
621 /* 225 */ {{0x00FE, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_MINUS
},
623 /* 226 */ {{0x0101, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_8
},
625 /* 227 */ {{0x0103, 0x2460, 0x2461, DomCode::BRACKET_LEFT
}, VKEY_OEM_4
},
627 /* 228 */ {{0x0103, 0x2460, 0x2461, DomCode::DIGIT1
}, VKEY_1
},
629 /* 229 */ {{0x0105, 0x2460, 0x2461, DomCode::DIGIT1
}, VKEY_1
},
631 /* 230 */ {{0x0105, 0x2460, 0x2461, DomCode::KEY_Q
}, VKEY_Q
},
633 /* 231 */ {{0x0105, 0x2460, 0x2461, DomCode::QUOTE
}, VKEY_OEM_7
},
635 /* 232 */ {{0x0107, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_7
},
637 /* 233 */ {{0x010B, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_3
},
639 /* 234 */ {{0x010D, 0x2460, 0x2461, DomCode::COMMA
}, VKEY_OEM_COMMA
},
641 /* 235 */ {{0x010D, 0x2460, 0x2461, DomCode::DIGIT2
}, VKEY_2
},
643 /* 236 */ {{0x010D, 0x2460, 0x2461, DomCode::DIGIT4
}, VKEY_4
},
645 /* 237 */ {{0x010D, 0x2460, 0x2461, DomCode::KEY_P
}, VKEY_X
},
647 /* 238 */ {{0x010D, 0x2460, 0x2461, DomCode::SEMICOLON
}, VKEY_OEM_1
},
649 /* 239 */ {{0x0111, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
}, VKEY_OEM_6
},
651 /* 240 */ {{0x0111, 0x2460, 0x2461, DomCode::DIGIT0
}, VKEY_0
},
653 /* 241 */ {{0x0113, 0x2460, 0x2461, DomCode::NONE
}, VKEY_W
},
655 /* 242 */ {{0x0117, 0x2460, 0x2461, DomCode::DIGIT4
}, VKEY_4
},
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
},
663 /* 246 */ {{0x0119, 0x2460, 0x2461, DomCode::DIGIT3
}, VKEY_3
},
665 /* 247 */ {{0x011B, 0x2460, 0x2461, DomCode::NONE
}, VKEY_2
},
667 /* 248 */ {{0x011F, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_6
},
669 /* 249 */ {{0x0121, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_4
},
671 /* 250 */ {{0x0127, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_6
},
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
},
677 /* 253 */ {{0x012F, 0x2460, 0x2461, DomCode::DIGIT5
}, VKEY_5
},
679 /* 254 */ {{0x0131, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_1
},
681 /* 255 */ {{0x0137, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_5
},
683 /* 256 */ {{0x013C, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_2
},
685 /* 257 */ {{0x013E, 0x2460, 0x2461, DomCode::NONE
}, VKEY_2
},
687 /* 258 */ {{0x0142, 0x2460, 0x2461, DomCode::BACKSLASH
}, VKEY_OEM_2
},
689 /* 259 */ {{0x0142, 0x2460, 0x2461, DomCode::SEMICOLON
}, VKEY_OEM_1
},
691 /* 260 */ {{0x0146, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_4
},
693 /* 261 */ {{0x0148, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_5
},
694 // o double acute, *, *
695 /* 262 */ {{0x0151, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_4
},
697 /* 263 */ {{0x0159, 0x2460, 0x2461, DomCode::NONE
}, VKEY_5
},
699 /* 264 */ {{0x015F, 0x2460, 0x2461, DomCode::PERIOD
}, VKEY_OEM_PERIOD
},
701 /* 265 */ {{0x015F, 0x2460, 0x2461, DomCode::SEMICOLON
}, VKEY_OEM_1
},
703 /* 266 */ {{0x0161, 0x2460, 0x2461, DomCode::BRACKET_LEFT
}, VKEY_OEM_4
},
705 /* 267 */ {{0x0161, 0x2460, 0x2461, DomCode::DIGIT3
}, VKEY_3
},
707 /* 268 */ {{0x0161, 0x2460, 0x2461, DomCode::DIGIT6
}, VKEY_6
},
709 /* 269 */ {{0x0161, 0x2460, 0x2461, DomCode::KEY_A
}, VKEY_OEM_1
},
711 /* 270 */ {{0x0161, 0x2460, 0x2461, DomCode::KEY_F
}, VKEY_F
},
713 /* 271 */ {{0x0161, 0x2460, 0x2461, DomCode::PERIOD
}, VKEY_OEM_PERIOD
},
715 /* 272 */ {{0x0163, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_7
},
717 /* 273 */ {{0x0165, 0x2460, 0x2461, DomCode::NONE
}, VKEY_5
},
719 /* 274 */ {{0x016B, 0x2460, 0x2461, DomCode::DIGIT8
}, VKEY_8
},
721 /* 275 */ {{0x016B, 0x2460, 0x2461, DomCode::KEY_Q
}, VKEY_Q
},
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
},
733 /* 281 */ {{0x0173, 0x2460, 0x2461, DomCode::DIGIT7
}, VKEY_7
},
735 /* 282 */ {{0x017C, 0x2460, 0x2461, DomCode::BACKSLASH
}, VKEY_OEM_5
},
737 /* 283 */ {{0x017C, 0x2460, 0x2461, DomCode::BRACKET_LEFT
}, VKEY_OEM_4
},
739 /* 284 */ {{0x017E, 0x2460, 0x2461, DomCode::BACKSLASH
}, VKEY_OEM_5
},
741 /* 285 */ {{0x017E, 0x2460, 0x2461, DomCode::BRACKET_LEFT
}, VKEY_Y
},
743 /* 286 */ {{0x017E, 0x2460, 0x2461, DomCode::DIGIT6
}, VKEY_6
},
745 /* 287 */ {{0x017E, 0x2460, 0x2461, DomCode::EQUAL
}, VKEY_OEM_PLUS
},
747 /* 288 */ {{0x017E, 0x2460, 0x2461, DomCode::KEY_W
}, VKEY_W
},
749 /* 289 */ {{0x01A1, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_6
},
751 /* 290 */ {{0x01B0, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_4
},
753 /* 291 */ {{0x01B6, 0x2460, 0x2461, DomCode::NONE
}, VKEY_OEM_6
},
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
) {
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.
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
;
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
) {
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
,
893 EXPECT_EQ(layout_id
, e
->layout
);
894 EXPECT_EQ(layout_variant
, e
->variant
);