| 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/platform_key_map_win.h" |
| 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 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 if (IsRepeated(*this)) | 757 if (IsRepeated(*this)) |
| 754 set_flags(flags() | ui::EF_IS_REPEAT); | 758 set_flags(flags() | ui::EF_IS_REPEAT); |
| 755 | 759 |
| 756 #if defined(USE_X11) | 760 #if defined(USE_X11) |
| 757 NormalizeFlags(); | 761 NormalizeFlags(); |
| 758 #endif | 762 #endif |
| 759 #if defined(OS_WIN) | 763 #if defined(OS_WIN) |
| 760 // Only Windows has native character events. | 764 // Only Windows has native character events. |
| 761 if (is_char_) | 765 if (is_char_) |
| 762 key_ = DomKey::FromCharacter(native_event.wParam); | 766 key_ = DomKey::FromCharacter(native_event.wParam); |
| 767 else |
| 768 key_ = PlatformKeyMap::DomCodeAndFlagsToDomKeyStatic(code_, flags()); |
| 763 #endif | 769 #endif |
| 764 } | 770 } |
| 765 | 771 |
| 766 KeyEvent::KeyEvent(EventType type, | 772 KeyEvent::KeyEvent(EventType type, |
| 767 KeyboardCode key_code, | 773 KeyboardCode key_code, |
| 768 int flags) | 774 int flags) |
| 769 : Event(type, EventTimeForNow(), flags), | 775 : Event(type, EventTimeForNow(), flags), |
| 770 key_code_(key_code), | 776 key_code_(key_code), |
| 771 code_(UsLayoutKeyboardCodeToDomCode(key_code)) { | 777 code_(UsLayoutKeyboardCodeToDomCode(key_code)) { |
| 772 } | 778 } |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 gfx::PointF(x, y), | 1047 gfx::PointF(x, y), |
| 1042 time_stamp, | 1048 time_stamp, |
| 1043 flags | EF_FROM_TOUCH), | 1049 flags | EF_FROM_TOUCH), |
| 1044 details_(details) { | 1050 details_(details) { |
| 1045 } | 1051 } |
| 1046 | 1052 |
| 1047 GestureEvent::~GestureEvent() { | 1053 GestureEvent::~GestureEvent() { |
| 1048 } | 1054 } |
| 1049 | 1055 |
| 1050 } // namespace ui | 1056 } // namespace ui |
| OLD | NEW |