Dispatch touch events and perform default touch actions.

This is currently limited to simple single-touch actions. It does not include
momentum scrolling or pinch zooming.
This commit is contained in:
Matt Brubeck 2015-08-14 07:24:50 -07:00
parent 4ed15a8853
commit fe7460f34d
9 changed files with 276 additions and 15 deletions

View file

@ -150,7 +150,7 @@ pub enum ConstellationControlMsg {
}
/// The mouse button involved in the event.
#[derive(Clone, Debug)]
#[derive(Clone, Copy, Debug)]
pub enum MouseButton {
/// The left mouse button.
Left,
@ -172,6 +172,12 @@ pub enum CompositorEvent {
MouseUpEvent(MouseButton, Point2D<f32>),
/// The mouse was moved over a point.
MouseMoveEvent(Point2D<f32>),
/// A touch began at a point.
TouchDownEvent(i32, Point2D<f32>),
/// A touch was moved over a point.
TouchMoveEvent(i32, Point2D<f32>),
/// A touch ended at a point.
TouchUpEvent(i32, Point2D<f32>),
/// A key was pressed.
KeyEvent(Key, KeyState, KeyModifiers),
}