OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ash/ime/event.h" |
| 6 |
| 7 namespace ash { |
| 8 |
| 9 TranslatedKeyEvent::TranslatedKeyEvent(const base::NativeEvent& native_event, |
| 10 bool is_char) |
| 11 : KeyEvent(native_event, is_char) { |
| 12 set_type(type() == ui::ET_KEY_PRESSED ? |
| 13 ui::ET_TRANSLATED_KEY_PRESS : ui::ET_TRANSLATED_KEY_RELEASE); |
| 14 } |
| 15 |
| 16 TranslatedKeyEvent::TranslatedKeyEvent(bool is_press, |
| 17 ui::KeyboardCode key_code, |
| 18 int flags) |
| 19 : KeyEvent((is_press ? |
| 20 ui::ET_TRANSLATED_KEY_PRESS : ui::ET_TRANSLATED_KEY_RELEASE), |
| 21 key_code, |
| 22 flags) { |
| 23 } |
| 24 |
| 25 void TranslatedKeyEvent::ConvertToKeyEvent() { |
| 26 set_type(type() == ui::ET_TRANSLATED_KEY_PRESS ? |
| 27 ui::ET_KEY_PRESSED : ui::ET_KEY_RELEASED); |
| 28 } |
| 29 |
| 30 } // namespace ash |
OLD | NEW |