OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h" | 5 #include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 int state = (((flags & EF_ALTGR_DOWN) == EF_ALTGR_DOWN) << 1) | | 270 int state = (((flags & EF_ALTGR_DOWN) == EF_ALTGR_DOWN) << 1) | |
271 ((flags & EF_SHIFT_DOWN) == EF_SHIFT_DOWN); | 271 ((flags & EF_SHIFT_DOWN) == EF_SHIFT_DOWN); |
272 base::char16 ch = e->character[state]; | 272 base::char16 ch = e->character[state]; |
273 *out_dom_key = (ch & DK) ? DomKey::DEAD : DomKey::CHARACTER; | 273 *out_dom_key = (ch & DK) ? DomKey::DEAD : DomKey::CHARACTER; |
274 *out_character = ch; | 274 *out_character = ch; |
275 if ((flags & EF_CAPS_LOCK_DOWN) == EF_CAPS_LOCK_DOWN) { | 275 if ((flags & EF_CAPS_LOCK_DOWN) == EF_CAPS_LOCK_DOWN) { |
276 ch = (ch & ~DK) | 0x20; | 276 ch = (ch & ~DK) | 0x20; |
277 if ((ch >= 'a') && (ch <= 'z')) | 277 if ((ch >= 'a') && (ch <= 'z')) |
278 *out_character = e->character[state ^ 1]; | 278 *out_character = e->character[state ^ 1]; |
279 } | 279 } |
280 *out_key_code = DomCodeToKeyboardCode(dom_code); | 280 *out_key_code = DomCodeToNonLocatedKeyboardCode(dom_code); |
281 return true; | 281 return true; |
282 } | 282 } |
283 } | 283 } |
284 } | 284 } |
285 | 285 |
286 for (size_t i = 0; i < arraysize(non_printable_code_map); ++i) { | 286 for (size_t i = 0; i < arraysize(non_printable_code_map); ++i) { |
287 const NonPrintableCodeEntry* e = &non_printable_code_map[i]; | 287 const NonPrintableCodeEntry* e = &non_printable_code_map[i]; |
288 if (e->dom_code == dom_code) { | 288 if (e->dom_code == dom_code) { |
289 *out_dom_key = e->dom_key; | 289 *out_dom_key = e->dom_key; |
290 *out_character = e->character; | 290 *out_character = e->character; |
291 *out_key_code = NonPrintableDomKeyToKeyboardCode(e->dom_key); | 291 *out_key_code = NonPrintableDomKeyToKeyboardCode(e->dom_key); |
292 return true; | 292 return true; |
293 } | 293 } |
294 } | 294 } |
295 | 295 |
296 return false; | 296 return false; |
297 } | 297 } |
298 | 298 |
299 } // namespace ui | 299 } // namespace ui |
OLD | NEW |