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/layout_util.h" | 5 #include "ui/events/ozone/layout/layout_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ui/events/event_constants.h" | 9 #include "ui/events/event_constants.h" |
10 #include "ui/events/keycodes/dom3/dom_code.h" | 10 #include "ui/events/keycodes/dom3/dom_code.h" |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 return false; | 539 return false; |
540 } | 540 } |
541 } | 541 } |
542 | 542 |
543 int ModifierDomKeyToEventFlag(DomKey key) { | 543 int ModifierDomKeyToEventFlag(DomKey key) { |
544 switch (key) { | 544 switch (key) { |
545 case DomKey::ALT: | 545 case DomKey::ALT: |
546 return EF_ALT_DOWN; | 546 return EF_ALT_DOWN; |
547 case DomKey::ALT_GRAPH: | 547 case DomKey::ALT_GRAPH: |
548 return EF_ALTGR_DOWN; | 548 return EF_ALTGR_DOWN; |
| 549 // ChromeOS uses F16 to represent CapsLock before the rewriting stage, |
| 550 // based on the historical X11 implementation. |
| 551 // TODO post-X11: Switch to use CapsLock uniformly. |
| 552 case DomKey::F16: |
549 case DomKey::CAPS_LOCK: | 553 case DomKey::CAPS_LOCK: |
550 return EF_CAPS_LOCK_DOWN; | 554 return EF_CAPS_LOCK_DOWN; |
551 case DomKey::CONTROL: | 555 case DomKey::CONTROL: |
552 return EF_CONTROL_DOWN; | 556 return EF_CONTROL_DOWN; |
553 case DomKey::HYPER: | 557 case DomKey::HYPER: |
554 return EF_MOD3_DOWN; | 558 return EF_MOD3_DOWN; |
555 case DomKey::META: | 559 case DomKey::META: |
556 return EF_ALT_DOWN; | 560 return EF_ALT_DOWN; |
557 case DomKey::OS: | 561 case DomKey::OS: |
558 return EF_COMMAND_DOWN; | 562 return EF_COMMAND_DOWN; |
559 case DomKey::SHIFT: | 563 case DomKey::SHIFT: |
560 return EF_SHIFT_DOWN; | 564 return EF_SHIFT_DOWN; |
561 case DomKey::SUPER: | 565 case DomKey::SUPER: |
562 return EF_MOD3_DOWN; | 566 return EF_MOD3_DOWN; |
563 default: | 567 default: |
564 return EF_NONE; | 568 return EF_NONE; |
565 } | 569 } |
566 // Not represented: | 570 // Not represented: |
567 // DomKey::ACCEL | 571 // DomKey::ACCEL |
568 // DomKey::FN | 572 // DomKey::FN |
569 // DomKey::FN_LOCK | 573 // DomKey::FN_LOCK |
570 // DomKey::NUM_LOCK | 574 // DomKey::NUM_LOCK |
571 // DomKey::SCROLL_LOCK | 575 // DomKey::SCROLL_LOCK |
572 // DomKey::SYMBOL | 576 // DomKey::SYMBOL |
573 // DomKey::SYMBOL_LOCK | 577 // DomKey::SYMBOL_LOCK |
574 } | 578 } |
575 | 579 |
576 } // namespace ui | 580 } // namespace ui |
OLD | NEW |