diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-04-05 21:07:05 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-04-05 21:07:05 +0530 |
commit | 0ff8adb09778402e88fe0d0ad92f4b399ca8ca01 (patch) | |
tree | fd3403bb54587c41f953e00740be30058c94543d /components/script_traits/lib.rs | |
parent | a8ed5c3fc66ab9ea57b6b78311485040dae27328 (diff) | |
parent | 0d529274a425f44b17a93d6823929eacb4ba96f2 (diff) | |
download | servo-0ff8adb09778402e88fe0d0ad92f4b399ca8ca01.tar.gz servo-0ff8adb09778402e88fe0d0ad92f4b399ca8ca01.zip |
Auto merge of #9811 - paulrouget:forceTouch, r=mbrubeck
forcetouch events
https://developer.apple.com/library/mac/documentation/AppleApplications/Conceptual/SafariJSProgTopics/RespondingtoForceTouchEventsfromJavaScript.html
Not sure how we want to land that yet. Maybe reproduce the webkit events (as in this PR), or as touch/mousemouse events.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9811)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script_traits/lib.rs')
-rw-r--r-- | components/script_traits/lib.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index ac3632c6a08..7175536f280 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -227,10 +227,23 @@ pub enum CompositorEvent { MouseMoveEvent(Option<Point2D<f32>>), /// A touch event was generated with a touch ID and location. TouchEvent(TouchEventType, TouchId, Point2D<f32>), + /// Touchpad pressure event + TouchpadPressureEvent(Point2D<f32>, f32, TouchpadPressurePhase), /// A key was pressed. KeyEvent(Key, KeyState, KeyModifiers), } +/// Touchpad pressure phase for TouchpadPressureEvent. +#[derive(Copy, Clone, HeapSizeOf, PartialEq, Deserialize, Serialize)] +pub enum TouchpadPressurePhase { + /// Pressure before a regular click. + BeforeClick, + /// Pressure after a regular click. + AfterFirstClick, + /// Pressure after a "forceTouch" click + AfterSecondClick, +} + /// An opaque wrapper around script<->layout channels to avoid leaking message types into /// crates that don't need to know about them. pub struct OpaqueScriptLayoutChannel(pub (Box<Any + Send>, Box<Any + Send>)); |