| 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 "ui/events/event_constants.h" | 7 #include "ui/events/event_constants.h" |
| 8 #include "ui/events/keycodes/dom/dom_key.h" | 8 #include "ui/events/keycodes/dom/dom_key.h" |
| 9 | 9 |
| 10 namespace ui { | 10 namespace ui { |
| 11 | 11 |
| 12 int ModifierDomKeyToEventFlag(DomKey key) { | 12 int ModifierDomKeyToEventFlag(DomKey key) { |
| 13 switch (key) { | 13 switch (key) { |
| 14 case DomKey::ALT: | 14 case DomKey::ALT: |
| 15 return EF_ALT_DOWN; | 15 return EF_ALT_DOWN; |
| 16 case DomKey::ALT_GRAPH: | 16 case DomKey::ALT_GRAPH: |
| 17 return EF_ALTGR_DOWN; | 17 return EF_ALTGR_DOWN; |
| 18 // ChromeOS uses F16 to represent CapsLock before the rewriting stage, | 18 // ChromeOS uses F16 to represent CapsLock before the rewriting stage, |
| 19 // based on the historical X11 implementation. | 19 // based on the historical X11 implementation. |
| 20 // TODO post-X11: Switch to use CapsLock uniformly. | 20 // TODO post-X11: Switch to use CapsLock uniformly. |
| 21 case DomKey::F16: | 21 case DomKey::F16: |
| 22 case DomKey::CAPS_LOCK: | 22 case DomKey::CAPS_LOCK: |
| 23 return EF_CAPS_LOCK_DOWN; | 23 return EF_CAPS_LOCK_DOWN; |
| 24 case DomKey::CONTROL: | 24 case DomKey::CONTROL: |
| 25 return EF_CONTROL_DOWN; | 25 return EF_CONTROL_DOWN; |
| 26 case DomKey::HYPER: | |
| 27 return EF_MOD3_DOWN; | |
| 28 case DomKey::META: | 26 case DomKey::META: |
| 29 return EF_ALT_DOWN; | 27 return EF_ALT_DOWN; |
| 30 case DomKey::OS: | 28 case DomKey::OS: |
| 31 return EF_COMMAND_DOWN; | 29 return EF_COMMAND_DOWN; |
| 32 case DomKey::SHIFT: | 30 case DomKey::SHIFT: |
| 33 return EF_SHIFT_DOWN; | 31 return EF_SHIFT_DOWN; |
| 34 case DomKey::SUPER: | 32 case DomKey::SHIFT_LEVEL5: |
| 35 return EF_MOD3_DOWN; | 33 return EF_MOD3_DOWN; |
| 36 default: | 34 default: |
| 37 return EF_NONE; | 35 return EF_NONE; |
| 38 } | 36 } |
| 39 // Not represented: | 37 // Not represented: |
| 40 // DomKey::ACCEL | 38 // DomKey::ACCEL |
| 41 // DomKey::FN | 39 // DomKey::FN |
| 42 // DomKey::FN_LOCK | 40 // DomKey::FN_LOCK |
| 41 // DomKey::HYPER |
| 43 // DomKey::NUM_LOCK | 42 // DomKey::NUM_LOCK |
| 44 // DomKey::SCROLL_LOCK | 43 // DomKey::SCROLL_LOCK |
| 45 // DomKey::SYMBOL | 44 // DomKey::SUPER |
| 46 // DomKey::SYMBOL_LOCK | 45 // DomKey::SYMBOL_LOCK |
| 47 } | 46 } |
| 48 | 47 |
| 49 } // namespace ui | 48 } // namespace ui |
| OLD | NEW |