| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 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 module mojo; | |
| 6 | |
| 7 import "mojo/services/geometry/public/interfaces/geometry.mojom"; | |
| 8 import "mojo/services/public/interfaces/input_events/input_event_constants.mojom
"; | |
| 9 import "mojo/services/public/interfaces/input_events/input_key_codes.mojom"; | |
| 10 | |
| 11 struct LocationData { | |
| 12 Point? in_view_location; | |
| 13 Point? screen_location; | |
| 14 }; | |
| 15 | |
| 16 struct KeyData { | |
| 17 // The chromium event key code; these values are from the ui/ KeyCode enum, | |
| 18 // which has the fun property of being neither consistently the Windows key | |
| 19 // code, nor the X11 keycodes. (This value is consistent across platforms | |
| 20 // for basic ASCII characters; it will differ for modifiers. We don't define | |
| 21 // this as a mojo enum because mojom doesn't appear to have a platform | |
| 22 // dependent preprocessor yet.) | |
| 23 // | |
| 24 // TODO(erg): Remove this, and declare Win32 keycodes correct by fiat. We can | |
| 25 // not do this until we remove ui::Event usage from within mojo. | |
| 26 int32 key_code; | |
| 27 | |
| 28 // Whether this is a character event, and the character value if it is. Note | |
| 29 // that this is different than |text|, which holds a value even when there | |
| 30 // isn't actually a character to insert. (For example, |text| will be set and | |
| 31 // have a value on backspace, and |character| won't.) | |
| 32 bool is_char; | |
| 33 uint16 character; | |
| 34 | |
| 35 // The Win32 key code. Because of the web, this is the closest thing that we | |
| 36 // have to a cross platform key state. | |
| 37 KeyboardCode windows_key_code; | |
| 38 | |
| 39 // The platform specific key code. | |
| 40 // | |
| 41 // TODO(erg): This exists only for NPAPI support, pepper USB keyboard support | |
| 42 // and IME on android support. Theoretically, we should be able to remove this | |
| 43 // in the medium to long term. | |
| 44 int32 native_key_code; | |
| 45 | |
| 46 // The text generated by this keystroke. Corresponds to | |
| 47 // blink::WebKeyboardEvent::text. | |
| 48 uint16 text; | |
| 49 | |
| 50 // Like |text|, but unmodified by concurrently held modifier keys (except | |
| 51 // shift). Corresponds to blink::WebKeyboardEvent::unmodifiedText. | |
| 52 uint16 unmodified_text; | |
| 53 }; | |
| 54 | |
| 55 struct TouchData { | |
| 56 int32 pointer_id; | |
| 57 }; | |
| 58 | |
| 59 struct MouseWheelData { | |
| 60 int32 x_offset; | |
| 61 int32 y_offset; | |
| 62 }; | |
| 63 | |
| 64 struct Event { | |
| 65 EventType action; | |
| 66 EventFlags flags; | |
| 67 int64 time_stamp; | |
| 68 LocationData? location_data; | |
| 69 KeyData? key_data; | |
| 70 TouchData? touch_data; | |
| 71 MouseWheelData? wheel_data; | |
| 72 }; | |
| OLD | NEW |