| 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 #include "ui/aura/event.h" | 5 #include "ui/aura/event.h" |
| 6 | 6 |
| 7 #if defined(USE_X11) | 7 #if defined(USE_X11) |
| 8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 rotation_angle_(0.0f), | 176 rotation_angle_(0.0f), |
| 177 force_(0.0f) { | 177 force_(0.0f) { |
| 178 } | 178 } |
| 179 | 179 |
| 180 KeyEvent::KeyEvent(const base::NativeEvent& native_event, bool is_char) | 180 KeyEvent::KeyEvent(const base::NativeEvent& native_event, bool is_char) |
| 181 : Event(native_event, | 181 : Event(native_event, |
| 182 ui::EventTypeFromNative(native_event), | 182 ui::EventTypeFromNative(native_event), |
| 183 ui::EventFlagsFromNative(native_event)), | 183 ui::EventFlagsFromNative(native_event)), |
| 184 key_code_(ui::KeyboardCodeFromNative(native_event)), | 184 key_code_(ui::KeyboardCodeFromNative(native_event)), |
| 185 is_char_(is_char), | 185 is_char_(is_char), |
| 186 skip_ime_(false), |
| 186 character_(0), | 187 character_(0), |
| 187 unmodified_character_(0) { | 188 unmodified_character_(0) { |
| 188 } | 189 } |
| 189 | 190 |
| 190 KeyEvent::KeyEvent(ui::EventType type, | 191 KeyEvent::KeyEvent(ui::EventType type, |
| 191 ui::KeyboardCode key_code, | 192 ui::KeyboardCode key_code, |
| 192 int flags) | 193 int flags) |
| 193 : Event(type, flags), | 194 : Event(type, flags), |
| 194 key_code_(key_code), | 195 key_code_(key_code), |
| 195 is_char_(false), | 196 is_char_(false), |
| 197 skip_ime_(false), |
| 196 character_(ui::GetCharacterFromKeyCode(key_code, flags)), | 198 character_(ui::GetCharacterFromKeyCode(key_code, flags)), |
| 197 unmodified_character_(0) { | 199 unmodified_character_(0) { |
| 198 } | 200 } |
| 199 | 201 |
| 200 uint16 KeyEvent::GetCharacter() const { | 202 uint16 KeyEvent::GetCharacter() const { |
| 201 if (character_) | 203 if (character_) |
| 202 return character_; | 204 return character_; |
| 203 | 205 |
| 204 #if defined(OS_WIN) | 206 #if defined(OS_WIN) |
| 205 return (native_event().message == WM_CHAR) ? key_code_ : | 207 return (native_event().message == WM_CHAR) ? key_code_ : |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 uint16 ch = ui::GetCharacterFromXEvent(native_event()); | 247 uint16 ch = ui::GetCharacterFromXEvent(native_event()); |
| 246 return ch ? ch : | 248 return ch ? ch : |
| 247 ui::GetCharacterFromKeyCode(key_code_, flags() & ui::EF_SHIFT_DOWN); | 249 ui::GetCharacterFromKeyCode(key_code_, flags() & ui::EF_SHIFT_DOWN); |
| 248 #else | 250 #else |
| 249 NOTIMPLEMENTED(); | 251 NOTIMPLEMENTED(); |
| 250 return 0; | 252 return 0; |
| 251 #endif | 253 #endif |
| 252 } | 254 } |
| 253 | 255 |
| 254 } // namespace aura | 256 } // namespace aura |
| OLD | NEW |