| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef UI_AURA_EVENT_H_ | 5 #ifndef UI_AURA_EVENT_H_ |
| 6 #define UI_AURA_EVENT_H_ | 6 #define UI_AURA_EVENT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/event_types.h" | 10 #include "base/event_types.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 const float rotation_angle_; | 120 const float rotation_angle_; |
| 121 | 121 |
| 122 // Force (pressure) of the touch. Normalized to be [0, 1]. Default to be 0.0. | 122 // Force (pressure) of the touch. Normalized to be [0, 1]. Default to be 0.0. |
| 123 const float force_; | 123 const float force_; |
| 124 | 124 |
| 125 DISALLOW_COPY_AND_ASSIGN(TouchEvent); | 125 DISALLOW_COPY_AND_ASSIGN(TouchEvent); |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 class AURA_EXPORT KeyEvent : public Event { | 128 class AURA_EXPORT KeyEvent : public Event { |
| 129 public: | 129 public: |
| 130 explicit KeyEvent(const base::NativeEvent& native_event); | 130 KeyEvent(const base::NativeEvent& native_event, bool is_char); |
| 131 | 131 |
| 132 // Used for synthetic events in testing. | 132 // Used for synthetic events in testing. |
| 133 KeyEvent(ui::EventType type, | 133 KeyEvent(ui::EventType type, |
| 134 ui::KeyboardCode key_code, | 134 ui::KeyboardCode key_code, |
| 135 int flags); | 135 int flags); |
| 136 | 136 |
| 137 ui::KeyboardCode key_code() const { return key_code_; } | 137 ui::KeyboardCode key_code() const { return key_code_; } |
| 138 bool is_char() const { return is_char_; } |
| 138 | 139 |
| 139 private: | 140 private: |
| 140 ui::KeyboardCode key_code_; | 141 ui::KeyboardCode key_code_; |
| 142 // True if this is a translated character event (vs. a raw key down). Both |
| 143 // share the same type: ui::ET_KEY_PRESSED. |
| 144 bool is_char_; |
| 141 }; | 145 }; |
| 142 | 146 |
| 143 } // namespace aura | 147 } // namespace aura |
| 144 | 148 |
| 145 #endif // UI_AURA_EVENT_H_ | 149 #endif // UI_AURA_EVENT_H_ |
| OLD | NEW |