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.
7 import "ui/mojo/events/input_event_constants.mojom";
8 import "ui/mojo/events/input_key_codes.mojom";
9 import "ui/mojo/geometry/geometry.mojom";
12 // The chromium event key code; these values are from the ui/ KeyCode enum,
13 // which has the fun property of being neither consistently the Windows key
14 // code, nor the X11 keycodes. (This value is consistent across platforms
15 // for basic ASCII characters; it will differ for modifiers. We don't define
16 // this as a mojo enum because mojom doesn't appear to have a platform
17 // dependent preprocessor yet.)
19 // TODO(erg): Remove this, and declare Win32 keycodes correct by fiat. We can
20 // not do this until we remove ui::Event usage from within mojo.
23 // Whether this is a character event, and the character value if it is. Note
24 // that this is different than |text|, which holds a value even when there
25 // isn't actually a character to insert. (For example, |text| will be set and
26 // have a value on backspace, and |character| won't.)
30 // The Win32 key code. Because of the web, this is the closest thing that we
31 // have to a cross platform key state.
32 KeyboardCode windows_key_code;
34 // The platform specific key code.
36 // TODO(erg): This exists only for NPAPI support, pepper USB keyboard support
37 // and IME on android support. Theoretically, we should be able to remove this
38 // in the medium to long term.
39 int32 native_key_code;
41 // The text generated by this keystroke. Corresponds to
42 // blink::WebKeyboardEvent::text.
45 // Like |text|, but unmodified by concurrently held modifier keys (except
46 // shift). Corresponds to blink::WebKeyboardEvent::unmodifiedText.
47 uint16 unmodified_text;
51 // |x| and |y| are in the coordinate system of the View.
52 // Typically, this will be an integer-valued translation w.r.t.
53 // the screen and in this case, |x| and |y| are in units of physical
54 // pixels. However, some View embedders may apply arbitrary transformations
55 // of a view w.r.t. the screen.
58 // |screen_x| and |screen_y| are in screen coordinates in units of
64 // TODO(rjkroege,sadrul): Add gesture representation.
68 LocationData location;
69 // Some devices (e.g. pen, finger) can extend across multiple pixels
70 // at once. |brush_data| provides additional data for this case and
71 // is available when |kind| is PEN or TOUCH.
72 BrushData? brush_data;
75 // Information payload to support
76 // https://developer.mozilla.org/en-US/docs/Web/Events/wheel.
77 // TODO(rjkroege): Handle MacOS momentum scrolling.
80 LocationData location;
81 // |delta_x|, |delta_y|, |delta_z| can be in units of pixels, lines, pages
82 // or control scaling as controlled by |mode|. Pixel scroll is physical
83 // pixels in the coordinate system of the target View.
89 // Supplementary data to support pointers where the pointer can
90 // cover multiple pixels per http://www.w3.org/TR/pointerevents/
92 // |width| and |height| are in CSS pixels in the coordinate system of
96 // |pressure| range is [0,1]. For devices like mice buttons where the
97 // pressure is not available, it will be set to 0.5 if the button is down.
99 // |tiltY| and |tiltX| are in degrees.
105 // TODO(sky): rename to type.
107 // TODO(sky): parts of this should move to PointerData.
109 // Time in microseconds from when the platform was started.
110 // This value accurately orders events w.r.t. to each other but
111 // does not position them at an absolute time.
114 PointerData? pointer_data;
115 // Some devices (e.g. trackpads or mice) have additional valuators
116 // such as the mouse wheel or ball. Present only if action is WHEEL.
117 WheelData? wheel_data;