Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Unified Diff: ui/events/event.h

Issue 755403006: Added experimental Touch.tilt, Touch.tiltDirection support for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused code (event_sender.cc) Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/cocoa/events_mac.mm ('k') | ui/events/event.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event.h
diff --git a/ui/events/event.h b/ui/events/event.h
index b65c27516ab48f1f6d4e4f1b00a2270524cd2a9a..28d7883d90d64509ed71e9e2ac8c2da88bfd9537 100644
--- a/ui/events/event.h
+++ b/ui/events/event.h
@@ -497,6 +497,8 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
radius_y_(model.radius_y_),
rotation_angle_(model.rotation_angle_),
force_(model.force_),
+ tilt_(model.tilt_),
+ tiltDirection_(model.tiltDirection_),
may_cause_scrolling_(model.may_cause_scrolling_),
should_remove_native_touch_id_mapping_(false) {}
@@ -513,7 +515,9 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
float radius_x,
float radius_y,
float angle,
- float force);
+ float force,
+ float tilt,
+ float tiltDirection);
~TouchEvent() override;
@@ -527,6 +531,8 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
float radius_y() const { return radius_y_ > 0 ? radius_y_ : radius_x_; }
float rotation_angle() const { return rotation_angle_; }
float force() const { return force_; }
+ float tilt() const { return tilt_; }
+ float tiltDirection() const { return tiltDirection_; }
void set_may_cause_scrolling(bool causes) { may_cause_scrolling_ = causes; }
bool may_cause_scrolling() const { return may_cause_scrolling_; }
@@ -575,6 +581,14 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
// Force (pressure) of the touch. Normalized to be [0, 1]. Default to be 0.0.
float force_;
+ // Tilt angle of the stylus away from the perpendicular to the screen.
+ // Default is NaN.
+ float tilt_;
+
+ // Clockwise angle from the X axis to the XY-projection of the stylus.
+ // Range is [-180, 180), default is NaN.
+ float tiltDirection_;
+
// Whether the (unhandled) touch event will produce a scroll event (e.g., a
// touchmove that exceeds the platform slop region, or a touchend that
// causes a fling). Defaults to false.
« no previous file with comments | « ui/events/cocoa/events_mac.mm ('k') | ui/events/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698