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

Unified Diff: ui/events/event.h

Issue 2647253002: Add tangentialPressure and twist properties to PointerEvent on Windows (Closed)
Patch Set: rotation Created 3 years, 11 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/blink/web_input_event_unittest.cc ('k') | ui/events/event_unittest.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 20e02626b872b087633488bf4e2e0d8c17e35cd5..d07fc639222a4b78e672b850b5bf38d452603308 100644
--- a/ui/events/event.h
+++ b/ui/events/event.h
@@ -417,7 +417,9 @@ struct EVENTS_EXPORT PointerDetails {
float radius_y,
float force,
float tilt_x,
- float tilt_y)
+ float tilt_y,
+ float tangential_pressure = 0.0f,
+ int twist = 0)
: pointer_type(pointer_type),
// If we aren't provided with a radius on one axis, use the
// information from the other axis.
@@ -425,7 +427,9 @@ struct EVENTS_EXPORT PointerDetails {
radius_y(radius_y > 0 ? radius_y : radius_x),
force(force),
tilt_x(tilt_x),
- tilt_y(tilt_y) {}
+ tilt_y(tilt_y),
+ tangential_pressure(tangential_pressure),
+ twist(twist) {}
PointerDetails(EventPointerType pointer_type, const gfx::Vector2d& offset)
: pointer_type(pointer_type),
force(std::numeric_limits<float>::quiet_NaN()),
@@ -437,7 +441,8 @@ struct EVENTS_EXPORT PointerDetails {
(force == other.force ||
(std::isnan(force) && std::isnan(other.force))) &&
tilt_x == other.tilt_x && tilt_y == other.tilt_y &&
- offset == other.offset;
+ tangential_pressure == other.tangential_pressure &&
+ twist == other.twist && offset == other.offset;
}
// The type of pointer device.
@@ -459,6 +464,16 @@ struct EVENTS_EXPORT PointerDetails {
float tilt_x = 0.0;
float tilt_y = 0.0;
+ // The normalized tangential pressure (or barrel pressure), typically set by
+ // an additional control of the stylus, which has a range of [-1,1], where 0
+ // is the neutral position of the control. Always 0 if the device does not
+ // support it.
+ float tangential_pressure = 0.0;
+
+ // The clockwise rotation of a pen stylus around its own major axis, in
+ // degrees in the range [0,359]. Always 0 if the device does not support it.
+ int twist = 0;
+
// Only used by mouse wheel events. The amount to scroll. This is in multiples
// of kWheelDelta.
// Note: offset_.x() > 0/offset_.y() > 0 means scroll left/up.
« no previous file with comments | « ui/events/blink/web_input_event_unittest.cc ('k') | ui/events/event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698