Chromium Code Reviews| 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 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 858 set_flags(flags() | ui::EF_IS_REPEAT); | 858 set_flags(flags() | ui::EF_IS_REPEAT); |
| 859 | 859 |
| 860 #if defined(USE_X11) | 860 #if defined(USE_X11) |
| 861 NormalizeFlags(); | 861 NormalizeFlags(); |
| 862 #endif | 862 #endif |
| 863 #if defined(OS_WIN) | 863 #if defined(OS_WIN) |
| 864 // Only Windows has native character events. | 864 // Only Windows has native character events. |
| 865 if (is_char_) | 865 if (is_char_) |
| 866 key_ = DomKey::FromCharacter(native_event.wParam); | 866 key_ = DomKey::FromCharacter(native_event.wParam); |
| 867 else | 867 else |
| 868 key_ = PlatformKeyMap::DomCodeAndFlagsToDomKeyStatic(code_, flags()); | 868 key_ = PlatformKeyMap::DomCodeAndFlagsToDomKeyStatic(code_, key_code_, |
|
dtapuska
2016/03/10 20:51:44
This is certainly odd that we require the key_code
Wez
2016/03/16 21:03:06
So sad. ;( Perhaps it would be cleanest to pass i
| |
| 869 flags()); | |
| 869 #endif | 870 #endif |
| 870 } | 871 } |
| 871 | 872 |
| 872 KeyEvent::KeyEvent(EventType type, | 873 KeyEvent::KeyEvent(EventType type, |
| 873 KeyboardCode key_code, | 874 KeyboardCode key_code, |
| 874 int flags) | 875 int flags) |
| 875 : Event(type, EventTimeForNow(), flags), | 876 : Event(type, EventTimeForNow(), flags), |
| 876 key_code_(key_code), | 877 key_code_(key_code), |
| 877 code_(UsLayoutKeyboardCodeToDomCode(key_code)) { | 878 code_(UsLayoutKeyboardCodeToDomCode(key_code)) { |
| 878 } | 879 } |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1147 gfx::PointF(x, y), | 1148 gfx::PointF(x, y), |
| 1148 time_stamp, | 1149 time_stamp, |
| 1149 flags | EF_FROM_TOUCH), | 1150 flags | EF_FROM_TOUCH), |
| 1150 details_(details) { | 1151 details_(details) { |
| 1151 } | 1152 } |
| 1152 | 1153 |
| 1153 GestureEvent::~GestureEvent() { | 1154 GestureEvent::~GestureEvent() { |
| 1154 } | 1155 } |
| 1155 | 1156 |
| 1156 } // namespace ui | 1157 } // namespace ui |
| OLD | NEW |