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 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 case DomKey::CAPS_LOCK: | 549 case DomKey::CAPS_LOCK: |
550 return EF_CAPS_LOCK_DOWN; | 550 // ChromeOS historically uses EF_MOD3_DOWN for the physical Caps Lock |
| 551 // key press, as distinct from EF_CAPS_LOCK_DOWN for the locked state. |
| 552 return EF_MOD3_DOWN; |
551 case DomKey::CONTROL: | 553 case DomKey::CONTROL: |
552 return EF_CONTROL_DOWN; | 554 return EF_CONTROL_DOWN; |
553 case DomKey::HYPER: | 555 case DomKey::HYPER: |
554 return EF_MOD3_DOWN; | 556 return EF_MOD3_DOWN; |
555 case DomKey::META: | 557 case DomKey::META: |
556 return EF_ALT_DOWN; | 558 return EF_ALT_DOWN; |
557 case DomKey::OS: | 559 case DomKey::OS: |
558 return EF_COMMAND_DOWN; | 560 return EF_COMMAND_DOWN; |
559 case DomKey::SHIFT: | 561 case DomKey::SHIFT: |
560 return EF_SHIFT_DOWN; | 562 return EF_SHIFT_DOWN; |
561 case DomKey::SUPER: | |
562 return EF_MOD3_DOWN; | |
563 default: | 563 default: |
564 return EF_NONE; | 564 return EF_NONE; |
565 } | 565 } |
566 // Not represented: | 566 // Not represented: |
567 // DomKey::ACCEL | 567 // DomKey::ACCEL |
568 // DomKey::FN | 568 // DomKey::FN |
569 // DomKey::FN_LOCK | 569 // DomKey::FN_LOCK |
570 // DomKey::NUM_LOCK | 570 // DomKey::NUM_LOCK |
571 // DomKey::SCROLL_LOCK | 571 // DomKey::SCROLL_LOCK |
| 572 // DomKey::SUPER |
572 // DomKey::SYMBOL | 573 // DomKey::SYMBOL |
573 // DomKey::SYMBOL_LOCK | 574 // DomKey::SYMBOL_LOCK |
574 } | 575 } |
575 | 576 |
576 } // namespace ui | 577 } // namespace ui |
OLD | NEW |