Trait smithay_client_toolkit::seat::touch::TouchHandler
source · pub trait TouchHandler: Sized {
// Required methods
fn down(
&mut self,
conn: &Connection,
qh: &QueueHandle<Self>,
touch: &WlTouch,
serial: u32,
time: u32,
surface: WlSurface,
id: i32,
position: (f64, f64)
);
fn up(
&mut self,
conn: &Connection,
qh: &QueueHandle<Self>,
touch: &WlTouch,
serial: u32,
time: u32,
id: i32
);
fn motion(
&mut self,
conn: &Connection,
qh: &QueueHandle<Self>,
touch: &WlTouch,
time: u32,
id: i32,
position: (f64, f64)
);
fn shape(
&mut self,
conn: &Connection,
qh: &QueueHandle<Self>,
touch: &WlTouch,
id: i32,
major: f64,
minor: f64
);
fn orientation(
&mut self,
conn: &Connection,
qh: &QueueHandle<Self>,
touch: &WlTouch,
id: i32,
orientation: f64
);
fn cancel(
&mut self,
conn: &Connection,
qh: &QueueHandle<Self>,
touch: &WlTouch
);
}
Required Methods§
sourcefn down(
&mut self,
conn: &Connection,
qh: &QueueHandle<Self>,
touch: &WlTouch,
serial: u32,
time: u32,
surface: WlSurface,
id: i32,
position: (f64, f64)
)
fn down( &mut self, conn: &Connection, qh: &QueueHandle<Self>, touch: &WlTouch, serial: u32, time: u32, surface: WlSurface, id: i32, position: (f64, f64) )
New touch point.
Indicates a new touch point has appeared on the surface, starting a touch sequence. The ID associated with this event identifies this touch point for devices with multi-touch and will be referenced in future events.
The associated touch ID ceases to be valid after the touch up event with the associated ID and may be reused for other touch points after that.
Coordinates are surface-local.
sourcefn up(
&mut self,
conn: &Connection,
qh: &QueueHandle<Self>,
touch: &WlTouch,
serial: u32,
time: u32,
id: i32
)
fn up( &mut self, conn: &Connection, qh: &QueueHandle<Self>, touch: &WlTouch, serial: u32, time: u32, id: i32 )
End of touch sequence.
sourcefn motion(
&mut self,
conn: &Connection,
qh: &QueueHandle<Self>,
touch: &WlTouch,
time: u32,
id: i32,
position: (f64, f64)
)
fn motion( &mut self, conn: &Connection, qh: &QueueHandle<Self>, touch: &WlTouch, time: u32, id: i32, position: (f64, f64) )
Touch point motion.
Coordinates are surface-local.
sourcefn shape(
&mut self,
conn: &Connection,
qh: &QueueHandle<Self>,
touch: &WlTouch,
id: i32,
major: f64,
minor: f64
)
fn shape( &mut self, conn: &Connection, qh: &QueueHandle<Self>, touch: &WlTouch, id: i32, major: f64, minor: f64 )
Touch point shape change.
The shape of a touch point is approximated by an ellipse through the major and minor axis length. Major always represents the larger of the two axis and is orthogonal to minor.
The dimensions are specified in surface-local coordinates and the locations reported by other events always report the center of the ellipse.
sourcefn orientation(
&mut self,
conn: &Connection,
qh: &QueueHandle<Self>,
touch: &WlTouch,
id: i32,
orientation: f64
)
fn orientation( &mut self, conn: &Connection, qh: &QueueHandle<Self>, touch: &WlTouch, id: i32, orientation: f64 )
Touch point shape orientation.
The orientation describes the clockwise angle of a touch point’s major axis to the positive surface y-axis and is normalized to the -180° to +180° range.
sourcefn cancel(&mut self, conn: &Connection, qh: &QueueHandle<Self>, touch: &WlTouch)
fn cancel(&mut self, conn: &Connection, qh: &QueueHandle<Self>, touch: &WlTouch)
Cancel active touch sequence.
This indicates that the compositor has cancelled the active touch sequence, for example due to detection of a touch gesture.