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.
5 #ifndef ASH_WM_EVENT_H_
6 #define ASH_WM_EVENT_H_
9 #include "ash/ash_export.h"
10 #include "base/event_types.h"
11 #include "ui/aura/event.h"
12 #include "ui/base/events.h"
13 #include "ui/base/keycodes/keyboard_codes.h"
17 // A key event which is translated by an input method (IME).
18 // For example, if an IME receives a KeyEvent(ui::VKEY_SPACE), and it does not
19 // consume the key, the IME usually generates and dispatches a
20 // TranslatedKeyEvent(ui::VKEY_SPACE) event. If the IME receives a KeyEvent and
21 // it does consume the event, it might dispatch a
22 // TranslatedKeyEvent(ui::VKEY_PROCESSKEY) event as defined in the DOM spec.
23 class ASH_EXPORT TranslatedKeyEvent
: public aura::KeyEvent
{
25 TranslatedKeyEvent(const base::NativeEvent
& native_event
, bool is_char
);
27 // Used for synthetic events such as a VKEY_PROCESSKEY key event.
28 TranslatedKeyEvent(bool is_press
,
29 ui::KeyboardCode key_code
,
32 // Changes the type() of the object from ET_TRANSLATED_KEY_* to ET_KEY_* so
33 // that RenderWidgetHostViewAura and NativeWidgetAura could handle the event.
34 void ConvertToKeyEvent();
39 #endif // ASH_WM_EVENT_H_