#[repr(C)]pub struct TouchPoint {
pub id: u64,
pub seat_id: u64,
pub position: LogicalPosition,
pub force: f32,
pub major: f32,
pub minor: f32,
pub orientation_rad: f32,
pub tool_type: TouchToolType,
}Expand description
Single touch point (finger, stylus, etc.)
Fields§
§id: u64Unique identifier for this touch point (persists across move events)
seat_id: u64Which SEAT’s touchscreen this contact is on (9b-ii-a-i-c): a second
seat’s fingers have their own id space (Wayland wl_touch ids are per
seat, X11 touch events carry their master pointer), so a contact is
identified by (seat_id, id). PRIMARY_POINTER_SEAT for the one
touchscreen every other platform has.
position: LogicalPositionCurrent position of the touch point in logical coordinates
force: f32Force/pressure of the touch (0.0 = no pressure, 1.0 = maximum pressure) Set to 0.5 if pressure is not available
major: f32Major axis of the contact ellipse, in logical px. 0.0 = not reported.
A contact is an area, not a point, and every platform says so: Wayland
wl_touch.shape, Windows POINTER_TOUCH_INFO.rcContact, Android
AXIS_TOUCH_MAJOR. Without it there is no palm rejection, no
brush-size-from-fingertip, and no way to size a hit target to a thumb
rather than to a mouse cursor.
minor: f32Minor axis of the contact ellipse, in logical px. 0.0 = not reported.
orientation_rad: f32Rotation of the contact ellipse, radians clockwise from the x-axis.
0.0 when unreported OR when a circular contact makes it meaningless —
check major/minor before trusting it.
tool_type: TouchToolTypeWhat is touching. Unknown where the platform does not classify.
Trait Implementations§
Source§impl Clone for TouchPoint
impl Clone for TouchPoint
Source§fn clone(&self) -> TouchPoint
fn clone(&self) -> TouchPoint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more