diff options
Diffstat (limited to 'components/script_traits')
-rw-r--r-- | components/script_traits/lib.rs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index 0e5fc316037..d5a030323f6 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -444,11 +444,11 @@ pub struct TouchId(pub i32); #[derive(Clone, Copy, Debug, Deserialize, Serialize)] pub enum MouseButton { /// The left mouse button. - Left, - /// The middle mouse button. - Middle, + Left = 1, /// The right mouse button. - Right, + Right = 2, + /// The middle mouse button. + Middle = 4, } /// The types of mouse events @@ -474,9 +474,16 @@ pub enum CompositorEvent { Point2D<f32>, Option<UntrustedNodeAddress>, Option<Point2D<f32>>, + // Bitmask of MouseButton values representing the currently pressed buttons + u16, ), /// The mouse was moved over a point (or was moved out of the recognizable region). - MouseMoveEvent(Option<Point2D<f32>>, Option<UntrustedNodeAddress>), + MouseMoveEvent( + Option<Point2D<f32>>, + Option<UntrustedNodeAddress>, + // Bitmask of MouseButton values representing the currently pressed buttons + u16, + ), /// A touch event was generated with a touch ID and location. TouchEvent( TouchEventType, |