OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/event.h" | 5 #include "ui/events/event.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #if defined(USE_X11) | 9 #if defined(USE_X11) |
10 #include <X11/extensions/XInput2.h> | 10 #include <X11/extensions/XInput2.h> |
(...skipping 19 matching lines...) Expand all Loading... | |
30 #include "ui/gfx/transform.h" | 30 #include "ui/gfx/transform.h" |
31 #include "ui/gfx/transform_util.h" | 31 #include "ui/gfx/transform_util.h" |
32 | 32 |
33 #if defined(USE_X11) | 33 #if defined(USE_X11) |
34 #include "ui/events/keycodes/keyboard_code_conversion_x.h" | 34 #include "ui/events/keycodes/keyboard_code_conversion_x.h" |
35 #elif defined(USE_OZONE) | 35 #elif defined(USE_OZONE) |
36 #include "ui/events/ozone/layout/keyboard_layout_engine.h" // nogncheck | 36 #include "ui/events/ozone/layout/keyboard_layout_engine.h" // nogncheck |
37 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" // nogncheck | 37 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" // nogncheck |
38 #endif | 38 #endif |
39 | 39 |
40 #if defined(OS_WIN) | |
41 #include "ui/events/keycodes/key_map_win.h" | |
Wez
2016/02/11 23:14:44
key_map_win.{cc|h} should be renamed to match the
| |
42 #endif | |
43 | |
40 namespace { | 44 namespace { |
41 | 45 |
42 std::string EventTypeName(ui::EventType type) { | 46 std::string EventTypeName(ui::EventType type) { |
43 #define RETURN_IF_TYPE(t) if (type == ui::t) return #t | 47 #define RETURN_IF_TYPE(t) if (type == ui::t) return #t |
44 #define CASE_TYPE(t) case ui::t: return #t | 48 #define CASE_TYPE(t) case ui::t: return #t |
45 switch (type) { | 49 switch (type) { |
46 CASE_TYPE(ET_UNKNOWN); | 50 CASE_TYPE(ET_UNKNOWN); |
47 CASE_TYPE(ET_MOUSE_PRESSED); | 51 CASE_TYPE(ET_MOUSE_PRESSED); |
48 CASE_TYPE(ET_MOUSE_DRAGGED); | 52 CASE_TYPE(ET_MOUSE_DRAGGED); |
49 CASE_TYPE(ET_MOUSE_RELEASED); | 53 CASE_TYPE(ET_MOUSE_RELEASED); |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
685 if (IsRepeated(*this)) | 689 if (IsRepeated(*this)) |
686 set_flags(flags() | ui::EF_IS_REPEAT); | 690 set_flags(flags() | ui::EF_IS_REPEAT); |
687 | 691 |
688 #if defined(USE_X11) | 692 #if defined(USE_X11) |
689 NormalizeFlags(); | 693 NormalizeFlags(); |
690 #endif | 694 #endif |
691 #if defined(OS_WIN) | 695 #if defined(OS_WIN) |
692 // Only Windows has native character events. | 696 // Only Windows has native character events. |
693 if (is_char_) | 697 if (is_char_) |
694 key_ = DomKey::FromCharacter(native_event.wParam); | 698 key_ = DomKey::FromCharacter(native_event.wParam); |
699 else | |
700 key_ = WindowsKeyMap::DomCodeAndFlagsToDomKeyStatic(code_, flags()); | |
695 #endif | 701 #endif |
696 } | 702 } |
697 | 703 |
698 KeyEvent::KeyEvent(EventType type, | 704 KeyEvent::KeyEvent(EventType type, |
699 KeyboardCode key_code, | 705 KeyboardCode key_code, |
700 int flags) | 706 int flags) |
701 : Event(type, EventTimeForNow(), flags), | 707 : Event(type, EventTimeForNow(), flags), |
702 key_code_(key_code), | 708 key_code_(key_code), |
703 code_(UsLayoutKeyboardCodeToDomCode(key_code)) { | 709 code_(UsLayoutKeyboardCodeToDomCode(key_code)) { |
704 } | 710 } |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
973 gfx::PointF(x, y), | 979 gfx::PointF(x, y), |
974 time_stamp, | 980 time_stamp, |
975 flags | EF_FROM_TOUCH), | 981 flags | EF_FROM_TOUCH), |
976 details_(details) { | 982 details_(details) { |
977 } | 983 } |
978 | 984 |
979 GestureEvent::~GestureEvent() { | 985 GestureEvent::~GestureEvent() { |
980 } | 986 } |
981 | 987 |
982 } // namespace ui | 988 } // namespace ui |
OLD | NEW |